From b591550f62a5e0ab249405f70ef52a02e857abe2 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Tue, 9 Mar 2021 13:58:12 +1100 Subject: [PATCH] Add some simple shader tests for compatibility context These are some simple compile tests to make sure implementations correctly default to core shaders when no core/es/compatibility qualifier is defined. And also correctly disable functionality in core shaders that was moved to compatibility in GL 4.2 Here we also add some basic support for creating compat profiles to the framework. For now we just use core function init and state resets as a dummy for compat as we don't currently need to use any compat features other than the context creatation itself. Affects: KHR-GL42-COMPAT.shaders42* Components: Framework, OpenGL VK-GL-CTS issue: 2837 Change-Id: I055bf2e9ab7361436c8cc96f7d1acc041f61e76b --- external/openglcts/data/gl42-compat/builtins.test | 292 +++++++++++++++++++++ external/openglcts/data/gl42-compat/varyings.test | 101 +++++++ .../4.6.0.x/compat-gl42-master.txt | 14 + .../gl/khronos_mustpass/4.6.0.x/mustpass.xml | 6 + .../4.6.0.x/src/gl42-compat-master.txt | 1 + .../4.6.1.x/compat-gl42-master.txt | 14 + .../gl/khronos_mustpass/4.6.1.x/mustpass.xml | 6 + .../4.6.1.x/src/gl42-compat-master.txt | 1 + external/openglcts/modules/gl/gl3cTestPackages.cpp | 17 +- external/openglcts/modules/gl/gl3cTestPackages.hpp | 15 ++ external/openglcts/modules/gl/gl4cTestPackages.cpp | 49 ++++ external/openglcts/modules/gl/gl4cTestPackages.hpp | 16 ++ .../openglcts/modules/glcTestPackageRegistry.cpp | 5 + .../modules/runner/glcKhronosMustpassGl.hpp | 6 + external/openglcts/scripts/build_caselists.py | 1 + external/openglcts/scripts/build_mustpass.py | 1 + external/openglcts/scripts/mustpass.py | 2 + framework/opengl/gluRenderContext.cpp | 19 ++ framework/opengl/gluStateReset.cpp | 5 +- framework/platform/null/tcuNullRenderContext.cpp | 5 + 20 files changed, 559 insertions(+), 17 deletions(-) create mode 100644 external/openglcts/data/gl42-compat/builtins.test create mode 100644 external/openglcts/data/gl42-compat/varyings.test create mode 100644 external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/compat-gl42-master.txt create mode 100644 external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/src/gl42-compat-master.txt create mode 100644 external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/compat-gl42-master.txt create mode 100644 external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/src/gl42-compat-master.txt diff --git a/external/openglcts/data/gl42-compat/builtins.test b/external/openglcts/data/gl42-compat/builtins.test new file mode 100644 index 0000000..fa3e2d8 --- /dev/null +++ b/external/openglcts/data/gl42-compat/builtins.test @@ -0,0 +1,292 @@ +group builtins "Builtin Tests" + + case core_gl_FragColor + version 420 + expect compile_fail + vertex "" + #version 420 + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 420 + void main() + { + gl_FragColor = vec4(1.0); + } + "" + end + + case core_gl_FragData + version 420 + expect compile_fail + vertex "" + #version 420 + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 420 + void main() + { + gl_FragData[0] = vec4(1.0, 1.0, 1.0, 1.0); + } + "" + end + + case core_gl_MaxVaryingFloats + version 420 + expect compile_fail + vertex "" + #version 420 + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 420 + out vec4 color; + void main() + { + color = vec4(float(gl_MaxVaryingFloats)); + } + "" + end + + case core_texture_builtins + version 420 + expect compile_fail + vertex "" + #version 420 + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 420 + uniform sampler1D tex1d; + uniform sampler2D tex2d; + uniform sampler3D tex3d; + uniform samplerCube texCube; + + uniform float i; + uniform float dummy_f_coord; + uniform vec2 dummy_v2_coord; + uniform vec3 dummy_v3_coord; + uniform vec4 dummy_v4_coord; + out vec4 color; + void main() + { + color = texture1D(tex1d, dummy_f_coord, i); + color =+ texture1DProj(tex1d, dummy_v2_coord, i); + color =+ texture1DProj(tex1d, dummy_v4_coord, i); + color =+ texture1DLod(tex1d, dummy_f_coord, i); + color =+ texture1DProjLod(tex1d, dummy_v2_coord, i); + color =+ texture1DProjLod(tex1d, dummy_v4_coord, i); + + color =+ texture2D(tex2d, dummy_v2_coord, i); + color =+ texture2DProj(tex2d, dummy_v3_coord, i); + color =+ texture2DProj(tex2d, dummy_v4_coord, i); + color =+ texture2DLod(tex2d, dummy_v2_coord, i); + color =+ texture2DProjLod(tex2d, dummy_v3_coord, i); + color =+ texture2DProjLod(tex2d, dummy_v4_coord, i); + + color =+ texture3D(tex3d, dummy_v3_coord, i); + color =+ texture3DProj(tex3d, dummy_v4_coord, i); + color =+ texture3DLod(tex3d, dummy_v3_coord, i); + color =+ texture3DProjLod(tex3d, dummy_v4_coord, i); + + color =+ textureCube(texCube, dummy_v3_coord, i); + color =+ textureCubeLod(texCube, dummy_v3_coord, i); + } + "" + end + + case core_shadow_builtins + version 420 + expect compile_fail + vertex "" + #version 420 + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 420 + uniform sampler1DShadow tex1dshadow; + uniform sampler2DShadow tex2dshadow; + + uniform float i; + uniform vec3 dummy_v3_coord; + uniform vec4 dummy_v4_coord; + out vec4 color; + void main() + { + color = shadow1D(tex1dshadow, dummy_v3_coord, i); + color =+ shadow1DProj(tex1dshadow, dummy_v4_coord, i); + color =+ shadow1DLod(tex1dshadow, dummy_v3_coord, i); + color =+ shadow1DProjLod(tex1dshadow, dummy_v4_coord, i); + + color =+ shadow2D(tex2dshadow, dummy_v3_coord, i); + color =+ shadow2DProj(tex2dshadow, dummy_v4_coord, i); + color =+ shadow2DLod(tex2dshadow, dummy_v3_coord, i); + color =+ shadow2DProjLod(tex2dshadow, dummy_v4_coord, i); + } + "" + end + + case compatibility_gl_FragColor + version 420 + vertex "" + #version 420 compatibility + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 420 compatibility + void main() + { + gl_FragColor = vec4(1.0); + } + "" + end + + case compatibility_gl_FragData + version 420 + vertex "" + #version 420 compatibility + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 420 compatibility + void main() + { + gl_FragData[0] = vec4(1.0, 1.0, 1.0, 1.0); + } + "" + end + + case compatibility_gl_MaxVaryingFloats + version 420 + vertex "" + #version 420 compatibility + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 420 compatibility + out vec4 color; + void main() + { + color = vec4(float(gl_MaxVaryingFloats)); + } + "" + end + + case compatibility_texture_builtins + version 420 + vertex "" + #version 420 compatibility + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 420 compatibility + uniform sampler1D tex1d; + uniform sampler2D tex2d; + uniform sampler3D tex3d; + uniform samplerCube texCube; + + uniform float i; + uniform float dummy_f_coord; + uniform vec2 dummy_v2_coord; + uniform vec3 dummy_v3_coord; + uniform vec4 dummy_v4_coord; + out vec4 color; + void main() + { + color = texture1D(tex1d, dummy_f_coord, i); + color =+ texture1DProj(tex1d, dummy_v2_coord, i); + color =+ texture1DProj(tex1d, dummy_v4_coord, i); + color =+ texture1DLod(tex1d, dummy_f_coord, i); + color =+ texture1DProjLod(tex1d, dummy_v2_coord, i); + color =+ texture1DProjLod(tex1d, dummy_v4_coord, i); + + color =+ texture2D(tex2d, dummy_v2_coord, i); + color =+ texture2DProj(tex2d, dummy_v3_coord, i); + color =+ texture2DProj(tex2d, dummy_v4_coord, i); + color =+ texture2DLod(tex2d, dummy_v2_coord, i); + color =+ texture2DProjLod(tex2d, dummy_v3_coord, i); + color =+ texture2DProjLod(tex2d, dummy_v4_coord, i); + + color =+ texture3D(tex3d, dummy_v3_coord, i); + color =+ texture3DProj(tex3d, dummy_v4_coord, i); + color =+ texture3DLod(tex3d, dummy_v3_coord, i); + color =+ texture3DProjLod(tex3d, dummy_v4_coord, i); + + color =+ textureCube(texCube, dummy_v3_coord, i); + color =+ textureCubeLod(texCube, dummy_v3_coord, i); + } + "" + end + + case compatibility_shadow_builtins + version 420 + vertex "" + #version 420 compatibility + ${VERTEX_DECLARATIONS} + void main() + { + ${VERTEX_OUTPUT} + } + "" + fragment "" + #version 420 compatibility + uniform sampler1DShadow tex1dshadow; + uniform sampler2DShadow tex2dshadow; + + uniform float i; + uniform vec3 dummy_v3_coord; + uniform vec4 dummy_v4_coord; + out vec4 color; + void main() + { + color = shadow1D(tex1dshadow, dummy_v3_coord, i); + color =+ shadow1DProj(tex1dshadow, dummy_v4_coord, i); + color =+ shadow1DLod(tex1dshadow, dummy_v3_coord, i); + color =+ shadow1DProjLod(tex1dshadow, dummy_v4_coord, i); + + color =+ shadow2D(tex2dshadow, dummy_v3_coord, i); + color =+ shadow2DProj(tex2dshadow, dummy_v4_coord, i); + color =+ shadow2DLod(tex2dshadow, dummy_v3_coord, i); + color =+ shadow2DProjLod(tex2dshadow, dummy_v4_coord, i); + } + "" + end + +end diff --git a/external/openglcts/data/gl42-compat/varyings.test b/external/openglcts/data/gl42-compat/varyings.test new file mode 100644 index 0000000..afb8753 --- /dev/null +++ b/external/openglcts/data/gl42-compat/varyings.test @@ -0,0 +1,101 @@ +group varyings "Varying Tests" + + case core_varyings + version 450 + expect compile_fail + vertex "" + #version 450 + ${VERTEX_DECLARATIONS} + in vec4 in_v; + varying vec4 out_v; + void main() + { + ${VERTEX_OUTPUT} + out_v = in_v; + } + "" + fragment "" + #version 450 + varying vec4 out_v; + out vec4 color; + void main() + { + color = out_v; + } + "" + end + + case core_attributes + version 420 + expect compile_fail + vertex "" + #version 420 + ${VERTEX_DECLARATIONS} + attribute vec4 in_v; + out vec4 out_v; + void main() + { + ${VERTEX_OUTPUT} + out_v = in_v; + } + "" + fragment "" + #version 420 + in vec4 out_v; + out vec4 color; + void main() + { + color = out_v; + } + "" + end + + case compatibility_varyings + version 420 + vertex "" + #version 420 compatibility + ${VERTEX_DECLARATIONS} + in vec4 in_v; + varying vec4 out_v; + void main() + { + ${VERTEX_OUTPUT} + out_v = in_v; + } + "" + fragment "" + #version 420 compatibility + varying vec4 out_v; + out vec4 color; + void main() + { + color = out_v; + } + "" + end + + case compatibility_attributes + version 420 + vertex "" + #version 420 compatibility + ${VERTEX_DECLARATIONS} + attribute vec4 in_v; + out vec4 out_v; + void main() + { + ${VERTEX_OUTPUT} + out_v = in_v; + } + "" + fragment "" + #version 420 compatibility + in vec4 out_v; + out vec4 color; + void main() + { + color = out_v; + } + "" + end + +end diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/compat-gl42-master.txt b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/compat-gl42-master.txt new file mode 100644 index 0000000..272f8dc --- /dev/null +++ b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/compat-gl42-master.txt @@ -0,0 +1,14 @@ +KHR-COMPAT-GL42.shaders42.builtin.builtins.core_gl_FragColor +KHR-COMPAT-GL42.shaders42.builtin.builtins.core_gl_FragData +KHR-COMPAT-GL42.shaders42.builtin.builtins.core_gl_MaxVaryingFloats +KHR-COMPAT-GL42.shaders42.builtin.builtins.core_texture_builtins +KHR-COMPAT-GL42.shaders42.builtin.builtins.core_shadow_builtins +KHR-COMPAT-GL42.shaders42.builtin.builtins.compatibility_gl_FragColor +KHR-COMPAT-GL42.shaders42.builtin.builtins.compatibility_gl_FragData +KHR-COMPAT-GL42.shaders42.builtin.builtins.compatibility_gl_MaxVaryingFloats +KHR-COMPAT-GL42.shaders42.builtin.builtins.compatibility_texture_builtins +KHR-COMPAT-GL42.shaders42.builtin.builtins.compatibility_shadow_builtins +KHR-COMPAT-GL42.shaders42.varying.varyings.core_varyings +KHR-COMPAT-GL42.shaders42.varying.varyings.core_attributes +KHR-COMPAT-GL42.shaders42.varying.varyings.compatibility_varyings +KHR-COMPAT-GL42.shaders42.varying.varyings.compatibility_attributes diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/mustpass.xml b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/mustpass.xml index 6e1cc56..c5e47d8 100644 --- a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/mustpass.xml +++ b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/mustpass.xml @@ -48,6 +48,12 @@ + + + + + + diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/src/gl42-compat-master.txt b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/src/gl42-compat-master.txt new file mode 100644 index 0000000..79d0db4 --- /dev/null +++ b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/src/gl42-compat-master.txt @@ -0,0 +1 @@ +KHR-GL42-COMPAT.* diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/compat-gl42-master.txt b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/compat-gl42-master.txt new file mode 100644 index 0000000..272f8dc --- /dev/null +++ b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/compat-gl42-master.txt @@ -0,0 +1,14 @@ +KHR-COMPAT-GL42.shaders42.builtin.builtins.core_gl_FragColor +KHR-COMPAT-GL42.shaders42.builtin.builtins.core_gl_FragData +KHR-COMPAT-GL42.shaders42.builtin.builtins.core_gl_MaxVaryingFloats +KHR-COMPAT-GL42.shaders42.builtin.builtins.core_texture_builtins +KHR-COMPAT-GL42.shaders42.builtin.builtins.core_shadow_builtins +KHR-COMPAT-GL42.shaders42.builtin.builtins.compatibility_gl_FragColor +KHR-COMPAT-GL42.shaders42.builtin.builtins.compatibility_gl_FragData +KHR-COMPAT-GL42.shaders42.builtin.builtins.compatibility_gl_MaxVaryingFloats +KHR-COMPAT-GL42.shaders42.builtin.builtins.compatibility_texture_builtins +KHR-COMPAT-GL42.shaders42.builtin.builtins.compatibility_shadow_builtins +KHR-COMPAT-GL42.shaders42.varying.varyings.core_varyings +KHR-COMPAT-GL42.shaders42.varying.varyings.core_attributes +KHR-COMPAT-GL42.shaders42.varying.varyings.compatibility_varyings +KHR-COMPAT-GL42.shaders42.varying.varyings.compatibility_attributes diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/mustpass.xml b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/mustpass.xml index 001d7ad..0b11fd1 100644 --- a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/mustpass.xml +++ b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/mustpass.xml @@ -48,6 +48,12 @@ + + + + + + diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/src/gl42-compat-master.txt b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/src/gl42-compat-master.txt new file mode 100644 index 0000000..79d0db4 --- /dev/null +++ b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/src/gl42-compat-master.txt @@ -0,0 +1 @@ +KHR-GL42-COMPAT.* diff --git a/external/openglcts/modules/gl/gl3cTestPackages.cpp b/external/openglcts/modules/gl/gl3cTestPackages.cpp index 576457c..edf7bc0 100644 --- a/external/openglcts/modules/gl/gl3cTestPackages.cpp +++ b/external/openglcts/modules/gl/gl3cTestPackages.cpp @@ -58,22 +58,7 @@ namespace gl3cts { -class TestCaseWrapper : public tcu::TestCaseExecutor -{ -public: - TestCaseWrapper(GL30TestPackage& package, de::SharedPtr waiverMechanism); - ~TestCaseWrapper(void); - - void init(tcu::TestCase* testCase, const std::string& path); - void deinit(tcu::TestCase* testCase); - tcu::TestNode::IterateResult iterate(tcu::TestCase* testCase); - -private: - GL30TestPackage& m_testPackage; - de::SharedPtr m_waiverMechanism; -}; - -TestCaseWrapper::TestCaseWrapper(GL30TestPackage& package, de::SharedPtr waiverMechanism) +TestCaseWrapper::TestCaseWrapper(deqp::TestPackage& package, de::SharedPtr waiverMechanism) : m_testPackage (package) , m_waiverMechanism (waiverMechanism) { diff --git a/external/openglcts/modules/gl/gl3cTestPackages.hpp b/external/openglcts/modules/gl/gl3cTestPackages.hpp index f1a3c25..7d05442 100644 --- a/external/openglcts/modules/gl/gl3cTestPackages.hpp +++ b/external/openglcts/modules/gl/gl3cTestPackages.hpp @@ -32,6 +32,21 @@ namespace gl3cts { +class TestCaseWrapper : public tcu::TestCaseExecutor +{ +public: + TestCaseWrapper(deqp::TestPackage& package, de::SharedPtr waiverMechanism); + ~TestCaseWrapper(void); + + void init(tcu::TestCase* testCase, const std::string& path); + void deinit(tcu::TestCase* testCase); + tcu::TestNode::IterateResult iterate(tcu::TestCase* testCase); + +private: + deqp::TestPackage& m_testPackage; + de::SharedPtr m_waiverMechanism; +}; + class GL30TestPackage : public deqp::TestPackage { public: diff --git a/external/openglcts/modules/gl/gl4cTestPackages.cpp b/external/openglcts/modules/gl/gl4cTestPackages.cpp index 79fdc11..4c2a547 100644 --- a/external/openglcts/modules/gl/gl4cTestPackages.cpp +++ b/external/openglcts/modules/gl/gl4cTestPackages.cpp @@ -224,6 +224,55 @@ void GL42TestPackage::init(void) } } +// GL42CompatTestPackage + +class GL42CompatShaderTests : public deqp::TestCaseGroup +{ +public: + GL42CompatShaderTests(deqp::Context& context) : TestCaseGroup(context, "shaders42", "Shading Language Tests") + { + } + + void init(void) + { + addChild(new deqp::ShaderLibraryGroup(m_context, "builtin", "Builtin Tests", "gl42-compat/builtins.test")); + addChild(new deqp::ShaderLibraryGroup(m_context, "varying", "Varying Tests", "gl42-compat/varyings.test")); + } +}; + +GL42CompatTestPackage::GL42CompatTestPackage(tcu::TestContext& testCtx, const char* packageName, const char* description, + glu::ContextType renderContextType) + : TestPackage(testCtx, packageName, packageName, renderContextType, "gl_cts/data/") +{ + (void)description; +} + +GL42CompatTestPackage::~GL42CompatTestPackage(void) +{ +} + +void GL42CompatTestPackage::init(void) +{ + // Call init() in parent - this creates context. + TestPackage::init(); + + try + { + addChild(new GL42CompatShaderTests(getContext())); + } + catch (...) + { + // Destroy context. + TestPackage::deinit(); + throw; + } +} + +tcu::TestCaseExecutor* GL42CompatTestPackage::createExecutor(void) const +{ + return new gl3cts::TestCaseWrapper(const_cast(*this), m_waiverMechanism); +} + // GL43TestPackage GL43TestPackage::GL43TestPackage(tcu::TestContext& testCtx, const char* packageName, const char* description, diff --git a/external/openglcts/modules/gl/gl4cTestPackages.hpp b/external/openglcts/modules/gl/gl4cTestPackages.hpp index 1603215..07047aa 100644 --- a/external/openglcts/modules/gl/gl4cTestPackages.hpp +++ b/external/openglcts/modules/gl/gl4cTestPackages.hpp @@ -66,6 +66,22 @@ public: void init(void); }; +class GL42CompatTestPackage : public deqp::TestPackage +{ +public: + GL42CompatTestPackage(tcu::TestContext& testCtx, const char* packageName, + const char* description = "OpenGL 4.2 Compatibility Conformance Tests", + glu::ContextType renderContextType = glu::ContextType(4, 2, glu::PROFILE_COMPATIBILITY)); + + ~GL42CompatTestPackage(void); + + tcu::TestCaseExecutor* createExecutor(void) const; + + void init(void); + + using deqp::TestPackage::getContext; +}; + class GL43TestPackage : public GL42TestPackage { public: diff --git a/external/openglcts/modules/glcTestPackageRegistry.cpp b/external/openglcts/modules/glcTestPackageRegistry.cpp index 55d5126..1429a2e 100644 --- a/external/openglcts/modules/glcTestPackageRegistry.cpp +++ b/external/openglcts/modules/glcTestPackageRegistry.cpp @@ -203,6 +203,10 @@ static tcu::TestPackage* createGL42Package(tcu::TestContext& testCtx) { return new gl4cts::GL42TestPackage(testCtx, "KHR-GL42"); } +static tcu::TestPackage* createGL42CompatPackage(tcu::TestContext& testCtx) +{ + return new gl4cts::GL42CompatTestPackage(testCtx, "KHR-GL42-COMPAT"); +} static tcu::TestPackage* createGL43Package(tcu::TestContext& testCtx) { return new gl4cts::GL43TestPackage(testCtx, "KHR-GL43"); @@ -322,6 +326,7 @@ void registerPackages(void) registry->registerPackage("KHR-GL40", createGL40Package); registry->registerPackage("KHR-GL41", createGL41Package); registry->registerPackage("KHR-GL42", createGL42Package); + registry->registerPackage("KHR-COMPAT-GL42", createGL42CompatPackage); registry->registerPackage("KHR-GL43", createGL43Package); registry->registerPackage("KHR-GL44", createGL44Package); registry->registerPackage("KHR-GL45", createGL45Package); diff --git a/external/openglcts/modules/runner/glcKhronosMustpassGl.hpp b/external/openglcts/modules/runner/glcKhronosMustpassGl.hpp index f2acd63..d9372c7 100644 --- a/external/openglcts/modules/runner/glcKhronosMustpassGl.hpp +++ b/external/openglcts/modules/runner/glcKhronosMustpassGl.hpp @@ -42,6 +42,10 @@ static const RunParams khronos_mustpass_gl_first_cfg[] = { { glu::ApiType::core(4, 2), "master", DE_NULL, "unspecified", 2, DE_NULL, 113, 47 }, { glu::ApiType::core(4, 2), "master", DE_NULL, "unspecified", 3, "rgba8888d24s8", 64, -1 }, { glu::ApiType::core(4, 2), "master", DE_NULL, "unspecified", 3, "rgba8888d24s8", -1, 64 }, + { glu::ApiType::compatibility(4, 2), "master", DE_NULL, "unspecified", 1, DE_NULL, 64, 64 }, + { glu::ApiType::compatibility(4, 2), "master", DE_NULL, "unspecified", 2, DE_NULL, 113, 47 }, + { glu::ApiType::compatibility(4, 2), "master", DE_NULL, "unspecified", 3, "rgba8888d24s8", 64, -1 }, + { glu::ApiType::compatibility(4, 2), "master", DE_NULL, "unspecified", 3, "rgba8888d24s8", -1, 64 }, { glu::ApiType::core(4, 1), "master", DE_NULL, "unspecified", 1, DE_NULL, 64, 64 }, { glu::ApiType::core(4, 1), "master", DE_NULL, "unspecified", 2, DE_NULL, 113, 47 }, { glu::ApiType::core(4, 1), "master", DE_NULL, "unspecified", 3, "rgba8888d24s8", 64, -1 }, @@ -211,6 +215,8 @@ static const RunParams khronos_mustpass_gl_other_cfg[] = { { glu::ApiType::core(4, 3), "master", DE_NULL, "unspecified", 2, DE_NULL, 113, 47 }, { glu::ApiType::core(4, 2), "master", DE_NULL, "unspecified", 1, DE_NULL, 64, 64 }, { glu::ApiType::core(4, 2), "master", DE_NULL, "unspecified", 2, DE_NULL, 113, 47 }, + { glu::ApiType::compatibility(4, 2), "master", DE_NULL, "unspecified", 1, DE_NULL, 64, 64 }, + { glu::ApiType::compatibility(4, 2), "master", DE_NULL, "unspecified", 2, DE_NULL, 113, 47 }, { glu::ApiType::core(4, 1), "master", DE_NULL, "unspecified", 1, DE_NULL, 64, 64 }, { glu::ApiType::core(4, 1), "master", DE_NULL, "unspecified", 2, DE_NULL, 113, 47 }, { glu::ApiType::core(4, 0), "master", DE_NULL, "unspecified", 1, DE_NULL, 64, 64 }, diff --git a/external/openglcts/scripts/build_caselists.py b/external/openglcts/scripts/build_caselists.py index ced4106..c12c676 100644 --- a/external/openglcts/scripts/build_caselists.py +++ b/external/openglcts/scripts/build_caselists.py @@ -58,6 +58,7 @@ MODULES = [ Module("KHR-GL44", "GL44"), Module("KHR-GL43", "GL43"), Module("KHR-GL42", "GL42"), + Module("KHR-GL42-COMPAT", "GL42-COMPAT"), Module("KHR-GL41", "GL41"), Module("KHR-GL40", "GL40"), Module("KHR-GL33", "GL33"), diff --git a/external/openglcts/scripts/build_mustpass.py b/external/openglcts/scripts/build_mustpass.py index 5420b8f..b22062e 100644 --- a/external/openglcts/scripts/build_mustpass.py +++ b/external/openglcts/scripts/build_mustpass.py @@ -1079,6 +1079,7 @@ GL_MODULES = OrderedDict([ ('KHR-GL44', ['master', [include('gl44-master.txt'), exclude('gl44-test-issues.txt')]]), ('KHR-GL43', ['master', [include('gl43-master.txt'), exclude('gl43-test-issues.txt')]]), ('KHR-GL42', ['master', [include('gl42-master.txt'), exclude('gl42-test-issues.txt')]]), + ('KHR-GL42-COMPAT', ['master', [include('gl42-compat-master.txt')]]), ('KHR-GL41', ['master', [include('gl41-master.txt'), exclude('gl41-test-issues.txt')]]), ('KHR-GL40', ['master', [include('gl40-master.txt'), exclude('gl40-test-issues.txt')]]), ('KHR-GL33', ['master', [include('gl33-master.txt'), exclude('gl33-test-issues.txt')]]), diff --git a/external/openglcts/scripts/mustpass.py b/external/openglcts/scripts/mustpass.py index 5dabc29..b0fd963 100644 --- a/external/openglcts/scripts/mustpass.py +++ b/external/openglcts/scripts/mustpass.py @@ -291,6 +291,8 @@ def getApiType(apiName): return "glu::ApiType::core(3, 0)" if apiName == "EGL": return "glu::ApiType()" + if apiName == "GL42-COMPAT": + return "glu::ApiType::compatibility(4, 2)" raise Exception("Unknown API %s" % apiName) return "Unknown" diff --git a/framework/opengl/gluRenderContext.cpp b/framework/opengl/gluRenderContext.cpp index 6bb3e4a..6c533ee 100644 --- a/framework/opengl/gluRenderContext.cpp +++ b/framework/opengl/gluRenderContext.cpp @@ -262,6 +262,16 @@ void initCoreFunctions (glw::Functions* dst, const glw::FunctionLoader* loader, { ApiType::core(4,4), glw::initGL44Core }, { ApiType::core(4,5), glw::initGL45Core }, { ApiType::core(4,6), glw::initGL46Core }, + // TODO: initialise actual compat functions rather than using core as a dummy + { ApiType::compatibility(3,2), glw::initGL32Core }, + { ApiType::compatibility(3,3), glw::initGL33Core }, + { ApiType::compatibility(4,0), glw::initGL40Core }, + { ApiType::compatibility(4,1), glw::initGL41Core }, + { ApiType::compatibility(4,2), glw::initGL42Core }, + { ApiType::compatibility(4,3), glw::initGL43Core }, + { ApiType::compatibility(4,4), glw::initGL44Core }, + { ApiType::compatibility(4,5), glw::initGL45Core }, + { ApiType::compatibility(4,6), glw::initGL46Core }, }; for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(s_initFuncs); ndx++) @@ -322,6 +332,15 @@ const char* getApiTypeDescription (ApiType type) else if (type == glu::ApiType::core(4, 4)) return "OpenGL 4.4 core"; else if (type == glu::ApiType::core(4, 5)) return "OpenGL 4.5 core"; else if (type == glu::ApiType::core(4, 6)) return "OpenGL 4.6 core"; + else if (type == glu::ApiType::compatibility(3, 2)) return "OpenGL 3.2 compatibility"; + else if (type == glu::ApiType::compatibility(3, 3)) return "OpenGL 3.3 compatibility"; + else if (type == glu::ApiType::compatibility(4, 0)) return "OpenGL 4.0 compatibility"; + else if (type == glu::ApiType::compatibility(4, 1)) return "OpenGL 4.1 compatibility"; + else if (type == glu::ApiType::compatibility(4, 2)) return "OpenGL 4.2 compatibility"; + else if (type == glu::ApiType::compatibility(4, 3)) return "OpenGL 4.3 compatibility"; + else if (type == glu::ApiType::compatibility(4, 4)) return "OpenGL 4.4 compatibility"; + else if (type == glu::ApiType::compatibility(4, 5)) return "OpenGL 4.5 compatibility"; + else if (type == glu::ApiType::compatibility(4, 6)) return "OpenGL 4.6 compatibility"; else return DE_NULL; } diff --git a/framework/opengl/gluStateReset.cpp b/framework/opengl/gluStateReset.cpp index f7e41f2..c094bee 100644 --- a/framework/opengl/gluStateReset.cpp +++ b/framework/opengl/gluStateReset.cpp @@ -1211,7 +1211,10 @@ void resetState (const RenderContext& renderCtx, const ContextInfo& ctxInfo) resetStateES(renderCtx, ctxInfo); else if (isContextTypeGLCore(renderCtx.getType())) resetStateGLCore(renderCtx, ctxInfo); - else + else if (isContextTypeGLCompatibility(renderCtx.getType())) { + // TODO: handle reset state correctly for compatibility profile + resetStateGLCore(renderCtx, ctxInfo); + } else throw tcu::InternalError("State reset requested for unsupported context type"); } diff --git a/framework/platform/null/tcuNullRenderContext.cpp b/framework/platform/null/tcuNullRenderContext.cpp index 7e5b363..e11d469 100644 --- a/framework/platform/null/tcuNullRenderContext.cpp +++ b/framework/platform/null/tcuNullRenderContext.cpp @@ -193,6 +193,11 @@ Context::Context (ContextType ctxType_) version = "4.6.0"; shadingLanguageVersion = "4.60"; } + else if (glu::isContextTypeGLCompatibility(ctxType) && ctxType.getMajorVersion() == 4 && ctxType.getMinorVersion() <= 2) + { + version = "4.2.0"; + shadingLanguageVersion = "4.20"; + } else throw tcu::NotSupportedError("Unsupported GL version", "", __FILE__, __LINE__); -- 2.7.4