"cwd": "${workspaceFolder}/build/Debug/netcoreapp3.1/",
"stopAtEntry": false,
"console": "internalConsole",
- "env": {
- "VK_ICD_FILENAMES": "/usr/local/share/vulkan/icd.d/radeon_icd.x86_64.json",
- "RADV_PERFTEST": "rt,ext_ms"
- }
},
{
"name": ".NET Core Launch (Compute)",
PhysicalDeviceCollection phys = instance.GetAvailablePhysicalDevice ();
phy = instance.GetAvailablePhysicalDevice ().FirstOrDefault (p => p.Properties.deviceType == VkPhysicalDeviceType.DiscreteGpu && p.HasSwapChainSupport);
Console.WriteLine($"Using gpu: {phy.Properties.deviceName}");
-
+
VkPhysicalDeviceFeatures2 phyFeat2 = VkPhysicalDeviceFeatures2.New;
- VkPhysicalDeviceMeshShaderFeaturesEXT meshFeat = VkPhysicalDeviceMeshShaderFeaturesEXT.New;
-
- IntPtr pPhyFeat2 = Marshal.AllocHGlobal(Marshal.SizeOf<VkPhysicalDeviceFeatures2>());
- IntPtr pMeshFeat = Marshal.AllocHGlobal(Marshal.SizeOf<VkPhysicalDeviceMeshShaderFeaturesEXT>());
-
- Marshal.StructureToPtr<VkPhysicalDeviceMeshShaderFeaturesEXT>(meshFeat, pMeshFeat,false);
- phyFeat2.pNext = pMeshFeat;
- Marshal.StructureToPtr<VkPhysicalDeviceFeatures2>(phyFeat2, pPhyFeat2,false);
-
- Vk.vkGetPhysicalDeviceFeatures2(phy.Handle, pPhyFeat2);
-
- phyFeat2 = Marshal.PtrToStructure<VkPhysicalDeviceFeatures2>(pPhyFeat2);
- meshFeat = Marshal.PtrToStructure<VkPhysicalDeviceMeshShaderFeaturesEXT>(pMeshFeat);
- Marshal.FreeHGlobal(pPhyFeat2);
- Marshal.FreeHGlobal(pMeshFeat);
-
- Console.WriteLine($"Mesh Shader Support:\t{meshFeat.meshShader}");
- Console.WriteLine($"Task Shader Support:\t{meshFeat.taskShader}");
-
- if (!(meshFeat.meshShader && meshFeat.taskShader)) {
- phy = null;
+ using (var meshFeat = new PNext<VkPhysicalDeviceMeshShaderFeaturesEXT>()) {
+ phyFeat2.pNext = meshFeat;
+ Vk.vkGetPhysicalDeviceFeatures2(phy.Handle, ref phyFeat2);
+
+ Console.WriteLine($"Mesh Shader Support:\t{meshFeat.Val.meshShader}");
+ Console.WriteLine($"Task Shader Support:\t{meshFeat.Val.taskShader}");
+ if (!(meshFeat.Val.meshShader && meshFeat.Val.taskShader)) {
+ phy = null;
+ }
}
}
public Image ExportTo (Device targetdev, VkExternalMemoryHandleTypeFlags handleTypes) {
VkMemoryHostPointerPropertiesEXT hostPointerProps = default;
- VkResult res = vkGetMemoryHostPointerPropertiesEXT (Dev.Handle, handleTypes, importedHandle, out hostPointerProps);
+ VkResult res = vkGetMemoryHostPointerPropertiesEXT (Dev.Handle, handleTypes, importedHandle, ref hostPointerProps);
if (res != VkResult.Success)
return null;
Image img = new Image (targetdev, memoryFlags, this.info, queuesFamillies);
<ItemGroup>
<PackageReference Include="SpirVTasks" Version="$(SpirVTasksPackageVersion)" />
- <PackageReference Include="Vulkan" Version="0.4.2" />
+ <PackageReference Include="Vulkan" Version="0.5.0" />
<PackageReference Include="shaderc.net" Version="0.1.0" />
<PackageReference Include="glfw-sharp" Version="0.2.14" />
</ItemGroup>