Correct robust buffer access behavior tests
authorPiotr Byszewski <piotr.byszewski@mobica.com>
Tue, 31 Oct 2017 16:57:52 +0000 (17:57 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 23 Nov 2017 10:00:46 +0000 (05:00 -0500)
Robust buffer access behavior tests vere moved to contexless module.
In addition common version of those test was generalized so that it
can test both es and core GL.

Components: OpenGL

VK-GL-CTS issue: 793

Affects:
KHR-NoContext.es32.robust_buffer_access_behavior.*
KHR-NoContext.gl43.robust_buffer_access_behavior.*

Change-Id: Idd967d00635faff4ec41d57abf203f22286bc145

25 files changed:
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/gl43-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/gl44-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/gl45-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.0.x/gl46-master.txt
external/openglcts/data/mustpass/gl/khronos_mustpass_noctx/4.6.0.x/gl43-khr-master.txt [new file with mode: 0644]
external/openglcts/data/mustpass/gl/khronos_mustpass_noctx/4.6.0.x/mustpass.xml
external/openglcts/data/mustpass/gl/khronos_mustpass_noctx/4.6.0.x/src/gl43-khr-master.txt [new file with mode: 0644]
external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.3.x/src/gles32-khr-master.txt
external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.3.x/src/gles32-khr-test-issues.txt
external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.4.x/src/gles32-khr-master.txt
external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.4.x/src/gles32-khr-test-issues.txt
external/openglcts/data/mustpass/gles/khronos_mustpass/master/gles32-khr-master.txt
external/openglcts/data/mustpass/gles/khronos_mustpass_noctx/master/gles32-khr-noctx-master.txt
external/openglcts/modules/common/glcNoDefaultContextPackage.cpp
external/openglcts/modules/common/glcRobustBufferAccessBehaviorTests.cpp
external/openglcts/modules/common/glcRobustBufferAccessBehaviorTests.hpp
external/openglcts/modules/common/glcRobustnessTests.cpp
external/openglcts/modules/gl/gl4cTestPackages.cpp
external/openglcts/modules/gles32/CMakeLists.txt
external/openglcts/modules/gles32/es32cRobustBufferAccessBehaviorTests.cpp [deleted file]
external/openglcts/modules/gles32/es32cRobustBufferAccessBehaviorTests.hpp [deleted file]
external/openglcts/modules/gles32/es32cTestPackage.cpp
external/openglcts/modules/runner/glcKhronosMustpassGlNocontext.hpp
external/openglcts/scripts/build_caselists.py
external/openglcts/scripts/build_mustpass.py

index bc704ac..ebf7caa 100644 (file)
@@ -3949,11 +3949,6 @@ KHR-GL43.compute_shader.api-indirect
 KHR-GL43.compute_shader.api-program
 KHR-GL43.compute_shader.glsl-compile-time-errors
 KHR-GL43.compute_shader.glsl-link-time-errors
-KHR-GL43.robust_buffer_access_behavior.vertex_buffer_objects
-KHR-GL43.robust_buffer_access_behavior.texel_fetch
-KHR-GL43.robust_buffer_access_behavior.image_load_store
-KHR-GL43.robust_buffer_access_behavior.storage_buffer
-KHR-GL43.robust_buffer_access_behavior.uniform_buffer
 KHR-GL43.shader_storage_buffer_object.basic-basic
 KHR-GL43.shader_storage_buffer_object.basic-basic-cs
 KHR-GL43.shader_storage_buffer_object.basic-max
index d2efc91..52e5e3b 100644 (file)
@@ -3949,11 +3949,6 @@ KHR-GL44.compute_shader.api-indirect
 KHR-GL44.compute_shader.api-program
 KHR-GL44.compute_shader.glsl-compile-time-errors
 KHR-GL44.compute_shader.glsl-link-time-errors
-KHR-GL44.robust_buffer_access_behavior.vertex_buffer_objects
-KHR-GL44.robust_buffer_access_behavior.texel_fetch
-KHR-GL44.robust_buffer_access_behavior.image_load_store
-KHR-GL44.robust_buffer_access_behavior.storage_buffer
-KHR-GL44.robust_buffer_access_behavior.uniform_buffer
 KHR-GL44.shader_storage_buffer_object.basic-basic
 KHR-GL44.shader_storage_buffer_object.basic-basic-cs
 KHR-GL44.shader_storage_buffer_object.basic-max
index a1132ec..59b26dc 100644 (file)
@@ -3950,11 +3950,6 @@ KHR-GL45.compute_shader.api-indirect
 KHR-GL45.compute_shader.api-program
 KHR-GL45.compute_shader.glsl-compile-time-errors
 KHR-GL45.compute_shader.glsl-link-time-errors
-KHR-GL45.robust_buffer_access_behavior.vertex_buffer_objects
-KHR-GL45.robust_buffer_access_behavior.texel_fetch
-KHR-GL45.robust_buffer_access_behavior.image_load_store
-KHR-GL45.robust_buffer_access_behavior.storage_buffer
-KHR-GL45.robust_buffer_access_behavior.uniform_buffer
 KHR-GL45.shader_storage_buffer_object.basic-basic
 KHR-GL45.shader_storage_buffer_object.basic-basic-cs
 KHR-GL45.shader_storage_buffer_object.basic-max
index 6e54fe2..c575a98 100644 (file)
@@ -3950,11 +3950,6 @@ KHR-GL46.compute_shader.api-indirect
 KHR-GL46.compute_shader.api-program
 KHR-GL46.compute_shader.glsl-compile-time-errors
 KHR-GL46.compute_shader.glsl-link-time-errors
-KHR-GL46.robust_buffer_access_behavior.vertex_buffer_objects
-KHR-GL46.robust_buffer_access_behavior.texel_fetch
-KHR-GL46.robust_buffer_access_behavior.image_load_store
-KHR-GL46.robust_buffer_access_behavior.storage_buffer
-KHR-GL46.robust_buffer_access_behavior.uniform_buffer
 KHR-GL46.shader_storage_buffer_object.basic-basic
 KHR-GL46.shader_storage_buffer_object.basic-basic-cs
 KHR-GL46.shader_storage_buffer_object.basic-max
diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass_noctx/4.6.0.x/gl43-khr-master.txt b/external/openglcts/data/mustpass/gl/khronos_mustpass_noctx/4.6.0.x/gl43-khr-master.txt
new file mode 100644 (file)
index 0000000..dc70349
--- /dev/null
@@ -0,0 +1,5 @@
+KHR-NoContext.gl43.robust_buffer_access_behavior.vertex_buffer_objects
+KHR-NoContext.gl43.robust_buffer_access_behavior.texel_fetch
+KHR-NoContext.gl43.robust_buffer_access_behavior.image_load_store
+KHR-NoContext.gl43.robust_buffer_access_behavior.storage_buffer
+KHR-NoContext.gl43.robust_buffer_access_behavior.uniform_buffer
index 584e263..2030340 100644 (file)
@@ -20,6 +20,7 @@
        <TestPackage name="Khronos Mustpass GL NoContext">
                <Configuration caseListFile="gl30-khr-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=64 --deqp-surface-height=64 --deqp-base-seed=1 --deqp-watchdog=disable" name="khr-master" os="any" useForFirstEGLConfig="True"/>
                <Configuration caseListFile="gl40-khr-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=64 --deqp-surface-height=64 --deqp-base-seed=1 --deqp-watchdog=disable" name="khr-master" os="any" useForFirstEGLConfig="True"/>
+               <Configuration caseListFile="gl43-khr-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=64 --deqp-surface-height=64 --deqp-base-seed=1 --deqp-watchdog=disable" name="khr-master" os="any" useForFirstEGLConfig="True"/>
                <Configuration caseListFile="gl45-khr-master.txt" commandLine="--deqp-screen-rotation=unspecified --deqp-surface-width=64 --deqp-surface-height=64 --deqp-base-seed=1 --deqp-watchdog=disable" name="khr-master" os="any" useForFirstEGLConfig="True"/>
        </TestPackage>
 </Mustpass>
diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass_noctx/4.6.0.x/src/gl43-khr-master.txt b/external/openglcts/data/mustpass/gl/khronos_mustpass_noctx/4.6.0.x/src/gl43-khr-master.txt
new file mode 100644 (file)
index 0000000..c9c40fc
--- /dev/null
@@ -0,0 +1 @@
+KHR-NoContext.gl43.*
index b5c8cee..96e023f 100644 (file)
@@ -303,8 +303,3 @@ KHR-GLES32.core.draw_buffers_indexed.set_get
 KHR-GLES32.core.draw_buffers_indexed.color_masks
 KHR-GLES32.core.draw_buffers_indexed.blending
 KHR-GLES32.core.draw_buffers_indexed.negative
-KHR-GLES32.robust.robust_buffer_access_behavior.vertex_buffer_objects
-KHR-GLES32.robust.robust_buffer_access_behavior.texel_fetch
-KHR-GLES32.robust.robust_buffer_access_behavior.image_load_store
-KHR-GLES32.robust.robust_buffer_access_behavior.storage_buffer
-KHR-GLES32.robust.robust_buffer_access_behavior.uniform_buffer
index faaabc9..fa283f6 100644 (file)
@@ -1009,8 +1009,3 @@ KHR-GLES32.core.constant_expressions.array_normalize_vec4_tess_control
 KHR-GLES32.core.constant_expressions.array_normalize_vec4_tess_eval
 KHR-GLES32.core.separable_programs_tf.tessellation_active
 KHR-GLES32.core.separable_programs_tf.geometry_active
-KHR-GLES32.robust.robust_buffer_access_behavior.vertex_buffer_objects
-KHR-GLES32.robust.robust_buffer_access_behavior.texel_fetch
-KHR-GLES32.robust.robust_buffer_access_behavior.image_load_store
-KHR-GLES32.robust.robust_buffer_access_behavior.storage_buffer
-KHR-GLES32.robust.robust_buffer_access_behavior.uniform_buffer
index 915efb5..009e2ef 100644 (file)
@@ -1016,8 +1016,3 @@ KHR-GLES32.core.separable_programs_tf.tessellation_active
 KHR-GLES32.core.separable_programs_tf.geometry_active
 KHR-GLES32.core.copy_image.r32i_texture
 KHR-GLES32.core.copy_image.r32ui_texture
-KHR-GLES32.robust.robust_buffer_access_behavior.vertex_buffer_objects
-KHR-GLES32.robust.robust_buffer_access_behavior.texel_fetch
-KHR-GLES32.robust.robust_buffer_access_behavior.image_load_store
-KHR-GLES32.robust.robust_buffer_access_behavior.storage_buffer
-KHR-GLES32.robust.robust_buffer_access_behavior.uniform_buffer
index 985fc13..86035fb 100644 (file)
@@ -6,3 +6,8 @@ KHR-NoContext.es32.context_flags.no_flags_set_case
 KHR-NoContext.es32.context_flags.debug_flag_set_case
 KHR-NoContext.es32.context_flags.robust_flag_set_case
 KHR-NoContext.es32.context_flags.all_flags_set_case
+KHR-NoContext.es32.robust_buffer_access_behavior.vertex_buffer_objects
+KHR-NoContext.es32.robust_buffer_access_behavior.texel_fetch
+KHR-NoContext.es32.robust_buffer_access_behavior.image_load_store
+KHR-NoContext.es32.robust_buffer_access_behavior.storage_buffer
+KHR-NoContext.es32.robust_buffer_access_behavior.uniform_buffer
index e918e67..6d5df68 100644 (file)
@@ -25,6 +25,7 @@
 #include "glcContextFlagsTests.hpp"
 #include "glcMultipleContextsTests.hpp"
 #include "glcNoErrorTests.hpp"
+#include "glcRobustBufferAccessBehaviorTests.hpp"
 #include "glcRobustnessTests.hpp"
 #include "gluRenderContext.hpp"
 
@@ -93,6 +94,10 @@ void NoDefaultContextPackage::init(void)
        gl40Group->addChild(new glcts::MultipleContextsTests(getTestContext(), glu::ApiType::core(4, 0)));
        addChild(gl40Group);
 
+       tcu::TestCaseGroup* gl43Group = new tcu::TestCaseGroup(getTestContext(), "gl43", "");
+       gl43Group->addChild(new glcts::RobustBufferAccessBehaviorTests(getTestContext(), glu::ApiType::core(4, 3)));
+       addChild(gl43Group);
+
        tcu::TestCaseGroup* gl45Group = new tcu::TestCaseGroup(getTestContext(), "gl45", "");
        gl45Group->addChild(new glcts::RobustnessTests(getTestContext(), glu::ApiType::core(4, 5)));
        gl45Group->addChild(new glcts::ContextFlagsTests(getTestContext(), glu::ApiType::core(4, 5)));
@@ -105,6 +110,7 @@ void NoDefaultContextPackage::init(void)
        tcu::TestCaseGroup* es32Group = new tcu::TestCaseGroup(getTestContext(), "es32", "");
        es32Group->addChild(new glcts::RobustnessTests(getTestContext(), glu::ApiType::es(3, 2)));
        es32Group->addChild(new glcts::ContextFlagsTests(getTestContext(), glu::ApiType::es(3, 2)));
+       es32Group->addChild(new glcts::RobustBufferAccessBehaviorTests(getTestContext(), glu::ApiType::es(3, 2)));
        addChild(es32Group);
 }
 
index dd93337..32b0191 100644 (file)
 
 #include "glcRobustBufferAccessBehaviorTests.hpp"
 
+#include "deSharedPtr.hpp"
 #include "gluContextInfo.hpp"
 #include "gluDefs.hpp"
 #include "gluShaderUtil.hpp"
 #include "glwEnums.hpp"
 #include "glwFunctions.hpp"
+#include "tcuCommandLine.hpp"
+#include "tcuStringTemplate.hpp"
 #include "tcuTestLog.hpp"
 
 #include <cstring>
@@ -35,7 +38,7 @@
 
 using namespace glw;
 
