From b3c019f4169e7b45b7cfe275c353f871531904b0 Mon Sep 17 00:00:00 2001 From: nieznanysprawiciel Date: Fri, 15 Nov 2024 11:45:12 +0100 Subject: [PATCH] Test compilation of opacity vertex shader --- .../TestGeometryShaderCompilation.cpp | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/swGUI/Tests/TestRenderingSystem.DX11/TestGeometryShaderCompilation.cpp b/swGUI/Tests/TestRenderingSystem.DX11/TestGeometryShaderCompilation.cpp index 60f47dc7..8536cc03 100644 --- a/swGUI/Tests/TestRenderingSystem.DX11/TestGeometryShaderCompilation.cpp +++ b/swGUI/Tests/TestRenderingSystem.DX11/TestGeometryShaderCompilation.cpp @@ -33,3 +33,23 @@ TEST_CASE( "GUI.Rendering.DX11.Geometry.ShaderCompilation.ForwardAttributes", "[ CHECK( renderingData.VertexShader != nullptr ); } +// ================================ // +// Test default shader for forwarding attributes. +TEST_CASE( "GUI.Rendering.DX11.Geometry.ShaderCompilation.ForwardWithOpacity", "[GUISystem][RenderingSystem][Drawing]" ) +{ + TestFramework* framework = GetGlobalTestFramework(); + + FakeDrawingPtr drawing = std::make_shared< FakeDrawing >(); + FakeGeometryPtr geom = std::make_shared< FakeGeometry >( Geometry::ConstantBufferMode::Disable ); + ShaderProvider* sp = framework->GetRenderingSystem()->GetShaderProvider(); + + geom->SetShaderFunction( "$(CoreGUI-Shader-Dir)/Geometry/ForwardWithOpacity.vsh" ); + + drawing->UpdateVertexShader( sp, geom.get(), sp->GetOpacityVSTemplate() ); + + auto& renderingData = CLASS_TESTER( Drawing )::GetGeometryRenderingData( drawing.get() ); + + INFO( "[Default ForwardWithOpacity.vsh] Shader compilation failed." ); + CHECK( renderingData.VertexShader != nullptr ); +} +