Skip to content

Commit

Permalink
Test brush shaders combinations
Browse files Browse the repository at this point in the history
  • Loading branch information
nieznanysprawiciel committed Nov 20, 2024
1 parent 75e3f05 commit 92cd04d
Showing 1 changed file with 71 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,24 @@ TEST_CASE( "GUI.Rendering.DX11.Brush.ShaderCompilation.SolidColorBrush", "[GUISy
CHECK( renderingData.PixelShader != nullptr );
}

// ================================ //
//
TEST_CASE( "GUI.Rendering.DX11.Brush.ShaderCompilation.SolidColorBrush.Opacity", "[GUISystem][RenderingSystem][Drawing]" )
{
TestFramework* framework = GetGlobalTestFramework();

FakeDrawingPtr drawing = std::make_shared< FakeDrawing >();
SolidColorBrushPtr brush = std::make_shared< SolidColorBrush >();
ShaderProvider* sp = framework->GetRenderingSystem()->GetShaderProvider();

drawing->UpdateBrushShader( sp, brush.get(), sp->GetBasicPSTemplate() );

auto& renderingData = CLASS_TESTER( Drawing )::GetBrushRenderingData( drawing.get() );

INFO( "[SolidColorBrush] Brush Shader compilation failed." );
CHECK( renderingData.PixelShader != nullptr );
}

// ================================ //
//
TEST_CASE( "GUI.Rendering.DX11.Brush.ShaderCompilation.LinearGradientBrush", "[GUISystem][RenderingSystem][Drawing]" )
Expand All @@ -54,6 +72,24 @@ TEST_CASE( "GUI.Rendering.DX11.Brush.ShaderCompilation.LinearGradientBrush", "[G
CHECK( renderingData.PixelShader != nullptr );
}

// ================================ //
//
TEST_CASE( "GUI.Rendering.DX11.Brush.ShaderCompilation.LinearGradientBrush.Opacity", "[GUISystem][RenderingSystem][Drawing]" )
{
TestFramework* framework = GetGlobalTestFramework();

FakeDrawingPtr drawing = std::make_shared< FakeDrawing >();
LinearGradientBrushPtr brush = std::make_shared< LinearGradientBrush >();
ShaderProvider* sp = framework->GetRenderingSystem()->GetShaderProvider();

drawing->UpdateBrushShader( sp, brush.get(), sp->GetBasicPSTemplate() );

auto& renderingData = CLASS_TESTER( Drawing )::GetBrushRenderingData( drawing.get() );

INFO( "[LinearGradientBrush] Brush Shader compilation failed." );
CHECK( renderingData.PixelShader != nullptr );
}

// ================================ //
//
TEST_CASE( "GUI.Rendering.DX11.Brush.ShaderCompilation.AngleGradientBrush", "[GUISystem][RenderingSystem][Drawing]" )
Expand All @@ -71,6 +107,24 @@ TEST_CASE( "GUI.Rendering.DX11.Brush.ShaderCompilation.AngleGradientBrush", "[GU
CHECK( renderingData.PixelShader != nullptr );
}

// ================================ //
//
TEST_CASE( "GUI.Rendering.DX11.Brush.ShaderCompilation.AngleGradientBrush.Opacity", "[GUISystem][RenderingSystem][Drawing]" )
{
TestFramework* framework = GetGlobalTestFramework();

FakeDrawingPtr drawing = std::make_shared< FakeDrawing >();
AngleGradientBrushPtr brush = std::make_shared< AngleGradientBrush >();
ShaderProvider* sp = framework->GetRenderingSystem()->GetShaderProvider();

drawing->UpdateBrushShader( sp, brush.get(), sp->GetBasicPSTemplate() );

auto& renderingData = CLASS_TESTER( Drawing )::GetBrushRenderingData( drawing.get() );

INFO( "[AngleGradientBrush] Brush Shader compilation failed." );
CHECK( renderingData.PixelShader != nullptr );
}

// ================================ //
//
TEST_CASE( "GUI.Rendering.DX11.Brush.ShaderCompilation.ImageBrush", "[GUISystem][RenderingSystem][Drawing]" )
Expand All @@ -88,3 +142,20 @@ TEST_CASE( "GUI.Rendering.DX11.Brush.ShaderCompilation.ImageBrush", "[GUISystem]
CHECK( renderingData.PixelShader != nullptr );
}

// ================================ //
//
TEST_CASE( "GUI.Rendering.DX11.Brush.ShaderCompilation.ImageBrush.Opacity", "[GUISystem][RenderingSystem][Drawing]" )
{
TestFramework* framework = GetGlobalTestFramework();

FakeDrawingPtr drawing = std::make_shared< FakeDrawing >();
ImageBrushPtr brush = std::make_shared< ImageBrush >();
ShaderProvider* sp = framework->GetRenderingSystem()->GetShaderProvider();

drawing->UpdateBrushShader( sp, brush.get(), sp->GetBasicPSTemplate() );

auto& renderingData = CLASS_TESTER( Drawing )::GetBrushRenderingData( drawing.get() );

INFO( "[ImageBrush] Brush Shader compilation failed." );
CHECK( renderingData.PixelShader != nullptr );
}

0 comments on commit 92cd04d

Please sign in to comment.