From 0f1ffe9dae9fd2b7d8410285ebe8eac6b306b23d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 6 Oct 2024 16:48:16 +0200 Subject: [PATCH] GL: add XFAILs for some NVidia-specific behavior in ShaderProgram tests. Neither of those are really critically important. Failure not being a failure is fine (just don't make the shader broken in the first place), multiple color output bindings should be in the shader source anyway. --- .../GL/Test/AbstractShaderProgramGLTest.cpp | 31 ++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp b/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp index f8ddf1e5f..acc6b5ccf 100644 --- a/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp +++ b/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp @@ -506,8 +506,15 @@ void AbstractShaderProgramGLTest::createMultipleOutputs() { const bool valid = program.validate().first(); MAGNUM_VERIFY_NO_GL_ERROR(); - CORRADE_VERIFY(linked); { + #ifdef MAGNUM_TARGET_GLES + CORRADE_EXPECT_FAIL_IF(Context::current().detectedDriver() & Context::DetectedDriver::NVidia, + "NVidia drivers don't take glBindFragDataLocationEXT() into account on ES."); + #endif + CORRADE_VERIFY(linked); + if(!linked) + return; + } { #ifdef CORRADE_TARGET_APPLE CORRADE_EXPECT_FAIL("macOS drivers need insane amount of state to validate properly."); #endif @@ -578,8 +585,15 @@ void AbstractShaderProgramGLTest::createMultipleOutputsIndexed() { const bool valid = program.validate().first(); MAGNUM_VERIFY_NO_GL_ERROR(); - CORRADE_VERIFY(linked); { + #ifdef MAGNUM_TARGET_GLES + CORRADE_EXPECT_FAIL_IF(Context::current().detectedDriver() & Context::DetectedDriver::NVidia, + "NVidia drivers don't take glBindFragDataLocationEXT() into account on ES."); + #endif + CORRADE_VERIFY(linked); + if(!linked) + return; + } { #ifdef CORRADE_TARGET_APPLE CORRADE_EXPECT_FAIL("macOS drivers need insane amount of state to validate properly."); #endif @@ -808,11 +822,14 @@ void main() { Containers::Pair result = program.validate(); MAGNUM_VERIFY_NO_GL_ERROR(); - CORRADE_VERIFY(!result.first()); - /* The message shouldn't be empty */ - CORRADE_COMPARE_AS(result.second(), - "", - TestSuite::Compare::NotEqual); + { + CORRADE_EXPECT_FAIL_IF(Context::current().detectedDriver() & Context::DetectedDriver::NVidia, "NVidia doesn't treat conflicting sampler locations as a failure."); + CORRADE_VERIFY(!result.first()); + /* The message shouldn't be empty */ + CORRADE_COMPARE_AS(result.second(), + "", + TestSuite::Compare::NotEqual); + } /* No stray \0 or \n should be anywhere */ CORRADE_COMPARE_AS(result.second(), "\0"_s, TestSuite::Compare::StringNotContains); CORRADE_COMPARE_AS(result.second(), "\n"_s, TestSuite::Compare::StringNotContains);