bufSize of glGetInternalformativ does not follow spec
authorPierre Tsai <chentsai@amd.com>
Thu, 2 Aug 2018 15:13:14 +0000 (11:13 -0400)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 23 Aug 2018 11:52:06 +0000 (07:52 -0400)
In the specification section 22.3 Internal Format Queries
(glspec46.core.pdf page 564), it is written:
No more than bufSize integers will be written into params.

The confusion may come from the man page where in one point it is said:
"No more than bufSize basic machine units will be written to this
memory." But the above description is still a number of integers.

Affects:

KHR-GL46.sparse_texture_tests.SparseDSATextureCommitment
KHR-GL46.sparse_texture_tests.SparseTextureAllocation
KHR-GL46.sparse_texture_tests.SparseTextureCommitment
KHR-GL46.sparse_texture_tests.TextureParameterQueries
KHR-GL46.sparse_texture_tests.InternalFormatQueries

Components: OpenGL

VK-GL-CTS issue: 1296

Change-Id: I05ea0cbe54539f6f8711278cb7b08ad7e5862aa9

external/openglcts/modules/gl/gl4cSparseTextureTests.cpp

index 1d1e901..3097dd0 100644 (file)
@@ -130,13 +130,13 @@ GLint SparseTextureUtils::getTargetDepth(GLint target)
 void SparseTextureUtils::getTexturePageSizes(const glw::Functions& gl, glw::GLint target, glw::GLint format,
                                                                                         glw::GLint& pageSizeX, glw::GLint& pageSizeY, glw::GLint& pageSizeZ)
 {
-       gl.getInternalformativ(target, format, GL_VIRTUAL_PAGE_SIZE_X_ARB, sizeof(pageSizeX), &pageSizeX);
+       gl.getInternalformativ(target, format, GL_VIRTUAL_PAGE_SIZE_X_ARB, 1, &pageSizeX);
        GLU_EXPECT_NO_ERROR(gl.getError(), "getInternalformativ error occurred for GL_VIRTUAL_PAGE_SIZE_X_ARB");
 
-       gl.getInternalformativ(target, format, GL_VIRTUAL_PAGE_SIZE_Y_ARB, sizeof(pageSizeY), &pageSizeY);
+       gl.getInternalformativ(target, format, GL_VIRTUAL_PAGE_SIZE_Y_ARB, 1, &pageSizeY);
        GLU_EXPECT_NO_ERROR(gl.getError(), "getInternalformativ error occurred for GL_VIRTUAL_PAGE_SIZE_Y_ARB");
 
-       gl.getInternalformativ(target, format, GL_VIRTUAL_PAGE_SIZE_Z_ARB, sizeof(pageSizeZ), &pageSizeZ);
+       gl.getInternalformativ(target, format, GL_VIRTUAL_PAGE_SIZE_Z_ARB, 1, &pageSizeZ);
        GLU_EXPECT_NO_ERROR(gl.getError(), "getInternalformativ error occurred for GL_VIRTUAL_PAGE_SIZE_Z_ARB");
 }
 
@@ -883,7 +883,7 @@ tcu::TestNode::IterateResult InternalFormatQueriesTestCase::iterate()
                        const GLint& format = *formIter;
                        GLint            value;
 
-                       gl.getInternalformativ(target, format, GL_NUM_VIRTUAL_PAGE_SIZES_ARB, sizeof(value), &value);
+                       gl.getInternalformativ(target, format, GL_NUM_VIRTUAL_PAGE_SIZES_ARB, 1, &value);
                        GLU_EXPECT_NO_ERROR(gl.getError(), "getInternalformativ error occurred for GL_NUM_VIRTUAL_PAGE_SIZES_ARB");
                        if (value == 0)
                        {
@@ -1323,7 +1323,7 @@ bool SparseTextureAllocationTestCase::verifyTexStorageVirtualPageSizeIndexError(
                return false;
        }
 
-       gl.getInternalformativ(target, format, GL_NUM_VIRTUAL_PAGE_SIZES_ARB, sizeof(numPageSizes), &numPageSizes);
+       gl.getInternalformativ(target, format, GL_NUM_VIRTUAL_PAGE_SIZES_ARB, 1, &numPageSizes);
        if (!SparseTextureUtils::verifyQueryError(mLog, "getInternalformativ", target, GL_NUM_VIRTUAL_PAGE_SIZES_ARB,
                                                                                          gl.getError(), GL_NO_ERROR))
        {