Fix extension support checks in negative api tests
authorGraeme Leese <gleese@broadcom.com>
Thu, 23 Feb 2017 16:56:10 +0000 (16:56 +0000)
committerMika Isojärvi <misojarvi@google.com>
Wed, 5 Jul 2017 20:44:25 +0000 (13:44 -0700)
Add checks for tessellation and geometry shader support for negative
shader storage and primitive bounding box tests.

Move all uses of cubemap array textures inside the extension checks in
the texture tests.

Bug: 29835218
Change-Id: I6051fff231285ed7d9c71015c2bb11a9fc7b909b
Signed-off-by: Pierre Couillaud <pierre@broadcom.com>
modules/gles31/functional/es31fNegativeTextureApiTests.cpp

index 6038b40..52f7146 100644 (file)
@@ -2916,8 +2916,6 @@ void texsubimage3d_neg_level (NegativeTestContext& ctx)
        ctx.glTexImage3D                (GL_TEXTURE_3D, 0, GL_RGBA, 4, 4, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
        ctx.glBindTexture               (GL_TEXTURE_2D_ARRAY, textures[1]);
        ctx.glTexImage3D                (GL_TEXTURE_2D_ARRAY, 0, GL_RGBA, 4, 4, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
-       ctx.glBindTexture               (GL_TEXTURE_CUBE_MAP_ARRAY, textures[2]);
-       ctx.glTexImage3D                (GL_TEXTURE_CUBE_MAP_ARRAY, 0, GL_RGBA, 4, 4, 6, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
        ctx.expectError                 (GL_NO_ERROR);
 
        ctx.beginSection("GL_INVALID_VALUE is generated if level is less than 0.");
@@ -2928,6 +2926,10 @@ void texsubimage3d_neg_level (NegativeTestContext& ctx)
 
        if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) || ctx.getContextInfo().isExtensionSupported("GL_OES_texture_cube_map_array"))
        {
+               ctx.glBindTexture               (GL_TEXTURE_CUBE_MAP_ARRAY, textures[2]);
+               ctx.glTexImage3D                (GL_TEXTURE_CUBE_MAP_ARRAY, 0, GL_RGBA, 4, 4, 6, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
+               ctx.expectError                 (GL_NO_ERROR);
+
                ctx.glTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, -1, 0, 0, 0, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
                ctx.expectError(GL_INVALID_VALUE);
        }
@@ -2971,8 +2973,6 @@ void texsubimage3d_neg_offset (NegativeTestContext& ctx)
        ctx.glTexImage3D                (GL_TEXTURE_3D, 0, GL_RGBA, 4, 4, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
        ctx.glBindTexture               (GL_TEXTURE_2D_ARRAY, textures[1]);
        ctx.glTexImage3D                (GL_TEXTURE_2D_ARRAY, 0, GL_RGBA, 4, 4, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
-       ctx.glBindTexture               (GL_TEXTURE_CUBE_MAP_ARRAY, textures[2]);
-       ctx.glTexImage3D                (GL_TEXTURE_CUBE_MAP_ARRAY, 0, GL_RGBA, 4, 4, 6, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
        ctx.expectError                 (GL_NO_ERROR);
 
        ctx.beginSection("GL_INVALID_VALUE is generated if xoffset, yoffset or zoffset are negative.");
@@ -2995,6 +2995,10 @@ void texsubimage3d_neg_offset (NegativeTestContext& ctx)
 
        if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) || ctx.getContextInfo().isExtensionSupported("GL_OES_texture_cube_map_array"))
        {
+               ctx.glBindTexture               (GL_TEXTURE_CUBE_MAP_ARRAY, textures[2]);
+               ctx.glTexImage3D                (GL_TEXTURE_CUBE_MAP_ARRAY, 0, GL_RGBA, 4, 4, 6, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
+               ctx.expectError                 (GL_NO_ERROR);
+
                ctx.glTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, 0, -1, 0, 0, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
                ctx.expectError(GL_INVALID_VALUE);
                ctx.glTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, 0, 0, -1, 0, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);