Add some simple shader tests for compatibility context
authorTimothy Arceri <tarceri@itsqueeze.com>
Tue, 9 Mar 2021 02:58:12 +0000 (13:58 +1100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 16 Apr 2021 07:42:43 +0000 (07:42 +0000)
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

20 files changed:
external/openglcts/data/gl42-compat/builtins.test [new file with mode: 0644]
external/openglcts/data/gl42-compat/varyings.test [new file with mode: 0644]
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/compat-gl42-master.txt [new file with mode: 0644]
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/mustpass.xml
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/src/gl42-compat-master.txt [new file with mode: 0644]
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/compat-gl42-master.txt [new file with mode: 0644]
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/mustpass.xml
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/src/gl42-compat-master.txt [new file with mode: 0644]
external/openglcts/modules/gl/gl3cTestPackages.cpp
external/openglcts/modules/gl/gl3cTestPackages.hpp
external/openglcts/modules/gl/gl4cTestPackages.cpp
external/openglcts/modules/gl/gl4cTestPackages.hpp
external/openglcts/modules/glcTestPackageRegistry.cpp
external/openglcts/modules/runner/glcKhronosMustpassGl.hpp
external/openglcts/scripts/build_caselists.py
external/openglcts/scripts/build_mustpass.py
external/openglcts/scripts/mustpass.py
framework/opengl/gluRenderContext.cpp
framework/opengl/gluStateReset.cpp
framework/platform/null/tcuNullRenderContext.cpp

diff --git a/external/openglcts/data/gl42-compat/builtins.test b/external/openglcts/data/gl42-compat/builtins.test
new file mode 100644 (file)
index 0000000..fa3e2d8
--- /dev/null
@@ -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 (file)
index 0000000..afb8753
--- /dev/null
@@ -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 (file)
index 0000000..272f8dc
--- /dev/null
@@ -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
index 6e1cc56cc98878bf4e560e4fd4c04dc678c5fca5..c5e47d8f0db1d5a115c6b53d561ec8c8fcb9e982 100644 (file)
                <Configuration caseListFile="gl42-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=-1 --deqp-surface-height=64 --deqp-base-seed=3 --deqp-gl-config-name=rgba8888d24s8 --deqp-surface-type=fbo --deqp-watchdog=disable" name="master" os="any" useForFirstEGLConfig="True"/>
                <Configuration caseListFile="gl42-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=64 --deqp-surface-height=64 --deqp-base-seed=1 --deqp-watchdog=disable" name="master" os="any" useForFirstEGLConfig="False"/>
                <Configuration caseListFile="gl42-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=113 --deqp-surface-height=47 --deqp-base-seed=2 --deqp-watchdog=disable" name="master" os="any" useForFirstEGLConfig="False"/>
+               <Configuration caseListFile="gl42-compat-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=64 --deqp-surface-height=64 --deqp-base-seed=1 --deqp-watchdog=disable" name="master" os="any" useForFirstEGLConfig="True"/>
+               <Configuration caseListFile="gl42-compat-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=113 --deqp-surface-height=47 --deqp-base-seed=2 --deqp-watchdog=disable" name="master" os="any" useForFirstEGLConfig="True"/>
+               <Configuration caseListFile="gl42-compat-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=64 --deqp-surface-height=-1 --deqp-base-seed=3 --deqp-gl-config-name=rgba8888d24s8 --deqp-surface-type=fbo --deqp-watchdog=disable" name="master" os="any" useForFirstEGLConfig="True"/>
+               <Configuration caseListFile="gl42-compat-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=-1 --deqp-surface-height=64 --deqp-base-seed=3 --deqp-gl-config-name=rgba8888d24s8 --deqp-surface-type=fbo --deqp-watchdog=disable" name="master" os="any" useForFirstEGLConfig="True"/>
+               <Configuration caseListFile="gl42-compat-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=64 --deqp-surface-height=64 --deqp-base-seed=1 --deqp-watchdog=disable" name="master" os="any" useForFirstEGLConfig="False"/>
+               <Configuration caseListFile="gl42-compat-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=113 --deqp-surface-height=47 --deqp-base-seed=2 --deqp-watchdog=disable" name="master" os="any" useForFirstEGLConfig="False"/>
                <Configuration caseListFile="gl41-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=64 --deqp-surface-height=64 --deqp-base-seed=1 --deqp-watchdog=disable" name="master" os="any" useForFirstEGLConfig="True"/>
                <Configuration caseListFile="gl41-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=113 --deqp-surface-height=47 --deqp-base-seed=2 --deqp-watchdog=disable" name="master" os="any" useForFirstEGLConfig="True"/>
                <Configuration caseListFile="gl41-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=64 --deqp-surface-height=-1 --deqp-base-seed=3 --deqp-gl-config-name=rgba8888d24s8 --deqp-surface-type=fbo --deqp-watchdog=disable" name="master" os="any" useForFirstEGLConfig="True"/>
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 (file)
index 0000000..79d0db4
--- /dev/null
@@ -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 (file)
index 0000000..272f8dc
--- /dev/null
@@ -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
index 001d7adaf9f1f302a549790460caa052428dd393..0b11fd14702b0f975d725962be19544fcf9333e3 100644 (file)
                <Configuration caseListFile="gl42-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=-1 --deqp-surface-height=64 --deqp-base-seed=3 --deqp-gl-config-name=rgba8888d24s8 --deqp-surface-type=fbo --deqp-watchdog=disable" name="master" os="any" useForFirstEGLConfig="True"/>
                <Configuration caseListFile="gl42-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=64 --deqp-surface-height=64 --deqp-base-seed=1 --deqp-watchdog=disable" name="master" os="any" useForFirstEGLConfig="False"/>
                <Configuration caseListFile="gl42-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=113 --deqp-surface-height=47 --deqp-base-seed=2 --deqp-watchdog=disable" name="master" os="any" useForFirstEGLConfig="False"/>
+               <Configuration caseListFile="gl42-compat-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=64 --deqp-surface-height=64 --deqp-base-seed=1 --deqp-watchdog=disable" name="master" os="any" useForFirstEGLConfig="True"/>
+               <Configuration caseListFile="gl42-compat-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=113 --deqp-surface-height=47 --deqp-base-seed=2 --deqp-watchdog=disable" name="master" os="any" useForFirstEGLConfig="True"/>
+               <Configuration caseListFile="gl42-compat-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=64 --deqp-surface-height=-1 --deqp-base-seed=3 --deqp-gl-config-name=rgba8888d24s8 --deqp-surface-type=fbo --deqp-watchdog=disable" name="master" os="any" useForFirstEGLConfig="True"/>
+               <Configuration caseListFile="gl42-compat-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=-1 --deqp-surface-height=64 --deqp-base-seed=3 --deqp-gl-config-name=rgba8888d24s8 --deqp-surface-type=fbo --deqp-watchdog=disable" name="master" os="any" useForFirstEGLConfig="True"/>
+               <Configuration caseListFile="gl42-compat-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=64 --deqp-surface-height=64 --deqp-base-seed=1 --deqp-watchdog=disable" name="master" os="any" useForFirstEGLConfig="False"/>
+               <Configuration caseListFile="gl42-compat-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=113 --deqp-surface-height=47 --deqp-base-seed=2 --deqp-watchdog=disable" name="master" os="any" useForFirstEGLConfig="False"/>
                <Configuration caseListFile="gl41-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=64 --deqp-surface-height=64 --deqp-base-seed=1 --deqp-watchdog=disable" name="master" os="any" useForFirstEGLConfig="True"/>
                <Configuration caseListFile="gl41-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=113 --deqp-surface-height=47 --deqp-base-seed=2 --deqp-watchdog=disable" name="master" os="any" useForFirstEGLConfig="True"/>
                <Configuration caseListFile="gl41-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=64 --deqp-surface-height=-1 --deqp-base-seed=3 --deqp-gl-config-name=rgba8888d24s8 --deqp-surface-type=fbo --deqp-watchdog=disable" name="master" os="any" useForFirstEGLConfig="True"/>
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 (file)
index 0000000..79d0db4
--- /dev/null
@@ -0,0 +1 @@
+KHR-GL42-COMPAT.*
index 576457c84d57a044b8096630bf17fea56cb799f8..edf7bc05c33089cd5de61bc30392efcda27abe6d 100644 (file)
 namespace gl3cts
 {
 
-class TestCaseWrapper : public tcu::TestCaseExecutor
-{
-public:
-       TestCaseWrapper(GL30TestPackage& package, de::SharedPtr<tcu::WaiverUtil> 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<tcu::WaiverUtil>  m_waiverMechanism;
-};
-
-TestCaseWrapper::TestCaseWrapper(GL30TestPackage& package, de::SharedPtr<tcu::WaiverUtil> waiverMechanism)
+TestCaseWrapper::TestCaseWrapper(deqp::TestPackage& package, de::SharedPtr<tcu::WaiverUtil> waiverMechanism)
        : m_testPackage                 (package)
        , m_waiverMechanism             (waiverMechanism)
 {
index f1a3c255ea3f36b9d21c21a77ea906ed7063cd66..7d05442fd34c6cd8be77f8bb8887d6acae18fab6 100644 (file)
 namespace gl3cts
 {
 
+class TestCaseWrapper : public tcu::TestCaseExecutor
+{
+public:
+       TestCaseWrapper(deqp::TestPackage& package, de::SharedPtr<tcu::WaiverUtil> 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<tcu::WaiverUtil>  m_waiverMechanism;
+};
+
 class GL30TestPackage : public deqp::TestPackage
 {
 public:
index 79fdc11bc5515904aa0af18476def2222347865b..4c2a5472959b9005879d89109291fbef338446e5 100644 (file)
@@ -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<GL42CompatTestPackage&>(*this), m_waiverMechanism);
+}
+
 // GL43TestPackage
 
 GL43TestPackage::GL43TestPackage(tcu::TestContext& testCtx, const char* packageName, const char* description,
index 1603215b166a3ac299c3ebb86e311e6640405792..07047aaa8aab91d7edaae4f162965b1a35c1d2ac 100644 (file)
@@ -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:
index 55d512634a57adf8b4fe047a54908c6c6089906b..1429a2ec4567ef6d58431b44ab06cc313e0f9dd5 100644 (file)
@@ -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);
index f2acd634c338216bfc47e885a7e583e3a8c0958c..d9372c7390d93e3bc2ceb62c995a2bcf566a895e 100644 (file)
@@ -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 },
index ced4106eee1db66b4740f51ed8f361f2798d1a4b..c12c676a83737963221f02240bb40e9dd88141aa 100644 (file)
@@ -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"),
index 5420b8fb671d173bb82e6ef17ec7b80554cb7627..b22062e6c1fc94716604661bae055e120705643c 100644 (file)
@@ -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')]]),
index 5dabc2936ad6cc0922f6b6bc592d3878f4c38e26..b0fd9633158efc395e3e90eb24dfe11e851700d3 100644 (file)
@@ -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"
index 6bb3e4adac6cb9849449b1f1d6893c73c4a56703..6c533ee5ded6332d6cb2ce2cae60c53b2dee9fda 100644 (file)
@@ -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;
 }
 
index f7e41f24e117f174e4ad9d9ae4f8fae0c1b78179..c094beec9df0ffdf0c5c805271820b9c61322aaa 100644 (file)
@@ -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");
 }
 
index 7e5b363117bc6c36a0a35dc8fb7e41a4b8c78519..e11d469aad4d2213f8ac3b7db6fafa55df9bf144 100644 (file)
@@ -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__);