From d11f3acd99341df781a3cf760ac9764953bc3629 Mon Sep 17 00:00:00 2001 From: Egor Date: Sun, 18 Feb 2018 16:10:33 -0800 Subject: Disabled dual-source color blend testing on GLES as it is not supported even in GLES3.2 and only works on NVidia's tablet --- Tests/TestApp/src/TestBlendState.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'Tests/TestApp/src/TestBlendState.cpp') diff --git a/Tests/TestApp/src/TestBlendState.cpp b/Tests/TestApp/src/TestBlendState.cpp index e54e4ad..9ee7fe2 100644 --- a/Tests/TestApp/src/TestBlendState.cpp +++ b/Tests/TestApp/src/TestBlendState.cpp @@ -51,6 +51,10 @@ TestBlendState::TestBlendState( IRenderDevice *pDevice, IDeviceContext *pContext TestPipelineStateBase(pDevice, "Blend state initialization test"), m_pDeviceContext(pContext) { + // Dual-source color blending is not supported in GLES3.2, but NVidia's GPUs do support it + const auto& DevCaps = pDevice->GetDeviceCaps(); + bool TestSRC1 = DevCaps.DevType != DeviceType::OpenGLES;// || DevCaps.Vendor == GPU_VENDOR::NVIDIA; + m_PSODesc.Name = "PSO-TestBlendStates"; BlendStateDesc &BSDesc = m_PSODesc.GraphicsPipeline.BlendDesc; BSDesc.RenderTargets[0].BlendEnable = True; @@ -80,14 +84,13 @@ TestBlendState::TestBlendState( IRenderDevice *pDevice, IDeviceContext *pContext BLEND_FACTOR_INV_SRC1_ALPHA, }; - for( int i = 0; i < BlendStateDesc::MaxRenderTargets; ++i ) { auto &RT = BSDesc.RenderTargets[i]; RT.BlendEnable = True; for( auto bf = BLEND_FACTOR_UNDEFINED + 1; bf < BLEND_FACTOR_NUM_FACTORS; ++bf ) { - if( i > 0 && + if( (!TestSRC1 || i > 0) && (bf == BLEND_FACTOR_SRC1_COLOR || bf == BLEND_FACTOR_INV_SRC1_COLOR || bf == BLEND_FACTOR_SRC1_ALPHA || @@ -99,7 +102,7 @@ TestBlendState::TestBlendState( IRenderDevice *pDevice, IDeviceContext *pContext for( auto bf = BLEND_FACTOR_UNDEFINED + 1; bf < BLEND_FACTOR_NUM_FACTORS; ++bf ) { - if( i > 0 && + if( (!TestSRC1 || i > 0) && (bf == BLEND_FACTOR_SRC1_COLOR || bf == BLEND_FACTOR_INV_SRC1_COLOR || bf == BLEND_FACTOR_SRC1_ALPHA || @@ -123,7 +126,7 @@ TestBlendState::TestBlendState( IRenderDevice *pDevice, IDeviceContext *pContext for( auto bf = 0; bf < _countof(AlphaBlendFactors); ++bf ) { auto AlphaBlend = AlphaBlendFactors[bf]; - if( i > 0 && (AlphaBlend == BLEND_FACTOR_SRC1_ALPHA || AlphaBlend == BLEND_FACTOR_INV_SRC1_ALPHA) ) + if( (!TestSRC1 || i > 0) && (AlphaBlend == BLEND_FACTOR_SRC1_ALPHA || AlphaBlend == BLEND_FACTOR_INV_SRC1_ALPHA) ) continue; RT.SrcBlendAlpha = AlphaBlend; @@ -133,7 +136,7 @@ TestBlendState::TestBlendState( IRenderDevice *pDevice, IDeviceContext *pContext for( auto bf = 0; bf < _countof(AlphaBlendFactors); ++bf ) { auto AlphaBlend = AlphaBlendFactors[bf]; - if( i > 0 && (AlphaBlend == BLEND_FACTOR_SRC1_ALPHA || AlphaBlend == BLEND_FACTOR_INV_SRC1_ALPHA) ) + if( (!TestSRC1 || i > 0) && (AlphaBlend == BLEND_FACTOR_SRC1_ALPHA || AlphaBlend == BLEND_FACTOR_INV_SRC1_ALPHA) ) continue; RT.DestBlendAlpha = AlphaBlend; -- cgit v1.2.3