From 02d1ce42f934978229c9e78fe215766f03b75d04 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Sat, 20 Nov 2021 22:45:26 +0100 Subject: [PATCH] debug distanceFieldFontTest --- samples/DistanceFieldFontTest/Program.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/samples/DistanceFieldFontTest/Program.cs b/samples/DistanceFieldFontTest/Program.cs index 8de28a8..8a3e064 100644 --- a/samples/DistanceFieldFontTest/Program.cs +++ b/samples/DistanceFieldFontTest/Program.cs @@ -17,7 +17,7 @@ namespace DistanceFieldFontTest { SwapChain.PREFERED_FORMAT = VkFormat.B8g8r8a8Unorm; #if DEBUG Instance.VALIDATION = true; - Instance.RENDER_DOC_CAPTURE = false; + Instance.RENDER_DOC_CAPTURE = true; #endif using (Program vke = new Program ()) { vke.Run (); @@ -63,6 +63,8 @@ namespace DistanceFieldFontTest { Vector4 textColor = new Vector4 (1.0f, 1.0f, 0.0f, 1.0f);//alpha => 0:disabled 1:enabled Vector4 outlineColor = new Vector4 (1.0f, 0.0f, 0.0f, 0.6f);//alpha => 0:disabled 1:enabled + uint indexCount; + protected override void initVulkan () { base.initVulkan (); @@ -137,7 +139,7 @@ namespace DistanceFieldFontTest { ushort indexOffset = 0; float charSize = 1.0f; - + float w = fontTexture.Width; float posx = 0.0f; @@ -186,6 +188,8 @@ namespace DistanceFieldFontTest { svbo = new HostBuffer (dev, VkBufferUsageFlags.TransferSrc, vx); sibo = new HostBuffer (dev, VkBufferUsageFlags.TransferSrc, indices.ToArray()); + + indexCount = (uint)indices.Count; } bool rebuildBuffers; @@ -228,7 +232,7 @@ namespace DistanceFieldFontTest { cmd.BindVertexBuffer (vbo, 0); cmd.BindIndexBuffer (ibo, VkIndexType.Uint16); - cmd.DrawIndexed ((uint)ibo.ElementCount,1,0,0,0); + cmd.DrawIndexed (indexCount,1,0,0,0); pipeline.RenderPass.End (cmd); } @@ -275,7 +279,7 @@ namespace DistanceFieldFontTest { default: base.onKeyDown (key, scanCode, modifiers); break; - } + } } protected override void OnResize () { base.OnResize (); -- 2.47.3