Use 64-bit math in work group size assertion.
[platform/upstream/VK-GL-CTS.git] / modules / gles31 / functional / es31fNegativeComputeTests.cpp
index c0c36bc..8d492ab 100644 (file)
@@ -361,7 +361,7 @@ void exceed_atomic_counters_limit (NegativeTestContext& ctx)
        std::ostringstream      shaderBody;
 
        shaderDecl      << "layout(binding = 0, offset = 0) uniform atomic_uint u_atomic0;\n"
-                               << "layout(binding = 0, offset = " << sizeof(GLuint) * getResourceLimit(ctx, GL_MAX_COMPUTE_ATOMIC_COUNTERS) << ") uniform atomic_uint u_atomic1;\n"
+                               << "layout(binding = " << sizeof(GLuint) * getResourceLimit(ctx, GL_MAX_COMPUTE_ATOMIC_COUNTERS) << ", offset = 0) uniform atomic_uint u_atomic1;\n"
                                << "\n"
                                << "layout(binding = 0) buffer Output {\n"
                                << "    uint value;\n"
@@ -646,7 +646,7 @@ void invalid_maximum_work_group_sizes (NegativeTestContext& ctx)
        ctx.glGetIntegerv(GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS, &maxWorkGroupInvocations);
        ctx.expectError(GL_NO_ERROR);
 
-       DE_ASSERT((maxWorkGroupSizeX * maxWorkGroupSizeY * maxWorkGroupSizeZ) > maxWorkGroupInvocations );
+       DE_ASSERT(((deInt64) maxWorkGroupSizeX * maxWorkGroupSizeY * maxWorkGroupSizeZ) > maxWorkGroupInvocations );
 
        const bool                              isES32                  = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
        const char* const               shaderVersion   = isES32
@@ -800,6 +800,12 @@ void invalid_layout_qualifiers (NegativeTestContext& ctx)
 
 void invalid_write_built_in_constants (NegativeTestContext& ctx)
 {
+       if ((!ctx.isExtensionSupported("GL_EXT_tessellation_shader") && !ctx.isExtensionSupported("GL_OES_tessellation_shader")) ||
+           (!ctx.isExtensionSupported("GL_EXT_geometry_shader") && !ctx.isExtensionSupported("GL_OES_geometry_shader")))
+       {
+               TCU_THROW(NotSupportedError, "tessellation and geometry shader extensions not supported");
+       }
+
        const bool                                      isES32                  = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
        map<string, string>                     args;