hjimbens
Posts: 78
Joined: Fri May 24, 2013 9:05 am

GPU memory usage of RGB textures

Wed May 29, 2013 8:10 am

Creating textures with

Code: Select all

glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, (GLsizei)mWidth, (GLsizei)mHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, GetPixels ());
seems to use the same amount of GPU memory as creating them with

Code: Select all

glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, (GLsizei)mWidth, (GLsizei)mHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, GetPixels ());
.
In both cases vcdbg shows a texture blob that uses approximately 4*mHeight*mWidth bytes.
That is a pity because it wastes 30% of GPU memory.

lb
Posts: 263
Joined: Sat Jan 28, 2012 8:07 pm

Re: GPU memory usage of RGB textures

Thu May 30, 2013 10:25 pm

GPUs typically don't support RGB formats in hardware, due to the horrible alignment issues it poses. It's quite normal. If you can, use ETC1 texture compression. You'll lose some quality, but at just 4 bits per pixel, the data size will be very small.

Return to “OpenGLES”