The device I use is Adreno 330.
I'm using a large Pixel Buffer Object(PBO) to upload multiple textures at once. But some mipmap is totally corrupted, looks like they read from other/random memory address.
Sometimes those "black" mipmap show value 0x02020202 in Adreno Profiler.
the pseudo code I use:
create a big buffer(16MB in my case)
glBufferData with "data" = NULL;
ptr = glMapBufferRange;
foreach image:
foreach mipmap in image
calculate mipmap data size
setup correspending buffer offset
memcpy mipmap data to (ptr + offset)
glFlushMappedBufferRange()
glUnmapBuffer()
bind buffer to PIXEL_UNPACK_BUFFER
for each image:
createTexture;
bindTexture;
allocate memory use textureStorage2D;
foreach mipmap in image:
glCompressedTexSubImage2D, "data" is set to correspending buffer offset
If I don't use PBO, those textures are correct.
Also, if I use a smaller PBO(for example 2MB), all textures are correct.
I wonder whether it is a bug with the driver, something is wrong when using PBO and large data offset (2MB = 0x200000)
P.S. I check every step with glGetError(), no error happened.
P.S. I test my code on PoweVR / Mali / Nvidia cards, all seem work correctly.