From b1469f9775f88f5af895bac5be06b39417b6b53b Mon Sep 17 00:00:00 2001 From: TheSpydog Date: Sat, 21 Jan 2023 00:57:25 +0000 Subject: [PATCH] Use .refresh shaders instead of .spv (#1) Migrate the test suite to using the Refresh shader format instead of spirv Co-authored-by: Caleb Cornett Reviewed-on: https://gitea.moonside.games/MoonsideGames/MoonWorksGraphicsTests/pulls/1 --- BasicCompute/BasicComputeGame.cs | 8 ++++---- BasicTriangle/BasicTriangleGame.cs | 4 ++-- CompressedTextures/CompressedTexturesGame.cs | 4 ++-- ComputeUniforms/ComputeUniformsGame.cs | 6 +++--- CopyTexture/CopyTextureGame.cs | 4 ++-- Cube/CubeGame.cs | 12 ++++++------ CullFace/CullFaceGame.cs | 4 ++-- DrawIndirect/DrawIndirectGame.cs | 4 ++-- MSAA/MSAAGame.cs | 8 ++++---- ...te.spv => CalculateSquaresCompute.refresh} | Bin 916 -> 925 bytes ...Compute.spv => FillTextureCompute.refresh} | Bin 888 -> 897 bytes ...ute.spv => GradientTextureCompute.refresh} | Bin 1548 -> 1557 bytes ...olorVert.spv => PositionColorVert.refresh} | Bin 1052 -> 1061 bytes ...pv => PositionColorVertWithMatrix.refresh} | Bin 1348 -> 1357 bytes ...rtices.spv => RawTriangleVertices.refresh} | Bin 1568 -> 1577 bytes .../{SkyboxFrag.spv => SkyboxFrag.refresh} | Bin 640 -> 649 bytes .../{SkyboxVert.spv => SkyboxVert.refresh} | Bin 1276 -> 1285 bytes .../{SolidColor.spv => SolidColor.refresh} | Bin 448 -> 457 bytes ...Frag.spv => TexturedDepthQuadFrag.refresh} | Bin 1648 -> 1657 bytes ...dQuadFrag.spv => TexturedQuadFrag.refresh} | Bin 632 -> 641 bytes ...TexturedQuadFragWithMultiplyColor.refresh} | Bin 908 -> 917 bytes ...dQuadVert.spv => TexturedQuadVert.refresh} | Bin 1088 -> 1097 bytes ...spv => TexturedQuadVertWithMatrix.refresh} | Bin 1384 -> 1393 bytes .../Content/Shaders/compileShaders.ps1 | 5 ----- MoonWorks.Test.Common/TestUtils.cs | 2 +- .../TexturedAnimatedQuadGame.cs | 4 ++-- TexturedQuad/TexturedQuadGame.cs | 4 ++-- .../TriangleVertexBufferGame.cs | 4 ++-- 28 files changed, 34 insertions(+), 39 deletions(-) rename MoonWorks.Test.Common/Content/Shaders/Compiled/{CalculateSquaresCompute.spv => CalculateSquaresCompute.refresh} (82%) rename MoonWorks.Test.Common/Content/Shaders/Compiled/{FillTextureCompute.spv => FillTextureCompute.refresh} (83%) rename MoonWorks.Test.Common/Content/Shaders/Compiled/{GradientTextureCompute.spv => GradientTextureCompute.refresh} (91%) rename MoonWorks.Test.Common/Content/Shaders/Compiled/{PositionColorVert.spv => PositionColorVert.refresh} (85%) rename MoonWorks.Test.Common/Content/Shaders/Compiled/{PositionColorVertWithMatrix.spv => PositionColorVertWithMatrix.refresh} (88%) rename MoonWorks.Test.Common/Content/Shaders/Compiled/{RawTriangleVertices.spv => RawTriangleVertices.refresh} (90%) rename MoonWorks.Test.Common/Content/Shaders/Compiled/{SkyboxFrag.spv => SkyboxFrag.refresh} (71%) rename MoonWorks.Test.Common/Content/Shaders/Compiled/{SkyboxVert.spv => SkyboxVert.refresh} (89%) rename MoonWorks.Test.Common/Content/Shaders/Compiled/{SolidColor.spv => SolidColor.refresh} (69%) rename MoonWorks.Test.Common/Content/Shaders/Compiled/{TexturedDepthQuadFrag.spv => TexturedDepthQuadFrag.refresh} (89%) rename MoonWorks.Test.Common/Content/Shaders/Compiled/{TexturedQuadFrag.spv => TexturedQuadFrag.refresh} (71%) rename MoonWorks.Test.Common/Content/Shaders/Compiled/{TexturedQuadFragWithMultiplyColor.spv => TexturedQuadFragWithMultiplyColor.refresh} (82%) rename MoonWorks.Test.Common/Content/Shaders/Compiled/{TexturedQuadVert.spv => TexturedQuadVert.refresh} (83%) rename MoonWorks.Test.Common/Content/Shaders/Compiled/{TexturedQuadVertWithMatrix.spv => TexturedQuadVertWithMatrix.refresh} (86%) delete mode 100644 MoonWorks.Test.Common/Content/Shaders/compileShaders.ps1 diff --git a/BasicCompute/BasicComputeGame.cs b/BasicCompute/BasicComputeGame.cs index 83d2791..cfe69a8 100644 --- a/BasicCompute/BasicComputeGame.cs +++ b/BasicCompute/BasicComputeGame.cs @@ -16,7 +16,7 @@ namespace MoonWorks.Test // Create the compute pipeline that writes texture data ShaderModule fillTextureComputeShaderModule = new ShaderModule( GraphicsDevice, - TestUtils.GetShaderPath("FillTextureCompute.spv") + TestUtils.GetShaderPath("FillTextureCompute") ); ComputePipeline fillTextureComputePipeline = new ComputePipeline( @@ -27,7 +27,7 @@ namespace MoonWorks.Test // Create the compute pipeline that calculates squares of numbers ShaderModule calculateSquaresComputeShaderModule = new ShaderModule( GraphicsDevice, - TestUtils.GetShaderPath("CalculateSquaresCompute.spv") + TestUtils.GetShaderPath("CalculateSquaresCompute") ); ComputePipeline calculateSquaresComputePipeline = new ComputePipeline( @@ -38,12 +38,12 @@ namespace MoonWorks.Test // Create the graphics pipeline ShaderModule vertShaderModule = new ShaderModule( GraphicsDevice, - TestUtils.GetShaderPath("TexturedQuadVert.spv") + TestUtils.GetShaderPath("TexturedQuadVert") ); ShaderModule fragShaderModule = new ShaderModule( GraphicsDevice, - TestUtils.GetShaderPath("TexturedQuadFrag.spv") + TestUtils.GetShaderPath("TexturedQuadFrag") ); GraphicsPipelineCreateInfo drawPipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo( diff --git a/BasicTriangle/BasicTriangleGame.cs b/BasicTriangle/BasicTriangleGame.cs index ec799d2..7bcd0ff 100644 --- a/BasicTriangle/BasicTriangleGame.cs +++ b/BasicTriangle/BasicTriangleGame.cs @@ -19,8 +19,8 @@ namespace MoonWorks.Test { Logger.LogInfo("Press Left to toggle wireframe mode\nPress Down to toggle small viewport\nPress Right to toggle scissor rect"); - ShaderModule vertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("RawTriangleVertices.spv")); - ShaderModule fragShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("SolidColor.spv")); + ShaderModule vertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("RawTriangleVertices")); + ShaderModule fragShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("SolidColor")); GraphicsPipelineCreateInfo pipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo( MainWindow.SwapchainFormat, diff --git a/CompressedTextures/CompressedTexturesGame.cs b/CompressedTextures/CompressedTexturesGame.cs index c701d8f..9fe91b4 100644 --- a/CompressedTextures/CompressedTexturesGame.cs +++ b/CompressedTextures/CompressedTexturesGame.cs @@ -28,8 +28,8 @@ namespace MoonWorks.Test Logger.LogInfo("Setting texture to: " + textureNames[0]); // Load the shaders - ShaderModule vertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("TexturedQuadVert.spv")); - ShaderModule fragShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("TexturedQuadFrag.spv")); + ShaderModule vertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("TexturedQuadVert")); + ShaderModule fragShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("TexturedQuadFrag")); // Create the graphics pipeline GraphicsPipelineCreateInfo pipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo( diff --git a/ComputeUniforms/ComputeUniformsGame.cs b/ComputeUniforms/ComputeUniformsGame.cs index 70d66d1..a3204c6 100644 --- a/ComputeUniforms/ComputeUniformsGame.cs +++ b/ComputeUniforms/ComputeUniformsGame.cs @@ -28,7 +28,7 @@ namespace MoonWorks.Test // Create the compute pipeline that writes texture data ShaderModule gradientTextureComputeShaderModule = new ShaderModule( GraphicsDevice, - TestUtils.GetShaderPath("GradientTextureCompute.spv") + TestUtils.GetShaderPath("GradientTextureCompute") ); ComputePipeline gradientTextureComputePipeline = new ComputePipeline( @@ -39,12 +39,12 @@ namespace MoonWorks.Test // Create the graphics pipeline ShaderModule vertShaderModule = new ShaderModule( GraphicsDevice, - TestUtils.GetShaderPath("TexturedQuadVert.spv") + TestUtils.GetShaderPath("TexturedQuadVert") ); ShaderModule fragShaderModule = new ShaderModule( GraphicsDevice, - TestUtils.GetShaderPath("TexturedQuadFrag.spv") + TestUtils.GetShaderPath("TexturedQuadFrag") ); GraphicsPipelineCreateInfo drawPipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo( diff --git a/CopyTexture/CopyTextureGame.cs b/CopyTexture/CopyTextureGame.cs index 478f50c..6607dc0 100644 --- a/CopyTexture/CopyTextureGame.cs +++ b/CopyTexture/CopyTextureGame.cs @@ -17,8 +17,8 @@ namespace MoonWorks.Test public CopyTextureGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), 60, true) { // Load the shaders - ShaderModule vertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("TexturedQuadVert.spv")); - ShaderModule fragShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("TexturedQuadFrag.spv")); + ShaderModule vertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("TexturedQuadVert")); + ShaderModule fragShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("TexturedQuadFrag")); // Create the graphics pipeline GraphicsPipelineCreateInfo pipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo( diff --git a/Cube/CubeGame.cs b/Cube/CubeGame.cs index a7baba5..fd16c64 100644 --- a/Cube/CubeGame.cs +++ b/Cube/CubeGame.cs @@ -86,29 +86,29 @@ namespace MoonWorks.Test { ShaderModule cubeVertShaderModule = new ShaderModule( GraphicsDevice, - TestUtils.GetShaderPath("PositionColorVertWithMatrix.spv") + TestUtils.GetShaderPath("PositionColorVertWithMatrix") ); ShaderModule cubeFragShaderModule = new ShaderModule( GraphicsDevice, - TestUtils.GetShaderPath("SolidColor.spv") + TestUtils.GetShaderPath("SolidColor") ); ShaderModule skyboxVertShaderModule = new ShaderModule( GraphicsDevice, - TestUtils.GetShaderPath("SkyboxVert.spv") + TestUtils.GetShaderPath("SkyboxVert") ); ShaderModule skyboxFragShaderModule = new ShaderModule( GraphicsDevice, - TestUtils.GetShaderPath("SkyboxFrag.spv") + TestUtils.GetShaderPath("SkyboxFrag") ); ShaderModule blitVertShaderModule = new ShaderModule( GraphicsDevice, - TestUtils.GetShaderPath("TexturedQuadVert.spv") + TestUtils.GetShaderPath("TexturedQuadVert") ); ShaderModule blitFragShaderModule = new ShaderModule( GraphicsDevice, - TestUtils.GetShaderPath("TexturedDepthQuadFrag.spv") + TestUtils.GetShaderPath("TexturedDepthQuadFrag") ); depthTexture = Texture.CreateTexture2D( diff --git a/CullFace/CullFaceGame.cs b/CullFace/CullFaceGame.cs index 93a9c18..3d8bf03 100644 --- a/CullFace/CullFaceGame.cs +++ b/CullFace/CullFaceGame.cs @@ -22,8 +22,8 @@ namespace MoonWorks.Test Logger.LogInfo("Press Down to toggle the winding order of the triangles (default is counter-clockwise)"); // Load the shaders - ShaderModule vertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("PositionColorVert.spv")); - ShaderModule fragShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("SolidColor.spv")); + ShaderModule vertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("PositionColorVert")); + ShaderModule fragShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("SolidColor")); // Create the graphics pipelines GraphicsPipelineCreateInfo pipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo( diff --git a/DrawIndirect/DrawIndirectGame.cs b/DrawIndirect/DrawIndirectGame.cs index e7611da..9979b51 100644 --- a/DrawIndirect/DrawIndirectGame.cs +++ b/DrawIndirect/DrawIndirectGame.cs @@ -14,8 +14,8 @@ namespace MoonWorks.Test public DrawIndirectGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), 60, true) { // Load the shaders - ShaderModule vertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("PositionColorVert.spv")); - ShaderModule fragShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("SolidColor.spv")); + ShaderModule vertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("PositionColorVert")); + ShaderModule fragShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("SolidColor")); // Create the graphics pipeline GraphicsPipelineCreateInfo pipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo( diff --git a/MSAA/MSAAGame.cs b/MSAA/MSAAGame.cs index 3b3e0b8..4b8ce7a 100644 --- a/MSAA/MSAAGame.cs +++ b/MSAA/MSAAGame.cs @@ -22,8 +22,8 @@ namespace MoonWorks.Test Logger.LogInfo("Setting sample count to: " + currentSampleCount); // Create the MSAA pipelines - ShaderModule triangleVertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("RawTriangleVertices.spv")); - ShaderModule triangleFragShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("SolidColor.spv")); + ShaderModule triangleVertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("RawTriangleVertices")); + ShaderModule triangleFragShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("SolidColor")); GraphicsPipelineCreateInfo pipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo( TextureFormat.R8G8B8A8, @@ -37,8 +37,8 @@ namespace MoonWorks.Test } // Create the blit pipeline - ShaderModule blitVertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("TexturedQuadVert.spv")); - ShaderModule blitFragShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("TexturedQuadFrag.spv")); + ShaderModule blitVertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("TexturedQuadVert")); + ShaderModule blitFragShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("TexturedQuadFrag")); pipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo( MainWindow.SwapchainFormat, diff --git a/MoonWorks.Test.Common/Content/Shaders/Compiled/CalculateSquaresCompute.spv b/MoonWorks.Test.Common/Content/Shaders/Compiled/CalculateSquaresCompute.refresh similarity index 82% rename from MoonWorks.Test.Common/Content/Shaders/Compiled/CalculateSquaresCompute.spv rename to MoonWorks.Test.Common/Content/Shaders/Compiled/CalculateSquaresCompute.refresh index 5492e6f5409397175911cef00ac67a846c88c840..db1640d81477885692fe459832a23b0a04372811 100644 GIT binary patch delta 17 YcmbQjK9`*{$Sv4|aSAg7!-gr$04QJtTL1t6 delta 8 PcmbQsK81ZF=M-iD48{VH diff --git a/MoonWorks.Test.Common/Content/Shaders/Compiled/FillTextureCompute.spv b/MoonWorks.Test.Common/Content/Shaders/Compiled/FillTextureCompute.refresh similarity index 83% rename from MoonWorks.Test.Common/Content/Shaders/Compiled/FillTextureCompute.spv rename to MoonWorks.Test.Common/Content/Shaders/Compiled/FillTextureCompute.refresh index 3f90d1599c6f117939ac1c8283434414b283b594..9cc02045dc2d4595c18a3f708f4632c23d161e10 100644 GIT binary patch delta 17 Ycmeyt*2vBo delta 8 PcmbQr)5EiolZOoe3xxs( diff --git a/MoonWorks.Test.Common/Content/Shaders/Compiled/PositionColorVert.spv b/MoonWorks.Test.Common/Content/Shaders/Compiled/PositionColorVert.refresh similarity index 85% rename from MoonWorks.Test.Common/Content/Shaders/Compiled/PositionColorVert.spv rename to MoonWorks.Test.Common/Content/Shaders/Compiled/PositionColorVert.refresh index 35c29f80650933f69042d4a4e7a5255936d6f5e5..5daef2439b36e20ad2f43b14863c62b631a98e37 100644 GIT binary patch delta 17 YcmbQkv6O=|$Sv4|QHF(qVS@|{03}TWe*gdg delta 8 PcmZ3=F^6L#rwj`K3{wIu diff --git a/MoonWorks.Test.Common/Content/Shaders/Compiled/PositionColorVertWithMatrix.spv b/MoonWorks.Test.Common/Content/Shaders/Compiled/PositionColorVertWithMatrix.refresh similarity index 88% rename from MoonWorks.Test.Common/Content/Shaders/Compiled/PositionColorVertWithMatrix.spv rename to MoonWorks.Test.Common/Content/Shaders/Compiled/PositionColorVertWithMatrix.refresh index 8676f660d7d6273fafc879a7ad110654e96d94a7..9e90d79bce92b540bf0a2c2b4cd5db42853ab8db 100644 GIT binary patch delta 17 YcmX@Yb(V`W$Sv4|(S?(^b delta 8 PcmX@hb%bjprwc0p4(tM{ diff --git a/MoonWorks.Test.Common/Content/Shaders/Compiled/RawTriangleVertices.spv b/MoonWorks.Test.Common/Content/Shaders/Compiled/RawTriangleVertices.refresh similarity index 90% rename from MoonWorks.Test.Common/Content/Shaders/Compiled/RawTriangleVertices.spv rename to MoonWorks.Test.Common/Content/Shaders/Compiled/RawTriangleVertices.refresh index 68f53519f1afd3ed607a990f1d4057f35e082fd7..3b388c38a6b0841ae62cdb1143daae905a6db3e0 100644 GIT binary patch delta 17 YcmZ3$vyz81$Sv4|QGtztVS@r2048?>n*aa+ delta 8 PcmZ3pF delta 8 PcmZo<{lT)4vw{f#4d?>5 diff --git a/MoonWorks.Test.Common/Content/Shaders/Compiled/TexturedQuadFragWithMultiplyColor.spv b/MoonWorks.Test.Common/Content/Shaders/Compiled/TexturedQuadFragWithMultiplyColor.refresh similarity index 82% rename from MoonWorks.Test.Common/Content/Shaders/Compiled/TexturedQuadFragWithMultiplyColor.spv rename to MoonWorks.Test.Common/Content/Shaders/Compiled/TexturedQuadFragWithMultiplyColor.refresh index 0c4dc460c7df1ecf2a554f60d72a50c3174c0f4c..079835c80985b68b7cb9e78ad3d4c21161c7fdc5 100644 GIT binary patch delta 17 YcmeBSpUTb|