neevek
neevek

Reputation: 12148

glTexSubImage2D is slow uploading YUV data

I am writing a video player, I decoded the video frames and use 3 sampler2Ds for receiving the YUV format frame data, it renders perfectly fine.

But it has serious performance issue with glTexSubImage2D. I observed strange behaviors:

  1. Uploading YUV data in an order of Y, U, V, then uploading U is randomly slow(1ms to 100ms).
  2. Uploading YUV data in an order of Y, V, U, then uploading V is randomly slow(1ms to 100ms).
  3. Uploading YUV data in an order of U, V, Y, then uploading Y is constantly slow(10ms to 50ms).

For other components that are not slow to upload, they take less than 1ms. I use glTexSubImage2D with internalFormat=GL_RED, format=GL_RED, dataType=GL_UNSIGNED_BYTE.

What could be the possible cause of these strange behaviors?

Upvotes: 0

Views: 336

Answers (0)

Related Questions