]> O.S.I.I.S - jp/vke.net.git/commitdiff
debug distanceFieldFontTest
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 20 Nov 2021 21:45:26 +0000 (22:45 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 20 Nov 2021 21:45:26 +0000 (22:45 +0100)
samples/DistanceFieldFontTest/Program.cs

index 8de28a8f190714444e738f9925094d88379f645d..8a3e064e1b7925c6b2f6e2ccfc128054c685823b 100644 (file)
@@ -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<Vertex> (dev, VkBufferUsageFlags.TransferSrc, vx);
                        sibo = new HostBuffer<ushort> (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 ();