From: Jean-Philippe Bruyère Date: Thu, 7 May 2020 09:02:14 +0000 (+0200) Subject: test with byvalarrays in vk.net X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=refs%2Fheads%2FByValArray;p=jp%2Fvke.net.git test with byvalarrays in vk.net --- diff --git a/samples/ClearScreen/main.cs b/samples/ClearScreen/main.cs index 3e11384..4c5d1bd 100644 --- a/samples/ClearScreen/main.cs +++ b/samples/ClearScreen/main.cs @@ -1,6 +1,7 @@ // Copyright (c) 2019 Jean-Philippe Bruyère // // 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 diff --git a/vke/src/base/PhysicalDevice.cs b/vke/src/base/PhysicalDevice.cs index ec9d085..2fa1d98 100644 --- a/vke/src/base/PhysicalDevice.cs +++ b/vke/src/base/PhysicalDevice.cs @@ -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 ()); + vkGetPhysicalDeviceProperties (phy, ptr); + VkPhysicalDeviceProperties pdp = Marshal.PtrToStructure (ptr); + Marshal.FreeHGlobal (ptr); return pdp; } } diff --git a/vke/vke.csproj b/vke/vke.csproj index ca08d45..ee98059 100644 --- a/vke/vke.csproj +++ b/vke/vke.csproj @@ -56,7 +56,7 @@ - +