generatemipmap_zero_level_array_compressed may reuse stale object
authorYabin Zheng <yabin.zheng@arm.com>
Wed, 6 Jun 2018 03:09:25 +0000 (11:09 +0800)
committerAlexander Galazin <alexander.galazin@arm.com>
Fri, 8 Jun 2018 11:32:35 +0000 (13:32 +0200)
The test should add a new individual texture object for this sub-test.

Components: OpenGL

Affects:
dEQP-GLES2.functional.negative_api.texture.generatemipmap_zero_level_array_compressed

VK-GL-CTS issue: 1206

Change-Id: I3af22e04c110f7e08a90596c198a9ae3da76fcdc

modules/gles2/functional/es2fNegativeTextureApiTests.cpp

index 33c102d..fcf2dba 100644 (file)
@@ -1225,11 +1225,15 @@ void NegativeTextureApiTests::init (void)
                        getSupportedExtensions(GL_NUM_COMPRESSED_TEXTURE_FORMATS, GL_COMPRESSED_TEXTURE_FORMATS, compressedFormats);
                        if (!compressedFormats.empty())
                        {
+                               GLuint texture;
+                               glGenTextures(1, &texture);
+                               glBindTexture(GL_TEXTURE_2D, texture);
                                m_log << TestLog::Section("", "GL_INVALID_OPERATION is generated if the zero level array is stored in a compressed internal format.");
                                glCompressedTexImage2D(GL_TEXTURE_2D, 0, compressedFormats[0], 0, 0, 0, 0, 0);
                                glGenerateMipmap(GL_TEXTURE_2D);
                                expectError(GL_INVALID_OPERATION);
                                m_log << TestLog::EndSection;
+                               glDeleteTextures(1, &texture);
                        }
                });
        ES2F_ADD_API_CASE(generatemipmap_incomplete_cube, "Invalid glGenerateMipmap() usage",