From: Piotr Byszewski Date: Thu, 28 Jul 2022 18:09:31 +0000 (+0200) Subject: Add coverage for MaxAtomicCounterBufferSize X-Git-Tag: upstream/1.3.5~202 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7a85882fa6d968f2d8d575ceb671599bd55f72e3;p=platform%2Fupstream%2FVK-GL-CTS.git Add coverage for MaxAtomicCounterBufferSize Test if placing an atomic counter into a buffer at such an offset that the buffer is too large results in a compilation error. Components: OpenGL VK-GL-CTS issue: 3124 Affects: KHR-GL42.shader_atomic_counters.negative-large-offset KHR-GLES31.core.shader_atomic_counters.negative-large-offset Change-Id: Ib1ea21f2c1035d0a86ab2d4b3e4260756c88bfba --- diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl42-master.txt b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl42-master.txt index 602b9fc..49de8ac 100644 --- a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl42-master.txt +++ b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl42-master.txt @@ -5413,6 +5413,7 @@ KHR-GL42.shader_atomic_counters.negative-ubo KHR-GL42.shader_atomic_counters.negative-uniform KHR-GL42.shader_atomic_counters.negative-array KHR-GL42.shader_atomic_counters.negative-arithmetic +KHR-GL42.shader_atomic_counters.negative-large-offset KHR-GL42.shader_image_load_store.basic-api-get KHR-GL42.shader_image_load_store.basic-api-bind KHR-GL42.shader_image_load_store.basic-api-barrier diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl43-master.txt b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl43-master.txt index bf50fb7..c2bb1cd 100644 --- a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl43-master.txt +++ b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl43-master.txt @@ -5413,6 +5413,7 @@ KHR-GL43.shader_atomic_counters.negative-ubo KHR-GL43.shader_atomic_counters.negative-uniform KHR-GL43.shader_atomic_counters.negative-array KHR-GL43.shader_atomic_counters.negative-arithmetic +KHR-GL43.shader_atomic_counters.negative-large-offset KHR-GL43.shader_image_load_store.basic-api-get KHR-GL43.shader_image_load_store.basic-api-bind KHR-GL43.shader_image_load_store.basic-api-barrier diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl44-master.txt b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl44-master.txt index b65e276..797029d 100644 --- a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl44-master.txt +++ b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl44-master.txt @@ -5413,6 +5413,7 @@ KHR-GL44.shader_atomic_counters.negative-ubo KHR-GL44.shader_atomic_counters.negative-uniform KHR-GL44.shader_atomic_counters.negative-array KHR-GL44.shader_atomic_counters.negative-arithmetic +KHR-GL44.shader_atomic_counters.negative-large-offset KHR-GL44.shader_image_load_store.basic-api-get KHR-GL44.shader_image_load_store.basic-api-bind KHR-GL44.shader_image_load_store.basic-api-barrier diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl45-master.txt b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl45-master.txt index 174b1d2..3493268 100644 --- a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl45-master.txt +++ b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl45-master.txt @@ -5413,6 +5413,7 @@ KHR-GL45.shader_atomic_counters.negative-ubo KHR-GL45.shader_atomic_counters.negative-uniform KHR-GL45.shader_atomic_counters.negative-array KHR-GL45.shader_atomic_counters.negative-arithmetic +KHR-GL45.shader_atomic_counters.negative-large-offset KHR-GL45.shader_atomic_counters.negative-unsized-array KHR-GL45.shader_image_load_store.basic-api-get KHR-GL45.shader_image_load_store.basic-api-bind diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl46-master.txt b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl46-master.txt index 0f36a95..30b8797 100644 --- a/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl46-master.txt +++ b/external/openglcts/data/mustpass/gl/khronos_mustpass/4.6.1.x/gl46-master.txt @@ -5413,6 +5413,7 @@ KHR-GL46.shader_atomic_counters.negative-ubo KHR-GL46.shader_atomic_counters.negative-uniform KHR-GL46.shader_atomic_counters.negative-array KHR-GL46.shader_atomic_counters.negative-arithmetic +KHR-GL46.shader_atomic_counters.negative-large-offset KHR-GL46.shader_atomic_counters.negative-unsized-array KHR-GL46.shader_image_load_store.basic-api-get KHR-GL46.shader_image_load_store.basic-api-bind diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl42-master.txt b/external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl42-master.txt index 602b9fc..49de8ac 100644 --- a/external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl42-master.txt +++ b/external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl42-master.txt @@ -5413,6 +5413,7 @@ KHR-GL42.shader_atomic_counters.negative-ubo KHR-GL42.shader_atomic_counters.negative-uniform KHR-GL42.shader_atomic_counters.negative-array KHR-GL42.shader_atomic_counters.negative-arithmetic +KHR-GL42.shader_atomic_counters.negative-large-offset KHR-GL42.shader_image_load_store.basic-api-get KHR-GL42.shader_image_load_store.basic-api-bind KHR-GL42.shader_image_load_store.basic-api-barrier diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl43-master.txt b/external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl43-master.txt index bf50fb7..c2bb1cd 100644 --- a/external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl43-master.txt +++ b/external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl43-master.txt @@ -5413,6 +5413,7 @@ KHR-GL43.shader_atomic_counters.negative-ubo KHR-GL43.shader_atomic_counters.negative-uniform KHR-GL43.shader_atomic_counters.negative-array KHR-GL43.shader_atomic_counters.negative-arithmetic +KHR-GL43.shader_atomic_counters.negative-large-offset KHR-GL43.shader_image_load_store.basic-api-get KHR-GL43.shader_image_load_store.basic-api-bind KHR-GL43.shader_image_load_store.basic-api-barrier diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl44-master.txt b/external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl44-master.txt index b65e276..797029d 100644 --- a/external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl44-master.txt +++ b/external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl44-master.txt @@ -5413,6 +5413,7 @@ KHR-GL44.shader_atomic_counters.negative-ubo KHR-GL44.shader_atomic_counters.negative-uniform KHR-GL44.shader_atomic_counters.negative-array KHR-GL44.shader_atomic_counters.negative-arithmetic +KHR-GL44.shader_atomic_counters.negative-large-offset KHR-GL44.shader_image_load_store.basic-api-get KHR-GL44.shader_image_load_store.basic-api-bind KHR-GL44.shader_image_load_store.basic-api-barrier diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl45-master.txt b/external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl45-master.txt index 174b1d2..3493268 100644 --- a/external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl45-master.txt +++ b/external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl45-master.txt @@ -5413,6 +5413,7 @@ KHR-GL45.shader_atomic_counters.negative-ubo KHR-GL45.shader_atomic_counters.negative-uniform KHR-GL45.shader_atomic_counters.negative-array KHR-GL45.shader_atomic_counters.negative-arithmetic +KHR-GL45.shader_atomic_counters.negative-large-offset KHR-GL45.shader_atomic_counters.negative-unsized-array KHR-GL45.shader_image_load_store.basic-api-get KHR-GL45.shader_image_load_store.basic-api-bind diff --git a/external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl46-master.txt b/external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl46-master.txt index 0f36a95..30b8797 100644 --- a/external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl46-master.txt +++ b/external/openglcts/data/mustpass/gl/khronos_mustpass/main/gl46-master.txt @@ -5413,6 +5413,7 @@ KHR-GL46.shader_atomic_counters.negative-ubo KHR-GL46.shader_atomic_counters.negative-uniform KHR-GL46.shader_atomic_counters.negative-array KHR-GL46.shader_atomic_counters.negative-arithmetic +KHR-GL46.shader_atomic_counters.negative-large-offset KHR-GL46.shader_atomic_counters.negative-unsized-array KHR-GL46.shader_image_load_store.basic-api-get KHR-GL46.shader_image_load_store.basic-api-bind diff --git a/external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.5.x/gles31-khr-master.txt b/external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.5.x/gles31-khr-master.txt index 170bb02..5246f5b 100644 --- a/external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.5.x/gles31-khr-master.txt +++ b/external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.5.x/gles31-khr-master.txt @@ -86,6 +86,7 @@ KHR-GLES31.core.shader_atomic_counters.negative-ubo KHR-GLES31.core.shader_atomic_counters.negative-uniform KHR-GLES31.core.shader_atomic_counters.negative-array KHR-GLES31.core.shader_atomic_counters.negative-arithmetic +KHR-GLES31.core.shader_atomic_counters.negative-large-offset KHR-GLES31.core.shader_atomic_counters.negative-unsized-array KHR-GLES31.core.texture_gather.api-enums KHR-GLES31.core.texture_gather.gather-glsl-compile diff --git a/external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.6.x/gles31-khr-master.txt b/external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.6.x/gles31-khr-master.txt index 170bb02..5246f5b 100644 --- a/external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.6.x/gles31-khr-master.txt +++ b/external/openglcts/data/mustpass/gles/khronos_mustpass/3.2.6.x/gles31-khr-master.txt @@ -86,6 +86,7 @@ KHR-GLES31.core.shader_atomic_counters.negative-ubo KHR-GLES31.core.shader_atomic_counters.negative-uniform KHR-GLES31.core.shader_atomic_counters.negative-array KHR-GLES31.core.shader_atomic_counters.negative-arithmetic +KHR-GLES31.core.shader_atomic_counters.negative-large-offset KHR-GLES31.core.shader_atomic_counters.negative-unsized-array KHR-GLES31.core.texture_gather.api-enums KHR-GLES31.core.texture_gather.gather-glsl-compile diff --git a/external/openglcts/data/mustpass/gles/khronos_mustpass/main/gles31-khr-master.txt b/external/openglcts/data/mustpass/gles/khronos_mustpass/main/gles31-khr-master.txt index 170bb02..5246f5b 100644 --- a/external/openglcts/data/mustpass/gles/khronos_mustpass/main/gles31-khr-master.txt +++ b/external/openglcts/data/mustpass/gles/khronos_mustpass/main/gles31-khr-master.txt @@ -86,6 +86,7 @@ KHR-GLES31.core.shader_atomic_counters.negative-ubo KHR-GLES31.core.shader_atomic_counters.negative-uniform KHR-GLES31.core.shader_atomic_counters.negative-array KHR-GLES31.core.shader_atomic_counters.negative-arithmetic +KHR-GLES31.core.shader_atomic_counters.negative-large-offset KHR-GLES31.core.shader_atomic_counters.negative-unsized-array KHR-GLES31.core.texture_gather.api-enums KHR-GLES31.core.texture_gather.gather-glsl-compile diff --git a/external/openglcts/modules/gl/gl4cShaderAtomicCountersTests.cpp b/external/openglcts/modules/gl/gl4cShaderAtomicCountersTests.cpp index 6bc07f2..28bbbd0 100644 --- a/external/openglcts/modules/gl/gl4cShaderAtomicCountersTests.cpp +++ b/external/openglcts/modules/gl/gl4cShaderAtomicCountersTests.cpp @@ -4166,7 +4166,6 @@ class NegativeArithmetic : public SACSubcaseBase virtual long Run() { - // create program const char* glsl_vs = "#version 420 core" NL "layout(location = 0) in vec4 i_vertex;" NL "void main() {" NL " gl_Position = i_vertex;" NL "}"; @@ -4219,6 +4218,55 @@ class NegativeArithmetic : public SACSubcaseBase } }; +class NegativeLargeOffset : public SACSubcaseBase +{ + virtual std::string Title() + { + return NL "GLSL errors"; + } + + virtual std::string Purpose() + { + return NL "Verify that it is compile-time error to declare an atomic counter whose offset \n" + "is such that the buffer containing it would be larger than MaxAtomicCounterBufferSiz."; + } + + virtual long Run() + { + GLint maxSize; + glGetIntegerv(GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE, &maxSize); + + std::ostringstream os; + os << "#version 420 core" NL "layout(location = 0) out uvec4 o_color;" NL + "layout(binding = 0, offset = " << maxSize << ") uniform atomic_uint ac_counter_fs;" NL + "void main() {" NL " o_color = uvec4(atomicCounterIncrement(ac_counter_fs)); " NL " }"; + std::string source = os.str(); + const char* glsl_fs = source.c_str(); + + GLuint sh = glCreateShader(GL_FRAGMENT_SHADER); + glShaderSource(sh, 1, &glsl_fs, NULL); + glCompileShader(sh); + GLint status_comp; + glGetShaderiv(sh, GL_COMPILE_STATUS, &status_comp); + glDeleteShader(sh); + + if (status_comp == GL_TRUE) + { + m_context.getTestContext().getLog() + << tcu::TestLog::Message << "Expected error during fragment shader compilation." + << tcu::TestLog::EndMessage; + return ERROR; + } + + return NO_ERROR; + } + + virtual long Cleanup() + { + return NO_ERROR; + } +}; + class AdvancedManyDrawCalls2 : public SACSubcaseBase { @@ -4606,6 +4654,7 @@ void ShaderAtomicCountersTests::init() addChild(new TestSubcase(m_context, "negative-uniform", TestSubcase::Create)); addChild(new TestSubcase(m_context, "negative-array", TestSubcase::Create)); addChild(new TestSubcase(m_context, "negative-arithmetic", TestSubcase::Create)); + addChild(new TestSubcase(m_context, "negative-large-offset", TestSubcase::Create)); if(contextSupports(m_context.getRenderContext().getType(), glu::ApiType::core(4, 5))) addChild(new TestSubcase(m_context, "negative-unsized-array", TestSubcase::Create)); diff --git a/external/openglcts/modules/gles31/es31cShaderAtomicCountersTests.cpp b/external/openglcts/modules/gles31/es31cShaderAtomicCountersTests.cpp index 852e179..155c89f 100644 --- a/external/openglcts/modules/gles31/es31cShaderAtomicCountersTests.cpp +++ b/external/openglcts/modules/gles31/es31cShaderAtomicCountersTests.cpp @@ -3602,7 +3602,7 @@ class NegativeUnsizedArray : public SACSubcaseBase virtual std::string Purpose() { - return NL "Verify that it is compile-time error to declare an unsized array of atomic_uint.."; + return NL "Verify that it is compile-time error to declare an unsized array of atomic_uint."; } virtual std::string Method() @@ -3640,6 +3640,50 @@ class NegativeUnsizedArray : public SACSubcaseBase } }; +class NegativeLargeOffset : public SACSubcaseBase +{ + virtual std::string Title() + { + return NL "GLSL errors"; + } + + virtual std::string Purpose() + { + return NL "Verify that it is compile-time error to declare an atomic counter whose offset \n" + "is such that the buffer containing it would be larger than MaxAtomicCounterBufferSiz."; + } + + virtual long Run() + { + GLint maxSize; + glGetIntegerv(GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE, &maxSize); + + std::ostringstream os; + os << "#version 310 es" NL "layout(location = 0) out uvec4 o_color;" NL + "layout(binding = 0, offset = " << maxSize << ") uniform atomic_uint ac_counter_fs;" NL + "void main() {" NL " o_color = uvec4(atomicCounterIncrement(ac_counter_fs)); " NL " }"; + std::string source = os.str(); + const char* glsl_fs = source.c_str(); + + GLuint sh = glCreateShader(GL_FRAGMENT_SHADER); + glShaderSource(sh, 1, &glsl_fs, NULL); + glCompileShader(sh); + GLint status_comp; + glGetShaderiv(sh, GL_COMPILE_STATUS, &status_comp); + glDeleteShader(sh); + + if (status_comp == GL_TRUE) + { + m_context.getTestContext().getLog() + << tcu::TestLog::Message << "Expected error during fragment shader compilation." + << tcu::TestLog::EndMessage; + return ERROR; + } + + return NO_ERROR; + } +}; + class AdvancedManyDrawCalls2 : public SACSubcaseBase { @@ -3997,6 +4041,7 @@ void ShaderAtomicCountersTests::init() addChild(new TestSubcase(m_context, "negative-uniform", TestSubcase::Create)); addChild(new TestSubcase(m_context, "negative-array", TestSubcase::Create)); addChild(new TestSubcase(m_context, "negative-arithmetic", TestSubcase::Create)); + addChild(new TestSubcase(m_context, "negative-large-offset", TestSubcase::Create)); addChild(new TestSubcase(m_context, "negative-unsized-array", TestSubcase::Create)); } }