From 0c47e851468d092082a3cdd2cc264bd12837a196 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Thu, 17 Nov 2022 12:33:58 -0800 Subject: [PATCH] Texture format consistency --- BasicCompute/BasicComputeGame.cs | 1 + BasicTriangle/BasicTriangleGame.cs | 3 ++- Cube/CubeGame.cs | 1 + CullFace/CullFaceGame.cs | 1 + MSAA/MSAAGame.cs | 2 ++ MoonWorks.Test.Common/TestUtils.cs | 3 ++- TexturedAnimatedQuad/TexturedAnimatedQuadGame.cs | 1 + TexturedQuad/TexturedQuadGame.cs | 1 + TriangleVertexBuffer/TriangleVertexBufferGame.cs | 1 + 9 files changed, 12 insertions(+), 2 deletions(-) diff --git a/BasicCompute/BasicComputeGame.cs b/BasicCompute/BasicComputeGame.cs index 80a6ecc..def3193 100644 --- a/BasicCompute/BasicComputeGame.cs +++ b/BasicCompute/BasicComputeGame.cs @@ -47,6 +47,7 @@ namespace MoonWorks.Test ); GraphicsPipelineCreateInfo drawPipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo( + MainWindow.SwapchainFormat, vertShaderModule, fragShaderModule ); diff --git a/BasicTriangle/BasicTriangleGame.cs b/BasicTriangle/BasicTriangleGame.cs index f0dc225..e5b4048 100644 --- a/BasicTriangle/BasicTriangleGame.cs +++ b/BasicTriangle/BasicTriangleGame.cs @@ -23,6 +23,7 @@ namespace MoonWorks.Test ShaderModule fragShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("SolidColor.spv")); GraphicsPipelineCreateInfo pipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo( + MainWindow.SwapchainFormat, vertShaderModule, fragShaderModule ); @@ -70,7 +71,7 @@ namespace MoonWorks.Test { cmdbuf.SetScissor(scissorRect); } - + cmdbuf.DrawPrimitives(0, 1, 0, 0); cmdbuf.EndRenderPass(); } diff --git a/Cube/CubeGame.cs b/Cube/CubeGame.cs index 15767c4..a47e8df 100644 --- a/Cube/CubeGame.cs +++ b/Cube/CubeGame.cs @@ -210,6 +210,7 @@ namespace MoonWorks.Test // Create the blit pipeline GraphicsPipelineCreateInfo blitPipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo( + MainWindow.SwapchainFormat, blitVertShaderModule, blitFragShaderModule ); diff --git a/CullFace/CullFaceGame.cs b/CullFace/CullFaceGame.cs index 8ce915e..b6d60ce 100644 --- a/CullFace/CullFaceGame.cs +++ b/CullFace/CullFaceGame.cs @@ -27,6 +27,7 @@ namespace MoonWorks.Test // Create the graphics pipelines GraphicsPipelineCreateInfo pipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo( + MainWindow.SwapchainFormat, vertShaderModule, fragShaderModule ); diff --git a/MSAA/MSAAGame.cs b/MSAA/MSAAGame.cs index 6597898..6d56296 100644 --- a/MSAA/MSAAGame.cs +++ b/MSAA/MSAAGame.cs @@ -26,6 +26,7 @@ namespace MoonWorks.Test ShaderModule triangleFragShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("SolidColor.spv")); GraphicsPipelineCreateInfo pipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo( + TextureFormat.R8G8B8A8, triangleVertShaderModule, triangleFragShaderModule ); @@ -40,6 +41,7 @@ namespace MoonWorks.Test ShaderModule blitFragShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("TexturedQuadFrag.spv")); pipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo( + MainWindow.SwapchainFormat, blitVertShaderModule, blitFragShaderModule ); diff --git a/MoonWorks.Test.Common/TestUtils.cs b/MoonWorks.Test.Common/TestUtils.cs index bd4dcfa..b7518b5 100644 --- a/MoonWorks.Test.Common/TestUtils.cs +++ b/MoonWorks.Test.Common/TestUtils.cs @@ -24,6 +24,7 @@ namespace MoonWorks.Test } public static GraphicsPipelineCreateInfo GetStandardGraphicsPipelineCreateInfo( + TextureFormat swapchainFormat, ShaderModule vertShaderModule, ShaderModule fragShaderModule ) { @@ -31,7 +32,7 @@ namespace MoonWorks.Test { AttachmentInfo = new GraphicsPipelineAttachmentInfo( new ColorAttachmentDescription( - TextureFormat.R8G8B8A8, + swapchainFormat, ColorAttachmentBlendState.Opaque ) ), diff --git a/TexturedAnimatedQuad/TexturedAnimatedQuadGame.cs b/TexturedAnimatedQuad/TexturedAnimatedQuadGame.cs index 2e4ea9a..bcc3d72 100644 --- a/TexturedAnimatedQuad/TexturedAnimatedQuadGame.cs +++ b/TexturedAnimatedQuad/TexturedAnimatedQuadGame.cs @@ -45,6 +45,7 @@ namespace MoonWorks.Test // Create the graphics pipeline GraphicsPipelineCreateInfo pipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo( + MainWindow.SwapchainFormat, vertShaderModule, fragShaderModule ); diff --git a/TexturedQuad/TexturedQuadGame.cs b/TexturedQuad/TexturedQuadGame.cs index ab93b5e..356fb00 100644 --- a/TexturedQuad/TexturedQuadGame.cs +++ b/TexturedQuad/TexturedQuadGame.cs @@ -34,6 +34,7 @@ namespace MoonWorks.Test // Create the graphics pipeline GraphicsPipelineCreateInfo pipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo( + MainWindow.SwapchainFormat, vertShaderModule, fragShaderModule ); diff --git a/TriangleVertexBuffer/TriangleVertexBufferGame.cs b/TriangleVertexBuffer/TriangleVertexBufferGame.cs index 5fc5702..9b92f6d 100644 --- a/TriangleVertexBuffer/TriangleVertexBufferGame.cs +++ b/TriangleVertexBuffer/TriangleVertexBufferGame.cs @@ -17,6 +17,7 @@ namespace MoonWorks.Test // Create the graphics pipeline GraphicsPipelineCreateInfo pipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo( + MainWindow.SwapchainFormat, vertShaderModule, fragShaderModule );