]> O.S.I.I.S - jp/vke.net.git/commitdiff
test with byvalarrays in vk.net ByValArray
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Thu, 7 May 2020 09:02:14 +0000 (11:02 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Thu, 7 May 2020 09:02:14 +0000 (11:02 +0200)
samples/ClearScreen/main.cs
vke/src/base/PhysicalDevice.cs
vke/vke.csproj

index 3e11384431d2732ab852a139e09b9a47ecf3efb9..4c5d1bde8fc616feb6e8f0eb0b9e0c6533e70cea 100644 (file)
@@ -1,6 +1,7 @@
 // Copyright (c) 2019  Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
 //
 // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+using System;
 using vke;
 using Vulkan;
 
@@ -30,7 +31,10 @@ namespace ClearScreen {
                        //is handled automatically by the render pass.
                        renderPass = new RenderPass (dev, swapChain.ColorFormat);
                        //default clear values are automatically added for each attacments
-                       renderPass.ClearValues[0] = new VkClearValue (0.1f, 0.2f, 1);
+                       renderPass.ClearValues[0] = new VkClearValue (0.9f, 0.9f, 1);
+
+                       Console.WriteLine ($"{renderPass.ClearValues[0].color.float32[0]}");
+
                        //bound to a pipeline, renderpasses are automatically activated, here we use
                        //a stand alone renderpass just to clear the screen, so we have to
                        //activate it manually
index ec9d08547a850f2e29ae6ec7589b5cc2a575b078..2fa1d98664051eedeca04d08bb5b6a0889110c96 100644 (file)
@@ -54,7 +54,10 @@ namespace vke {
                public VkQueueFamilyProperties [] QueueFamilies { get; private set; }
                public VkPhysicalDeviceProperties Properties {
                        get {
-                               vkGetPhysicalDeviceProperties (phy, out VkPhysicalDeviceProperties pdp);
+                               IntPtr ptr = Marshal.AllocHGlobal (Marshal.SizeOf<VkPhysicalDeviceProperties> ());
+                               vkGetPhysicalDeviceProperties (phy, ptr);
+                               VkPhysicalDeviceProperties pdp = Marshal.PtrToStructure<VkPhysicalDeviceProperties> (ptr);
+                               Marshal.FreeHGlobal (ptr);
                                return pdp;
                        }
                }
index ca08d454e45ad7086cf00af717a05b7b839a5d0a..ee98059f534c01f5c75485864345e641426ecf5f 100644 (file)
@@ -56,7 +56,7 @@
                
        <ItemGroup>
                <PackageReference Include="SpirVTasks" Version="$(SpirVTasksPackageVersion)" />
-               <PackageReference Include="Vulkan" Version="0.2.2.2-beta" />
+               <PackageReference Include="Vulkan" Version="0.2.19-beta" />
                <PackageReference Include="glfw-sharp" Version="0.2.2" />
                <PackageReference Include="shaderc.net" Version="0.1.0" />
        </ItemGroup>