]> O.S.I.I.S - jp/vke.net.git/commitdiff
update vk.net to 0.5
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Tue, 1 Nov 2022 20:22:36 +0000 (21:22 +0100)
committerj-p <jp_bruyere@hotmail.com>
Tue, 1 Nov 2022 20:53:51 +0000 (21:53 +0100)
.vscode/launch.json
samples/MeshShader/main.cs
vke/src/base/Image.cs
vke/vke.csproj

index 038b2cd2a852ecb71eb1edf75dbac3acf3cc5fba..9ba8dc4a3f01f966a5498c1e0f33919968b703e0 100644 (file)
                        "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)",
index 48930049841a66327da43146096858cd425a1192..6f96028a62855462eb78cb85eaaa6ec17597ca51 100644 (file)
@@ -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<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;                             
+                               }
                        }
                }               
                
index 7cdfb3788c239ecff483be9dccff778eba90fcc6..7948949acda315afa2b5905c575ddbd47a8989d7 100644 (file)
@@ -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);
index 9ecb0ab2c9a6fea95fbdb7aafd39c93936b4c3b1..327deccf326c454316622a90e8d463c685dcd50f 100644 (file)
@@ -48,7 +48,7 @@
 
        <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>