Forums - Corrupted texture data when using PBO

1 post / 0 new
Corrupted texture data when using PBO
Corvo
Join Date: 26 Aug 15
Posts: 1
Posted: Fri, 2016-12-30 02:25

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.

 

  • Up0
  • Down0

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.