From: Jean-Philippe Bruyère Date: Tue, 1 Nov 2022 20:22:36 +0000 (+0100) Subject: update vk.net to 0.5 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=1ee6d8bcd6715c859a263e935ad565bc9f385c33;p=jp%2Fvke.net.git update vk.net to 0.5 --- diff --git a/.vscode/launch.json b/.vscode/launch.json index 038b2cd..9ba8dc4 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -53,10 +53,6 @@ "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)", diff --git a/samples/MeshShader/main.cs b/samples/MeshShader/main.cs index 4893004..6f96028 100644 --- a/samples/MeshShader/main.cs +++ b/samples/MeshShader/main.cs @@ -25,29 +25,17 @@ namespace MeshShader { 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()); - IntPtr pMeshFeat = Marshal.AllocHGlobal(Marshal.SizeOf()); - - Marshal.StructureToPtr(meshFeat, pMeshFeat,false); - phyFeat2.pNext = pMeshFeat; - Marshal.StructureToPtr(phyFeat2, pPhyFeat2,false); - - Vk.vkGetPhysicalDeviceFeatures2(phy.Handle, pPhyFeat2); - - phyFeat2 = Marshal.PtrToStructure(pPhyFeat2); - meshFeat = Marshal.PtrToStructure(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()) { + 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; + } } } diff --git a/vke/src/base/Image.cs b/vke/src/base/Image.cs index 7cdfb37..7948949 100644 --- a/vke/src/base/Image.cs +++ b/vke/src/base/Image.cs @@ -475,7 +475,7 @@ namespace vke { 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); diff --git a/vke/vke.csproj b/vke/vke.csproj index 9ecb0ab..327decc 100644 --- a/vke/vke.csproj +++ b/vke/vke.csproj @@ -48,7 +48,7 @@ - +