From 7de6062a64124e40116ab5cbd21dcea06efdff78 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Sun, 5 Dec 2021 09:09:58 +0100 Subject: [PATCH] debug --- vke/src/SpecializationConstant.cs | 9 ++++----- vke/src/base/GraphicPipeline.cs | 4 ++++ vke/src/base/Queue.cs | 2 ++ vke/src/base/RenderPass.cs | 5 +---- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/vke/src/SpecializationConstant.cs b/vke/src/SpecializationConstant.cs index a2a095e..65f3fe0 100644 --- a/vke/src/SpecializationConstant.cs +++ b/vke/src/SpecializationConstant.cs @@ -11,18 +11,18 @@ namespace vke { /// Hold shader specialization constant value and type /// public class SpecializationConstant : SpecializationConstant { - T val; + T val; - public T Value => val; + public T Value => val; #region CTOR - public SpecializationConstant (uint id, T value) : base(id) { + public SpecializationConstant (uint id, T value) : base(id) { val = value; } #endregion public override uint Size => (uint)Marshal.SizeOf (); - internal unsafe override void WriteTo (IntPtr ptr) { + internal unsafe override void WriteTo (IntPtr ptr) { if (typeof (T) == typeof (float)) { float v = Convert.ToSingle (Value); System.Buffer.MemoryCopy (&v, ptr.ToPointer (), 4, 4); @@ -82,7 +82,6 @@ namespace vke { public void Dispose () { infos.Dispose(); Marshal.FreeHGlobal (pData); - entries.Unpin (); } } } diff --git a/vke/src/base/GraphicPipeline.cs b/vke/src/base/GraphicPipeline.cs index 88c5fc7..01a8ef4 100644 --- a/vke/src/base/GraphicPipeline.cs +++ b/vke/src/base/GraphicPipeline.cs @@ -99,6 +99,10 @@ namespace vke { Utils.CheckResult (vkCreateGraphicsPipelines (Dev.Handle, Cache == null ? VkPipelineCache.Null : Cache.handle, 1, ref info, IntPtr.Zero, out handle)); + vertInputInfo.Dispose(); + viewportState.Dispose(); + dynStatesInfo.Dispose(); + colorBlendInfo.Dispose(); info.Dispose (); } } diff --git a/vke/src/base/Queue.cs b/vke/src/base/Queue.cs index 3de9713..e1f2562 100644 --- a/vke/src/base/Queue.cs +++ b/vke/src/base/Queue.cs @@ -49,6 +49,8 @@ namespace vke { vkQueuePresentKHR (handle, ref present); + idx.Unpin(); + present.Dispose(); } } diff --git a/vke/src/base/RenderPass.cs b/vke/src/base/RenderPass.cs index 27d8687..cd1c975 100644 --- a/vke/src/base/RenderPass.cs +++ b/vke/src/base/RenderPass.cs @@ -113,9 +113,6 @@ namespace vke { handle = Dev.CreateRenderPass (renderPassInfo); - foreach (SubPass sp in subpasses) - sp.UnpinLists (); - if (PNext != null) PNext.ReleasePointer (); @@ -208,7 +205,7 @@ namespace vke { vkCmdBeginRenderPass (cmd.Handle, ref info, contents); - ClearValues.Unpin (); + info.Dispose (); } /// /// Switch to next subpass -- 2.47.3