From: Jean-Philippe Bruyère Date: Tue, 28 Mar 2023 14:01:01 +0000 (+0200) Subject: fill even odd first ok X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=da6a3cff1bd628f0e035000c48c8b3d00cfeadfd;p=jp%2Fvke.net.git fill even odd first ok --- diff --git a/samples/FillTests/main.cs b/samples/FillTests/main.cs index 4d68f9e..8605c61 100644 --- a/samples/FillTests/main.cs +++ b/samples/FillTests/main.cs @@ -15,7 +15,7 @@ namespace FillTests { static void Main (string[] args) { #if DEBUG //Instance.VALIDATION = true; - //Instance.RENDER_DOC_CAPTURE = true; + Instance.RENDER_DOC_CAPTURE = true; #endif using (Program vke = new Program ()) { vke.Run (); @@ -64,7 +64,7 @@ namespace FillTests { DescriptorSet dsComp, dsFSQ;//descriptor set for the mvp matrice. vke.Image imgContour, imgColor; - VkFormat rastFormat = VkFormat.B8g8r8a8Uint; + VkFormat rastFormat = VkFormat.R32g32Sfloat; const VkSampleCountFlags contourSamplesCount = VkSampleCountFlags.SampleCount1; void createIbo() { @@ -95,12 +95,10 @@ namespace FillTests { } Console.WriteLine(""); } - - } - UpdateFrequency = 20; + UpdateFrequency = 1; vbo = new HostBuffer (dev, VkBufferUsageFlags.VertexBuffer, vertices.ToArray()); vbo.SetName("vbo"); @@ -167,11 +165,6 @@ namespace FillTests { cmds = cmdPool.AllocateCommandBuffer (swapChain.ImageCount); } - //view update override, see base method for more informations. - public override void UpdateView () { - - base.UpdateView (); - } Vector2 curMousePos; const float pointSizeSquared = 50; diff --git a/samples/FillTests/shaders/contour.frag b/samples/FillTests/shaders/contour.frag index 8f31963..cf9d541 100644 --- a/samples/FillTests/shaders/contour.frag +++ b/samples/FillTests/shaders/contour.frag @@ -4,9 +4,10 @@ #extension GL_ARB_shading_language_420pack : enable layout (location = 0) in flat uint inContourID; -layout (location = 0) out uvec4 outFragColor; +layout (location = 0) out vec2 outFragColor; void main() { - outFragColor = uvec4(1u << gl_PrimitiveID, inContourID, 0, 255); + uint tmp = 1u << gl_PrimitiveID; + outFragColor = vec2(float(tmp), inContourID); } \ No newline at end of file diff --git a/samples/FillTests/shaders/test.comp b/samples/FillTests/shaders/test.comp index c68fc0d..6553b77 100644 --- a/samples/FillTests/shaders/test.comp +++ b/samples/FillTests/shaders/test.comp @@ -3,7 +3,7 @@ #extension GL_ARB_separate_shader_objects : enable #extension GL_ARB_shading_language_420pack : enable -layout (set = 0, binding = 0, rgba8ui) readonly uniform uimage2D inputImage; +layout (set = 0, binding = 0, rg32f) readonly uniform image2D inputImage; layout (set = 0, binding = 1, rgba8) writeonly uniform image2D outputImage; layout(push_constant) uniform PushConsts { @@ -26,9 +26,9 @@ void main() int start = -1; for(int i=0; i 0) { imageStore(outputImage, uv, vec4(1.f,0.f,0.f,1.f)); @@ -41,7 +41,7 @@ void main() if ((bc % 2) != 0) { if (start >= 0) { for(int j=start; j