Gday,
I'm encountering an issue with the ARB_sparse_texture extension where my application's memory usage is jumping 120mb when committing any tile from the mipmap tail.
The minimum code I've got to reproduce this is:
GLuint page_texture;
glGenTextures(1, &page_texture);
glBindTexture(GL_TEXTURE_2D, page_texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SPARSE_ARB, GL_TRUE);
glTexStorage2D(GL_TEXTURE_2D, 15, GL_RGBA32F, 16384, 16384);
// Commit a level 0 page.
glTexPageCommitmentARB(GL_TEXTURE_2D, 0, 0, 0, 0, 64, 64, 0, GL_TRUE);
// 4kb increase here.
// Commit level 10 (first tail level).
glTexPageCommitmentARB(GL_TEXTURE_2D, 10, 0, 0, 0, 16, 16, 0, GL_TRUE);
// 120mb increase here.
It may be important to note that the 120mb increase is constant across sparse texture sizes. Creating a 256x256 sparse texture and committing the first tail level still results in a 120mb memory increase. For convenience, that code is also:
GLuint page_texture;
glGenTextures(1, &page_texture);
glBindTexture(GL_TEXTURE_2D, page_texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SPARSE_ARB, GL_TRUE);
glTexStorage2D(GL_TEXTURE_2D, 9, GL_RGBA32F, 256, 256);
glTexPageCommitmentARB(GL_TEXTURE_2D, 0, 0, 0, 0, 64, 64, 0, GL_TRUE);
glTexPageCommitmentARB(GL_TEXTURE_2D, 4, 0, 0, 0, 16, 16, 0, GL_TRUE);
// 120mb increase here.
My system is running the 18.5.2 drivers with the RX480. Has anyone else seen this problem?
Thanks,
-Lucas
Thanks dipak, I've updated the OP
Hello lucasz, if you could provide the binary with the minimum code to reproduce the problem, that'll be very helpful for us to investigate this issue effectively. Thanks.
We will investigate this problem, and keep you updated, thanks.
Lucas, the level 10 needs to be resident for this case as it goes beyond the total number of levels that may be partially resident.
Hi Lucasz,
How did you measure memory usage?
Thanks