Forums - PBO performance message

5 posts / 0 new
Last post
PBO performance message
wayne.hong
Join Date: 8 Nov 16
Posts: 5
Posted: Tue, 2017-01-31 08:05

I was trying to upload an image to a 2D texture using PBO. In my KHR debug callback, I received the following message:

GLES Message: type = Performance, severity = High, message = CPU path taken to copy PBO

I am testing my app using Google Pixel with Adreno 530 and the performance is only half of the non PBO version. Is PBO really supported on Adreno GPUs?

Best,

Wayne 

 

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Thu, 2017-02-02 06:55

Hi Wayne - Could you describe the method and APIs you're using with PBO uploading?

You might look at the current thread, and our Adreno SDK sample that uses PBOs..though it doesn't show using PIXEL_PACK_BUFFER which should be more optimal (http://www.opengl.org/wiki/Pixel_Buffer_Object).

https://developer.qualcomm.com/forum/qdn-forums/mobile-technologies/mobile-gaming-graphics-optimization-adreno/27196

 

-mark

  • Up0
  • Down0
wayne.hong
Join Date: 8 Nov 16
Posts: 5
Posted: Wed, 2017-02-08 08:16

Hi Mark,

It turns out that PBO DMA copying only works for the texture whose size is power of two (POT). For NPOT texture, the CPU path will be taken to copy PBO. Do you know the reason of this limitation for using PBO?

Best,

Wayne

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Sun, 2017-02-12 19:19

Turns out that it's not a POT requirement that forces the DMA copying, but related to the pitch:

1) The pitch must be a multiple of the hardware requirement (64 pixels for current Adreno hardware)

2) The base+offset must be a must also be a multiple of the hardware requirement as well.

  • Up0
  • Down0
prollin
Join Date: 17 Aug 11
Posts: 3
Posted: Sun, 2018-02-25 00:16

I currently am observing the same issue on Adreno GPU (tested on 530 and 305). glReadPixels seems to block no matter what I do, even when the texture size is properly aligned as suggested above (tried with 128x128 texture). Adreno GPUs seems to be the only ones affected so far.

Am I missing anything? is it just not possible to perform asynchronous glReadPixels on Adreno GPUs?

Below is the relevant part of my code (let me know if anything else is needed to investigate):

// Begin get data
if (glPbo == -1)
{
  glGenBuffers(1, &glPbo);
  glBindBuffer(GL_PIXEL_PACK_BUFFER, glPbo);
  int dataSize = 4 * width * height;
  glBufferData(GL_PIXEL_PACK_BUFFER, dataSize, NULL, GL_STATIC_READ);
}
else
{
  glBindBuffer(GL_PIXEL_PACK_BUFFER, glPbo);
}
if (glFbo == -1)
{
  glGenFramebuffers(1, &glFbo);
  glBindFramebuffer(GL_FRAMEBUFFER, glFbo);
  glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE2D, glTexture, level);
}
else
{
  glBindFramebuffer(GL_FRAMEBUFFER, glFbo);
}
glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, NULL); // <<<<<< Seems to be blocking
int glSync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
 
// Once sync object is signaled
glBindBuffer(GL_PIXEL_PACK_BUFFER, glPbo);
void* pboPtr = glMapBufferRange(GL_PIXEL_PACK_BUFFER, NULL, dataSize, GL_MAP_READ_BIT);
// do memcopy here
glUnmapBuffer(GL_PIXEL_PACK_BUFFER);


Thanks!

  • Up0
  • Down0
or Register

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.