-namespace deqp
+namespace glcts
 {
 namespace RobustBufferAccessBehavior
 {
@@ -62,7 +65,7 @@ const GLenum Buffer::m_targets[Buffer::m_n_targets] = {
  *
  * @param context CTS context.
  **/
-Buffer::Buffer(deqp::Context& context) : m_id(m_invalid_id), m_context(context), m_target(GL_ARRAY_BUFFER)
+Buffer::Buffer(const glw::Functions& gl) : m_id(m_invalid_id), m_gl(gl), m_target(GL_ARRAY_BUFFER)
 {
 }
 
@@ -88,11 +91,9 @@ void Buffer::InitData(glw::GLenum target, glw::GLenum usage, glw::GLsizeiptr siz
 
        m_target = target;
 
-       const Functions& gl = m_context.getRenderContext().getFunctions();
-
-       Generate(gl, m_id);
-       Bind(gl, m_id, m_target);
-       Data(gl, m_target, usage, size, data);
+       Generate(m_gl, m_id);
+       Bind(m_gl, m_id, m_target);
+       Data(m_gl, m_target, usage, size, data);
 }
 
 /** Release buffer instance
@@ -102,9 +103,7 @@ void Buffer::Release()
 {
        if (m_invalid_id != m_id)
        {
-               const Functions& gl = m_context.getRenderContext().getFunctions();
-
-               gl.deleteBuffers(1, &m_id);
+               m_gl.deleteBuffers(1, &m_id);
                m_id = m_invalid_id;
        }
 }
@@ -114,9 +113,7 @@ void Buffer::Release()
  **/
 void Buffer::Bind() const
 {
-       const Functions& gl = m_context.getRenderContext().getFunctions();
-
-       Bind(gl, m_id, m_target);
+       Bind(m_gl, m_id, m_target);
 }
 
 /** Binds indexed buffer
@@ -125,9 +122,7 @@ void Buffer::Bind() const
  **/
 void Buffer::BindBase(glw::GLuint index) const
 {
-       const Functions& gl = m_context.getRenderContext().getFunctions();
-
-       BindBase(gl, m_id, m_target, index);
+       BindBase(m_gl, m_id, m_target, index);
 }
 
 /** Bind buffer to given target
@@ -212,7 +207,7 @@ const GLuint Framebuffer::m_invalid_id = -1;
  *
  * @param context CTS context.
  **/
-Framebuffer::Framebuffer(deqp::Context& context) : m_id(m_invalid_id), m_context(context)
+Framebuffer::Framebuffer(const glw::Functions& gl) : m_id(m_invalid_id), m_gl(gl)
 {
        /* Nothing to done here */
 }
@@ -232,9 +227,7 @@ void Framebuffer::Release()
 {
        if (m_invalid_id != m_id)
        {
-               const Functions& gl = m_context.getRenderContext().getFunctions();
-
-               gl.deleteFramebuffers(1, &m_id);
+               m_gl.deleteFramebuffers(1, &m_id);
                m_id = m_invalid_id;
        }
 }
@@ -296,15 +289,15 @@ const GLuint Program::m_invalid_id = 0;
  *
  * @param context CTS context.
  **/
-Program::Program(deqp::Context& context)
+Program::Program(const glw::Functions& gl)
        : m_id(m_invalid_id)
-       , m_compute(context)
-       , m_fragment(context)
-       , m_geometry(context)
-       , m_tess_ctrl(context)
-       , m_tess_eval(context)
-       , m_vertex(context)
-       , m_context(context)
+       , m_compute(gl)
+       , m_fragment(gl)
+       , m_geometry(gl)
+       , m_tess_ctrl(gl)
+       , m_tess_eval(gl)
+       , m_vertex(gl)
+       , m_gl(gl)
 {
        /* Nothing to be done here */
 }
@@ -333,9 +326,6 @@ void Program::Init(const std::string& compute_shader, const std::string& fragmen
        /* Delete previous program */
        Release();
 
-       /* GL entry points */
-       const Functions& gl = m_context.getRenderContext().getFunctions();
-
        /* Initialize shaders */
        m_compute.Init(GL_COMPUTE_SHADER, compute_shader);
        m_fragment.Init(GL_FRAGMENT_SHADER, fragment_shader);
@@ -345,16 +335,16 @@ void Program::Init(const std::string& compute_shader, const std::string& fragmen
        m_vertex.Init(GL_VERTEX_SHADER, vertex_shader);
 
        /* Create program, set up transform feedback and attach shaders */
-       Create(gl, m_id);
-       Attach(gl, m_id, m_compute.m_id);
-       Attach(gl, m_id, m_fragment.m_id);
-       Attach(gl, m_id, m_geometry.m_id);
-       Attach(gl, m_id, m_tess_ctrl.m_id);
-       Attach(gl, m_id, m_tess_eval.m_id);
-       Attach(gl, m_id, m_vertex.m_id);
+       Create(m_gl, m_id);
+       Attach(m_gl, m_id, m_compute.m_id);
+       Attach(m_gl, m_id, m_fragment.m_id);
+       Attach(m_gl, m_id, m_geometry.m_id);
+       Attach(m_gl, m_id, m_tess_ctrl.m_id);
+       Attach(m_gl, m_id, m_tess_eval.m_id);
+       Attach(m_gl, m_id, m_vertex.m_id);
 
        /* Link program */
-       Link(gl, m_id);
+       Link(m_gl, m_id);
 }
 
 /** Release program instance
@@ -362,13 +352,11 @@ void Program::Init(const std::string& compute_shader, const std::string& fragmen
  **/
 void Program::Release()
 {
-       const Functions& gl = m_context.getRenderContext().getFunctions();
-
        if (m_invalid_id != m_id)
        {
-               Use(gl, m_invalid_id);
+               Use(m_gl, m_invalid_id);
 
-               gl.deleteProgram(m_id);
+               m_gl.deleteProgram(m_id);
                m_id = m_invalid_id;
        }
 
@@ -385,9 +373,7 @@ void Program::Release()
  **/
 void Program::Use() const
 {
-       const Functions& gl = m_context.getRenderContext().getFunctions();
-
-       Use(gl, m_id);
+       Use(m_gl, m_id);
 }
 
 /** Attach shader to program
@@ -480,7 +466,7 @@ const GLuint Shader::m_invalid_id = 0;
  *
  * @param context CTS context.
  **/
-Shader::Shader(deqp::Context& context) : m_id(m_invalid_id), m_context(context)
+Shader::Shader(const glw::Functions& gl) : m_id(m_invalid_id), m_gl(gl)
 {
        /* Nothing to be done here */
 }
@@ -509,13 +495,10 @@ void Shader::Init(glw::GLenum stage, const std::string& source)
        /* Delete any previous shader */
        Release();
 
-       /* Create, set source and compile */
-       const Functions& gl = m_context.getRenderContext().getFunctions();
+       Create(m_gl, stage, m_id);
+       Source(m_gl, m_id, source);
 
-       Create(gl, stage, m_id);
-       Source(gl, m_id, source);
-
-       Compile(gl, m_id);
+       Compile(m_gl, m_id);
 }
 
 /** Release shader instance
@@ -525,9 +508,7 @@ void Shader::Release()
 {
        if (m_invalid_id != m_id)
        {
-               const Functions& gl = m_context.getRenderContext().getFunctions();
-
-               gl.deleteShader(m_id);
+               m_gl.deleteShader(m_id);
                m_id = m_invalid_id;
        }
 }
@@ -610,7 +591,7 @@ const GLuint Texture::m_invalid_id = -1;
  *
  * @param context CTS context.
  **/
-Texture::Texture(deqp::Context& context) : m_id(m_invalid_id), m_context(context)
+Texture::Texture(const glw::Functions& gl) : m_id(m_invalid_id), m_gl(gl)
 {
        /* Nothing to done here */
 }
@@ -630,9 +611,7 @@ void Texture::Release()
 {
        if (m_invalid_id != m_id)
        {
-               const Functions& gl = m_context.getRenderContext().getFunctions();
-
-               gl.deleteTextures(1, &m_id);
+               m_gl.deleteTextures(1, &m_id);
                m_id = m_invalid_id;
        }
 }
@@ -935,7 +914,7 @@ const GLuint VertexArray::m_invalid_id = -1;
  *
  * @param context CTS context.
  **/
-VertexArray::VertexArray(deqp::Context& context) : m_id(m_invalid_id), m_context(context)
+VertexArray::VertexArray(const glw::Functions& gl) : m_id(m_invalid_id), m_gl(gl)
 {
 }
 
@@ -954,11 +933,9 @@ void VertexArray::Release()
 {
        if (m_invalid_id != m_id)
        {
-               const Functions& gl = m_context.getRenderContext().getFunctions();
+               Bind(m_gl, 0);
 
-               Bind(gl, 0);
-
-               gl.deleteVertexArrays(1, &m_id);
+               m_gl.deleteVertexArrays(1, &m_id);
 
                m_id = m_invalid_id;
        }
@@ -995,53 +972,93 @@ void VertexArray::Generate(const glw::Functions& gl, glw::GLuint& out_id)
        out_id = id;
 }
 
-/** Replace first occurance of <token> with <text> in <string> starting at <search_posistion>
- *
- * @param token           Token string
- * @param search_position Position at which find will start, it is updated to position at which replaced text ends
- * @param text            String that will be used as replacement for <token>
- * @param string          String to work on
- **/
-void replaceToken(const GLchar* token, size_t& search_position, const GLchar* text, std::string& string)
+template <typename TYPE>
+void initPixels(std::vector<TYPE>& pixels, GLuint n_pixels, GLuint n_channels)
 {
-       const size_t text_length        = strlen(text);
-       const size_t token_length   = strlen(token);
-       const size_t token_position = string.find(token, search_position);
-
-       string.replace(token_position, token_length, text, text_length);
+       if (n_channels == 1)
+       {
+               for (GLuint i = 0; i < n_pixels; ++i)
+                       pixels[i] = static_cast<TYPE>(i);
+       }
+       else if (n_channels == 2)
+       {
+               for (GLuint i = 0; i < n_pixels; ++i)
+               {
+                       GLuint idx              = i * 2;
+                       pixels[idx]             = static_cast<TYPE>(i);
+                       pixels[idx + 1] = pixels[idx];
+               }
+       }
+       else if (n_channels == 4)
+       {
+               for (GLuint i = 0; i < n_pixels; ++i)
+               {
+                       GLuint idx              = i * 4;
+                       pixels[idx]             = static_cast<TYPE>(i);
+                       pixels[idx + 1] = pixels[idx];
+                       pixels[idx + 2] = pixels[idx];
+                       pixels[idx + 3] = pixels[idx];
+               }
+       }
+       else
+               TCU_FAIL("Unsuported number of channels");
+}
 
-       search_position = token_position + text_length;
+RobustnessBase::RobustnessBase(tcu::TestContext& testCtx, const char* name, const char* description,
+                                                          glu::ApiType apiType)
+       : tcu::TestCase(testCtx, name, description), m_api_type(apiType), m_has_khr_robust_buffer_access(false)
+{
 }
 
-bool isRobustBufferAccessBehaviorFeatureSupported(deqp::Context& context)
+glu::RenderContext* RobustnessBase::createRobustContext(glu::ResetNotificationStrategy reset)
 {
-       glu::ContextType context_type = context.getRenderContext().getType();
-       if (context.getContextInfo().isExtensionSupported("GL_KHR_robust_buffer_access_behavior") ||
-               context.getContextInfo().isExtensionSupported("GL_ARB_robust_buffer_access_behavior") ||
-               contextSupports(context_type, glu::ApiType::core(4, 3)))
+       // Create test context to verify if required extensions are available
        {
-               return true;
+               deqp::Context                   context(m_testCtx, glu::ContextType(m_api_type));
+               const glu::ContextInfo& contextInfo  = context.getContextInfo();
+               glu::ContextType                context_type = context.getRenderContext().getType();
+               if (!contextInfo.isExtensionSupported("GL_KHR_robustness") &&
+                       !contextSupports(context_type, glu::ApiType::es(3, 2)))
+               {
+                       m_testCtx.setTestResult(QP_TEST_RESULT_NOT_SUPPORTED, "GL_KHR_robustness extension not supported");
+                       return NULL;
+               }
+
+               m_has_khr_robust_buffer_access = contextInfo.isExtensionSupported("GL_KHR_robust_buffer_access_behavior") ||
+                                                                                contextInfo.isExtensionSupported("GL_ARB_robust_buffer_access_behavior") ||
+                                                                                contextSupports(context_type, glu::ApiType::core(4, 5));
+               if (!m_has_khr_robust_buffer_access && !contextSupports(context_type, glu::ApiType::core(4, 3)))
+               {
+                       m_testCtx.setTestResult(QP_TEST_RESULT_NOT_SUPPORTED,
+                                                                       "robust_buffer_access_behavior extension not supported");
+                       return NULL;
+               }
+
+               glu::GLSLVersion glslVersion   = glu::getContextTypeGLSLVersion(context_type);
+               m_specializationMap["VERSION"] = glu::getGLSLVersionDeclaration(glslVersion);
+               m_context_is_es                            = glu::isContextTypeES(context_type);
        }
-       context.getTestContext().setTestResult(QP_TEST_RESULT_NOT_SUPPORTED, "Not Supported");
-       return false;
-}
 
-/** Constructor
- *
- * @param context Test context
- **/
-VertexBufferObjectsTest::VertexBufferObjectsTest(deqp::Context& context)
-       : TestCase(context, "vertex_buffer_objects", "Verifies that out-of-bound reads from VB result in zero")
-{
-       /* Nothing to be done */
+       glu::RenderConfig               renderCfg(glu::ContextType(m_api_type, glu::CONTEXT_ROBUST));
+       const tcu::CommandLine& commandLine = m_testCtx.getCommandLine();
+       glu::parseRenderConfig(&renderCfg, commandLine);
+
+       if (commandLine.getSurfaceType() == tcu::SURFACETYPE_WINDOW)
+               renderCfg.resetNotificationStrategy = reset;
+       else
+               throw tcu::NotSupportedError("Test not supported in non-windowed context");
+
+       /* Try to create core/es robusness context */
+       return createRenderContext(m_testCtx.getPlatform(), commandLine, renderCfg);
 }
 
 /** Constructor
  *
- * @param context Test context
+ * @param testCtx Test context
  **/
-VertexBufferObjectsTest::VertexBufferObjectsTest(deqp::Context& context, const char* name, const char* description)
-       : TestCase(context, name, description)
+VertexBufferObjectsTest::VertexBufferObjectsTest(tcu::TestContext& testCtx, glu::ApiType apiType)
+       : RobustnessBase(testCtx, "vertex_buffer_objects", "Verifies that out-of-bound reads from VB result in zero",
+                                        apiType)
 {
        /* Nothing to be done */
 }
@@ -1052,7 +1069,8 @@ VertexBufferObjectsTest::VertexBufferObjectsTest(deqp::Context& context, const c
  **/
 tcu::TestNode::IterateResult VertexBufferObjectsTest::iterate()
 {
-       if (!isRobustBufferAccessBehaviorFeatureSupported(m_context))
+       de::SharedPtr<glu::RenderContext> robustContext(createRobustContext());
+       if (!robustContext.get())
                return STOP;
 
        static const GLuint invalid_elements[] = {
@@ -1080,15 +1098,15 @@ tcu::TestNode::IterateResult VertexBufferObjectsTest::iterate()
        static const GLuint width         = 8;
 
        /* GL entry points */
-       const Functions& gl = m_context.getRenderContext().getFunctions();
+       const Functions& gl = robustContext->getFunctions();
 
        /* Test case objects */
-       Framebuffer framebuffer(m_context);
-       Program         program(m_context);
-       Texture         texture(m_context);
-       Buffer          elements_buffer(m_context);
-       Buffer          vertices_buffer(m_context);
-       VertexArray vao(m_context);
+       Framebuffer framebuffer(gl);
+       Program         program(gl);
+       Texture         texture(gl);
+       Buffer          elements_buffer(gl);
+       Buffer          vertices_buffer(gl);
+       VertexArray vao(gl);
 
        /* Vertex array */
        VertexArray::Generate(gl, vao.m_id);
@@ -1123,17 +1141,16 @@ tcu::TestNode::IterateResult VertexBufferObjectsTest::iterate()
        /* Binding elements/indices buffer */
        elements_buffer.Bind();
 
-       cleanTexture(texture.m_id);
+       cleanTexture(gl, texture.m_id);
 
        gl.drawElements(GL_TRIANGLES, n_vertices, GL_UNSIGNED_INT, 0 /* indices */);
        GLU_EXPECT_NO_ERROR(gl.getError(), "DrawElements");
 
-       if (false == verifyValidResults(texture.m_id))
+       if (false == verifyValidResults(gl, texture.m_id))
        {
-               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Invalid result for valid input"
-                                                                                       << tcu::TestLog::EndMessage;
+               m_testCtx.getLog() << tcu::TestLog::Message << "Invalid result for valid input" << tcu::TestLog::EndMessage;
 
-               m_context.getTestContext().setTestResult(QP_TEST_RESULT_FAIL, "Fail");
+               m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
                return tcu::TestNode::STOP;
        }
 
@@ -1161,22 +1178,22 @@ tcu::TestNode::IterateResult VertexBufferObjectsTest::iterate()
                                                                 invalid_elements_set[buffer_index]);
                elements_buffer.Bind();
 
-               cleanTexture(texture.m_id);
+               cleanTexture(gl, texture.m_id);
 
                gl.drawElements(GL_TRIANGLES, n_vertices, GL_UNSIGNED_INT, 0 /* indices */);
                GLU_EXPECT_NO_ERROR(gl.getError(), "DrawElements");
 
-               if (false == verifyInvalidResults(texture.m_id))
+               if (false == verifyInvalidResults(gl, texture.m_id))
                {
-                       m_context.getTestContext().getLog()
-                               << tcu::TestLog::Message << "Invalid result for invalid input" << tcu::TestLog::EndMessage;
-                       m_context.getTestContext().setTestResult(QP_TEST_RESULT_FAIL, "Fail");
+                       m_testCtx.getLog() << tcu::TestLog::Message << "Invalid result for invalid input"
+                                                          << tcu::TestLog::EndMessage;
+                       m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
                        return tcu::TestNode::STOP;
                }
        }
 
        /* Done */
-       m_context.getTestContext().setTestResult(QP_TEST_RESULT_PASS, "Pass");
+       m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
        return tcu::TestNode::STOP;
 }
 
@@ -1186,15 +1203,13 @@ tcu::TestNode::IterateResult VertexBufferObjectsTest::iterate()
  **/
 std::string VertexBufferObjectsTest::getFragmentShader()
 {
-       return std::string("#version 430 core\n"
-                                          "\n"
-                                          "layout (location = 0) out vec4 out_fs_color;\n"
-                                          "\n"
-                                          "void main()\n"
-                                          "{\n"
-                                          "    out_fs_color = vec4(1.0 / 256.0, 1.0, 1.0, 1.0);\n"
-                                          "}\n"
-                                          "\n");
+       const char* source = "${VERSION}\n"
+                                                "layout (location = 0) out lowp uvec4 out_fs_color;\n"
+                                                "void main()\n"
+                                                "{\n"
+                                                "    out_fs_color = uvec4(1, 255, 255, 255);\n"
+                                                "}\n";
+       return tcu::StringTemplate(source).specialize(m_specializationMap);
 }
 
 /** Prepare shader for current test case
@@ -1203,28 +1218,25 @@ std::string VertexBufferObjectsTest::getFragmentShader()
  **/
 std::string VertexBufferObjectsTest::getVertexShader()
 {
-       return std::string("#version 430 core\n"
-                                          "\n"
-                                          "layout (location = 0) in vec4 in_vs_position;\n"
-                                          "\n"
-                                          "void main()\n"
-                                          "{\n"
-                                          "    gl_Position = in_vs_position;\n"
-                                          "}\n"
-                                          "\n");
+       const char* source = "${VERSION}\n"
+                                                "layout (location = 0) in vec4 in_vs_position;\n"
+                                                "void main()\n"
+                                                "{\n"
+                                                "    gl_Position = in_vs_position;\n"
+                                                "}\n";
+
+       return tcu::StringTemplate(source).specialize(m_specializationMap);
 }
 
 /** Fill texture with value 128
  *
  * @param texture_id Id of texture
  **/
-void VertexBufferObjectsTest::cleanTexture(glw::GLuint texture_id)
+void VertexBufferObjectsTest::cleanTexture(const Functions& gl, glw::GLuint texture_id)
 {
        static const GLuint height = 8;
        static const GLuint width  = 8;
 
-       const Functions& gl = m_context.getRenderContext().getFunctions();
-
        GLubyte pixels[width * height];
        for (GLuint i = 0; i < width * height; ++i)
        {
@@ -1246,9 +1258,12 @@ void VertexBufferObjectsTest::cleanTexture(glw::GLuint texture_id)
  *
  * @return false when image is filled with 1, true otherwise
  **/
-bool VertexBufferObjectsTest::verifyInvalidResults(glw::GLuint texture_id)
+bool VertexBufferObjectsTest::verifyInvalidResults(const Functions& gl, glw::GLuint texture_id)
 {
-       return !verifyResults(texture_id);
+       // In OpenGL ES there is undefined out-of-bound behavior - no verification
+       if (m_context_is_es)
+               return true;
+       return !verifyResults(gl, texture_id);
 }
 
 /** Verifies that texutre is filled with 1
@@ -1257,9 +1272,9 @@ bool VertexBufferObjectsTest::verifyInvalidResults(glw::GLuint texture_id)
  *
  * @return true when image is filled with 1, false otherwise
  **/
-bool VertexBufferObjectsTest::verifyValidResults(glw::GLuint texture_id)
+bool VertexBufferObjectsTest::verifyValidResults(const Functions& gl, glw::GLuint texture_id)
 {
-       return verifyResults(texture_id);
+       return verifyResults(gl, texture_id);
 }
 
 /** Verifies that texutre is filled with 1
@@ -1268,30 +1283,22 @@ bool VertexBufferObjectsTest::verifyValidResults(glw::GLuint texture_id)
  *
  * @return true when image is filled with 1, false otherwise
  **/
-bool VertexBufferObjectsTest::verifyResults(glw::GLuint texture_id)
+bool VertexBufferObjectsTest::verifyResults(const Functions& gl, glw::GLuint texture_id)
 {
        static const GLuint height = 8;
        static const GLuint width  = 8;
+       GLuint                          pixel_size       = 4 * sizeof(GLuint);
+       GLuint                          expected_value = 1;
 
-       const Functions& gl = m_context.getRenderContext().getFunctions();
-
-       GLubyte pixels[width * height];
-       for (GLuint i = 0; i < width * height; ++i)
-       {
-               pixels[i] = 0;
-       }
-
+       std::vector<GLubyte> pixels(width * height * pixel_size, 0);
        Texture::Bind(gl, texture_id, GL_TEXTURE_2D);
-
-       Texture::GetData(gl, 0 /* level */, GL_TEXTURE_2D, GL_RED_INTEGER, GL_UNSIGNED_BYTE, pixels);
-
-       /* Unbind */
+       Texture::GetData(gl, texture_id, 0 /* level */, width, height, GL_RGBA_INTEGER, GL_UNSIGNED_INT, &pixels[0]);
        Texture::Bind(gl, 0, GL_TEXTURE_2D);
 
        /* Verify */
-       for (GLuint i = 0; i < width * height; ++i)
+       for (GLuint i = 0; i < pixels.size(); i += pixel_size)
        {
-               if (255 != pixels[i])
+               if (expected_value != pixels[i])
                        return false;
        }
 
@@ -1300,10 +1307,10 @@ bool VertexBufferObjectsTest::verifyResults(glw::GLuint texture_id)
 
 /** Constructor
  *
- * @param context Test context
+ * @param testCtx Test context
  **/
-TexelFetchTest::TexelFetchTest(deqp::Context& context)
-       : TestCase(context, "texel_fetch", "Verifies that out-of-bound fetches from texture result in zero")
+TexelFetchTest::TexelFetchTest(tcu::TestContext& testCtx, glu::ApiType apiType)
+       : RobustnessBase(testCtx, "texel_fetch", "Verifies that out-of-bound fetches from texture result in zero", apiType)
        , m_test_case(R8)
 {
        /* Nothing to be done */
@@ -1311,10 +1318,14 @@ TexelFetchTest::TexelFetchTest(deqp::Context& context)
 
 /** Constructor
  *
- * @param context Test context
+ * @param testCtx Test context
+ * @param name Test name
+ * @param description Test description
+ * @param apiType Api type
  **/
-TexelFetchTest::TexelFetchTest(deqp::Context& context, const glw::GLchar* name, const glw::GLchar* description)
-       : TestCase(context, name, description), m_test_case(R8)
+TexelFetchTest::TexelFetchTest(tcu::TestContext& testCtx, const char* name, const char* description,
+                                                          glu::ApiType apiType)
+       : RobustnessBase(testCtx, name, description, apiType), m_test_case(R8)
 {
        /* Nothing to be done */
 }
@@ -1325,7 +1336,8 @@ TexelFetchTest::TexelFetchTest(deqp::Context& context, const glw::GLchar* name,
  **/
 tcu::TestNode::IterateResult TexelFetchTest::iterate()
 {
-       if (!isRobustBufferAccessBehaviorFeatureSupported(m_context))
+       de::SharedPtr<glu::RenderContext> robustContext(createRobustContext());
+       if (!robustContext.get())
                return STOP;
 
        /* Constants */
@@ -1333,7 +1345,7 @@ tcu::TestNode::IterateResult TexelFetchTest::iterate()
        static const GLuint width  = 16;
 
        /* GL entry points */
-       const Functions& gl = m_context.getRenderContext().getFunctions();
+       const Functions& gl = robustContext->getFunctions();
 
        /* Test result indicator */
        bool test_result = true;
@@ -1344,6 +1356,7 @@ tcu::TestNode::IterateResult TexelFetchTest::iterate()
                1008, // high fetch
        };
        GLuint fetch_offsets_count = sizeof(invalid_fetch_offsets) / sizeof(GLuint);
+       glu::ContextType contextType             = robustContext->getType();
 
        /* Iterate over all cases */
        for (; m_test_case < LAST; m_test_case = (TEST_CASES)((GLuint)m_test_case + 1))
@@ -1367,11 +1380,11 @@ tcu::TestNode::IterateResult TexelFetchTest::iterate()
                }
 
                /* */
-               Texture         destination_texture(m_context);
-               Framebuffer framebuffer(m_context);
-               Texture         source_texture(m_context);
-               Program         program(m_context);
-               VertexArray vao(m_context);
+               Texture         destination_texture(gl);
+               Framebuffer framebuffer(gl);
+               Texture         source_texture(gl);
+               Program         program(gl);
+               VertexArray vao(gl);
 
                /* Prepare VAO */
                VertexArray::Generate(gl, vao.m_id);
@@ -1398,15 +1411,15 @@ tcu::TestNode::IterateResult TexelFetchTest::iterate()
                                 * to upload the texture so max_image_samples >= 4
                                 * is also required.
                                 */
-                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Test case: " << getTestCaseName()
-                                                                                                       << " not supported" << tcu::TestLog::EndMessage;
+                               m_testCtx.getLog() << tcu::TestLog::Message << "Test case: " << getTestCaseName() << " not supported"
+                                                                  << tcu::TestLog::EndMessage;
 
                                continue;
                        }
                }
 
-               prepareTexture(false, destination_texture.m_id);
-               prepareTexture(true, source_texture.m_id);
+               prepareTexture(gl, false, destination_texture.m_id);
+               prepareTexture(gl, true, source_texture.m_id);
 
                /* Select FBO settings */
                if (R32UI_MIPMAP == m_test_case)
@@ -1425,7 +1438,7 @@ tcu::TestNode::IterateResult TexelFetchTest::iterate()
                                                                   width, height);
 
                /* Prepare valid program */
-               program.Init("" /* cs */, getFragmentShader(true), getGeometryShader(), "" /* tcs */, "" /* tes */,
+               program.Init("" /* cs */, getFragmentShader(contextType, true), getGeometryShader(), "" /* tcs */, "" /* tes */,
                                         getVertexShader());
 
                /* Test valid case */
@@ -1444,8 +1457,8 @@ tcu::TestNode::IterateResult TexelFetchTest::iterate()
                GLU_EXPECT_NO_ERROR(gl.getError(), "CheckFramebufferStatus");
                if (GL_FRAMEBUFFER_COMPLETE != fbo_status)
                {
-                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "Test case: " << getTestCaseName()
-                                                                                               << " not supported" << tcu::TestLog::EndMessage;
+                       m_testCtx.getLog() << tcu::TestLog::Message << "Test case: " << getTestCaseName() << " not supported"
+                                                          << tcu::TestLog::EndMessage;
 
                        continue;
                }
@@ -1475,7 +1488,7 @@ tcu::TestNode::IterateResult TexelFetchTest::iterate()
                }
 
                /* Verification */
-               if (false == verifyValidResults(destination_texture.m_id))
+               if (false == verifyValidResults(gl, destination_texture.m_id))
                {
                        test_result = false;
                }
@@ -1484,9 +1497,10 @@ tcu::TestNode::IterateResult TexelFetchTest::iterate()
                for (GLuint index = 0; index < fetch_offsets_count; ++index)
                {
                        /* Prepare invalid program */
-                       program.Init("" /* cs */, getFragmentShader(false, invalid_fetch_offsets[index]), getGeometryShader(),
-                                                "" /* tcs */, "" /* tes */, getVertexShader());
+                       program.Init("" /* cs */, getFragmentShader(contextType, false, invalid_fetch_offsets[index]),
+                                                getGeometryShader(), "" /* tcs */, "" /* tes */, getVertexShader());
                        Program::Use(gl, program.m_id);
+                       Framebuffer::Bind(gl, GL_DRAW_FRAMEBUFFER, framebuffer.m_id);
 
                        /* Set texture */
                        gl.activeTexture(GL_TEXTURE0); /* location = 0 */
@@ -1496,15 +1510,16 @@ tcu::TestNode::IterateResult TexelFetchTest::iterate()
                        GLU_EXPECT_NO_ERROR(gl.getError(), "Uniform1i");
 
                        /* Draw */
+                       gl.clear(GL_COLOR_BUFFER_BIT);
                        gl.drawArrays(GL_POINTS, 0 /* first */, 1 /* count */);
                        GLU_EXPECT_NO_ERROR(gl.getError(), "DrawArrays");
 
                        /* Verification */
-                       if (false == verifyInvalidResults(destination_texture.m_id))
+                       if (false == verifyInvalidResults(gl, destination_texture.m_id))
                        {
                                test_result = false;
-                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Test case: " << getTestCaseName()
-                                                                                                       << " failed" << tcu::TestLog::EndMessage;
+                               m_testCtx.getLog() << tcu::TestLog::Message << "Test case: " << getTestCaseName() << " failed for "
+                                                                  << invalid_fetch_offsets[index] << " offset" << tcu::TestLog::EndMessage;
                        }
                }
        }
@@ -1512,11 +1527,11 @@ tcu::TestNode::IterateResult TexelFetchTest::iterate()
        /* Set result */
        if (true == test_result)
        {
-               m_context.getTestContext().setTestResult(QP_TEST_RESULT_PASS, "Pass");
+               m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
        }
        else
        {
-               m_context.getTestContext().setTestResult(QP_TEST_RESULT_FAIL, "Fail");
+               m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
        }
 
        /* Done */
@@ -1529,86 +1544,53 @@ tcu::TestNode::IterateResult TexelFetchTest::iterate()
  *
  * @return string with prepared code
  **/
-std::string TexelFetchTest::getFragmentShader(bool is_case_valid, GLuint fetch_offset)
+std::string TexelFetchTest::getFragmentShader(const glu::ContextType&, bool is_case_valid, GLuint fetch_offset)
 {
-       static const GLchar* plane_0 = "    int   plane  = 0;\n";
-
-       static const GLchar* plane_1 = "    int   plane  = 1;\n";
-
-       static const GLchar* plane_2 = "    int   plane  = 2;\n";
-
-       static const GLchar* plane_sample_invalid = "    int   plane  = 9;\n";
-       //"    int   plane  = gl_SampleID + 4;\n";
+       const GLchar* source = "${VERSION}\n"
+                                                  "in lowp vec2 gs_fs_tex_coord;\n"
+                                                  "layout (location = 0) out lowp ${TYPE} out_fs_color;\n"
+                                                  "layout (location = 0) uniform lowp ${SAMPLER} uni_texture;\n"
+                                                  "\n"
+                                                  "void main()\n"
+                                                  "{\n"
+                                                  "  ivec2 point  = ivec2(gs_fs_tex_coord * 16.0 + float(${OFFSET}));\n"
+                                                  "  out_fs_color = texelFetch(uni_texture, point, ${PLANE});\n"
+                                                  "}\n";
 
-       static const GLchar* plane_sample_valid = "    int   plane  = gl_SampleID;\n";
-
-       static const GLchar* sampler_regular            = "sampler2D";
-       static const GLchar* sampler_regular_u          = "usampler2D";
-       static const GLchar* sampler_multisampled_u = "usampler2DMS";
-
-       static const GLchar* template_code = "VERSION"
-                                                                                "\n"
-                                                                                "                      in  lowp vec2      gs_fs_tex_coord;\n"
-                                                                                "layout (location = 0) out lowp TYPE      out_fs_color;\n"
-                                                                                "layout (location = 0) uniform lowp SAMPLER uni_texture;\n"
-                                                                                "\n"
-                                                                                "void main()\n"
-                                                                                "{\n"
-                                                                                "PLANE\n"
-                                                                                "    ivec2 point  = ivec2(gs_fs_tex_coord * 16.0) + ivec2(OFFSET);\n"
-                                                                                "    out_fs_color = texelFetch(uni_texture, point, plane);\n"
-                                                                                "}\n"
-                                                                                "\n";
-
-       static const GLchar* type_vec4  = "vec4";
-       static const GLchar* type_uvec4 = "uvec4";
-
-       const GLchar* plane   = plane_0;
-       const GLchar* sampler = sampler_regular;
-       const GLchar* type      = type_vec4;
+       m_specializationMap["PLANE"]   = "0";
+       m_specializationMap["SAMPLER"] = "sampler2D";
+       m_specializationMap["TYPE"]     = "vec4";
 
        if (R32UI_MIPMAP == m_test_case)
        {
-               plane   = plane_1;
-               sampler = sampler_regular_u;
-               type    = type_uvec4;
+               m_specializationMap["PLANE"]   = "1";
+               m_specializationMap["SAMPLER"] = "usampler2D";
+               m_specializationMap["TYPE"]     = "uvec4";
 
                if (false == is_case_valid)
                {
                        fetch_offset = 0;
-                       plane = plane_2;
+                       m_specializationMap["PLANE"] = "2";
                }
        }
        else if (R32UI_MULTISAMPLE == m_test_case)
        {
-               plane   = plane_sample_valid;
-               sampler = sampler_multisampled_u;
-               type    = type_uvec4;
+               m_specializationMap["PLANE"]   = "9";
+               m_specializationMap["SAMPLER"] = "usampler2DMS";
+               m_specializationMap["TYPE"]     = "uvec4";
 
                if (false == is_case_valid)
                {
                        fetch_offset = 0;
-                       plane = plane_sample_invalid;
+                       m_specializationMap["PLANE"] = "gl_SampleID";
                }
        }
 
-       glu::ContextType contextType = m_context.getRenderContext().getType();
-       glu::GLSLVersion glslVersion = glu::getContextTypeGLSLVersion(contextType);
-       const GLchar*   version  = glu::getGLSLVersionDeclaration(glslVersion);
-
-       size_t          position = 0;
-       std::string source   = template_code;
        std::stringstream offset;
        offset << fetch_offset;
-       std::string offset_str = offset.str();
-
-       replaceToken("VERSION", position, version, source);
-       replaceToken("TYPE", position, type, source);
-       replaceToken("SAMPLER", position, sampler, source);
-       replaceToken("PLANE", position, plane, source);
-       replaceToken("OFFSET", position, offset_str.c_str(), source);
+       m_specializationMap["OFFSET"] = offset.str();
 
-       return source;
+       return tcu::StringTemplate(source).specialize(m_specializationMap);
 }
 
 /** Prepare shader for current test case
@@ -1617,32 +1599,32 @@ std::string TexelFetchTest::getFragmentShader(bool is_case_valid, GLuint fetch_o
  **/
 std::string TexelFetchTest::getGeometryShader()
 {
-       return std::string("#version 430 core\n"
-                                          "\n"
-                                          "layout(points)                           in;\n"
-                                          "layout(triangle_strip, max_vertices = 4) out;\n"
-                                          "\n"
-                                          "out vec2 gs_fs_tex_coord;\n"
-                                          "\n"
-                                          "void main()\n"
-                                          "{\n"
-                                          "    gs_fs_tex_coord = vec2(0, 0);\n"
-                                          "    gl_Position     = vec4(-1, -1, 0, 1);\n"
-                                          "    EmitVertex();\n"
-                                          "\n"
-                                          "    gs_fs_tex_coord = vec2(0, 1);\n"
-                                          "    gl_Position     = vec4(-1, 1, 0, 1);\n"
-                                          "    EmitVertex();\n"
-                                          "\n"
-                                          "    gs_fs_tex_coord = vec2(1, 0);\n"
-                                          "    gl_Position     = vec4(1, -1, 0, 1);\n"
-                                          "    EmitVertex();\n"
-                                          "\n"
-                                          "    gs_fs_tex_coord = vec2(1, 1);\n"
-                                          "    gl_Position     = vec4(1, 1, 0, 1);\n"
-                                          "    EmitVertex();\n"
-                                          "}\n"
-                                          "\n");
+       static const GLchar* source = "${VERSION}\n"
+                                                                 "layout(points)                           in;\n"
+                                                                 "layout(triangle_strip, max_vertices = 4) out;\n"
+                                                                 "\n"
+                                                                 "out vec2 gs_fs_tex_coord;\n"
+                                                                 "\n"
+                                                                 "void main()\n"
+                                                                 "{\n"
+                                                                 "    gs_fs_tex_coord = vec2(0, 0);\n"
+                                                                 "    gl_Position     = vec4(-1, -1, 0, 1);\n"
+                                                                 "    EmitVertex();\n"
+                                                                 "\n"
+                                                                 "    gs_fs_tex_coord = vec2(0, 1);\n"
+                                                                 "    gl_Position     = vec4(-1, 1, 0, 1);\n"
+                                                                 "    EmitVertex();\n"
+                                                                 "\n"
+                                                                 "    gs_fs_tex_coord = vec2(1, 0);\n"
+                                                                 "    gl_Position     = vec4(1, -1, 0, 1);\n"
+                                                                 "    EmitVertex();\n"
+                                                                 "\n"
+                                                                 "    gs_fs_tex_coord = vec2(1, 1);\n"
+                                                                 "    gl_Position     = vec4(1, 1, 0, 1);\n"
+                                                                 "    EmitVertex();\n"
+                                                                 "}\n";
+
+       return tcu::StringTemplate(source).specialize(m_specializationMap);
 }
 
 /** Prepare shader for current test case
@@ -1651,13 +1633,13 @@ std::string TexelFetchTest::getGeometryShader()
  **/
 std::string TexelFetchTest::getVertexShader()
 {
-       return std::string("#version 430 core\n"
-                                          "\n"
-                                          "void main()\n"
-                                          "{\n"
-                                          "    gl_Position = vec4(0, 0, 0, 1);\n"
-                                          "}\n"
-                                          "\n");
+       static const GLchar* source = "${VERSION}\n"
+                                                                 "\n"
+                                                                 "void main()\n"
+                                                                 "{\n"
+                                                                 "    gl_Position = vec4(0, 0, 0, 1);\n"
+                                                                 "}\n";
+       return tcu::StringTemplate(source).specialize(m_specializationMap);
 }
 
 /** Returns name of current test case
@@ -1671,19 +1653,19 @@ const glw::GLchar* TexelFetchTest::getTestCaseName() const
        switch (m_test_case)
        {
        case R8:
-               name = "\"Sampling GL_R8 texture\"";
+               name = "Sampling GL_R8 texture";
                break;
        case RG8_SNORM:
-               name = "\"Sampling GL_RG8_SNORM  texture\"";
+               name = "Sampling GL_RG8_SNORM  texture";
                break;
        case RGBA32F:
-               name = "\"Sampling GL_RGBA32F  texture\"";
+               name = "Sampling GL_RGBA32F  texture";
                break;
        case R32UI_MIPMAP:
-               name = "\"Sampling mipmap of GL_32UI texture\"";
+               name = "Sampling mipmap of GL_32UI texture";
                break;
        case R32UI_MULTISAMPLE:
-               name = "\"Sampling GL_32UI multisampled texture\"";
+               name = "Sampling GL_32UI multisampled texture";
                break;
        default:
                TCU_FAIL("Invalid enum");
@@ -1698,15 +1680,12 @@ const glw::GLchar* TexelFetchTest::getTestCaseName() const
  * @param is_source  Selects if texutre will be used as source or destination
  * @param texture_id Id of texutre
  **/
-void TexelFetchTest::prepareTexture(bool is_source, glw::GLuint texture_id)
+void TexelFetchTest::prepareTexture(const Functions& gl, bool is_source, glw::GLuint texture_id)
 {
        /* Image size */
        static const GLuint image_height = 16;
        static const GLuint image_width  = 16;
 
-       /* GL entry points */
-       const Functions& gl = m_context.getRenderContext().getFunctions();
-
        /* Texture storage parameters */
        GLuint  height                  = image_height;
        GLenum  internal_format = 0;
@@ -1745,8 +1724,12 @@ void TexelFetchTest::prepareTexture(bool is_source, glw::GLuint texture_id)
        Texture::Bind(gl, texture_id, target);
        Texture::Storage(gl, target, n_levels, internal_format, width, height, 0);
 
-       gl.texParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-       gl.texParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+       /* Set samplers to NEAREST/NEAREST if required */
+       if (R32UI_MULTISAMPLE != m_test_case)
+       {
+               gl.texParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+               gl.texParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+       }
 
        /* Destination image can be left empty */
        if (false == is_source)
@@ -1811,25 +1794,37 @@ void TexelFetchTest::prepareTexture(bool is_source, glw::GLuint texture_id)
        else if (R32UI_MULTISAMPLE == m_test_case)
        {
                /* Compute shader */
-               static const GLchar* cs = "#version 430 core\n"
-                                                                 "\n"
-                                                                 "layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;\n"
-                                                                 "\n"
-                                                                 "layout (location = 0) writeonly uniform uimage2DMS uni_image;\n"
-                                                                 "\n"
-                                                                 "void main()\n"
-                                                                 "{\n"
-                                                                 "    const ivec2 point = ivec2(gl_WorkGroupID.x, gl_WorkGroupID.y);\n"
-                                                                 "    const uint  index = gl_WorkGroupID.y * 16 + gl_WorkGroupID.x;\n"
-                                                                 "\n"
-                                                                 "    imageStore(uni_image, point, 0, uvec4(index + 0, 0, 0, 0));\n"
-                                                                 "    imageStore(uni_image, point, 1, uvec4(index + 1, 0, 0, 0));\n"
-                                                                 "    imageStore(uni_image, point, 2, uvec4(index + 2, 0, 0, 0));\n"
-                                                                 "    imageStore(uni_image, point, 3, uvec4(index + 3, 0, 0, 0));\n"
-                                                                 "}\n"
-                                                                 "\n";
+               static const GLchar* source =
+                       "${VERSION}\n"
+                       "\n"
+                       "layout (local_size_x = ${LOCAL_SIZE}, local_size_y = ${LOCAL_SIZE}, local_size_z = 1) in;\n"
+                       "layout (${QUALIFIER​S}) writeonly uniform highp uimage2DMS uni_image;\n"
+                       "\n"
+                       "void main()\n"
+                       "{\n"
+                       "    const ivec2 point = ivec2(gl_WorkGroupID.x, gl_WorkGroupID.y);\n"
+                       "    const uint  index = gl_WorkGroupID.y * 16U + gl_WorkGroupID.x;\n"
+                       "\n"
+                       "    imageStore(uni_image, point, 0, uvec4(index + 0U, 0, 0, 0));\n"
+                       "    imageStore(uni_image, point, 1, uvec4(index + 1U, 0, 0, 0));\n"
+                       "    imageStore(uni_image, point, 2, uvec4(index + 2U, 0, 0, 0));\n"
+                       "    imageStore(uni_image, point, 3, uvec4(index + 3U, 0, 0, 0));\n"
+                       "}\n"
+                       "\n";
+
+               if (m_context_is_es)
+               {
+                       m_specializationMap["LOCAL_SIZE"]       = "16";
+                       m_specializationMap["QUALIFIER​S"] = "binding = 0, r32ui";
+               }
+               else
+               {
+                       m_specializationMap["LOCAL_SIZE"]       = "1";
+                       m_specializationMap["QUALIFIER​S"] = "location = 0";
+               }
 
-               Program program(m_context);
+               Program         program(gl);
+               std::string cs = tcu::StringTemplate(source).specialize(m_specializationMap);
                program.Init(cs, "", "", "", "", "");
                program.Use();
 
@@ -1837,8 +1832,11 @@ void TexelFetchTest::prepareTexture(bool is_source, glw::GLuint texture_id)
                                                        GL_WRITE_ONLY, GL_R32UI);
                GLU_EXPECT_NO_ERROR(gl.getError(), "BindImageTexture");
 
-               gl.uniform1i(0 /* location */, 0 /* image unit*/);
-               GLU_EXPECT_NO_ERROR(gl.getError(), "Uniform1i");
+               if (!m_context_is_es)
+               {
+                       gl.uniform1i(0 /* location */, 0 /* image unit*/);
+                       GLU_EXPECT_NO_ERROR(gl.getError(), "Uniform1i");
+               }
 
                gl.dispatchCompute(16, 16, 1);
                GLU_EXPECT_NO_ERROR(gl.getError(), "DispatchCompute");
@@ -1854,30 +1852,28 @@ void TexelFetchTest::prepareTexture(bool is_source, glw::GLuint texture_id)
  *
  * @return true when image is filled with 0, 1 or biggest represetable integer number, false otherwise
  **/
-bool TexelFetchTest::verifyInvalidResults(glw::GLuint texture_id)
+bool TexelFetchTest::verifyInvalidResults(const Functions& gl, glw::GLuint texture_id)
 {
        static const GLuint height   = 16;
        static const GLuint width       = 16;
        static const GLuint n_pixels = height * width;
 
-       const Functions& gl = m_context.getRenderContext().getFunctions();
+       // OpenGL ES has undefined out-of-bound behavior - no verification
+       if (m_context_is_es)
+               return true;
 
        bool result = true;
 
        if (R8 == m_test_case)
        {
-               static const GLuint n_channels = 1;
+               static const GLuint n_channels = 4;
 
-               std::vector<GLubyte> pixels;
-               pixels.resize(n_pixels * n_channels);
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       pixels[i] = static_cast<GLubyte>(i);
-               }
+               std::vector<GLubyte> pixels(n_pixels * n_channels);
+               initPixels(pixels, n_pixels, n_channels);
 
                Texture::Bind(gl, texture_id, GL_TEXTURE_2D);
 
-               Texture::GetData(gl, 0 /* level */, GL_TEXTURE_2D, GL_RED, GL_UNSIGNED_BYTE, &pixels[0]);
+               Texture::GetData(gl, 0 /* level */, GL_TEXTURE_2D, GL_RGBA, GL_UNSIGNED_BYTE, &pixels[0]);
 
                /* Unbind */
                Texture::Bind(gl, 0, GL_TEXTURE_2D);
@@ -1886,13 +1882,13 @@ bool TexelFetchTest::verifyInvalidResults(glw::GLuint texture_id)
                for (GLuint i = 0; i < n_pixels; ++i)
                {
                        const GLubyte expected_red = 0;
-                       const GLubyte drawn_red = pixels[i];
+                       const GLubyte drawn_red = pixels[i * n_channels];
 
                        if (expected_red != drawn_red)
                        {
-                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Invalid value: " << (GLuint)drawn_red
-                                                                                                       << ". Expected value: " << (GLuint)expected_red
-                                                                                                       << " at offset: " << i << tcu::TestLog::EndMessage;
+                               m_testCtx.getLog() << tcu::TestLog::Message << "Invalid value: " << (GLuint)drawn_red
+                                                                  << ". Expected value: " << (GLuint)expected_red << " at offset: " << i
+                                                                  << tcu::TestLog::EndMessage;
 
                                result = false;
                                break;
@@ -1901,19 +1897,14 @@ bool TexelFetchTest::verifyInvalidResults(glw::GLuint texture_id)
        }
        else if (RG8_SNORM == m_test_case)
        {
-               static const GLuint n_channels = 2;
+               static const GLuint n_channels = 4;
 
-               std::vector<GLbyte> pixels;
-               pixels.resize(n_pixels * n_channels);
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       pixels[i * n_channels + 0] = static_cast<GLubyte>(i);
-                       pixels[i * n_channels + 1] = static_cast<GLubyte>(i);
-               }
+               std::vector<GLbyte> pixels(n_pixels * n_channels);
+               initPixels(pixels, n_pixels, n_channels);
 
                Texture::Bind(gl, texture_id, GL_TEXTURE_2D);
 
-               Texture::GetData(gl, 0 /* level */, GL_TEXTURE_2D, GL_RG, GL_BYTE, &pixels[0]);
+               Texture::GetData(gl, 0 /* level */, GL_TEXTURE_2D, GL_RGBA, GL_BYTE, &pixels[0]);
 
                /* Unbind */
                Texture::Bind(gl, 0, GL_TEXTURE_2D);
@@ -1928,10 +1919,9 @@ bool TexelFetchTest::verifyInvalidResults(glw::GLuint texture_id)
 
                        if ((expected_red != drawn_red) || (expected_green != drawn_green))
                        {
-                               m_context.getTestContext().getLog()
-                                       << tcu::TestLog::Message << "Invalid value: " << (GLint)drawn_red << ", " << (GLint)drawn_green
-                                       << ". Expected value: " << (GLint)expected_red << ", " << (GLint)expected_green
-                                       << ". At offset: " << i << tcu::TestLog::EndMessage;
+                               m_testCtx.getLog() << tcu::TestLog::Message << "Invalid value: " << (GLint)drawn_red << ", "
+                                                                  << (GLint)drawn_green << ". Expected value: " << (GLint)expected_red << ", "
+                                                                  << (GLint)expected_green << ". At offset: " << i << tcu::TestLog::EndMessage;
 
                                result = false;
                                break;
@@ -1942,14 +1932,15 @@ bool TexelFetchTest::verifyInvalidResults(glw::GLuint texture_id)
        {
                static const GLuint n_channels = 4;
 
-               std::vector<GLfloat> pixels;
-               pixels.resize(n_pixels * n_channels);
+               std::vector<GLfloat> pixels(n_pixels * n_channels);
                for (GLuint i = 0; i < n_pixels; ++i)
                {
-                       pixels[i * n_channels + 0] = (GLfloat)i / (GLfloat)n_pixels;
-                       pixels[i * n_channels + 1] = (GLfloat)i / (GLfloat)n_pixels;
-                       pixels[i * n_channels + 2] = (GLfloat)i / (GLfloat)n_pixels;
-                       pixels[i * n_channels + 3] = (GLfloat)i / (GLfloat)n_pixels;
+                       const GLuint  idx   = i * n_channels;
+                       const GLfloat value = static_cast<GLfloat>(i) / n_pixels;
+                       pixels[idx + 0]         = value;
+                       pixels[idx + 1]         = value;
+                       pixels[idx + 2]         = value;
+                       pixels[idx + 3]         = value;
                }
 
                Texture::Bind(gl, texture_id, GL_TEXTURE_2D);
@@ -1981,11 +1972,10 @@ bool TexelFetchTest::verifyInvalidResults(glw::GLuint texture_id)
                                ((de::abs(expected_alpha_0 - drawn_alpha) > precision) &&
                                 (de::abs(expected_alpha_1 - drawn_alpha) > precision)))
                        {
-                               m_context.getTestContext().getLog()
-                                       << tcu::TestLog::Message << "Invalid value: " << drawn_red << ", " << drawn_green << ", "
-                                       << drawn_blue << ", " << drawn_alpha << ". Expected value: " << expected_red << ", "
-                                       << expected_green << ", " << expected_blue << ", " << expected_alpha_0 << " or " << expected_alpha_1
-                                       << ". At offset: " << i << tcu::TestLog::EndMessage;
+                               m_testCtx.getLog() << tcu::TestLog::Message << "Invalid value: " << drawn_red << ", " << drawn_green
+                                                                  << ", " << drawn_blue << ", " << drawn_alpha << ". Expected value: " << expected_red
+                                                                  << ", " << expected_green << ", " << expected_blue << ", " << expected_alpha_0
+                                                                  << " or " << expected_alpha_1 << ". At offset: " << i << tcu::TestLog::EndMessage;
 
                                result = false;
                                break;
@@ -1994,18 +1984,14 @@ bool TexelFetchTest::verifyInvalidResults(glw::GLuint texture_id)
        }
        else if (R32UI_MIPMAP == m_test_case)
        {
-               static const GLuint n_channels = 1;
+               static const GLuint n_channels = 4;
 
-               std::vector<GLuint> pixels;
-               pixels.resize(n_pixels * n_channels);
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       pixels[i] = i;
-               }
+               std::vector<GLuint> pixels(n_pixels * n_channels);
+               initPixels(pixels, n_pixels, n_channels);
 
                Texture::Bind(gl, texture_id, GL_TEXTURE_2D);
 
-               Texture::GetData(gl, 1 /* level */, GL_TEXTURE_2D, GL_RED_INTEGER, GL_UNSIGNED_INT, &pixels[0]);
+               Texture::GetData(gl, texture_id, 1 /* level */, width, height, GL_RGBA_INTEGER, GL_UNSIGNED_INT, &pixels[0]);
 
                /* Unbind */
                Texture::Bind(gl, 0, GL_TEXTURE_2D);
@@ -2014,13 +2000,13 @@ bool TexelFetchTest::verifyInvalidResults(glw::GLuint texture_id)
                for (GLuint i = 0; i < n_pixels; ++i)
                {
                        const GLuint expected_red = 0;
-                       const GLuint drawn_red  = pixels[i];
+                       const GLuint drawn_red  = pixels[i * n_channels];
 
                        if (expected_red != drawn_red)
                        {
-                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Invalid value: " << drawn_red
-                                                                                                       << ". Expected value: " << expected_red << " at offset: " << i
-                                                                                                       << tcu::TestLog::EndMessage;
+                               m_testCtx.getLog() << tcu::TestLog::Message << "Invalid value: " << drawn_red
+                                                                  << ". Expected value: " << expected_red << " at offset: " << i
+                                                                  << tcu::TestLog::EndMessage;
 
                                result = false;
                                break;
@@ -2029,43 +2015,45 @@ bool TexelFetchTest::verifyInvalidResults(glw::GLuint texture_id)
        }
        else if (R32UI_MULTISAMPLE == m_test_case)
        {
-               static const GLuint n_channels = 1;
+               static const GLuint n_channels = 4;
 
                /* Compute shader */
-               static const GLchar* cs = "#version 430 core\n"
-                                                                 "\n"
-                                                                 "layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;\n"
-                                                                 "\n"
-                                                                 "layout (location = 1)        writeonly uniform uimage2D   uni_destination_image;\n"
-                                                                 "layout (location = 0, r32ui) readonly  uniform uimage2DMS uni_source_image;\n"
-                                                                 "\n"
-                                                                 "void main()\n"
-                                                                 "{\n"
-                                                                 "    const ivec2 point = ivec2(gl_WorkGroupID.x, gl_WorkGroupID.y);\n"
-                                                                 "\n"
-                                                                 "    const uvec4 color_0 = imageLoad(uni_source_image, point, 0);\n"
-                                                                 "    const uvec4 color_1 = imageLoad(uni_source_image, point, 1);\n"
-                                                                 "    const uvec4 color_2 = imageLoad(uni_source_image, point, 2);\n"
-                                                                 "    const uvec4 color_3 = imageLoad(uni_source_image, point, 3);\n"
-                                                                 "\n"
-                                                                 "    if (any(equal(uvec4(color_0.r, color_1.r, color_2.r, color_3.r), uvec4(0))))\n"
-                                                                 "    {\n"
-                                                                 "        imageStore(uni_destination_image, point, uvec4(1, 1, 1, 1));\n"
-                                                                 "    }\n"
-                                                                 "    else\n"
-                                                                 "    {\n"
-                                                                 "        imageStore(uni_destination_image, point, uvec4(0, 0, 0, 0));\n"
-                                                                 "    }\n"
-                                                                 "}\n"
-                                                                 "\n";
+               static const GLchar* source =
+                       "${VERSION}\n"
+                       "\n"
+                       "layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;\n"
+                       "\n"
+                       "layout (location = 1)        writeonly uniform uimage2D   uni_destination_image;\n"
+                       "layout (location = 0, r32ui) readonly  uniform uimage2DMS uni_source_image;\n"
+                       "\n"
+                       "void main()\n"
+                       "{\n"
+                       "    const ivec2 point = ivec2(gl_WorkGroupID.x, gl_WorkGroupID.y);\n"
+                       "\n"
+                       "    const uvec4 color_0 = imageLoad(uni_source_image, point, 0);\n"
+                       "    const uvec4 color_1 = imageLoad(uni_source_image, point, 1);\n"
+                       "    const uvec4 color_2 = imageLoad(uni_source_image, point, 2);\n"
+                       "    const uvec4 color_3 = imageLoad(uni_source_image, point, 3);\n"
+                       "\n"
+                       "    if (any(equal(uvec4(color_0.r, color_1.r, color_2.r, color_3.r), uvec4(0))))\n"
+                       "    {\n"
+                       "        imageStore(uni_destination_image, point, uvec4(1, 1, 1, 1));\n"
+                       "    }\n"
+                       "    else\n"
+                       "    {\n"
+                       "        imageStore(uni_destination_image, point, uvec4(0, 0, 0, 0));\n"
+                       "    }\n"
+                       "}\n"
+                       "\n";
 
-               Program program(m_context);
-               Texture destination_texture(m_context);
+               Program program(gl);
+               Texture destination_texture(gl);
 
                Texture::Generate(gl, destination_texture.m_id);
                Texture::Bind(gl, destination_texture.m_id, GL_TEXTURE_2D);
                Texture::Storage(gl, GL_TEXTURE_2D, 1, GL_R32UI, width, height, 0 /* depth */);
 
+               std::string cs = tcu::StringTemplate(source).specialize(m_specializationMap);
                program.Init(cs, "", "", "", "", "");
                program.Use();
                gl.bindImageTexture(0 /* unit */, texture_id, 0 /* level */, GL_FALSE /* layered */, 0 /* layer */,
@@ -2085,14 +2073,10 @@ bool TexelFetchTest::verifyInvalidResults(glw::GLuint texture_id)
                GLU_EXPECT_NO_ERROR(gl.getError(), "DispatchCompute");
 
                /* Pixels buffer initialization */
-               std::vector<GLuint> pixels;
-               pixels.resize(n_pixels * n_channels);
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       pixels[i] = i;
-               }
+               std::vector<GLuint> pixels(n_pixels * n_channels);
+               initPixels(pixels, n_pixels, n_channels);
 
-               Texture::GetData(gl, 0 /* level */, GL_TEXTURE_2D, GL_RED_INTEGER, GL_UNSIGNED_INT, &pixels[0]);
+               Texture::GetData(gl, 0 /* level */, GL_TEXTURE_2D, GL_RGBA_INTEGER, GL_UNSIGNED_INT, &pixels[0]);
 
                /* Unbind */
                Texture::Bind(gl, 0, GL_TEXTURE_2D);
@@ -2101,13 +2085,13 @@ bool TexelFetchTest::verifyInvalidResults(glw::GLuint texture_id)
                for (GLuint i = 0; i < n_pixels; ++i)
                {
                        const GLuint expected_red = 1;
-                       const GLuint drawn_red  = pixels[i];
+                       const GLuint drawn_red  = pixels[i * n_channels];
 
                        if (expected_red != drawn_red)
                        {
-                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Invalid value: " << drawn_red
-                                                                                                       << ". Expected value: " << expected_red << " at offset: " << i
-                                                                                                       << tcu::TestLog::EndMessage;
+                               m_testCtx.getLog() << tcu::TestLog::Message << "Invalid value: " << drawn_red
+                                                                  << ". Expected value: " << expected_red << " at offset: " << i
+                                                                  << tcu::TestLog::EndMessage;
 
                                result = false;
                                break;
@@ -2124,30 +2108,24 @@ bool TexelFetchTest::verifyInvalidResults(glw::GLuint texture_id)
  *
  * @return true when image is filled with increasing values, false otherwise
  **/
-bool TexelFetchTest::verifyValidResults(glw::GLuint texture_id)
+bool TexelFetchTest::verifyValidResults(const Functions& gl, glw::GLuint texture_id)
 {
        static const GLuint height   = 16;
        static const GLuint width       = 16;
        static const GLuint n_pixels = height * width;
 
-       const Functions& gl = m_context.getRenderContext().getFunctions();
-
        bool result = true;
 
        if (R8 == m_test_case)
        {
-               static const GLuint n_channels = 1;
+               static const GLuint n_channels = 4;
 
                Texture::Bind(gl, texture_id, GL_TEXTURE_2D);
 
-               std::vector<GLubyte> pixels;
-               pixels.resize(n_pixels * n_channels);
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       pixels[i] = static_cast<GLubyte>(i);
-               }
+               std::vector<GLubyte> pixels(n_pixels * n_channels);
+               initPixels(pixels, n_pixels, n_channels);
 
-               Texture::GetData(gl, 0 /* level */, GL_TEXTURE_2D, GL_RED, GL_UNSIGNED_BYTE, &pixels[0]);
+               Texture::GetData(gl, texture_id, 0 /* level */, width, height, GL_RGBA, GL_UNSIGNED_BYTE, &pixels[0]);
 
                /* Unbind */
                Texture::Bind(gl, 0, GL_TEXTURE_2D);
@@ -2156,13 +2134,13 @@ bool TexelFetchTest::verifyValidResults(glw::GLuint texture_id)
                for (GLuint i = 0; i < n_pixels; ++i)
                {
                        const GLubyte expected_red = static_cast<GLubyte>(i);
-                       const GLubyte drawn_red = pixels[i];
+                       const GLubyte drawn_red = pixels[i * n_channels];
 
                        if (expected_red != drawn_red)
                        {
-                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Invalid value: " << (GLuint)drawn_red
-                                                                                                       << ". Expected value: " << (GLuint)expected_red
-                                                                                                       << " at offset: " << i << tcu::TestLog::EndMessage;
+                               m_testCtx.getLog() << tcu::TestLog::Message << "Invalid value: " << (GLuint)drawn_red
+                                                                  << ". Expected value: " << (GLuint)expected_red << " at offset: " << i
+                                                                  << tcu::TestLog::EndMessage;
 
                                result = false;
                                break;
@@ -2171,19 +2149,14 @@ bool TexelFetchTest::verifyValidResults(glw::GLuint texture_id)
        }
        else if (RG8_SNORM == m_test_case)
        {
-               static const GLuint n_channels = 2;
+               static const GLuint n_channels = 4;
 
                Texture::Bind(gl, texture_id, GL_TEXTURE_2D);
 
-               std::vector<GLbyte> pixels;
-               pixels.resize(n_pixels * n_channels);
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       pixels[i * n_channels + 0] = static_cast<GLubyte>(i);
-                       pixels[i * n_channels + 1] = static_cast<GLubyte>(i);
-               }
+               std::vector<GLbyte> pixels(n_pixels * n_channels);
+               initPixels(pixels, n_pixels, n_channels);
 
-               Texture::GetData(gl, 0 /* level */, GL_TEXTURE_2D, GL_RG, GL_BYTE, &pixels[0]);
+               Texture::GetData(gl, texture_id, 0 /* level */, width, height, GL_RGBA, GL_BYTE, &pixels[0]);
 
                /* Unbind */
                Texture::Bind(gl, 0, GL_TEXTURE_2D);
@@ -2198,10 +2171,9 @@ bool TexelFetchTest::verifyValidResults(glw::GLuint texture_id)
 
                        if ((expected_red != drawn_red) || (expected_green != drawn_green))
                        {
-                               m_context.getTestContext().getLog()
-                                       << tcu::TestLog::Message << "Invalid value: " << (GLint)drawn_red << ", " << (GLint)drawn_green
-                                       << ". Expected value: " << (GLint)expected_red << ", " << (GLint)expected_green
-                                       << ". At offset: " << i << tcu::TestLog::EndMessage;
+                               m_testCtx.getLog() << tcu::TestLog::Message << "Invalid value: " << (GLint)drawn_red << ", "
+                                                                  << (GLint)drawn_green << ". Expected value: " << (GLint)expected_red << ", "
+                                                                  << (GLint)expected_green << ". At offset: " << i << tcu::TestLog::EndMessage;
 
                                result = false;
                                break;
@@ -2214,17 +2186,18 @@ bool TexelFetchTest::verifyValidResults(glw::GLuint texture_id)
 
                Texture::Bind(gl, texture_id, GL_TEXTURE_2D);
 
-               std::vector<GLfloat> pixels;
-               pixels.resize(n_pixels * n_channels);
+               std::vector<GLfloat> pixels(n_pixels * n_channels);
                for (GLuint i = 0; i < n_pixels; ++i)
                {
-                       pixels[i * n_channels + 0] = (GLfloat)i / (GLfloat)n_pixels;
-                       pixels[i * n_channels + 1] = (GLfloat)i / (GLfloat)n_pixels;
-                       pixels[i * n_channels + 2] = (GLfloat)i / (GLfloat)n_pixels;
-                       pixels[i * n_channels + 3] = (GLfloat)i / (GLfloat)n_pixels;
+                       const GLuint  idx   = i * n_channels;
+                       const GLfloat value = static_cast<GLfloat>(i) / n_pixels;
+                       pixels[idx + 0]         = value;
+                       pixels[idx + 1]         = value;
+                       pixels[idx + 2]         = value;
+                       pixels[idx + 3]         = value;
                }
 
-               Texture::GetData(gl, 0 /* level */, GL_TEXTURE_2D, GL_RGBA, GL_FLOAT, &pixels[0]);
+               Texture::GetData(gl, texture_id, 0 /* level */, width, height, GL_RGBA, GL_FLOAT, &pixels[0]);
 
                /* Unbind */
                Texture::Bind(gl, 0, GL_TEXTURE_2D);
@@ -2236,19 +2209,19 @@ bool TexelFetchTest::verifyValidResults(glw::GLuint texture_id)
                        const GLfloat expected_green = (GLfloat)(i / 16) / 16.0f;
                        const GLfloat expected_blue  = (GLfloat)i / 256.0f;
                        const GLfloat expected_alpha = 1.0f;
-                       const GLfloat drawn_red          = pixels[i * n_channels + 0];
-                       const GLfloat drawn_green       = pixels[i * n_channels + 1];
-                       const GLfloat drawn_blue         = pixels[i * n_channels + 2];
-                       const GLfloat drawn_alpha       = pixels[i * n_channels + 3];
+                       const GLuint  idx                        = i * n_channels;
+                       const GLfloat drawn_red          = pixels[idx + 0];
+                       const GLfloat drawn_green       = pixels[idx + 1];
+                       const GLfloat drawn_blue         = pixels[idx + 2];
+                       const GLfloat drawn_alpha       = pixels[idx + 3];
 
                        if ((expected_red != drawn_red) || (expected_green != drawn_green) || (expected_blue != drawn_blue) ||
                                (expected_alpha != drawn_alpha))
                        {
-                               m_context.getTestContext().getLog()
-                                       << tcu::TestLog::Message << "Invalid value: " << drawn_red << ", " << drawn_green << ", "
-                                       << drawn_blue << ", " << drawn_alpha << ". Expected value: " << expected_red << ", "
-                                       << expected_green << ", " << expected_blue << ", " << expected_alpha << ". At offset: " << i
-                                       << tcu::TestLog::EndMessage;
+                               m_testCtx.getLog() << tcu::TestLog::Message << "Invalid value: " << drawn_red << ", " << drawn_green
+                                                                  << ", " << drawn_blue << ", " << drawn_alpha << ". Expected value: " << expected_red
+                                                                  << ", " << expected_green << ", " << expected_blue << ", " << expected_alpha
+                                                                  << ". At offset: " << i << tcu::TestLog::EndMessage;
 
                                result = false;
                                break;
@@ -2257,18 +2230,13 @@ bool TexelFetchTest::verifyValidResults(glw::GLuint texture_id)
        }
        else if (R32UI_MIPMAP == m_test_case)
        {
-               static const GLuint n_channels = 1;
+               static const GLuint n_channels = 4;
 
                Texture::Bind(gl, texture_id, GL_TEXTURE_2D);
 
-               std::vector<GLuint> pixels;
-               pixels.resize(n_pixels * n_channels * 4);
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       pixels[i] = 0;
-               }
+               std::vector<GLuint> pixels(n_pixels * n_channels, 0);
 
-               Texture::GetData(gl, 1 /* level */, GL_TEXTURE_2D, GL_RED_INTEGER, GL_UNSIGNED_INT, &pixels[0]);
+               Texture::GetData(gl, texture_id, 1 /* level */, width, height, GL_RGBA_INTEGER, GL_UNSIGNED_INT, &pixels[0]);
 
                /* Unbind */
                Texture::Bind(gl, 0, GL_TEXTURE_2D);
@@ -2277,13 +2245,13 @@ bool TexelFetchTest::verifyValidResults(glw::GLuint texture_id)
                for (GLuint i = 0; i < n_pixels; ++i)
                {
                        const GLuint expected_red = i;
-                       const GLuint drawn_red  = pixels[i];
+                       const GLuint drawn_red  = pixels[i * n_channels];
 
                        if (expected_red != drawn_red)
                        {
-                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Invalid value: " << drawn_red
-                                                                                                       << ". Expected value: " << expected_red << " at offset: " << i
-                                                                                                       << tcu::TestLog::EndMessage;
+                               m_testCtx.getLog() << tcu::TestLog::Message << "Invalid value: " << drawn_red
+                                                                  << ". Expected value: " << expected_red << " at offset: " << i
+                                                                  << tcu::TestLog::EndMessage;
 
                                result = false;
                                break;
@@ -2292,45 +2260,46 @@ bool TexelFetchTest::verifyValidResults(glw::GLuint texture_id)
        }
        else if (R32UI_MULTISAMPLE == m_test_case)
        {
-               static const GLuint n_channels = 1;
+               static const GLuint n_channels = 4;
 
                /* Compute shader */
-               static const GLchar* cs =
-                       "#version 430 core\n"
+               static const GLchar* source =
+                       "${VERSION}\n"
                        "\n"
                        "layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;\n"
                        "\n"
-                       "layout (location = 1)        writeonly uniform uimage2D   uni_destination_image;\n"
+                       "layout (location = 1, r32ui) writeonly uniform uimage2D   uni_destination_image;\n"
                        "layout (location = 0, r32ui) readonly  uniform uimage2DMS uni_source_image;\n"
                        "\n"
                        "void main()\n"
                        "{\n"
                        "    const ivec2 point = ivec2(gl_WorkGroupID.x, gl_WorkGroupID.y);\n"
-                       "    const uint  index = gl_WorkGroupID.y * 16 + gl_WorkGroupID.x;\n"
+                       "    const uint  index = gl_WorkGroupID.y * 16U + gl_WorkGroupID.x;\n"
                        "\n"
                        "    const uvec4 color_0 = imageLoad(uni_source_image, point, 0);\n"
                        "    const uvec4 color_1 = imageLoad(uni_source_image, point, 1);\n"
                        "    const uvec4 color_2 = imageLoad(uni_source_image, point, 2);\n"
                        "    const uvec4 color_3 = imageLoad(uni_source_image, point, 3);\n"
                        "\n"
-                       "    if (any(equal(uvec4(color_0.r, color_1.r, color_2.r, color_3.r), uvec4(index + 3))))\n"
+                       "    if (any(equal(uvec4(color_0.r, color_1.r, color_2.r, color_3.r), uvec4(index + 3U))))\n"
                        "    {\n"
-                       "        imageStore(uni_destination_image, point, uvec4(1, 1, 1, 1));\n"
+                       "        imageStore(uni_destination_image, point, uvec4(1U));\n"
                        "    }\n"
                        "    else\n"
                        "    {\n"
-                       "        imageStore(uni_destination_image, point, uvec4(0, 0, 0, 0));\n"
+                       "        imageStore(uni_destination_image, point, uvec4(0U));\n"
                        "    }\n"
                        "}\n"
                        "\n";
 
-               Program program(m_context);
-               Texture destination_texture(m_context);
+               Program program(gl);
+               Texture destination_texture(gl);
 
                Texture::Generate(gl, destination_texture.m_id);
                Texture::Bind(gl, destination_texture.m_id, GL_TEXTURE_2D);
                Texture::Storage(gl, GL_TEXTURE_2D, 1, GL_R32UI, width, height, 0 /* depth */);
 
+               std::string cs = tcu::StringTemplate(source).specialize(m_specializationMap);
                program.Init(cs, "", "", "", "", "");
                program.Use();
                gl.bindImageTexture(0 /* unit */, texture_id, 0 /* level */, GL_FALSE /* layered */, 0 /* layer */,
@@ -2340,24 +2309,24 @@ bool TexelFetchTest::verifyValidResults(glw::GLuint texture_id)
                                                        0 /* layer */, GL_WRITE_ONLY, GL_R32UI);
                GLU_EXPECT_NO_ERROR(gl.getError(), "BindImageTexture");
 
-               gl.uniform1i(0 /* location */, 0 /* image unit*/);
-               GLU_EXPECT_NO_ERROR(gl.getError(), "Uniform1i");
+               if (!m_context_is_es)
+               {
+                       gl.uniform1i(0 /* location */, 0 /* image unit*/);
+                       GLU_EXPECT_NO_ERROR(gl.getError(), "Uniform1i");
 
-               gl.uniform1i(1 /* location */, 1 /* image unit*/);
-               GLU_EXPECT_NO_ERROR(gl.getError(), "Uniform1i");
+                       gl.uniform1i(1 /* location */, 1 /* image unit*/);
+                       GLU_EXPECT_NO_ERROR(gl.getError(), "Uniform1i");
+               }
 
                gl.dispatchCompute(16, 16, 1);
                GLU_EXPECT_NO_ERROR(gl.getError(), "DispatchCompute");
 
                /* Pixels buffer initialization */
-               std::vector<GLuint> pixels;
-               pixels.resize(n_pixels * n_channels);
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       pixels[i] = i;
-               }
+               std::vector<GLuint> pixels(n_pixels * n_channels);
+               initPixels(pixels, n_pixels, n_channels);
 
-               Texture::GetData(gl, 0 /* level */, GL_TEXTURE_2D, GL_RED_INTEGER, GL_UNSIGNED_INT, &pixels[0]);
+               Texture::GetData(gl, destination_texture.m_id, 0 /* level */, width, height, GL_RGBA_INTEGER, GL_UNSIGNED_INT,
+                                                &pixels[0]);
 
                /* Unbind */
                Texture::Bind(gl, 0, GL_TEXTURE_2D);
@@ -2366,13 +2335,13 @@ bool TexelFetchTest::verifyValidResults(glw::GLuint texture_id)
                for (GLuint i = 0; i < n_pixels; ++i)
                {
                        const GLuint expected_red = 1;
-                       const GLuint drawn_red  = pixels[i];
+                       const GLuint drawn_red  = pixels[i * n_channels];
 
                        if (expected_red != drawn_red)
                        {
-                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Invalid value: " << drawn_red
-                                                                                                       << ". Expected value: " << expected_red << " at offset: " << i
-                                                                                                       << tcu::TestLog::EndMessage;
+                               m_testCtx.getLog() << tcu::TestLog::Message << "Invalid value: " << drawn_red
+                                                                  << ". Expected value: " << expected_red << " at offset: " << i
+                                                                  << tcu::TestLog::EndMessage;
 
                                result = false;
                                break;
@@ -2385,22 +2354,13 @@ bool TexelFetchTest::verifyValidResults(glw::GLuint texture_id)
 
 /** Constructor
  *
- * @param context Test context
+ * @param testCtx Test context
+ * @param apiType Api type
  **/
-ImageLoadStoreTest::ImageLoadStoreTest(deqp::Context& context)
-       : TexelFetchTest(context, "image_load_store", "Verifies that out-of-bound to image result in zero or is discarded")
+ImageLoadStoreTest::ImageLoadStoreTest(tcu::TestContext& testCtx, glu::ApiType apiType)
+       : TexelFetchTest(testCtx, "image_load_store", "Verifies that out-of-bound to image result in zero or is discarded",
+                                        apiType)
 {
-       /* Nothing to be done */
-}
-
-/** Constructor
- *
- * @param context Test context
- **/
-ImageLoadStoreTest::ImageLoadStoreTest(deqp::Context& context, const glw::GLchar* name, const glw::GLchar* description)
-       : TexelFetchTest(context, name, description)
-{
-       /* Nothing to be done */
 }
 
 /** Execute test
@@ -2409,7 +2369,8 @@ ImageLoadStoreTest::ImageLoadStoreTest(deqp::Context& context, const glw::GLchar
  **/
 tcu::TestNode::IterateResult ImageLoadStoreTest::iterate()
 {
-       if (!isRobustBufferAccessBehaviorFeatureSupported(m_context))
+       de::SharedPtr<glu::RenderContext> robustContext(createRobustContext());
+       if (!robustContext.get())
                return STOP;
 
        /* Constants */
@@ -2417,7 +2378,7 @@ tcu::TestNode::IterateResult ImageLoadStoreTest::iterate()
        static const GLuint width  = 16;
 
        /* GL entry points */
-       const Functions& gl = m_context.getRenderContext().getFunctions();
+       const Functions& gl = robustContext->getFunctions();
 
        struct FetchingOffset
        {
@@ -2428,6 +2389,10 @@ tcu::TestNode::IterateResult ImageLoadStoreTest::iterate()
                { 16, 4 }, { 512, 4 }, { 1024, 8 }, { 2048, 8 },
        };
 
+       /* For ES start from RGBA32F as R8, R32UI_MULTISAMPLE and R8_SNORM are not supported */
+       if (m_context_is_es)
+               m_test_case = RGBA32F;
+
        /* Test result indicator */
        bool test_result = true;
 
@@ -2442,14 +2407,13 @@ tcu::TestNode::IterateResult ImageLoadStoreTest::iterate()
                        // Skip invalid program test in multi sample case
                        // texelFetch with invalid lod plane results undefined value
                        // OpenGL 4.5 Core Spec, around page 377
-                       m_test_case = (TEST_CASES)((GLuint)m_test_case + 1);
                        continue;
                }
 
                /* Test case objects */
-               Texture destination_texture(m_context);
-               Texture source_texture(m_context);
-               Program program(m_context);
+               Texture destination_texture(gl);
+               Texture source_texture(gl);
+               Program program(gl);
 
                /* Prepare textures */
                Texture::Generate(gl, destination_texture.m_id);
@@ -2472,15 +2436,14 @@ tcu::TestNode::IterateResult ImageLoadStoreTest::iterate()
                                 * to upload the texture so max_image_samples >= 4
                                 * is also required.
                                 */
-                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Test case: " << getTestCaseName()
-                                                                                                       << " not supported" << tcu::TestLog::EndMessage;
-
+                               m_testCtx.getLog() << tcu::TestLog::Message << "Test case: " << getTestCaseName() << " not supported"
+                                                                  << tcu::TestLog::EndMessage;
                                continue;
                        }
                }
 
-               prepareTexture(false, destination_texture.m_id);
-               prepareTexture(true, source_texture.m_id);
+               prepareTexture(gl, false, destination_texture.m_id);
+               prepareTexture(gl, true, source_texture.m_id);
 
                /* Test invalid source cases */
                for (GLuint i = 0; i < DE_LENGTH_OF_ARRAY(fetching_offsets); ++i)
@@ -2491,14 +2454,14 @@ tcu::TestNode::IterateResult ImageLoadStoreTest::iterate()
                        program.Use();
 
                        /* Set texture */
-                       setTextures(destination_texture.m_id, source_texture.m_id);
+                       setTextures(gl, destination_texture.m_id, source_texture.m_id);
 
                        /* Dispatch */
                        gl.dispatchCompute(width, height, 1 /* depth */);
                        GLU_EXPECT_NO_ERROR(gl.getError(), "DispatchCompute");
 
                        /* Verification */
-                       if (false == verifyInvalidResults(destination_texture.m_id))
+                       if (false == verifyInvalidResults(gl, destination_texture.m_id))
                        {
                                case_result = false;
                        }
@@ -2509,14 +2472,14 @@ tcu::TestNode::IterateResult ImageLoadStoreTest::iterate()
                program.Use();
 
                /* Set texture */
-               setTextures(destination_texture.m_id, source_texture.m_id);
+               setTextures(gl, destination_texture.m_id, source_texture.m_id);
 
                /* Dispatch */
                gl.dispatchCompute(width, height, 1 /* depth */);
                GLU_EXPECT_NO_ERROR(gl.getError(), "DispatchCompute");
 
                /* Verification */
-               if (false == verifyValidResults(destination_texture.m_id))
+               if (false == verifyValidResults(gl, destination_texture.m_id))
                {
                        case_result = false;
                }
@@ -2530,14 +2493,14 @@ tcu::TestNode::IterateResult ImageLoadStoreTest::iterate()
                        program.Use();
 
                        /* Set texture */
-                       setTextures(destination_texture.m_id, source_texture.m_id);
+                       setTextures(gl, destination_texture.m_id, source_texture.m_id);
 
                        /* Dispatch */
                        gl.dispatchCompute(width, height, 1 /* depth */);
                        GLU_EXPECT_NO_ERROR(gl.getError(), "DispatchCompute");
 
                        /* Verification */
-                       if (false == verifyValidResults(destination_texture.m_id))
+                       if (false == verifyValidResults(gl, destination_texture.m_id))
                        {
                                case_result = false;
                        }
@@ -2546,8 +2509,8 @@ tcu::TestNode::IterateResult ImageLoadStoreTest::iterate()
                /* Set test result */
                if (false == case_result)
                {
-                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "Test case: " << getTestCaseName()
-                                                                                               << " failed" << tcu::TestLog::EndMessage;
+                       m_testCtx.getLog() << tcu::TestLog::Message << "Test case: " << getTestCaseName() << " failed"
+                                                          << tcu::TestLog::EndMessage;
 
                        test_result = false;
                }
@@ -2556,11 +2519,11 @@ tcu::TestNode::IterateResult ImageLoadStoreTest::iterate()
        /* Set result */
        if (true == test_result)
        {
-               m_context.getTestContext().setTestResult(QP_TEST_RESULT_PASS, "Pass");
+               m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
        }
        else
        {
-               m_context.getTestContext().setTestResult(QP_TEST_RESULT_FAIL, "Fail");
+               m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
        }
 
        /* Done */
@@ -2575,53 +2538,34 @@ tcu::TestNode::IterateResult ImageLoadStoreTest::iterate()
  **/
 std::string ImageLoadStoreTest::getComputeShader(VERSION version, GLuint coord_offset, GLuint sample_offset)
 {
-       static const GLchar* template_code =
-               "#version 430 core\n"
+       static const GLchar* source =
+               "${VERSION}\n"
                "\n"
                "layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;\n"
                "\n"
-               "layout (location = 1) writeonly uniform IMAGE uni_destination_image;\n"
-               "layout (location = 0, FORMAT) readonly  uniform IMAGE uni_source_image;\n"
+               "layout (${QUALIFIER} = 1, ${FORMAT}) writeonly uniform highp ${IMAGE} uni_destination_image;\n"
+               "layout (${QUALIFIER} = 0, ${FORMAT}) readonly  uniform highp ${IMAGE} uni_source_image;\n"
                "\n"
                "void main()\n"
                "{\n"
-               "    const ivec2 point_destination = ivec2(gl_WorkGroupID.xy) + ivec2(COORD_OFFSET);\n"
-               "    const ivec2 point_source      = ivec2(gl_WorkGroupID.xy) + ivec2(COORD_OFFSET);\n"
+               "  ivec2 point_destination = ivec2(gl_WorkGroupID.xy) + ivec2(${DST_COORD_OFFSET}U);\n"
+               "  ivec2 point_source      = ivec2(gl_WorkGroupID.xy) + ivec2(${SRC_COORD_OFFSET}U);\n"
                "\n"
-               "COPY"
-               "}\n"
-               "\n";
+               "${COPY}"
+               "}\n";
 
        static const GLchar* copy_multisampled =
-               "    const TYPE color_0 = imageLoad(uni_source_image, point_source, 0 + SAMPLE_OFFSET);\n"
-               "    const TYPE color_1 = imageLoad(uni_source_image, point_source, 1 + SAMPLE_OFFSET);\n"
-               "    const TYPE color_2 = imageLoad(uni_source_image, point_source, 2 + SAMPLE_OFFSET);\n"
-               "    const TYPE color_3 = imageLoad(uni_source_image, point_source, 3 + SAMPLE_OFFSET);\n"
-               "    imageStore(uni_destination_image, point_destination, 0 + SAMPLE_OFFSET, color_0);\n"
-               "    imageStore(uni_destination_image, point_destination, 1 + SAMPLE_OFFSET, color_1);\n"
-               "    imageStore(uni_destination_image, point_destination, 2 + SAMPLE_OFFSET, color_2);\n"
-               "    imageStore(uni_destination_image, point_destination, 3 + SAMPLE_OFFSET, color_3);\n";
-
-       static const GLchar* copy_regular =
-               "    const TYPE color = imageLoad(uni_source_image, point_source);\n"
-               "    imageStore(uni_destination_image, point_destination, color);\n";
-
-       static const GLchar* format_r8            = "r8";
-       static const GLchar* format_rg8_snorm = "rg8_snorm";
-       static const GLchar* format_rgba32f   = "rgba32f";
-       static const GLchar* format_r32ui        = "r32ui";
-
-       static const GLchar* image_vec4         = "image2D";
-       static const GLchar* image_uvec4        = "uimage2D";
-       static const GLchar* image_uvec4_ms = "uimage2DMS";
-
-       static const GLchar* type_vec4  = "vec4";
-       static const GLchar* type_uvec4 = "uvec4";
-
-       const GLchar* copy   = copy_regular;
-       const GLchar* format = format_r8;
-       const GLchar* image  = image_vec4;
-       const GLchar* type   = type_vec4;
+               "  ${TYPE} color_0 = imageLoad(uni_source_image, point_source, 0 + ${SRC_SAMPLE_OFFSET});\n"
+               "  ${TYPE} color_1 = imageLoad(uni_source_image, point_source, 1 + ${SRC_SAMPLE_OFFSET});\n"
+               "  ${TYPE} color_2 = imageLoad(uni_source_image, point_source, 2 + ${SRC_SAMPLE_OFFSET});\n"
+               "  ${TYPE} color_3 = imageLoad(uni_source_image, point_source, 3 + ${SRC_SAMPLE_OFFSET});\n"
+               "  imageStore(uni_destination_image, point_destination, 0 + ${DST_SAMPLE_OFFSET}, color_0);\n"
+               "  imageStore(uni_destination_image, point_destination, 1 + ${DST_SAMPLE_OFFSET}, color_1);\n"
+               "  imageStore(uni_destination_image, point_destination, 2 + ${DST_SAMPLE_OFFSET}, color_2);\n"
+               "  imageStore(uni_destination_image, point_destination, 3 + ${DST_SAMPLE_OFFSET}, color_3);\n";
+
+       static const GLchar* copy_regular = "  ${TYPE} color = imageLoad(uni_source_image, point_source);\n"
+                                                                               "  imageStore(uni_destination_image, point_destination, color);\n";
 
        std::string src_coord_offset_str("0");
        std::string dst_coord_offset_str("0");
@@ -2633,83 +2577,54 @@ std::string ImageLoadStoreTest::getComputeShader(VERSION version, GLuint coord_o
        std::stringstream sample_offset_stream;
        sample_offset_stream << sample_offset;
 
-       if (version == SOURCE_INVALID)
-       {
-               src_coord_offset_str  = coord_offset_stream.str();
-               src_sample_offset_str = sample_offset_stream.str();
-       }
-       else if (version == DESTINATION_INVALID)
-       {
-               dst_coord_offset_str  = coord_offset_stream.str();
-               dst_sample_offset_str = sample_offset_stream.str();
-       }
-
+       m_specializationMap["QUALIFIER"] = m_context_is_es ? "binding" : "location";
+       m_specializationMap["IMAGE"]     = "image2D";
+       m_specializationMap["TYPE"]              = "vec4";
        switch (m_test_case)
        {
        case R8:
+               m_specializationMap["FORMAT"] = "r8";
                break;
        case RG8_SNORM:
-               format = format_rg8_snorm;
+               m_specializationMap["FORMAT"] = "rg8_snorm";
                break;
        case RGBA32F:
-               format = format_rgba32f;
+               m_specializationMap["FORMAT"] = "rgba32f";
                break;
        case R32UI_MIPMAP:
-               format = format_r32ui;
-               image  = image_uvec4;
-               type   = type_uvec4;
+               m_specializationMap["FORMAT"] = "r32ui";
+               m_specializationMap["IMAGE"]  = "uimage2D";
+               m_specializationMap["TYPE"]   = "uvec4";
                break;
        case R32UI_MULTISAMPLE:
-               copy             = copy_multisampled;
-               format           = format_r32ui;
-               image            = image_uvec4_ms;
-               coord_offset = 0;
-               type             = type_uvec4;
+               m_specializationMap["FORMAT"] = "r32ui";
+               m_specializationMap["IMAGE"]  = "uimage2DMS";
+               m_specializationMap["TYPE"]   = "uvec4";
                break;
        default:
                TCU_FAIL("Invalid enum");
        };
 
-       size_t          position = 0;
-       std::string source   = template_code;
+       m_specializationMap["SRC_COORD_OFFSET"]  = "0";
+       m_specializationMap["SRC_SAMPLE_OFFSET"] = "0";
+       m_specializationMap["DST_COORD_OFFSET"]  = "0";
+       m_specializationMap["DST_SAMPLE_OFFSET"] = "0";
 
-       replaceToken("IMAGE", position, image, source);
-       replaceToken("FORMAT", position, format, source);
-       replaceToken("IMAGE", position, image, source);
-       replaceToken("COORD_OFFSET", position, dst_coord_offset_str.c_str(), source);
-       replaceToken("COORD_OFFSET", position, src_coord_offset_str.c_str(), source);
-
-       size_t temp_position = position;
-       replaceToken("COPY", position, copy, source);
-       position = temp_position;
-
-       switch (m_test_case)
+       if (version == SOURCE_INVALID)
        {
-       case R8:
-       case RG8_SNORM:
-       case RGBA32F:
-       case R32UI_MIPMAP:
-               replaceToken("TYPE", position, type, source);
-               break;
-       case R32UI_MULTISAMPLE:
-               replaceToken("TYPE", position, type, source);
-               replaceToken("SAMPLE_OFFSET", position, src_sample_offset_str.c_str(), source);
-               replaceToken("TYPE", position, type, source);
-               replaceToken("SAMPLE_OFFSET", position, src_sample_offset_str.c_str(), source);
-               replaceToken("TYPE", position, type, source);
-               replaceToken("SAMPLE_OFFSET", position, src_sample_offset_str.c_str(), source);
-               replaceToken("TYPE", position, type, source);
-               replaceToken("SAMPLE_OFFSET", position, src_sample_offset_str.c_str(), source);
-               replaceToken("SAMPLE_OFFSET", position, dst_sample_offset_str.c_str(), source);
-               replaceToken("SAMPLE_OFFSET", position, dst_sample_offset_str.c_str(), source);
-               replaceToken("SAMPLE_OFFSET", position, dst_sample_offset_str.c_str(), source);
-               replaceToken("SAMPLE_OFFSET", position, dst_sample_offset_str.c_str(), source);
-               break;
-       default:
-               TCU_FAIL("Invalid enum");
+               m_specializationMap["SRC_COORD_OFFSET"]  = coord_offset_stream.str();
+               m_specializationMap["SRC_SAMPLE_OFFSET"] = sample_offset_stream.str();
+       }
+       else if (version == DESTINATION_INVALID)
+       {
+               m_specializationMap["DST_COORD_OFFSET"]  = coord_offset_stream.str();
+               m_specializationMap["DST_SAMPLE_OFFSET"] = sample_offset_stream.str();
        }
 
-       return source;
+       const GLchar* copy                      = (m_test_case == R32UI_MULTISAMPLE) ? copy_multisampled : copy_regular;
+       m_specializationMap["COPY"] = tcu::StringTemplate(copy).specialize(m_specializationMap);
+
+       return tcu::StringTemplate(source).specialize(m_specializationMap);
 }
 
 /** Set textures as images
@@ -2717,10 +2632,8 @@ std::string ImageLoadStoreTest::getComputeShader(VERSION version, GLuint coord_o
  * @param id_destination Id of texture used as destination
  * @param id_source      Id of texture used as source
  **/
-void ImageLoadStoreTest::setTextures(glw::GLuint id_destination, glw::GLuint id_source)
+void ImageLoadStoreTest::setTextures(const Functions& gl, glw::GLuint id_destination, glw::GLuint id_source)
 {
-       const Functions& gl = m_context.getRenderContext().getFunctions();
-
        GLenum format = 0;
        GLint  level  = 0;
 
@@ -2753,11 +2666,14 @@ void ImageLoadStoreTest::setTextures(glw::GLuint id_destination, glw::GLuint id_
                                                format);
        GLU_EXPECT_NO_ERROR(gl.getError(), "BindImageTexture");
 
-       gl.uniform1i(0 /* location */, 0 /* image unit*/);
-       GLU_EXPECT_NO_ERROR(gl.getError(), "Uniform1i");
+       if (!m_context_is_es)
+       {
+               gl.uniform1i(0 /* location */, 0 /* image unit*/);
+               GLU_EXPECT_NO_ERROR(gl.getError(), "Uniform1i");
 
-       gl.uniform1i(1 /* location */, 1 /* image unit*/);
-       GLU_EXPECT_NO_ERROR(gl.getError(), "Uniform1i");
+               gl.uniform1i(1 /* location */, 1 /* image unit*/);
+               GLU_EXPECT_NO_ERROR(gl.getError(), "Uniform1i");
+       }
 }
 
 /** Verifies that texutre is filled with 0
@@ -2766,13 +2682,16 @@ void ImageLoadStoreTest::setTextures(glw::GLuint id_destination, glw::GLuint id_
  *
  * @return true when image is filled with 0, false otherwise
  **/
-bool ImageLoadStoreTest::verifyInvalidResults(glw::GLuint texture_id)
+bool ImageLoadStoreTest::verifyInvalidResults(const Functions& gl, glw::GLuint texture_id)
 {
        static const GLuint height   = 16;
        static const GLuint width       = 16;
        static const GLuint n_pixels = height * width;
 
-       const Functions& gl = m_context.getRenderContext().getFunctions();
+       // OpenGL ES has undefined out-of-bound behavior - no verification
+       if (m_context_is_es)
+               return true;
+
        gl.memoryBarrier(GL_SHADER_IMAGE_ACCESS_BARRIER_BIT);
        GLU_EXPECT_NO_ERROR(gl.getError(), "MemoryBarrier");
 
@@ -2782,12 +2701,8 @@ bool ImageLoadStoreTest::verifyInvalidResults(glw::GLuint texture_id)
        {
                static const GLuint n_channels = 1;
 
-               std::vector<GLubyte> pixels;
-               pixels.resize(n_pixels * n_channels);
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       pixels[i] = static_cast<GLubyte>(i);
-               }
+               std::vector<GLubyte> pixels(n_pixels * n_channels);
+               initPixels(pixels, n_pixels, n_channels);
 
                Texture::Bind(gl, texture_id, GL_TEXTURE_2D);
 
@@ -2804,9 +2719,9 @@ bool ImageLoadStoreTest::verifyInvalidResults(glw::GLuint texture_id)
 
                        if (expected_red != drawn_red)
                        {
-                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Invalid value: " << (GLuint)drawn_red
-                                                                                                       << ". Expected value: " << (GLuint)expected_red
-                                                                                                       << " at offset: " << i << tcu::TestLog::EndMessage;
+                               m_testCtx.getLog() << tcu::TestLog::Message << "Invalid value: " << (GLuint)drawn_red
+                                                                  << ". Expected value: " << (GLuint)expected_red << " at offset: " << i
+                                                                  << tcu::TestLog::EndMessage;
 
                                result = false;
                                break;
@@ -2817,13 +2732,8 @@ bool ImageLoadStoreTest::verifyInvalidResults(glw::GLuint texture_id)
        {
                static const GLuint n_channels = 2;
 
-               std::vector<GLbyte> pixels;
-               pixels.resize(n_pixels * n_channels);
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       pixels[i * n_channels + 0] = static_cast<GLubyte>(i);
-                       pixels[i * n_channels + 1] = static_cast<GLubyte>(i);
-               }
+               std::vector<GLbyte> pixels(n_pixels * n_channels);
+               initPixels(pixels, n_pixels, n_channels);
 
                Texture::Bind(gl, texture_id, GL_TEXTURE_2D);
 
@@ -2842,10 +2752,9 @@ bool ImageLoadStoreTest::verifyInvalidResults(glw::GLuint texture_id)
 
                        if ((expected_red != drawn_red) || (expected_green != drawn_green))
                        {
-                               m_context.getTestContext().getLog()
-                                       << tcu::TestLog::Message << "Invalid value: " << (GLint)drawn_red << ", " << (GLint)drawn_green
-                                       << ". Expected value: " << (GLint)expected_red << ", " << (GLint)expected_green
-                                       << ". At offset: " << i << tcu::TestLog::EndMessage;
+                               m_testCtx.getLog() << tcu::TestLog::Message << "Invalid value: " << (GLint)drawn_red << ", "
+                                                                  << (GLint)drawn_green << ". Expected value: " << (GLint)expected_red << ", "
+                                                                  << (GLint)expected_green << ". At offset: " << i << tcu::TestLog::EndMessage;
 
                                result = false;
                                break;
@@ -2856,14 +2765,15 @@ bool ImageLoadStoreTest::verifyInvalidResults(glw::GLuint texture_id)
        {
                static const GLuint n_channels = 4;
 
-               std::vector<GLfloat> pixels;
-               pixels.resize(n_pixels * n_channels);
+               std::vector<GLfloat> pixels(n_pixels * n_channels);
                for (GLuint i = 0; i < n_pixels; ++i)
                {
-                       pixels[i * n_channels + 0] = (GLfloat)i / (GLfloat)n_pixels;
-                       pixels[i * n_channels + 1] = (GLfloat)i / (GLfloat)n_pixels;
-                       pixels[i * n_channels + 2] = (GLfloat)i / (GLfloat)n_pixels;
-                       pixels[i * n_channels + 3] = (GLfloat)i / (GLfloat)n_pixels;
+                       GLuint  idx             = i * n_channels;
+                       GLfloat value   = static_cast<GLfloat>(i) / n_pixels;
+                       pixels[idx + 0] = value;
+                       pixels[idx + 1] = value;
+                       pixels[idx + 2] = value;
+                       pixels[idx + 3] = value;
                }
 
                Texture::Bind(gl, texture_id, GL_TEXTURE_2D);
@@ -2880,19 +2790,19 @@ bool ImageLoadStoreTest::verifyInvalidResults(glw::GLuint texture_id)
                        const GLfloat expected_green = 0.0f;
                        const GLfloat expected_blue  = 0.0f;
                        const GLfloat expected_alpha = 0.0f;
-                       const GLfloat drawn_red          = pixels[i * n_channels + 0];
-                       const GLfloat drawn_green       = pixels[i * n_channels + 1];
-                       const GLfloat drawn_blue         = pixels[i * n_channels + 2];
-                       const GLfloat drawn_alpha       = pixels[i * n_channels + 3];
+                       const GLuint  idx                        = i * n_channels;
+                       const GLfloat drawn_red          = pixels[idx + 0];
+                       const GLfloat drawn_green       = pixels[idx + 1];
+                       const GLfloat drawn_blue         = pixels[idx + 2];
+                       const GLfloat drawn_alpha       = pixels[idx + 3];
 
                        if ((expected_red != drawn_red) || (expected_green != drawn_green) || (expected_blue != drawn_blue) ||
                                (expected_alpha != drawn_alpha))
                        {
-                               m_context.getTestContext().getLog()
-                                       << tcu::TestLog::Message << "Invalid value: " << drawn_red << ", " << drawn_green << ", "
-                                       << drawn_blue << ", " << drawn_alpha << ". Expected value: " << expected_red << ", "
-                                       << expected_green << ", " << expected_blue << ", " << expected_alpha << ". At offset: " << i
-                                       << tcu::TestLog::EndMessage;
+                               m_testCtx.getLog() << tcu::TestLog::Message << "Invalid value: " << drawn_red << ", " << drawn_green
+                                                                  << ", " << drawn_blue << ", " << drawn_alpha << ". Expected value: " << expected_red
+                                                                  << ", " << expected_green << ", " << expected_blue << ", " << expected_alpha
+                                                                  << ". At offset: " << i << tcu::TestLog::EndMessage;
 
                                result = false;
                                break;
@@ -2903,12 +2813,8 @@ bool ImageLoadStoreTest::verifyInvalidResults(glw::GLuint texture_id)
        {
                static const GLuint n_channels = 1;
 
-               std::vector<GLuint> pixels;
-               pixels.resize(n_pixels * n_channels);
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       pixels[i] = i;
-               }
+               std::vector<GLuint> pixels(n_pixels * n_channels);
+               initPixels(pixels, n_pixels, n_channels);
 
                Texture::Bind(gl, texture_id, GL_TEXTURE_2D);
 
@@ -2925,9 +2831,9 @@ bool ImageLoadStoreTest::verifyInvalidResults(glw::GLuint texture_id)
 
                        if (expected_red != drawn_red)
                        {
-                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Invalid value: " << drawn_red
-                                                                                                       << ". Expected value: " << expected_red << " at offset: " << i
-                                                                                                       << tcu::TestLog::EndMessage;
+                               m_testCtx.getLog() << tcu::TestLog::Message << "Invalid value: " << drawn_red
+                                                                  << ". Expected value: " << expected_red << " at offset: " << i
+                                                                  << tcu::TestLog::EndMessage;
 
                                result = false;
                                break;
@@ -2939,7 +2845,7 @@ bool ImageLoadStoreTest::verifyInvalidResults(glw::GLuint texture_id)
                static const GLuint n_channels = 1;
 
                /* Compute shader */
-               static const GLchar* cs = "#version 430 core\n"
+               static const GLchar* cs = "${VERSION}\n"
                                                                  "\n"
                                                                  "layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;\n"
                                                                  "\n"
@@ -2966,8 +2872,8 @@ bool ImageLoadStoreTest::verifyInvalidResults(glw::GLuint texture_id)
                                                                  "}\n"
                                                                  "\n";
 
-               Program program(m_context);
-               Texture destination_texture(m_context);
+               Program program(gl);
+               Texture destination_texture(gl);
 
                Texture::Generate(gl, destination_texture.m_id);
                Texture::Bind(gl, destination_texture.m_id, GL_TEXTURE_2D);
@@ -2992,12 +2898,8 @@ bool ImageLoadStoreTest::verifyInvalidResults(glw::GLuint texture_id)
                GLU_EXPECT_NO_ERROR(gl.getError(), "DispatchCompute");
 
                /* Pixels buffer initialization */
-               std::vector<GLuint> pixels;
-               pixels.resize(n_pixels * n_channels);
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       pixels[i] = i;
-               }
+               std::vector<GLuint> pixels(n_pixels * n_channels);
+               initPixels(pixels, n_pixels, n_channels);
 
                Texture::GetData(gl, 0 /* level */, GL_TEXTURE_2D, GL_RED_INTEGER, GL_UNSIGNED_INT, &pixels[0]);
 
@@ -3012,9 +2914,9 @@ bool ImageLoadStoreTest::verifyInvalidResults(glw::GLuint texture_id)
 
                        if (expected_red != drawn_red)
                        {
-                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Invalid value: " << drawn_red
-                                                                                                       << ". Expected value: " << expected_red << " at offset: " << i
-                                                                                                       << tcu::TestLog::EndMessage;
+                               m_testCtx.getLog() << tcu::TestLog::Message << "Invalid value: " << drawn_red
+                                                                  << ". Expected value: " << expected_red << " at offset: " << i
+                                                                  << tcu::TestLog::EndMessage;
 
                                result = false;
                                break;
@@ -3031,13 +2933,12 @@ bool ImageLoadStoreTest::verifyInvalidResults(glw::GLuint texture_id)
  *
  * @return true when image is filled with increasing values, false otherwise
  **/
-bool ImageLoadStoreTest::verifyValidResults(glw::GLuint texture_id)
+bool ImageLoadStoreTest::verifyValidResults(const glw::Functions& gl, glw::GLuint texture_id)
 {
        static const GLuint height   = 16;
        static const GLuint width       = 16;
        static const GLuint n_pixels = height * width;
 
-       const Functions& gl = m_context.getRenderContext().getFunctions();
        gl.memoryBarrier(GL_SHADER_IMAGE_ACCESS_BARRIER_BIT);
        GLU_EXPECT_NO_ERROR(gl.getError(), "MemoryBarrier");
 
@@ -3049,12 +2950,8 @@ bool ImageLoadStoreTest::verifyValidResults(glw::GLuint texture_id)
 
                Texture::Bind(gl, texture_id, GL_TEXTURE_2D);
 
-               std::vector<GLubyte> pixels;
-               pixels.resize(n_pixels * n_channels);
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       pixels[i] = static_cast<GLubyte>(i);
-               }
+               std::vector<GLubyte> pixels(n_pixels * n_channels);
+               initPixels(pixels, n_pixels, n_channels);
 
                Texture::GetData(gl, 0 /* level */, GL_TEXTURE_2D, GL_RED, GL_UNSIGNED_BYTE, &pixels[0]);
 
@@ -3069,9 +2966,9 @@ bool ImageLoadStoreTest::verifyValidResults(glw::GLuint texture_id)
 
                        if (expected_red != drawn_red)
                        {
-                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Invalid value: " << (GLuint)drawn_red
-                                                                                                       << ". Expected value: " << (GLuint)expected_red
-                                                                                                       << " at offset: " << i << tcu::TestLog::EndMessage;
+                               m_testCtx.getLog() << tcu::TestLog::Message << "Invalid value: " << (GLuint)drawn_red
+                                                                  << ". Expected value: " << (GLuint)expected_red << " at offset: " << i
+                                                                  << tcu::TestLog::EndMessage;
 
                                result = false;
                                break;
@@ -3084,13 +2981,8 @@ bool ImageLoadStoreTest::verifyValidResults(glw::GLuint texture_id)
 
                Texture::Bind(gl, texture_id, GL_TEXTURE_2D);
 
-               std::vector<GLbyte> pixels;
-               pixels.resize(n_pixels * n_channels);
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       pixels[i * n_channels + 0] = static_cast<GLubyte>(i);
-                       pixels[i * n_channels + 1] = static_cast<GLubyte>(i);
-               }
+               std::vector<GLbyte> pixels(n_pixels * n_channels);
+               initPixels(pixels, n_pixels, n_channels);
 
                Texture::GetData(gl, 0 /* level */, GL_TEXTURE_2D, GL_RG, GL_BYTE, &pixels[0]);
 
@@ -3107,10 +2999,9 @@ bool ImageLoadStoreTest::verifyValidResults(glw::GLuint texture_id)
 
                        if ((expected_red != drawn_red) || (expected_green != drawn_green))
                        {
-                               m_context.getTestContext().getLog()
-                                       << tcu::TestLog::Message << "Invalid value: " << (GLint)drawn_red << ", " << (GLint)drawn_green
-                                       << ". Expected value: " << (GLint)expected_red << ", " << (GLint)expected_green
-                                       << ". At offset: " << i << tcu::TestLog::EndMessage;
+                               m_testCtx.getLog() << tcu::TestLog::Message << "Invalid value: " << (GLint)drawn_red << ", "
+                                                                  << (GLint)drawn_green << ". Expected value: " << (GLint)expected_red << ", "
+                                                                  << (GLint)expected_green << ". At offset: " << i << tcu::TestLog::EndMessage;
 
                                result = false;
                                break;
@@ -3123,17 +3014,17 @@ bool ImageLoadStoreTest::verifyValidResults(glw::GLuint texture_id)
 
                Texture::Bind(gl, texture_id, GL_TEXTURE_2D);
 
-               std::vector<GLfloat> pixels;
-               pixels.resize(n_pixels * n_channels);
+               std::vector<GLfloat> pixels(n_pixels * n_channels);
                for (GLuint i = 0; i < n_pixels; ++i)
                {
-                       pixels[i * n_channels + 0] = (GLfloat)i / (GLfloat)n_pixels;
-                       pixels[i * n_channels + 1] = (GLfloat)i / (GLfloat)n_pixels;
-                       pixels[i * n_channels + 2] = (GLfloat)i / (GLfloat)n_pixels;
-                       pixels[i * n_channels + 3] = (GLfloat)i / (GLfloat)n_pixels;
+                       GLfloat value                      = static_cast<GLfloat>(i) / n_pixels;
+                       pixels[i * n_channels + 0] = value;
+                       pixels[i * n_channels + 1] = value;
+                       pixels[i * n_channels + 2] = value;
+                       pixels[i * n_channels + 3] = value;
                }
 
-               Texture::GetData(gl, 0 /* level */, GL_TEXTURE_2D, GL_RGBA, GL_FLOAT, &pixels[0]);
+               Texture::GetData(gl, texture_id, 0 /* level */, width, height, GL_RGBA, GL_FLOAT, &pixels[0]);
 
                /* Unbind */
                Texture::Bind(gl, 0, GL_TEXTURE_2D);
@@ -3145,19 +3036,19 @@ bool ImageLoadStoreTest::verifyValidResults(glw::GLuint texture_id)
                        const GLfloat expected_green = (GLfloat)(i / 16) / 16.0f;
                        const GLfloat expected_blue  = (GLfloat)i / 256.0f;
                        const GLfloat expected_alpha = 1.0f;
-                       const GLfloat drawn_red          = pixels[i * n_channels + 0];
-                       const GLfloat drawn_green       = pixels[i * n_channels + 1];
-                       const GLfloat drawn_blue         = pixels[i * n_channels + 2];
-                       const GLfloat drawn_alpha       = pixels[i * n_channels + 3];
+                       const GLuint  idx                        = i * n_channels;
+                       const GLfloat drawn_red          = pixels[idx + 0];
+                       const GLfloat drawn_green       = pixels[idx + 1];
+                       const GLfloat drawn_blue         = pixels[idx + 2];
+                       const GLfloat drawn_alpha       = pixels[idx + 3];
 
                        if ((expected_red != drawn_red) || (expected_green != drawn_green) || (expected_blue != drawn_blue) ||
                                (expected_alpha != drawn_alpha))
                        {
-                               m_context.getTestContext().getLog()
-                                       << tcu::TestLog::Message << "Invalid value: " << drawn_red << ", " << drawn_green << ", "
-                                       << drawn_blue << ", " << drawn_alpha << ". Expected value: " << expected_red << ", "
-                                       << expected_green << ", " << expected_blue << ", " << expected_alpha << ". At offset: " << i
-                                       << tcu::TestLog::EndMessage;
+                               m_testCtx.getLog() << tcu::TestLog::Message << "Invalid value: " << drawn_red << ", " << drawn_green
+                                                                  << ", " << drawn_blue << ", " << drawn_alpha << ". Expected value: " << expected_red
+                                                                  << ", " << expected_green << ", " << expected_blue << ", " << expected_alpha
+                                                                  << ". At offset: " << i << tcu::TestLog::EndMessage;
 
                                result = false;
                                break;
@@ -3166,18 +3057,14 @@ bool ImageLoadStoreTest::verifyValidResults(glw::GLuint texture_id)
        }
        else if (R32UI_MIPMAP == m_test_case)
        {
-               static const GLuint n_channels = 1;
+               static const GLuint n_channels = 4;
 
                Texture::Bind(gl, texture_id, GL_TEXTURE_2D);
 
-               std::vector<GLuint> pixels;
-               pixels.resize(n_pixels * n_channels * 4);
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       pixels[i] = 0;
-               }
+               std::vector<GLuint> pixels(n_pixels * n_channels);
+               initPixels(pixels, n_pixels, n_channels);
 
-               Texture::GetData(gl, 1 /* level */, GL_TEXTURE_2D, GL_RED_INTEGER, GL_UNSIGNED_INT, &pixels[0]);
+               Texture::GetData(gl, texture_id, 1 /* level */, width, height, GL_RGBA_INTEGER, GL_UNSIGNED_INT, &pixels[0]);
 
                /* Unbind */
                Texture::Bind(gl, 0, GL_TEXTURE_2D);
@@ -3186,13 +3073,13 @@ bool ImageLoadStoreTest::verifyValidResults(glw::GLuint texture_id)
                for (GLuint i = 0; i < n_pixels; ++i)
                {
                        const GLuint expected_red = i;
-                       const GLuint drawn_red  = pixels[i];
+                       const GLuint drawn_red  = pixels[i * n_channels];
 
                        if (expected_red != drawn_red)
                        {
-                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Invalid value: " << drawn_red
-                                                                                                       << ". Expected value: " << expected_red << " at offset: " << i
-                                                                                                       << tcu::TestLog::EndMessage;
+                               m_testCtx.getLog() << tcu::TestLog::Message << "Invalid value: " << drawn_red
+                                                                  << ". Expected value: " << expected_red << " at offset: " << i
+                                                                  << tcu::TestLog::EndMessage;
 
                                result = false;
                                break;
@@ -3205,7 +3092,7 @@ bool ImageLoadStoreTest::verifyValidResults(glw::GLuint texture_id)
 
                /* Compute shader */
                static const GLchar* cs =
-                       "#version 430 core\n"
+                       "${VERSION}\n"
                        "\n"
                        "layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;\n"
                        "\n"
@@ -3233,8 +3120,8 @@ bool ImageLoadStoreTest::verifyValidResults(glw::GLuint texture_id)
                        "}\n"
                        "\n";
 
-               Program program(m_context);
-               Texture destination_texture(m_context);
+               Program program(gl);
+               Texture destination_texture(gl);
 
                Texture::Generate(gl, destination_texture.m_id);
                Texture::Bind(gl, destination_texture.m_id, GL_TEXTURE_2D);
@@ -3259,12 +3146,8 @@ bool ImageLoadStoreTest::verifyValidResults(glw::GLuint texture_id)
                GLU_EXPECT_NO_ERROR(gl.getError(), "DispatchCompute");
 
                /* Pixels buffer initialization */
-               std::vector<GLuint> pixels;
-               pixels.resize(n_pixels * n_channels);
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       pixels[i] = i;
-               }
+               std::vector<GLuint> pixels(n_pixels * n_channels);
+               initPixels(pixels, n_pixels, n_channels);
 
                Texture::GetData(gl, 0 /* level */, GL_TEXTURE_2D, GL_RED_INTEGER, GL_UNSIGNED_INT, &pixels[0]);
 
@@ -3279,9 +3162,9 @@ bool ImageLoadStoreTest::verifyValidResults(glw::GLuint texture_id)
 
                        if (expected_red != drawn_red)
                        {
-                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Invalid value: " << drawn_red
-                                                                                                       << ". Expected value: " << expected_red << " at offset: " << i
-                                                                                                       << tcu::TestLog::EndMessage;
+                               m_testCtx.getLog() << tcu::TestLog::Message << "Invalid value: " << drawn_red
+                                                                  << ". Expected value: " << expected_red << " at offset: " << i
+                                                                  << tcu::TestLog::EndMessage;
 
                                result = false;
                                break;
@@ -3298,25 +3181,17 @@ const GLfloat StorageBufferTest::m_source_data[4]               = { 2.0f, 3.0f, 4.0f, 5.0f };
 
 /** Constructor
  *
- * @param context Test context
+ * @param testCtx Test context
+ * @param apiType Api type
  **/
-StorageBufferTest::StorageBufferTest(deqp::Context& context)
-       : TestCase(context, "storage_buffer", "Verifies that out-of-bound access to SSBO is discared or resutls in 0")
+StorageBufferTest::StorageBufferTest(tcu::TestContext& testCtx, glu::ApiType apiType)
+       : RobustnessBase(testCtx, "storage_buffer", "Verifies that out-of-bound access to SSBO is discared or resutls in 0",
+                                        apiType)
        , m_test_case(VALID)
-       , m_hasKhrRobustBufferAccess(false)
 {
        /* Nothing to be done here */
 }
 
-/** Constructor
- *
- * @param context Test context
- **/
-StorageBufferTest::StorageBufferTest(deqp::Context& context, const glw::GLchar* name, const glw::GLchar* description)
-       : TestCase(context, name, description), m_test_case(VALID)
-{
-       /* Nothing to be done */
-}
 
 /** Execute test
  *
@@ -3324,16 +3199,12 @@ StorageBufferTest::StorageBufferTest(deqp::Context& context, const glw::GLchar*
  **/
 tcu::TestNode::IterateResult StorageBufferTest::iterate()
 {
-       if (!isRobustBufferAccessBehaviorFeatureSupported(m_context))
+       de::SharedPtr<glu::RenderContext> robustContext(createRobustContext());
+       if (!robustContext.get())
                return STOP;
 
        /* GL entry points */
-       const Functions& gl = m_context.getRenderContext().getFunctions();
-
-       glu::ContextType contextType = m_context.getRenderContext().getType();
-       m_hasKhrRobustBufferAccess =
-               m_context.getContextInfo().isExtensionSupported("GL_KHR_robust_buffer_access_behavior") ||
-               contextSupports(contextType, glu::ApiType::core(4, 5));
+       const Functions& gl = robustContext->getFunctions();
 
        /* Test result indicator */
        bool test_result = true;
@@ -3349,9 +3220,9 @@ tcu::TestNode::IterateResult StorageBufferTest::iterate()
        while (LAST != m_test_case)
        {
                /* Test case objects */
-               Buffer  destination_buffer(m_context);
-               Buffer  source_buffer(m_context);
-               Program program(m_context);
+               Buffer  destination_buffer(gl);
+               Buffer  source_buffer(gl);
+               Program program(gl);
 
                /* Buffers initialization */
                destination_buffer.InitData(GL_SHADER_STORAGE_BUFFER, GL_DYNAMIC_COPY, sizeof(m_destination_data),
@@ -3395,11 +3266,11 @@ tcu::TestNode::IterateResult StorageBufferTest::iterate()
        /* Set result */
        if (true == test_result)
        {
-               m_context.getTestContext().setTestResult(QP_TEST_RESULT_PASS, "Pass");
+               m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
        }
        else
        {
-               m_context.getTestContext().setTestResult(QP_TEST_RESULT_FAIL, "Fail");
+               m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
        }
 
        /* Done */
@@ -3412,44 +3283,38 @@ tcu::TestNode::IterateResult StorageBufferTest::iterate()
  **/
 std::string StorageBufferTest::getComputeShader(GLuint offset)
 {
-       static const GLchar* cs = "#version 430 core\n"
-                                                         "\n"
-                                                         "layout (local_size_x = 4, local_size_y = 1, local_size_z = 1) in;\n"
-                                                         "\n"
-                                                         "layout (binding = 1, std430) buffer Source {\n"
-                                                         "    float data[];\n"
-                                                         "} source;\n"
-                                                         "\n"
-                                                         "layout (binding = 0, std430) buffer Destination {\n"
-                                                         "    float data[];\n"
-                                                         "} destination;\n"
-                                                         "\n"
-                                                         "void main()\n"
-                                                         "{\n"
-                                                         "    const uint index_destination = gl_LocalInvocationID.x + OFFSET;\n"
-                                                         "    const uint index_source      = gl_LocalInvocationID.x + OFFSET;\n"
-                                                         "\n"
-                                                         "    destination.data[index_destination] = source.data[index_source];\n"
-                                                         "}\n"
-                                                         "\n";
-
-       std::string   destination_offset("0");
-       std::string   source_offset("0");
-       size_t            position = 0;
-       std::string   source   = cs;
+       static const GLchar* source = "${VERSION}\n"
+                                                                 "\n"
+                                                                 "layout (local_size_x = 4, local_size_y = 1, local_size_z = 1) in;\n"
+                                                                 "\n"
+                                                                 "layout (binding = 1, std430) buffer Source {\n"
+                                                                 "    float data[];\n"
+                                                                 "} source;\n"
+                                                                 "\n"
+                                                                 "layout (binding = 0, std430) buffer Destination {\n"
+                                                                 "    float data[];\n"
+                                                                 "} destination;\n"
+                                                                 "\n"
+                                                                 "void main()\n"
+                                                                 "{\n"
+                                                                 "    uint index_destination = gl_LocalInvocationID.x + ${DST_OFFSET}U;\n"
+                                                                 "    uint index_source      = gl_LocalInvocationID.x + ${SRC_OFFSET}U;\n"
+                                                                 "\n"
+                                                                 "    destination.data[index_destination] = source.data[index_source];\n"
+                                                                 "}\n"
+                                                                 "\n";
 
        std::stringstream offset_stream;
        offset_stream << offset;
 
+       m_specializationMap["DST_OFFSET"] = "0";
+       m_specializationMap["SRC_OFFSET"] = "0";
        if (m_test_case == SOURCE_INVALID)
-               source_offset = offset_stream.str();
+               m_specializationMap["SRC_OFFSET"] = offset_stream.str();
        else if (m_test_case == DESTINATION_INVALID)
-               destination_offset = offset_stream.str();
+               m_specializationMap["DST_OFFSET"] = offset_stream.str();
 
-       replaceToken("OFFSET", position, destination_offset.c_str(), source);
-       replaceToken("OFFSET", position, source_offset.c_str(), source);
-
-       return source;
+       return tcu::StringTemplate(source).specialize(m_specializationMap);
 }
 
 /** Verify test case results
@@ -3472,6 +3337,10 @@ bool StorageBufferTest::verifyResults(GLfloat* buffer_data)
        static const GLfloat expected_data_invalid_source[4]       = { 0.0f, 0.0f, 0.0f, 0.0f };
        static const GLfloat expected_data_invalid_destination[4]  = { 1.0f, 1.0f, 1.0f, 1.0f };
 
+       /* OpenGL ES has undefined out-of-bound behavior - verify only valid result*/
+       if (m_context_is_es && (m_test_case != VALID))
+               return true;
+
        /* Prepare expected data const for proper case*/
        const GLchar*  name                                = 0;
        bool               check_expected_data = false;
@@ -3485,7 +3354,7 @@ bool StorageBufferTest::verifyResults(GLfloat* buffer_data)
                break;
        case SOURCE_INVALID:
                name                            = "invalid source indices";
-               if (m_hasKhrRobustBufferAccess)
+               if (m_has_khr_robust_buffer_access)
                {
                        for (int b = 0; b < 4; b++)
                        {
@@ -3509,8 +3378,8 @@ bool StorageBufferTest::verifyResults(GLfloat* buffer_data)
                                }
                                if (!valid)
                                {
-                                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "Test case: " << name << " failed"
-                                                                                                               << tcu::TestLog::EndMessage;
+                                       m_testCtx.getLog() << tcu::TestLog::Message << "Test case: " << name << " failed"
+                                                                          << tcu::TestLog::EndMessage;
                                }
                        }
                }
@@ -3522,7 +3391,7 @@ bool StorageBufferTest::verifyResults(GLfloat* buffer_data)
                break;
        case DESTINATION_INVALID:
                name                            = "invalid destination indices";
-               if (m_hasKhrRobustBufferAccess)
+               if (m_has_khr_robust_buffer_access)
                {
                        for (int b = 0; b < 4; b++)
                        {
@@ -3548,8 +3417,8 @@ bool StorageBufferTest::verifyResults(GLfloat* buffer_data)
                                }
                                if (!valid)
                                {
-                                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "Test case: " << name << " failed"
-                                                                                                               << tcu::TestLog::EndMessage;
+                                       m_testCtx.getLog() << tcu::TestLog::Message << "Test case: " << name << " failed"
+                                                                          << tcu::TestLog::EndMessage;
                                }
                        }
                }
@@ -3569,8 +3438,8 @@ bool StorageBufferTest::verifyResults(GLfloat* buffer_data)
                int size = static_cast<int>(sizeof(GLfloat) * 4);
                if (0 != memcmp(expected_data, buffer_data, size))
                {
-                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "Test case: " << name << " failed"
-                                                                                               << tcu::TestLog::EndMessage;
+                       m_testCtx.getLog() << tcu::TestLog::Message << "Test case: " << name << " failed"
+                                                          << tcu::TestLog::EndMessage;
                        return false;
                }
        }
@@ -3582,29 +3451,21 @@ bool StorageBufferTest::verifyResults(GLfloat* buffer_data)
  *
  * @param context Test context
  **/
-UniformBufferTest::UniformBufferTest(deqp::Context& context)
-       : TestCase(context, "uniform_buffer", "Verifies that out-of-bound access to UBO resutls in 0"), m_test_case(VALID)
+UniformBufferTest::UniformBufferTest(tcu::TestContext& testCtx, glu::ApiType apiType)
+       : RobustnessBase(testCtx, "uniform_buffer", "Verifies that out-of-bound access to UBO resutls in 0", apiType)
+       , m_test_case(VALID)
 {
        /* Nothing to be done here */
 }
 
-/** Constructor
- *
- * @param context Test context
- **/
-UniformBufferTest::UniformBufferTest(deqp::Context& context, const glw::GLchar* name, const glw::GLchar* description)
-       : TestCase(context, name, description), m_test_case(VALID)
-{
-       /* Nothing to be done */
-}
-
 /** Execute test
  *
  * @return tcu::TestNode::STOP
  **/
 tcu::TestNode::IterateResult UniformBufferTest::iterate()
 {
-       if (!isRobustBufferAccessBehaviorFeatureSupported(m_context))
+       de::SharedPtr<glu::RenderContext> robustContext(createRobustContext());
+       if (!robustContext.get())
                return STOP;
 
        static const GLfloat destination_data[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
@@ -3621,7 +3482,7 @@ tcu::TestNode::IterateResult UniformBufferTest::iterate()
        };
 
        /* GL entry points */
-       const Functions& gl = m_context.getRenderContext().getFunctions();
+       const Functions& gl = robustContext->getFunctions();
 
        /* Test result indicator */
        bool test_result = true;
@@ -3630,9 +3491,9 @@ tcu::TestNode::IterateResult UniformBufferTest::iterate()
        while (LAST != m_test_case)
        {
                /* Test case objects */
-               Buffer  destination_buffer(m_context);
-               Buffer  source_buffer(m_context);
-               Program program(m_context);
+               Buffer  destination_buffer(gl);
+               Buffer  source_buffer(gl);
+               Program program(gl);
 
                /* Buffers initialization */
                destination_buffer.InitData(GL_SHADER_STORAGE_BUFFER, GL_DYNAMIC_COPY, sizeof(destination_data),
@@ -3676,11 +3537,11 @@ tcu::TestNode::IterateResult UniformBufferTest::iterate()
        /* Set result */
        if (true == test_result)
        {
-               m_context.getTestContext().setTestResult(QP_TEST_RESULT_PASS, "Pass");
+               m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
        }
        else
        {
-               m_context.getTestContext().setTestResult(QP_TEST_RESULT_FAIL, "Fail");
+               m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
        }
 
        /* Done */
@@ -3693,42 +3554,36 @@ tcu::TestNode::IterateResult UniformBufferTest::iterate()
  **/
 std::string UniformBufferTest::getComputeShader(GLuint offset)
 {
-       static const GLchar* cs = "#version 430 core\n"
-                                                         "\n"
-                                                         "layout (local_size_x = 4, local_size_y = 1, local_size_z = 1) in;\n"
-                                                         "\n"
-                                                         "layout (binding = 0, std140) uniform Source {\n"
-                                                         "    float data[16];\n"
-                                                         "} source;\n"
-                                                         "\n"
-                                                         "layout (binding = 0, std430) buffer Destination {\n"
-                                                         "    float data[];\n"
-                                                         "} destination;\n"
-                                                         "\n"
-                                                         "void main()\n"
-                                                         "{\n"
-                                                         "    const uint index_destination = gl_LocalInvocationID.x + OFFSET;\n"
-                                                         "    const uint index_source      = gl_LocalInvocationID.x + OFFSET;\n"
-                                                         "\n"
-                                                         "    destination.data[index_destination] = source.data[index_source];\n"
-                                                         "}\n"
-                                                         "\n";
-
-       const GLchar* destination_offset = "0";
-       std::string   source_offset("0");
-       size_t            position = 0;
-       std::string   source   = cs;
-
-       std::stringstream offset_stream;
-       offset_stream << offset;
+       static const GLchar* source = "${VERSION}\n"
+                                                                 "\n"
+                                                                 "layout (local_size_x = 4, local_size_y = 1, local_size_z = 1) in;\n"
+                                                                 "\n"
+                                                                 "layout (binding = 0, std140) uniform Source {\n"
+                                                                 "    float data[16];\n"
+                                                                 "} source;\n"
+                                                                 "\n"
+                                                                 "layout (binding = 0, std430) buffer Destination {\n"
+                                                                 "    float data[];\n"
+                                                                 "} destination;\n"
+                                                                 "\n"
+                                                                 "void main()\n"
+                                                                 "{\n"
+                                                                 "    uint index_destination = gl_LocalInvocationID.x;\n"
+                                                                 "    uint index_source      = gl_LocalInvocationID.x + ${OFFSET}U;\n"
+                                                                 "\n"
+                                                                 "    destination.data[index_destination] = source.data[index_source];\n"
+                                                                 "}\n"
+                                                                 "\n";
 
+       m_specializationMap["OFFSET"] = "0";
        if (m_test_case == SOURCE_INVALID)
-               source_offset = offset_stream.str();
-
-       replaceToken("OFFSET", position, destination_offset, source);
-       replaceToken("OFFSET", position, source_offset.c_str(), source);
+       {
+               std::stringstream offset_stream;
+               offset_stream << offset;
+               m_specializationMap["OFFSET"] = offset_stream.str();
+       }
 
-       return source;
+       return tcu::StringTemplate(source).specialize(m_specializationMap);
 }
 
 /** Verify test case results
@@ -3764,8 +3619,7 @@ bool UniformBufferTest::verifyResults(GLfloat* buffer_data)
        /* Verify buffer data */
        if (0 != memcmp(expected_data, buffer_data, size))
        {
-               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Test case: " << name << " failed"
-                                                                                       << tcu::TestLog::EndMessage;
+               m_testCtx.getLog() << tcu::TestLog::Message << "Test case: " << name << " failed" << tcu::TestLog::EndMessage;
                return false;
        }
 
@@ -3777,9 +3631,10 @@ bool UniformBufferTest::verifyResults(GLfloat* buffer_data)
  *
  *  @param context Rendering context.
  **/
-RobustBufferAccessBehaviorTests::RobustBufferAccessBehaviorTests(deqp::Context& context)
-       : TestCaseGroup(context, "robust_buffer_access_behavior",
-                                       "Verifies \"robust buffer access behavior\" functionality")
+RobustBufferAccessBehaviorTests::RobustBufferAccessBehaviorTests(tcu::TestContext& testCtx, glu::ApiType apiType)
+       : tcu::TestCaseGroup(testCtx, "robust_buffer_access_behavior",
+                                                "Verifies \"robust buffer access behavior\" functionality")
+       , m_ApiType(apiType)
 {
        /* Left blank on purpose */
 }
@@ -3789,11 +3644,11 @@ RobustBufferAccessBehaviorTests::RobustBufferAccessBehaviorTests(deqp::Context&
  **/
 void RobustBufferAccessBehaviorTests::init(void)
 {
-       addChild(new RobustBufferAccessBehavior::VertexBufferObjectsTest(m_context));
-       addChild(new RobustBufferAccessBehavior::TexelFetchTest(m_context));
-       addChild(new RobustBufferAccessBehavior::ImageLoadStoreTest(m_context));
-       addChild(new RobustBufferAccessBehavior::StorageBufferTest(m_context));
-       addChild(new RobustBufferAccessBehavior::UniformBufferTest(m_context));
+       addChild(new RobustBufferAccessBehavior::VertexBufferObjectsTest(m_testCtx, m_ApiType));
+       addChild(new RobustBufferAccessBehavior::TexelFetchTest(m_testCtx, m_ApiType));
+       addChild(new RobustBufferAccessBehavior::ImageLoadStoreTest(m_testCtx, m_ApiType));
+       addChild(new RobustBufferAccessBehavior::StorageBufferTest(m_testCtx, m_ApiType));
+       addChild(new RobustBufferAccessBehavior::UniformBufferTest(m_testCtx, m_ApiType));
 }
 
-} /* deqp */
+} /* glcts */
index a3fd16a..d783951 100644 (file)
  * \brief Declares test classes for "Robust Buffer Access Behavior" functionality.
  */ /*-------------------------------------------------------------------*/
 
+#include "glcRobustnessTests.hpp"
 #include "glcTestCase.hpp"
 #include "glwDefs.hpp"
 #include "glwEnums.hpp"
 
-namespace deqp
+#include <map>
+
+namespace glcts
 {
 namespace RobustBufferAccessBehavior
 {
@@ -43,7 +46,7 @@ class Buffer
 public:
        /* Public methods */
        /* Ctr & Dtr */
-       Buffer(deqp::Context& context);
+       Buffer(const glw::Functions& gl);
        ~Buffer();
 
        /* Init & Release */
@@ -76,7 +79,7 @@ private:
        /* Private enums */
 
        /* Private fields */
-       deqp::Context& m_context;
+       const glw::Functions& m_gl;
        glw::GLenum     m_target;
 };
 
@@ -88,7 +91,7 @@ class Framebuffer
 public:
        /* Public methods */
        /* Ctr & Dtr */
-       Framebuffer(deqp::Context& context);
+       Framebuffer(const glw::Functions& gl);
        ~Framebuffer();
 
        /* Init & Release */
@@ -109,7 +112,7 @@ public:
 
 private:
        /* Private fields */
-       deqp::Context& m_context;
+       const glw::Functions& m_gl;
 };
 
 /** Represents shader instance.
@@ -120,7 +123,7 @@ class Shader
 public:
        /* Public methods */
        /* Ctr & Dtr */
-       Shader(deqp::Context& context);
+       Shader(const glw::Functions& gl);
        ~Shader();
 
        /* Init & Realese */
@@ -141,7 +144,7 @@ public:
 
 private:
        /* Private fields */
-       deqp::Context& m_context;
+       const glw::Functions& m_gl;
 };
 
 /** Represents program instance.
@@ -152,7 +155,7 @@ class Program
 public:
        /* Public methods */
        /* Ctr & Dtr */
-       Program(deqp::Context& context);
+       Program(const glw::Functions& gl);
        ~Program();
 
        /* Init & Release */
@@ -187,7 +190,7 @@ public:
 
 private:
        /* Private fields */
-       deqp::Context& m_context;
+       const glw::Functions& m_gl;
 };
 
 /** Represents texture instance
@@ -197,7 +200,7 @@ class Texture
 public:
        /* Public methods */
        /* Ctr & Dtr */
-       Texture(deqp::Context& context);
+       Texture(const glw::Functions& gl);
        ~Texture();
 
        /* Init & Release */
@@ -241,7 +244,7 @@ public:
 
 private:
        /* Private fields */
-       deqp::Context& m_context;
+       const glw::Functions& m_gl;
 };
 
 /** Represents Vertex array object
@@ -252,7 +255,7 @@ class VertexArray
 public:
        /* Public methods */
        /* Ctr & Dtr */
-       VertexArray(deqp::Context& Context);
+       VertexArray(const glw::Functions& gl);
        ~VertexArray();
 
        /* Init & Release */
@@ -270,7 +273,23 @@ public:
 
 private:
        /* Private fields */
-       deqp::Context& m_context;
+       const glw::Functions& m_gl;
+};
+
+class RobustnessBase : public tcu::TestCase
+{
+public:
+       RobustnessBase(tcu::TestContext& testCtx, const char* name, const char* description, glu::ApiType apiType);
+
+       glu::RenderContext* createRobustContext(
+               glu::ResetNotificationStrategy reset = glu::RESET_NOTIFICATION_STRATEGY_NO_RESET_NOTIFICATION);
+
+protected:
+       glu::ApiType m_api_type;
+       bool             m_context_is_es;
+       bool             m_has_khr_robust_buffer_access;
+
+       std::map<std::string, std::string> m_specializationMap;
 };
 
 /** Implementation of test VertexBufferObjects. Description follows:
@@ -319,12 +338,11 @@ private:
  * - inspect contents of framebuffer, it is expected that it is filled with
  * value 1.
  **/
-class VertexBufferObjectsTest : public deqp::TestCase
+class VertexBufferObjectsTest : public RobustnessBase
 {
 public:
        /* Public methods */
-       VertexBufferObjectsTest(deqp::Context& context);
-       VertexBufferObjectsTest(deqp::Context& context, const char* name, const char* description);
+       VertexBufferObjectsTest(tcu::TestContext& testCtx, glu::ApiType apiType);
        virtual ~VertexBufferObjectsTest()
        {
        }
@@ -334,12 +352,12 @@ public:
 
 protected:
        /* Protected methods */
-       virtual std::string getFragmentShader();
-       virtual std::string getVertexShader();
-       virtual void cleanTexture(glw::GLuint texture_id);
-       virtual bool verifyInvalidResults(glw::GLuint texture_id);
-       virtual bool verifyValidResults(glw::GLuint texture_id);
-       virtual bool verifyResults(glw::GLuint texture_id);
+       std::string getFragmentShader();
+       std::string getVertexShader();
+       void cleanTexture(const glw::Functions& gl, glw::GLuint texture_id);
+       bool verifyInvalidResults(const glw::Functions& gl, glw::GLuint texture_id);
+       bool verifyValidResults(const glw::Functions& gl, glw::GLuint texture_id);
+       bool verifyResults(const glw::Functions& gl, glw::GLuint texture_id);
 };
 
 /** Implementation of test TexelFetch. Description follows:
@@ -369,12 +387,12 @@ protected:
  * - mipmap at level 1;
  * - a texture with 4 samples.
  **/
-class TexelFetchTest : public deqp::TestCase
+class TexelFetchTest : public RobustnessBase
 {
 public:
        /* Public methods */
-       TexelFetchTest(deqp::Context& context);
-       TexelFetchTest(deqp::Context& context, const glw::GLchar* name, const glw::GLchar* description);
+       TexelFetchTest(tcu::TestContext& testCtx, glu::ApiType apiType);
+       TexelFetchTest(tcu::TestContext& testCtx, const char* name, const char* description, glu::ApiType apiType);
        virtual ~TexelFetchTest()
        {
        }
@@ -403,19 +421,20 @@ protected:
        };
 
        /* Protected methods */
-       virtual const glw::GLchar* getTestCaseName() const;
-       virtual void prepareTexture(bool is_source, glw::GLuint texture_id);
+       const glw::GLchar* getTestCaseName() const;
+       void prepareTexture(const glw::Functions& gl, bool is_source, glw::GLuint texture_id);
 
        /* Protected fields */
        TEST_CASES m_test_case;
 
 protected:
        /* Protected methods */
-       virtual std::string getFragmentShader(bool is_case_valid, glw::GLuint fetch_offset = 0);
-       virtual std::string getGeometryShader();
-       virtual std::string getVertexShader();
-       virtual bool verifyInvalidResults(glw::GLuint texture_id);
-       virtual bool verifyValidResults(glw::GLuint texture_id);
+       std::string getFragmentShader(const glu::ContextType& contextType, bool is_case_valid,
+                                                                 glw::GLuint fetch_offset = 0);
+       std::string  getGeometryShader();
+       std::string  getVertexShader();
+       virtual bool verifyInvalidResults(const glw::Functions& gl, glw::GLuint texture_id);
+       virtual bool verifyValidResults(const glw::Functions& gl, glw::GLuint texture_id);
 };
 
 /** Implementation of test ImageLoadStore. Description follows:
@@ -436,8 +455,7 @@ class ImageLoadStoreTest : public TexelFetchTest
 {
 public:
        /* Public methods */
-       ImageLoadStoreTest(deqp::Context& context);
-       ImageLoadStoreTest(deqp::Context& context, const char* name, const char* description);
+       ImageLoadStoreTest(tcu::TestContext& testCtx, glu::ApiType apiType);
        virtual ~ImageLoadStoreTest()
        {
        }
@@ -447,10 +465,10 @@ public:
 
 protected:
        /* Protected methods */
-       virtual std::string getComputeShader(VERSION version, glw::GLuint coord_offset = 0, glw::GLuint sample_offset = 0);
-       virtual void setTextures(glw::GLuint id_destination, glw::GLuint id_source);
-       virtual bool verifyInvalidResults(glw::GLuint texture_id);
-       virtual bool verifyValidResults(glw::GLuint texture_id);
+       std::string getComputeShader(VERSION version, glw::GLuint coord_offset = 0, glw::GLuint sample_offset = 0);
+       void setTextures(const glw::Functions& gl, glw::GLuint id_destination, glw::GLuint id_source);
+       bool verifyInvalidResults(const glw::Functions& gl, glw::GLuint texture_id);
+       bool verifyValidResults(const glw::Functions& gl, glw::GLuint texture_id);
 };
 
 /** Implementation of test StorageBuffer. Description follows:
@@ -479,12 +497,11 @@ protected:
  *   * value of src_index is equal to gl_LocalInvocationID.x + 16; It is
  *   expected that destination buffer will be filled with value 0.
  **/
-class StorageBufferTest : public deqp::TestCase
+class StorageBufferTest : public RobustnessBase
 {
 public:
        /* Public methods */
-       StorageBufferTest(deqp::Context& context);
-       StorageBufferTest(deqp::Context& context, const char* name, const char* description);
+       StorageBufferTest(tcu::TestContext& testCtx, glu::ApiType apiType);
        virtual ~StorageBufferTest()
        {
        }
@@ -504,12 +521,11 @@ protected:
        };
 
        /* Private methods */
-       virtual std::string getComputeShader(glw::GLuint offset);
-       virtual bool verifyResults(glw::GLfloat* buffer_data);
+       std::string getComputeShader(glw::GLuint offset);
+       bool verifyResults(glw::GLfloat* buffer_data);
 
        /* Protected fields */
        VERSION m_test_case;
-       bool m_hasKhrRobustBufferAccess;
 
        /* Protected constants */
        static const glw::GLfloat m_destination_data[4];
@@ -525,12 +541,11 @@ protected:
  * - use uniform buffer for source instead of storage buffer;
  * - ignore the case with invalid value of dst_index.
  **/
-class UniformBufferTest : public deqp::TestCase
+class UniformBufferTest : public RobustnessBase
 {
 public:
        /* Public methods */
-       UniformBufferTest(deqp::Context& context);
-       UniformBufferTest(deqp::Context& context, const char* name, const char* description);
+       UniformBufferTest(tcu::TestContext& testCtx, glu::ApiType apiType);
        virtual ~UniformBufferTest()
        {
        }
@@ -549,8 +564,8 @@ protected:
        };
 
        /* Protected methods */
-       virtual std::string getComputeShader(glw::GLuint offset);
-       virtual bool verifyResults(glw::GLfloat* buffer_data);
+       std::string getComputeShader(glw::GLuint offset);
+       bool verifyResults(glw::GLfloat* buffer_data);
 
        /* Protected fields */
        VERSION m_test_case;
@@ -558,11 +573,11 @@ protected:
 } /* RobustBufferAccessBehavior */
 
 /** Group class for multi bind conformance tests */
-class RobustBufferAccessBehaviorTests : public deqp::TestCaseGroup
+class RobustBufferAccessBehaviorTests : public tcu::TestCaseGroup
 {
 public:
        /* Public methods */
-       RobustBufferAccessBehaviorTests(deqp::Context& context);
+       RobustBufferAccessBehaviorTests(tcu::TestContext& testCtx, glu::ApiType apiType);
        virtual ~RobustBufferAccessBehaviorTests(void)
        {
        }
@@ -573,8 +588,10 @@ private:
        /* Private methods */
        RobustBufferAccessBehaviorTests(const RobustBufferAccessBehaviorTests& other);
        RobustBufferAccessBehaviorTests& operator=(const RobustBufferAccessBehaviorTests& other);
+
+       glu::ApiType m_ApiType;
 };
 
-} /* deqp */
+} /* glcts */
 
 #endif // _GLCROBUSTBUFFERACCESSBEHAVIORTESTS_HPP
index ac8e251..2a57b79 100644 (file)
@@ -34,7 +34,7 @@
 #include <cstring>
 
 using namespace glw;
-using namespace deqp::RobustBufferAccessBehavior;
+using namespace glcts::RobustBufferAccessBehavior;
 
 namespace glcts
 {
@@ -283,7 +283,7 @@ tcu::TestNode::IterateResult GetnUniformTest::iterate()
        bool test_result = true;
 
        /* Iterate over all cases */
-       Program program(*context);
+       Program program(gl);
 
        /* Compute Shader */
        bool                       glslES320 = contextSupports(renderContext.getType(), glu::ApiType::es(3, 2));
@@ -533,11 +533,11 @@ tcu::TestNode::IterateResult ReadnPixelsTest::iterate()
        const Functions& gl = context->getRenderContext().getFunctions();
 
        /* Test case objects */
-       Program         program(*context);
-       Texture         texture(*context);
-       Buffer          elements_buffer(*context);
-       Buffer          vertices_buffer(*context);
-       VertexArray vao(*context);
+       Program         program(gl);
+       Texture         texture(gl);
+       Buffer          elements_buffer(gl);
+       Buffer          vertices_buffer(gl);
+       VertexArray vao(gl);
 
        /* Vertex array initialization */
        VertexArray::Generate(gl, vao.m_id);
index a1bc0a7..60925ad 100644 (file)
@@ -73,7 +73,6 @@
 #include "glcInfoTests.hpp"
 #include "glcParallelShaderCompileTests.hpp"
 #include "glcPolygonOffsetClampTests.hpp"
-#include "glcRobustBufferAccessBehaviorTests.hpp"
 #include "glcSampleVariablesTests.hpp"
 #include "glcSeparableProgramsTransformFeedbackTests.hpp"
 #include "glcShaderConstExprTests.hpp"
@@ -233,7 +232,6 @@ void GL43TestPackage::init(void)
                addChild(new gl4cts::KHRDebugTests(getContext()));
                addChild(new gl4cts::ProgramInterfaceQueryTests(getContext()));
                addChild(new gl4cts::ComputeShaderTests(getContext()));
-               addChild(new deqp::RobustBufferAccessBehaviorTests(getContext()));
                addChild(new gl4cts::ShaderStorageBufferObjectTests(getContext()));
                addChild(new gl4cts::VertexAttribBindingTests(getContext()));
                addChild(new gl4cts::ShaderImageSizeTests(getContext()));
index abd8c42..0236139 100644 (file)
@@ -10,8 +10,6 @@ set(GLCTS_ES32_SRCS
        es32cTestPackage.hpp
        es32cCopyImageTests.cpp
        es32cCopyImageTests.hpp
-       es32cRobustBufferAccessBehaviorTests.cpp
-       es32cRobustBufferAccessBehaviorTests.hpp
        )
 
 set(GLCTS_ES32_LIBS
diff --git a/external/openglcts/modules/gles32/es32cRobustBufferAccessBehaviorTests.cpp b/external/openglcts/modules/gles32/es32cRobustBufferAccessBehaviorTests.cpp
deleted file mode 100644 (file)
index 5b46217..0000000
+++ /dev/null
@@ -1,1201 +0,0 @@
-/*-------------------------------------------------------------------------
- * OpenGL Conformance Test Suite
- * -----------------------------
- *
- * Copyright (c) 2016 The Khronos Group Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */ /*!
- * \file  es32cRobustBufferAccessBehaviorTests.cpp
- * \brief Implements conformance tests for "Robust Buffer Access Behavior" functionality.
- */ /*-------------------------------------------------------------------*/
-
-#include "es32cRobustBufferAccessBehaviorTests.hpp"
-
-#include "gluContextInfo.hpp"
-#include "gluDefs.hpp"
-#include "gluStrUtil.hpp"
-#include "glwEnums.hpp"
-#include "glwFunctions.hpp"
-#include "tcuTestLog.hpp"
-
-#include <cstring>
-#include <string>
-
-using namespace glw;
-using namespace deqp::RobustBufferAccessBehavior;
-
-namespace es32cts
-{
-namespace RobustBufferAccessBehavior
-{
-/** Constructor
- *
- * @param context Test context
- **/
-VertexBufferObjectsTest::VertexBufferObjectsTest(deqp::Context& context)
-       : deqp::RobustBufferAccessBehavior::VertexBufferObjectsTest(
-                 context, "vertex_buffer_objects", "Verifies that out-of-bound reads from VB result in zero")
-{
-       /* Nothing to be done */
-}
-
-/** Prepare shader for current test case
- *
- * @return Source
- **/
-std::string VertexBufferObjectsTest::getFragmentShader()
-{
-       return std::string("#version 320 es\n"
-                                          "\n"
-                                          "layout (location = 0) out lowp uvec4 out_fs_color;\n"
-                                          "\n"
-                                          "void main()\n"
-                                          "{\n"
-                                          "    out_fs_color = uvec4(1, 255, 255, 255);\n"
-                                          "}\n"
-                                          "\n");
-}
-
-/** Prepare shader for current test case
- *
- * @return Source
- **/
-std::string VertexBufferObjectsTest::getVertexShader()
-{
-       return std::string("#version 320 es\n"
-                                          "\n"
-                                          "layout (location = 0) in vec4 in_vs_position;\n"
-                                          "\n"
-                                          "void main()\n"
-                                          "{\n"
-                                          "    gl_Position = in_vs_position;\n"
-                                          "}\n"
-                                          "\n");
-}
-
-/** No verification because of undefined out-of-bound behavior in OpenGL ES
- *
- * @param texture_id Id of texture
- *
- * @return true
- **/
-bool VertexBufferObjectsTest::verifyInvalidResults(glw::GLuint texture_id)
-{
-       (void)texture_id;
-       return true;
-}
-
-/** Verifies that texutre is filled with 1
- *
- * @param texture_id Id of texture
- *
- * @return true when image is filled with 1, false otherwise
- **/
-bool VertexBufferObjectsTest::verifyResults(glw::GLuint texture_id)
-{
-       static const GLuint height       = 8;
-       static const GLuint width         = 8;
-       static const GLuint pixel_size = 4 * sizeof(GLuint);
-
-       const Functions& gl = m_context.getRenderContext().getFunctions();
-
-       const GLint buf_size = width * height * pixel_size;
-       GLubyte         pixels[buf_size];
-       deMemset(pixels, 0, buf_size);
-
-       Texture::Bind(gl, texture_id, GL_TEXTURE_2D);
-
-       Texture::GetData(gl, texture_id, 0 /* level */, width, height, GL_RGBA_INTEGER, GL_UNSIGNED_INT, pixels);
-
-       /* Unbind */
-       Texture::Bind(gl, 0, GL_TEXTURE_2D);
-
-       /* Verify */
-       for (GLuint i = 0; i < buf_size; i += pixel_size)
-       {
-               if (1 != pixels[i])
-               {
-                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "Invalid value: " << (GLuint)pixels[i]
-                                                                                               << " at offset: " << i << tcu::TestLog::EndMessage;
-
-                       return false;
-               }
-       }
-
-       return true;
-}
-
-/** Constructor
- *
- * @param context Test context
- **/
-TexelFetchTest::TexelFetchTest(deqp::Context& context)
-       : deqp::RobustBufferAccessBehavior::TexelFetchTest(context, "texel_fetch",
-                                                                                                          "Verifies that out-of-bound fetches from texture result in zero")
-{
-       /* Nothing to be done */
-}
-
-TexelFetchTest::TexelFetchTest(deqp::Context& context, const glw::GLchar* name, const glw::GLchar* description)
-       : deqp::RobustBufferAccessBehavior::TexelFetchTest(context, name, description)
-{
-       /* Nothing to be done */
-}
-
-/** Prepare shader for current test case
- *
- * @return Source
- **/
-std::string TexelFetchTest::getGeometryShader()
-{
-       return std::string("#version 320 es\n"
-                                          "\n"
-                                          "layout(points)                           in;\n"
-                                          "layout(triangle_strip, max_vertices = 4) out;\n"
-                                          "\n"
-                                          "out vec2 gs_fs_tex_coord;\n"
-                                          "\n"
-                                          "void main()\n"
-                                          "{\n"
-                                          "    gs_fs_tex_coord = vec2(0, 0);\n"
-                                          "    gl_Position     = vec4(-1, -1, 0, 1);\n"
-                                          "    EmitVertex();\n"
-                                          "\n"
-                                          "    gs_fs_tex_coord = vec2(0, 1);\n"
-                                          "    gl_Position     = vec4(-1, 1, 0, 1);\n"
-                                          "    EmitVertex();\n"
-                                          "\n"
-                                          "    gs_fs_tex_coord = vec2(1, 0);\n"
-                                          "    gl_Position     = vec4(1, -1, 0, 1);\n"
-                                          "    EmitVertex();\n"
-                                          "\n"
-                                          "    gs_fs_tex_coord = vec2(1, 1);\n"
-                                          "    gl_Position     = vec4(1, 1, 0, 1);\n"
-                                          "    EmitVertex();\n"
-                                          "}\n"
-                                          "\n");
-}
-
-/** Prepare shader for current test case
- *
- * @return Source
- **/
-std::string TexelFetchTest::getVertexShader()
-{
-       return std::string("#version 320 es\n"
-                                          "\n"
-                                          "void main()\n"
-                                          "{\n"
-                                          "    gl_Position = vec4(0, 0, 0, 1);\n"
-                                          "}\n"
-                                          "\n");
-}
-
-/** Prepare a texture
- *
- * @param is_source  Selects if texutre will be used as source or destination
- * @param texture_id Id of texutre
- **/
-void TexelFetchTest::prepareTexture(bool is_source, glw::GLuint texture_id)
-{
-       /* Image size */
-       static const GLuint image_height = 16;
-       static const GLuint image_width  = 16;
-
-       /* GL entry points */
-       const Functions& gl = m_context.getRenderContext().getFunctions();
-
-       /* Texture storage parameters */
-       GLuint  height                  = image_height;
-       GLenum  internal_format = 0;
-       GLsizei n_levels                = 1;
-       GLenum  target                  = GL_TEXTURE_2D;
-       GLuint  width                   = image_width;
-
-       /* Prepare texture storage parameters */
-       switch (m_test_case)
-       {
-       case R8:
-               internal_format = GL_R8;
-               break;
-       case RG8_SNORM:
-               internal_format = GL_RG8_SNORM;
-               break;
-       case RGBA32F:
-               internal_format = GL_RGBA32F;
-               break;
-       case R32UI_MIPMAP:
-               height                  = 2 * image_height;
-               internal_format = GL_R32UI;
-               n_levels                = 2;
-               width                   = 2 * image_width;
-               break;
-       case R32UI_MULTISAMPLE:
-               internal_format = GL_R32UI;
-               n_levels                = 4;
-               target                  = GL_TEXTURE_2D_MULTISAMPLE;
-               break;
-       default:
-               TCU_FAIL("Invalid enum");
-       }
-
-       /* Prepare storage */
-       Texture::Bind(gl, texture_id, target);
-       Texture::Storage(gl, target, n_levels, internal_format, width, height, 0);
-
-       /* Set samplers to NEAREST/NEAREST if required */
-       if (R32UI_MULTISAMPLE != m_test_case)
-       {
-               gl.texParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-               gl.texParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-       }
-
-       /* Destination image can be left empty */
-       if (false == is_source)
-       {
-               Texture::Bind(gl, 0, target);
-               return;
-       }
-
-       /* Prepare texture */
-       if (R8 == m_test_case)
-       {
-               GLubyte source_pixels[image_width * image_height];
-               for (GLuint i = 0; i < image_width * image_height; ++i)
-               {
-                       source_pixels[i] = (GLubyte)i;
-               }
-
-               Texture::SubImage(gl, GL_TEXTURE_2D, 0 /* level */, 0 /* x */, 0 /* y */, 0 /* z */, width, height,
-                                                 0 /* depth */, GL_RED, GL_UNSIGNED_BYTE, source_pixels);
-       }
-       else if (RG8_SNORM == m_test_case)
-       {
-               static const GLuint n_components = 2;
-
-               GLbyte source_pixels[image_width * image_height * n_components];
-               for (GLuint i = 0; i < image_width * image_height; ++i)
-               {
-                       source_pixels[i * n_components + 0] = (GLubyte)((i % 16));
-                       source_pixels[i * n_components + 1] = (GLubyte)((i / 16));
-               }
-
-               Texture::SubImage(gl, GL_TEXTURE_2D, 0 /* level */, 0 /* x */, 0 /* y */, 0 /* z */, width, height,
-                                                 0 /* depth */, GL_RG, GL_BYTE, source_pixels);
-       }
-       else if (RGBA32F == m_test_case)
-       {
-               static const GLuint n_components = 4;
-
-               GLfloat source_pixels[image_width * image_height * n_components];
-               for (GLuint i = 0; i < image_width * image_height; ++i)
-               {
-                       source_pixels[i * n_components + 0] = (GLfloat)(i % 16) / 16.0f;
-                       source_pixels[i * n_components + 1] = (GLfloat)(i / 16) / 16.0f;
-                       source_pixels[i * n_components + 2] = (GLfloat)i / 256.0f;
-                       source_pixels[i * n_components + 3] = 1.0f;
-               }
-
-               Texture::SubImage(gl, GL_TEXTURE_2D, 0 /* level */, 0 /* x */, 0 /* y */, 0 /* z */, width, height,
-                                                 0 /* depth */, GL_RGBA, GL_FLOAT, source_pixels);
-       }
-       else if (R32UI_MIPMAP == m_test_case)
-       {
-               GLuint source_pixels[image_width * image_height];
-               for (GLuint i = 0; i < image_width * image_height; ++i)
-               {
-                       source_pixels[i] = i;
-               }
-
-               Texture::SubImage(gl, GL_TEXTURE_2D, 1 /* level */, 0 /* x */, 0 /* y */, 0 /* z */, image_width, image_height,
-                                                 0 /* depth */, GL_RED_INTEGER, GL_UNSIGNED_INT, source_pixels);
-
-               /* texelFetch() undefined if the computed level of detail is not the texture’s base level and the texture’s
-                       minification filter is NEAREST or LINEAR */
-               gl.texParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
-       }
-       else if (R32UI_MULTISAMPLE == m_test_case)
-       {
-               /* Compute Shader */
-               static const GLchar* cs = "#version 320 es\n"
-                                                                 "\n"
-                                                                 "layout (local_size_x = 16, local_size_y = 16, local_size_z = 1) in;\n"
-                                                                 "\n"
-                                                                 "layout (binding = 0, r32ui) writeonly uniform highp uimage2DMS uni_image;\n"
-                                                                 "\n"
-                                                                 "void main()\n"
-                                                                 "{\n"
-                                                                 "    ivec2 point = ivec2(gl_WorkGroupID.x, gl_WorkGroupID.y);\n"
-                                                                 "    uint  index = gl_WorkGroupID.y * 16U + gl_WorkGroupID.x;\n"
-                                                                 "\n"
-                                                                 "    imageStore(uni_image, point, 0, uvec4(index + 0U, 0, 0, 0));\n"
-                                                                 "    imageStore(uni_image, point, 1, uvec4(index + 1U, 0, 0, 0));\n"
-                                                                 "    imageStore(uni_image, point, 2, uvec4(index + 2U, 0, 0, 0));\n"
-                                                                 "    imageStore(uni_image, point, 3, uvec4(index + 3U, 0, 0, 0));\n"
-                                                                 "}\n"
-                                                                 "\n";
-
-               Program program(m_context);
-               program.Init(cs, "", "", "", "", "");
-               program.Use();
-
-               gl.bindImageTexture(0 /* unit */, texture_id, 0 /* level */, GL_FALSE /* layered */, 0 /* layer */,
-                                                       GL_WRITE_ONLY, GL_R32UI);
-               GLU_EXPECT_NO_ERROR(gl.getError(), "BindImageTexture");
-
-               gl.dispatchCompute(16, 16, 1);
-               GLU_EXPECT_NO_ERROR(gl.getError(), "DispatchCompute");
-       }
-
-       Texture::Bind(gl, 0, target);
-}
-
-/** No verification because of undefined out-of-bound behavior in OpenGL ES
- *
- * @param texture_id Id of texture
- *
- * @return true
- **/
-bool TexelFetchTest::verifyInvalidResults(glw::GLuint texture_id)
-{
-       (void)texture_id;
-       return true;
-}
-
-/** Verifies that texutre is filled with increasing values
- *
- * @param texture_id Id of texture
- *
- * @return true when image is filled with increasing values, false otherwise
- **/
-bool TexelFetchTest::verifyValidResults(glw::GLuint texture_id)
-{
-       static const GLuint height   = 16;
-       static const GLuint width       = 16;
-       static const GLuint n_pixels = height * width;
-
-       const Functions& gl = m_context.getRenderContext().getFunctions();
-
-       bool result = true;
-
-       if (R8 == m_test_case)
-       {
-               static const GLuint n_channels = 4;
-
-               Texture::Bind(gl, texture_id, GL_TEXTURE_2D);
-
-               std::vector<GLubyte> pixels;
-               pixels.resize(n_pixels * n_channels);
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       pixels[i] = (GLubyte)i;
-               }
-
-               Texture::GetData(gl, texture_id, 0 /* level */, width, height, GL_RGBA, GL_UNSIGNED_BYTE, &pixels[0]);
-
-               /* Unbind */
-               Texture::Bind(gl, 0, GL_TEXTURE_2D);
-
-               /* Verify */
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       const GLubyte expected_red = (GLubyte)i;
-                       const GLubyte drawn_red = pixels[i * n_channels];
-
-                       if (expected_red != drawn_red)
-                       {
-                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Invalid value: " << (GLuint)drawn_red
-                                                                                                       << ". Expected value: " << (GLuint)expected_red
-                                                                                                       << " at offset: " << i << tcu::TestLog::EndMessage;
-
-                               result = false;
-                               break;
-                       }
-               }
-       }
-       else if (RG8_SNORM == m_test_case)
-       {
-               static const GLuint n_channels = 4;
-
-               Texture::Bind(gl, texture_id, GL_TEXTURE_2D);
-
-               std::vector<GLubyte> pixels;
-               pixels.resize(n_pixels * n_channels);
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       pixels[i * n_channels + 0] = (GLubyte)i;
-                       pixels[i * n_channels + 1] = (GLubyte)i;
-               }
-
-               Texture::GetData(gl, texture_id, 0 /* level */, width, height, GL_RGBA, GL_BYTE, &pixels[0]);
-
-               /* Unbind */
-               Texture::Bind(gl, 0, GL_TEXTURE_2D);
-
-               /* Verify */
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       const GLbyte expected_red   = (GLubyte)(i % 16);
-                       const GLbyte expected_green = (GLubyte)(i / 16);
-                       const GLbyte drawn_red          = pixels[i * n_channels + 0];
-                       const GLbyte drawn_green        = pixels[i * n_channels + 1];
-
-                       if ((expected_red != drawn_red) || (expected_green != drawn_green))
-                       {
-                               m_context.getTestContext().getLog()
-                                       << tcu::TestLog::Message << "Invalid value: " << (GLint)drawn_red << ", " << (GLint)drawn_green
-                                       << ". Expected value: " << (GLint)expected_red << ", " << (GLint)expected_green
-                                       << ". At offset: " << i << tcu::TestLog::EndMessage;
-
-                               result = false;
-                               break;
-                       }
-               }
-       }
-       else if (RGBA32F == m_test_case)
-       {
-               static const GLuint n_channels = 4;
-
-               Texture::Bind(gl, texture_id, GL_TEXTURE_2D);
-
-               std::vector<GLfloat> pixels;
-               pixels.resize(n_pixels * n_channels);
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       pixels[i * n_channels + 0] = (GLfloat)i / (GLfloat)n_pixels;
-                       pixels[i * n_channels + 1] = (GLfloat)i / (GLfloat)n_pixels;
-                       pixels[i * n_channels + 2] = (GLfloat)i / (GLfloat)n_pixels;
-                       pixels[i * n_channels + 3] = (GLfloat)i / (GLfloat)n_pixels;
-               }
-
-               Texture::GetData(gl, texture_id, 0 /* level */, width, height, GL_RGBA, GL_FLOAT, &pixels[0]);
-
-               /* Unbind */
-               Texture::Bind(gl, 0, GL_TEXTURE_2D);
-
-               /* Verify */
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       const GLfloat expected_red   = (GLfloat)(i % 16) / 16.0f;
-                       const GLfloat expected_green = (GLfloat)(i / 16) / 16.0f;
-                       const GLfloat expected_blue  = (GLfloat)i / 256.0f;
-                       const GLfloat expected_alpha = 1.0f;
-                       const GLfloat drawn_red          = pixels[i * n_channels + 0];
-                       const GLfloat drawn_green       = pixels[i * n_channels + 1];
-                       const GLfloat drawn_blue         = pixels[i * n_channels + 2];
-                       const GLfloat drawn_alpha       = pixels[i * n_channels + 3];
-
-                       if ((expected_red != drawn_red) || (expected_green != drawn_green) || (expected_blue != drawn_blue) ||
-                               (expected_alpha != drawn_alpha))
-                       {
-                               m_context.getTestContext().getLog()
-                                       << tcu::TestLog::Message << "Invalid value: " << drawn_red << ", " << drawn_green << ", "
-                                       << drawn_blue << ", " << drawn_alpha << ". Expected value: " << expected_red << ", "
-                                       << expected_green << ", " << expected_blue << ", " << expected_alpha << ". At offset: " << i
-                                       << tcu::TestLog::EndMessage;
-
-                               result = false;
-                               break;
-                       }
-               }
-       }
-       else if (R32UI_MIPMAP == m_test_case)
-       {
-               static const GLuint n_channels = 4;
-
-               Texture::Bind(gl, texture_id, GL_TEXTURE_2D);
-
-               std::vector<GLuint> pixels;
-               pixels.resize(n_pixels * n_channels);
-               deMemset(&pixels[0], 0, n_pixels * n_channels * sizeof(GLuint));
-
-               Texture::GetData(gl, texture_id, 1 /* level */, width, height, GL_RGBA_INTEGER, GL_UNSIGNED_INT, &pixels[0]);
-
-               /* Unbind */
-               Texture::Bind(gl, 0, GL_TEXTURE_2D);
-
-               /* Verify */
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       const GLuint expected_red = i;
-                       const GLuint drawn_red  = pixels[i * n_channels];
-
-                       if (expected_red != drawn_red)
-                       {
-                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Invalid value: " << drawn_red
-                                                                                                       << ". Expected value: " << expected_red << " at offset: " << i
-                                                                                                       << tcu::TestLog::EndMessage;
-
-                               result = false;
-                               break;
-                       }
-               }
-       }
-       else if (R32UI_MULTISAMPLE == m_test_case)
-       {
-               static const GLuint n_channels = 4;
-
-               /* Compute Shader */
-               static const GLchar* cs =
-                       "#version 320 es\n"
-                       "\n"
-                       "layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;\n"
-                       "\n"
-                       "layout (binding = 1, r32ui) writeonly uniform lowp uimage2D   uni_destination_image;\n"
-                       "layout (binding = 0, r32ui) readonly  uniform lowp uimage2DMS uni_source_image;\n"
-                       "\n"
-                       "void main()\n"
-                       "{\n"
-                       "    ivec2 point = ivec2(gl_WorkGroupID.x, gl_WorkGroupID.y);\n"
-                       "    uint  index = gl_WorkGroupID.y * 16U + gl_WorkGroupID.x;\n"
-                       "\n"
-                       "    uvec4 color_0 = imageLoad(uni_source_image, point, 0);\n"
-                       "    uvec4 color_1 = imageLoad(uni_source_image, point, 1);\n"
-                       "    uvec4 color_2 = imageLoad(uni_source_image, point, 2);\n"
-                       "    uvec4 color_3 = imageLoad(uni_source_image, point, 3);\n"
-                       "\n"
-                       "    if (any(equal(uvec4(color_0.r, color_1.r, color_2.r, color_3.r), uvec4(index + 3U))))\n"
-                       "    {\n"
-                       "        imageStore(uni_destination_image, point, uvec4(1U));\n"
-                       "    }\n"
-                       "    else\n"
-                       "    {\n"
-                       "        imageStore(uni_destination_image, point, uvec4(0U));\n"
-                       "    }\n"
-                       "}\n"
-                       "\n";
-
-               Program program(m_context);
-               Texture destination_texture(m_context);
-
-               Texture::Generate(gl, destination_texture.m_id);
-               Texture::Bind(gl, destination_texture.m_id, GL_TEXTURE_2D);
-               Texture::Storage(gl, GL_TEXTURE_2D, 1, GL_R32UI, width, height, 0 /* depth */);
-
-               program.Init(cs, "", "", "", "", "");
-               program.Use();
-               gl.bindImageTexture(0 /* unit */, texture_id, 0 /* level */, GL_FALSE /* layered */, 0 /* layer */,
-                                                       GL_READ_ONLY, GL_R32UI);
-               GLU_EXPECT_NO_ERROR(gl.getError(), "BindImageTexture");
-               gl.bindImageTexture(1 /* unit */, destination_texture.m_id, 0 /* level */, GL_FALSE /* layered */,
-                                                       0 /* layer */, GL_WRITE_ONLY, GL_R32UI);
-               GLU_EXPECT_NO_ERROR(gl.getError(), "BindImageTexture");
-
-               gl.dispatchCompute(16, 16, 1);
-               GLU_EXPECT_NO_ERROR(gl.getError(), "DispatchCompute");
-
-               /* Pixels buffer initialization */
-               std::vector<GLuint> pixels;
-               pixels.resize(n_pixels * n_channels);
-               for (GLuint i = 0; i < n_pixels * n_channels; ++i)
-               {
-                       pixels[i] = i;
-               }
-
-               Texture::GetData(gl, destination_texture.m_id, 0 /* level */, width, height, GL_RGBA_INTEGER, GL_UNSIGNED_INT,
-                                                &pixels[0]);
-
-               /* Unbind */
-               Texture::Bind(gl, 0, GL_TEXTURE_2D);
-
-               /* Verify */
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       const GLuint expected_red = 1;
-                       const GLuint drawn_red  = pixels[i * n_channels];
-
-                       if (expected_red != drawn_red)
-                       {
-                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Invalid value: " << drawn_red
-                                                                                                       << ". Expected value: " << expected_red << " at offset: " << i
-                                                                                                       << tcu::TestLog::EndMessage;
-
-                               result = false;
-                               break;
-                       }
-               }
-       }
-
-       return result;
-}
-
-/** Constructor
- *
- * @param context Test context
- **/
-ImageLoadStoreTest::ImageLoadStoreTest(deqp::Context& context)
-       : TexelFetchTest(context, "image_load_store", "Verifies that out-of-bound to image result in zero or is discarded")
-{
-       /* start from RGBA32F as R8, R32UI_MULTISAMPLE and R8_SNORM are not supported under GLES */
-       m_test_case = RGBA32F;
-}
-
-/** Execute test
- *
- * @return tcu::TestNode::STOP
- **/
-tcu::TestNode::IterateResult ImageLoadStoreTest::iterate()
-{
-       if (!m_context.getContextInfo().isExtensionSupported("GL_KHR_robust_buffer_access_behavior"))
-       {
-               m_testCtx.setTestResult(QP_TEST_RESULT_NOT_SUPPORTED, "Not Supported");
-               return STOP;
-       }
-
-       /* Constants */
-       static const GLuint height = 16;
-       static const GLuint width  = 16;
-
-       /* GL entry points */
-       const Functions& gl = m_context.getRenderContext().getFunctions();
-
-       const unsigned int coord_offsets[] = {
-               16, 512, 1024, 2048,
-       };
-
-       /* Test result indicator */
-       bool test_result = true;
-
-       /* Iterate over all cases */
-       while (LAST != m_test_case)
-       {
-               /* Test case result indicator */
-               bool case_result = true;
-
-               /* Test case objects */
-               Texture destination_texture(m_context);
-               Texture source_texture(m_context);
-               Program program(m_context);
-
-               /* Prepare textures */
-               Texture::Generate(gl, destination_texture.m_id);
-               Texture::Generate(gl, source_texture.m_id);
-
-               prepareTexture(false, destination_texture.m_id);
-               prepareTexture(true, source_texture.m_id);
-
-               /* Test invalid source cases */
-               for (GLuint i = 0; i < DE_LENGTH_OF_ARRAY(coord_offsets); ++i)
-               {
-                       const std::string& cs = getComputeShader(SOURCE_INVALID, coord_offsets[i]);
-                       program.Init(cs, "", "", "", "", "");
-                       program.Use();
-
-                       /* Set texture */
-                       setTextures(destination_texture.m_id, source_texture.m_id);
-
-                       /* Dispatch */
-                       gl.dispatchCompute(width, height, 1 /* depth */);
-                       GLU_EXPECT_NO_ERROR(gl.getError(), "DispatchCompute");
-
-                       /* Verification */
-                       if (false == verifyInvalidResults(destination_texture.m_id))
-                       {
-                               case_result = false;
-                       }
-               }
-
-               /* Test valid case */
-               program.Init(getComputeShader(VALID), "", "", "", "", "");
-               program.Use();
-
-               /* Set texture */
-               setTextures(destination_texture.m_id, source_texture.m_id);
-
-               /* Dispatch */
-               gl.dispatchCompute(width, height, 1 /* depth */);
-               GLU_EXPECT_NO_ERROR(gl.getError(), "DispatchCompute");
-
-               /* Verification */
-               if (false == verifyValidResults(destination_texture.m_id))
-               {
-                       case_result = false;
-               }
-
-               /* Test invalid destination cases */
-               for (GLuint i = 0; i < DE_LENGTH_OF_ARRAY(coord_offsets); ++i)
-               {
-                       const std::string& cs = getComputeShader(DESTINATION_INVALID, coord_offsets[i]);
-                       program.Init(cs, "", "", "", "", "");
-                       program.Use();
-
-                       /* Set texture */
-                       setTextures(destination_texture.m_id, source_texture.m_id);
-
-                       /* Dispatch */
-                       gl.dispatchCompute(width, height, 1 /* depth */);
-                       GLU_EXPECT_NO_ERROR(gl.getError(), "DispatchCompute");
-
-                       /* Verification */
-                       if (false == verifyValidResults(destination_texture.m_id))
-                       {
-                               case_result = false;
-                       }
-               }
-
-               /* Set test result */
-               if (false == case_result)
-               {
-                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "Test case: " << getTestCaseName()
-                                                                                               << " failed" << tcu::TestLog::EndMessage;
-
-                       test_result = false;
-               }
-
-               /* Increment */
-               m_test_case = (TEST_CASES)((GLuint)m_test_case + 1);
-       }
-
-       /* Set result */
-       if (true == test_result)
-       {
-               m_context.getTestContext().setTestResult(QP_TEST_RESULT_PASS, "Pass");
-       }
-       else
-       {
-               m_context.getTestContext().setTestResult(QP_TEST_RESULT_FAIL, "Fail");
-       }
-
-       /* Done */
-       return tcu::TestNode::STOP;
-}
-
-/** Prepare shader for current test case
- *
- * @param version Specify which version should be prepared
- *
- * @return Source
- **/
-std::string ImageLoadStoreTest::getComputeShader(VERSION version, GLuint coord_offset)
-{
-       static const GLchar* template_code =
-               "#version 320 es\n"
-               "\n"
-               "layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in;\n"
-               "\n"
-               "layout (binding = 1, FORMAT) writeonly uniform highp IMAGE uni_destination_image;\n"
-               "layout (binding = 0, FORMAT) readonly  uniform highp IMAGE uni_source_image;\n"
-               "\n"
-               "void main()\n"
-               "{\n"
-               "    ivec2 point_destination = ivec2(gl_WorkGroupID.xy) + ivec2(COORD_OFFSETU);\n"
-               "    ivec2 point_source      = ivec2(gl_WorkGroupID.xy) + ivec2(COORD_OFFSETU);\n"
-               "\n"
-               "COPY"
-               "}\n"
-               "\n";
-
-       static const GLchar* copy_regular = "    TYPE color = imageLoad(uni_source_image, point_source);\n"
-                                                                               "    imageStore(uni_destination_image, point_destination, color);\n";
-
-       static const GLchar* format_rgba32f = "rgba32f";
-       static const GLchar* format_r32ui   = "r32ui";
-
-       static const GLchar* image_vec4 = "image2D";
-
-       static const GLchar* image_uvec4 = "uimage2D";
-
-       static const GLchar* type_vec4  = "vec4";
-       static const GLchar* type_uvec4 = "uvec4";
-
-       const GLchar* copy                               = copy_regular;
-       const GLchar* format                     = format_rgba32f;
-       const GLchar* image                              = image_vec4;
-       const GLchar* type                               = type_vec4;
-       const GLchar* src_coord_offset   = "0";
-       const GLchar* dst_coord_offset   = "0";
-
-       std::stringstream coord_offset_stream;
-       coord_offset_stream << coord_offset;
-       std::string coord_offset_str = coord_offset_stream.str();
-
-       if (version == SOURCE_INVALID)
-               src_coord_offset = coord_offset_str.c_str();
-       else if (version == DESTINATION_INVALID)
-               dst_coord_offset = coord_offset_str.c_str();
-
-       switch (m_test_case)
-       {
-       case RGBA32F:
-               format = format_rgba32f;
-               break;
-       case R32UI_MIPMAP:
-               format = format_r32ui;
-               image  = image_uvec4;
-               type   = type_uvec4;
-               break;
-       default:
-               TCU_FAIL("Invalid enum");
-       };
-
-       size_t          position = 0;
-       std::string source   = template_code;
-
-       replaceToken("FORMAT", position, format, source);
-       replaceToken("IMAGE", position, image, source);
-       replaceToken("FORMAT", position, format, source);
-       replaceToken("IMAGE", position, image, source);
-       replaceToken("COORD_OFFSET", position, dst_coord_offset, source);
-       replaceToken("COORD_OFFSET", position, src_coord_offset, source);
-
-       size_t temp_position = position;
-       replaceToken("COPY", position, copy, source);
-       position = temp_position;
-
-       switch (m_test_case)
-       {
-       case RGBA32F:
-       case R32UI_MIPMAP:
-               replaceToken("TYPE", position, type, source);
-               break;
-       default:
-               TCU_FAIL("Invalid enum");
-       }
-
-       return source;
-}
-
-/** Set textures as images
- *
- * @param id_destination Id of texture used as destination
- * @param id_source      Id of texture used as source
- **/
-void ImageLoadStoreTest::setTextures(glw::GLuint id_destination, glw::GLuint id_source)
-{
-       const Functions& gl = m_context.getRenderContext().getFunctions();
-
-       GLenum format = 0;
-       GLint  level  = 0;
-
-       switch (m_test_case)
-       {
-       case RGBA32F:
-               format = GL_RGBA32F;
-               break;
-       case R32UI_MIPMAP:
-               format = GL_R32UI;
-               level  = 1;
-               break;
-       default:
-               TCU_FAIL("Invalid enum");
-       }
-
-       gl.bindImageTexture(0 /* unit */, id_source, level, GL_FALSE /* layered */, 0 /* layer */, GL_READ_ONLY, format);
-       GLU_EXPECT_NO_ERROR(gl.getError(), "BindImageTexture");
-
-       gl.bindImageTexture(1 /* unit */, id_destination, level, GL_FALSE /* layered */, 0 /* layer */, GL_WRITE_ONLY,
-                                               format);
-       GLU_EXPECT_NO_ERROR(gl.getError(), "BindImageTexture");
-}
-
-/** No verification because of undefined out-of-bound behavior in OpenGL ES
- *
- * @param texture_id Id of texture
- *
- * @return true
- **/
-bool ImageLoadStoreTest::verifyInvalidResults(glw::GLuint texture_id)
-{
-       (void)texture_id;
-       return true;
-}
-
-/** Verifies that texutre is filled with increasing values
- *
- * @param texture_id Id of texture
- *
- * @return true when image is filled with increasing values, false otherwise
- **/
-bool ImageLoadStoreTest::verifyValidResults(glw::GLuint texture_id)
-{
-       static const GLuint height   = 16;
-       static const GLuint width       = 16;
-       static const GLuint n_pixels = height * width;
-
-       const Functions& gl = m_context.getRenderContext().getFunctions();
-       gl.memoryBarrier(GL_SHADER_IMAGE_ACCESS_BARRIER_BIT);
-       GLU_EXPECT_NO_ERROR(gl.getError(), "MemoryBarrier");
-
-       bool result = true;
-
-       if (RGBA32F == m_test_case)
-       {
-               static const GLuint n_channels = 4;
-
-               Texture::Bind(gl, texture_id, GL_TEXTURE_2D);
-
-               std::vector<GLfloat> pixels;
-               pixels.resize(n_pixels * n_channels);
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       pixels[i * n_channels + 0] = (GLfloat)i / (GLfloat)n_pixels;
-                       pixels[i * n_channels + 1] = (GLfloat)i / (GLfloat)n_pixels;
-                       pixels[i * n_channels + 2] = (GLfloat)i / (GLfloat)n_pixels;
-                       pixels[i * n_channels + 3] = (GLfloat)i / (GLfloat)n_pixels;
-               }
-
-               Texture::GetData(gl, texture_id, 0 /* level */, width, height, GL_RGBA, GL_FLOAT, &pixels[0]);
-
-               /* Unbind */
-               Texture::Bind(gl, 0, GL_TEXTURE_2D);
-
-               /* Verify */
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       const GLfloat expected_red   = (GLfloat)(i % 16) / 16.0f;
-                       const GLfloat expected_green = (GLfloat)(i / 16) / 16.0f;
-                       const GLfloat expected_blue  = (GLfloat)i / 256.0f;
-                       const GLfloat expected_alpha = 1.0f;
-                       const GLfloat drawn_red          = pixels[i * n_channels + 0];
-                       const GLfloat drawn_green       = pixels[i * n_channels + 1];
-                       const GLfloat drawn_blue         = pixels[i * n_channels + 2];
-                       const GLfloat drawn_alpha       = pixels[i * n_channels + 3];
-
-                       if ((expected_red != drawn_red) || (expected_green != drawn_green) || (expected_blue != drawn_blue) ||
-                               (expected_alpha != drawn_alpha))
-                       {
-                               m_context.getTestContext().getLog()
-                                       << tcu::TestLog::Message << "Invalid value: " << drawn_red << ", " << drawn_green << ", "
-                                       << drawn_blue << ", " << drawn_alpha << ". Expected value: " << expected_red << ", "
-                                       << expected_green << ", " << expected_blue << ", " << expected_alpha << ". At offset: " << i
-                                       << tcu::TestLog::EndMessage;
-
-                               result = false;
-                               break;
-                       }
-               }
-       }
-       else if (R32UI_MIPMAP == m_test_case)
-       {
-               static const GLuint n_channels = 4;
-
-               Texture::Bind(gl, texture_id, GL_TEXTURE_2D);
-
-               std::vector<GLuint> pixels;
-               pixels.resize(n_pixels * n_channels);
-               for (GLuint i = 0; i < n_pixels * n_channels; ++i)
-               {
-                       pixels[i] = 0;
-               }
-
-               Texture::GetData(gl, texture_id, 1 /* level */, width, height, GL_RGBA_INTEGER, GL_UNSIGNED_INT, &pixels[0]);
-
-               /* Unbind */
-               Texture::Bind(gl, 0, GL_TEXTURE_2D);
-
-               /* Verify */
-               for (GLuint i = 0; i < n_pixels; ++i)
-               {
-                       const GLuint expected_red = i;
-                       const GLuint drawn_red  = pixels[i * n_channels];
-
-                       if (expected_red != drawn_red)
-                       {
-                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Invalid value: " << drawn_red
-                                                                                                       << ". Expected value: " << expected_red << " at offset: " << i
-                                                                                                       << tcu::TestLog::EndMessage;
-
-                               result = false;
-                               break;
-                       }
-               }
-       }
-
-       return result;
-}
-
-/** Constructor
- *
- * @param context Test context
- **/
-StorageBufferTest::StorageBufferTest(deqp::Context& context)
-       : deqp::RobustBufferAccessBehavior::StorageBufferTest(
-                 context, "storage_buffer", "Verifies that out-of-bound access to SSBO results with no error")
-{
-       /* Nothing to be done here */
-}
-
-/** Prepare shader for current test case
- *
- * @return Source
- **/
-std::string StorageBufferTest::getComputeShader(glw::GLuint offset)
-{
-       static const GLchar* cs = "#version 320 es\n"
-                                                         "\n"
-                                                         "layout (local_size_x = 4, local_size_y = 1, local_size_z = 1) in;\n"
-                                                         "\n"
-                                                         "layout (binding = 1) buffer Source {\n"
-                                                         "    float data[];\n"
-                                                         "} source;\n"
-                                                         "\n"
-                                                         "layout (binding = 0) buffer Destination {\n"
-                                                         "    float data[];\n"
-                                                         "} destination;\n"
-                                                         "\n"
-                                                         "void main()\n"
-                                                         "{\n"
-                                                         "    uint index_destination = gl_LocalInvocationID.x + OFFSETU;\n"
-                                                         "    uint index_source      = gl_LocalInvocationID.x + OFFSETU;\n"
-                                                         "\n"
-                                                         "    destination.data[index_destination] = source.data[index_source];\n"
-                                                         "}\n"
-                                                         "\n";
-
-       std::string   destination_offset("0");
-       std::string   source_offset("0");
-       size_t            position = 0;
-       std::string   source   = cs;
-
-       std::stringstream offset_stream;
-       offset_stream << offset;
-
-       if (m_test_case == SOURCE_INVALID)
-               source_offset = offset_stream.str();
-       else if (m_test_case == DESTINATION_INVALID)
-               destination_offset = offset_stream.str();
-
-       replaceToken("OFFSET", position, destination_offset.c_str(), source);
-       replaceToken("OFFSET", position, source_offset.c_str(), source);
-
-       return source;
-}
-
-/** Verify test case results
- *
- * @param buffer_data Buffer data to verify
- *
- * @return true if buffer_data is as expected, false othrewise
- **/
-bool StorageBufferTest::verifyResults(GLfloat* buffer_data)
-{
-       static const GLfloat expected_data_valid[4]                               = { 2.0f, 3.0f, 4.0f, 5.0f };
-       static const GLfloat expected_data_invalid_destination[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
-       static const GLfloat expected_data_invalid_source[4]      = { 0.0f, 0.0f, 0.0f, 0.0f };
-
-       int size = sizeof(GLfloat) * 4;
-
-       /* Prepare expected data const for proper case*/
-       const GLfloat* expected_data = 0;
-       const GLchar*  name                      = 0;
-       switch (m_test_case)
-       {
-       case VALID:
-               expected_data = expected_data_valid;
-               name              = "valid indices";
-               break;
-       case SOURCE_INVALID:
-               expected_data = expected_data_invalid_source;
-               name              = "invalid source indices";
-               break;
-       case DESTINATION_INVALID:
-               expected_data = expected_data_invalid_destination;
-               name              = "invalid destination indices";
-               break;
-       default:
-               TCU_FAIL("Invalid enum");
-       }
-
-       /* Verify buffer data */
-       if (m_test_case == VALID && memcmp(expected_data, buffer_data, size) != 0)
-       {
-               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Test case: " << name << " failed"
-                                                                                       << tcu::TestLog::EndMessage;
-               return false;
-       }
-
-       return true;
-}
-
-/** Constructor
- *
- * @param context Test context
- **/
-UniformBufferTest::UniformBufferTest(deqp::Context& context)
-       : deqp::RobustBufferAccessBehavior::UniformBufferTest(
-                 context, "uniform_buffer", "Verifies that out-of-bound access to UBO resutls with no error")
-{
-       /* Nothing to be done here */
-}
-
-/** Prepare shader for current test case
- *
- * @return Source
- **/
-std::string UniformBufferTest::getComputeShader(GLuint offset)
-{
-       static const GLchar* cs = "#version 320 es\n"
-                                                         "\n"
-                                                         "layout (local_size_x = 4, local_size_y = 1, local_size_z = 1) in;\n"
-                                                         "\n"
-                                                         "layout (binding = 0, std140) uniform Source {\n"
-                                                         "    float data[16];\n"
-                                                         "} source;\n"
-                                                         "\n"
-                                                         "layout (binding = 0, std430) buffer Destination {\n"
-                                                         "    float data[];\n"
-                                                         "} destination;\n"
-                                                         "\n"
-                                                         "void main()\n"
-                                                         "{\n"
-                                                         "    uint index_destination = gl_LocalInvocationID.x + OFFSETU;\n"
-                                                         "    uint index_source      = gl_LocalInvocationID.x + OFFSETU;\n"
-                                                         "\n"
-                                                         "    destination.data[index_destination] = source.data[index_source];\n"
-                                                         "}\n"
-                                                         "\n";
-
-       const GLchar* destination_offset = "0";
-       std::string   source_offset("0");
-       size_t            position = 0;
-       std::string   source   = cs;
-
-       std::stringstream offset_stream;
-       offset_stream << offset;
-
-       if (m_test_case == SOURCE_INVALID)
-               source_offset = offset_stream.str();
-
-       replaceToken("OFFSET", position, destination_offset, source);
-       replaceToken("OFFSET", position, source_offset.c_str(), source);
-
-       return source;
-}
-
-} /* RobustBufferAccessBehavior */
-
-/** Constructor.
- *
- *  @param context Rendering context.
- **/
-RobustBufferAccessBehaviorTests::RobustBufferAccessBehaviorTests(deqp::Context& context)
-       : deqp::RobustBufferAccessBehaviorTests(context)
-{
-       /* Left blank on purpose */
-}
-
-/** Initializes a multi_bind test group.
- *
- **/
-void RobustBufferAccessBehaviorTests::init(void)
-{
-       addChild(new RobustBufferAccessBehavior::VertexBufferObjectsTest(m_context));
-       addChild(new RobustBufferAccessBehavior::TexelFetchTest(m_context));
-       addChild(new RobustBufferAccessBehavior::ImageLoadStoreTest(m_context));
-       addChild(new RobustBufferAccessBehavior::StorageBufferTest(m_context));
-       addChild(new RobustBufferAccessBehavior::UniformBufferTest(m_context));
-}
-
-} /* es32cts namespace */
diff --git a/external/openglcts/modules/gles32/es32cRobustBufferAccessBehaviorTests.hpp b/external/openglcts/modules/gles32/es32cRobustBufferAccessBehaviorTests.hpp
deleted file mode 100644 (file)
index 31601e6..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-#ifndef _ES32CROBUSTBUFFERACCESSBEHAVIORTESTS_HPP
-#define _ES32CROBUSTBUFFERACCESSBEHAVIORTESTS_HPP
-/*-------------------------------------------------------------------------
- * OpenGL Conformance Test Suite
- * -----------------------------
- *
- * Copyright (c) 2016 The Khronos Group Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */ /*!
- * \file  es32cRobustBufferAccessBehaviorTests.hpp
- * \brief Declares test classes for "Robust Buffer Access Behavior" functionality.
- */ /*-------------------------------------------------------------------*/
-
-#include "glcRobustBufferAccessBehaviorTests.hpp"
-#include "glcTestCase.hpp"
-#include "glwDefs.hpp"
-#include "glwEnums.hpp"
-
-namespace es32cts
-{
-namespace RobustBufferAccessBehavior
-{
-/** Implementation of test VertexBufferObjects. Description follows:
- *
- * This test verifies that any "out-of-bound" read from vertex buffer result in
- * abnormal program exit.
- **/
-class VertexBufferObjectsTest : public deqp::RobustBufferAccessBehavior::VertexBufferObjectsTest
-{
-public:
-       /* Public methods */
-       VertexBufferObjectsTest(deqp::Context& context);
-       virtual ~VertexBufferObjectsTest()
-       {
-       }
-
-protected:
-       /* Protected methods */
-       std::string getFragmentShader();
-       std::string getVertexShader();
-       bool verifyInvalidResults(glw::GLuint texture_id);
-       bool verifyResults(glw::GLuint texture_id);
-};
-
-/** Implementation of test TexelFetch. Description follows:
- *
- * This test verifies that any "out-of-bound" fetch from texture result in
- * abnormal program exit.
- **/
-class TexelFetchTest : public deqp::RobustBufferAccessBehavior::TexelFetchTest
-{
-public:
-       /* Public methods */
-       TexelFetchTest(deqp::Context& context);
-       TexelFetchTest(deqp::Context& context, const glw::GLchar* name, const glw::GLchar* description);
-       virtual ~TexelFetchTest()
-       {
-       }
-
-protected:
-       /* Protected methods */
-       void prepareTexture(bool is_source, glw::GLuint texture_id);
-
-protected:
-       /* Protected methods */
-       std::string getGeometryShader();
-       std::string getVertexShader();
-       bool verifyInvalidResults(glw::GLuint texture_id);
-       bool verifyValidResults(glw::GLuint texture_id);
-};
-
-/** Implementation of test ImageLoadStore. Description follows:
- *
- * This test verifies that any "out-of-bound" access to image result in abnormal program exit.
- **/
-class ImageLoadStoreTest : public TexelFetchTest
-{
-public:
-       /* Public methods */
-       ImageLoadStoreTest(deqp::Context& context);
-       virtual ~ImageLoadStoreTest()
-       {
-       }
-
-       /* Public methods inherited from TestCase */
-       virtual tcu::TestNode::IterateResult iterate(void);
-
-protected:
-       /* Protected methods */
-       std::string getComputeShader(VERSION version, glw::GLuint coord_offset = 0);
-       void setTextures(glw::GLuint id_destination, glw::GLuint id_source);
-       bool verifyInvalidResults(glw::GLuint texture_id);
-       bool verifyValidResults(glw::GLuint texture_id);
-};
-
-/** Implementation of test StorageBuffer. Description follows:
- *
- * This test verifies that any "out-of-bound" access to buffer result in abnormal program exit.
- **/
-class StorageBufferTest : public deqp::RobustBufferAccessBehavior::StorageBufferTest
-{
-public:
-       /* Public methods */
-       StorageBufferTest(deqp::Context& context);
-       virtual ~StorageBufferTest()
-       {
-       }
-
-protected:
-       /* Protected methods */
-       std::string getComputeShader(glw::GLuint offset);
-       bool verifyResults(glw::GLfloat* buffer_data);
-};
-
-/** Implementation of test UniformBuffer. Description follows:
- *
- * This test verifies that any "out-of-bound" read from uniform buffer result
- * in abnormal program exit.
- **/
-class UniformBufferTest : public deqp::RobustBufferAccessBehavior::UniformBufferTest
-{
-public:
-       /* Public methods */
-       UniformBufferTest(deqp::Context& context);
-       virtual ~UniformBufferTest()
-       {
-       }
-
-protected:
-       /* Protected methods */
-       std::string getComputeShader(glw::GLuint offset);
-};
-
-} /* RobustBufferAccessBehavior */
-
-/** Group class for multi bind conformance tests */
-class RobustBufferAccessBehaviorTests : public deqp::RobustBufferAccessBehaviorTests
-{
-public:
-       /* Public methods */
-       RobustBufferAccessBehaviorTests(deqp::Context& context);
-       virtual ~RobustBufferAccessBehaviorTests(void)
-       {
-       }
-
-       virtual void init(void);
-
-private:
-       /* Private methods */
-       RobustBufferAccessBehaviorTests(const RobustBufferAccessBehaviorTests& other);
-       RobustBufferAccessBehaviorTests& operator=(const RobustBufferAccessBehaviorTests& other);
-};
-
-} /* es32cts */
-
-#endif // _ES32CROBUSTBUFFERACCESSBEHAVIORTESTS_HPP
index ad0bf99..32bf289 100644 (file)
@@ -24,7 +24,6 @@
 
 #include "es32cTestPackage.hpp"
 #include "es32cCopyImageTests.hpp"
-#include "es32cRobustBufferAccessBehaviorTests.hpp"
 #include "esextcTestPackage.hpp"
 #include "glcFragDepthTests.hpp"
 #include "glcInfoTests.hpp"
@@ -163,9 +162,6 @@ void ES32TestPackage::init(void)
                coreGroup->addChild(new glcts::SeparableProgramsTransformFeedbackTests(getContext()));
                coreGroup->addChild(new glcts::CopyImageTests(getContext()));
                addChild(coreGroup);
-               tcu::TestCaseGroup* robustGroup = new tcu::TestCaseGroup(getTestContext(), "robust", "");
-               robustGroup->addChild(new es32cts::RobustBufferAccessBehaviorTests(getContext()));
-               addChild(robustGroup);
        }
        catch (...)
        {
index c1281dc..d74d9c9 100644 (file)
@@ -24,6 +24,7 @@ const char* mustpassDir = "gl_cts/data/mustpass/gl/khronos_mustpass_noctx/4.6.0.
 static const RunParams khronos_mustpass_gl_nocontext_first_cfg[] = {
        { glu::ApiType::core(3, 0), "khr-master", DE_NULL, "unspecified", 1, DE_NULL, 64, 64 },
        { glu::ApiType::core(4, 0), "khr-master", DE_NULL, "unspecified", 1, DE_NULL, 64, 64 },
+       { glu::ApiType::core(4, 3), "khr-master", DE_NULL, "unspecified", 1, DE_NULL, 64, 64 },
        { glu::ApiType::core(4, 5), "khr-master", DE_NULL, "unspecified", 1, DE_NULL, 64, 64 },
 };
 
index 828b2cc..35710b9 100644 (file)
@@ -77,6 +77,7 @@ MODULES = [
        Module("GTF-GL30",              "GL30"),
        Module("KHR-NOCTX-GL30","GL30"),
        Module("KHR-NOCTX-GL40","GL40"),
+       Module("KHR-NOCTX-GL43","GL43"),
        Module("KHR-NOCTX-GL45","GL45"),
 ]
 GLCTS_BIN_NAME = "glcts"
@@ -103,7 +104,7 @@ def getModulesPath (buildCfg):
 
 def getCaseListFileName (module, caseListType):
        mname = module.name
-       if mname == "KHR-NOCTX-ES2" or mname == "KHR-NOCTX-ES32" or mname == "KHR-NOCTX-GL30" or mname == "KHR-NOCTX-GL40" or mname == "KHR-NOCTX-GL45":
+       if mname == "KHR-NOCTX-ES2" or mname == "KHR-NOCTX-ES32" or mname == "KHR-NOCTX-GL30" or mname == "KHR-NOCTX-GL40" or mname == "KHR-NOCTX-GL43" or mname == "KHR-NOCTX-GL45":
                mname =  "KHR-NoContext"
        return "%s-cases.%s" % (mname, caseListType)
 
index 5ccd336..4dc15d2 100644 (file)
@@ -1014,6 +1014,7 @@ GL_MODULES                                                        = OrderedDict([
 
 NOCTX_GL30_KHR_MODULE                  = getModuleByName("KHR-NOCTX-GL30")
 NOCTX_GL40_KHR_MODULE                  = getModuleByName("KHR-NOCTX-GL40")
+NOCTX_GL43_KHR_MODULE                  = getModuleByName("KHR-NOCTX-GL43")
 NOCTX_GL45_KHR_MODULE                  = getModuleByName("KHR-NOCTX-GL45")
 
 GLCTS_NOCTX_GL30_KHR_PKG                       = Package(module = NOCTX_GL30_KHR_MODULE, configurations = [
@@ -1034,6 +1035,15 @@ GLCTS_NOCTX_GL40_KHR_PKG                 = Package(module = NOCTX_GL40_KHR_MODULE, configurati
                                        filters                 = [include("gl40-khr-master.txt")]),
        ])
 
+GLCTS_NOCTX_GL43_KHR_PKG                       = Package(module = NOCTX_GL43_KHR_MODULE, configurations = [
+               # Master
+               Configuration(name                      = "khr-master",
+                                       surfacewidth    = "64",
+                                       surfaceheight   = "64",
+                                       baseseed                = "1",
+                                       filters                 = [include("gl43-khr-master.txt")]),
+       ])
+
 GLCTS_NOCTX_GL45_KHR_PKG                       = Package(module = NOCTX_GL45_KHR_MODULE, configurations = [
                # Master
                Configuration(name                      = "khr-master",
@@ -1070,7 +1080,7 @@ def generateGLMustpass():
                        gl_packages.append(pkg1)
 
                mustpass = [Mustpass(project = GL_CTS_KHR_MP_PROJECT, version = "4.6.0.x", isCurrent=True, packages = gl_packages),
-                                       Mustpass(project = GL_CTS_NOCTX_PROJECT, version = "4.6.0.x", isCurrent=True, packages = [GLCTS_NOCTX_GL30_KHR_PKG, GLCTS_NOCTX_GL40_KHR_PKG, GLCTS_NOCTX_GL45_KHR_PKG]),
+                                       Mustpass(project = GL_CTS_NOCTX_PROJECT, version = "4.6.0.x", isCurrent=True, packages = [GLCTS_NOCTX_GL30_KHR_PKG, GLCTS_NOCTX_GL40_KHR_PKG, GLCTS_NOCTX_GL43_KHR_PKG, GLCTS_NOCTX_GL45_KHR_PKG]),
                                        ]
                return mustpass