Platform: Linux Ubuntu, NVIDIA 970 GTX, driver 343.22, using glew 1.11.
Consider the following test function:
static bool demoSparseTextureProblem()
{
const int kDim = 256;
GLint xPage, yPage, zPage;
// get internal size of pages for 3D texture
glGetInternalformativ(GL_TEXTURE_3D,GL_R8, GL_VIRTUAL_PAGE_SIZE_X_ARB,
1, &xPage);
glGetInternalformativ(GL_TEXTURE_3D,GL_R8, GL_VIRTUAL_PAGE_SIZE_Y_ARB,
1, &yPage);
glGetInternalformativ(GL_TEXTURE_3D,GL_R8, GL_VIRTUAL_PAGE_SIZE_Z_ARB,
1, &zPage);
cout << "Page size: " << xPage << ',' << yPage << ',' << zPage << '
';
GLuint texID = 0;
glGenTextures(1,&texID);
glBindTexture(GL_TEXTURE_3D,texID);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_SPARSE_ARB, GL_TRUE);
glTexStorage3D(GL_TEXTURE_3D, 1, GL_R8, kDim, kDim, kDim);
for (int z = 0; z < kDim; z += zPage)
{
for (int y = 0; y < kDim; y += yPage)
{
for (int x = 0; x < kDim; x += xPage)
{
glTexPageCommitmentARB(GL_TEXTURE_3D, 0,
x, y, z, x + xPage,
y + yPage, z + zPage,
GL_TRUE);
if (glGetError() != GL_NO_ERROR)
{
std::cout << "Error commit at (" << x << ',' << y << ','
<< z << ")
";
}
}
}
}
glDeleteTextures(1,&texID);
}
With a texture size of 256, commitment of any page with coordinates >= 128 is not successful. With texture size of 128, any page with coordinates >=64 gives an error.
Am I doing something wrong or might this be a driver/glew bug?
Help really appreciated, thanks!