I am writing a video player, I decoded the video frames and use 3 sampler2D
s for receiving the YUV format frame data, it renders perfectly fine.
But it has serious performance issue with glTexSubImage2D
. I observed strange behaviors:
- Uploading YUV data in an order of Y, U, V, then uploading U is randomly slow(1ms to 100ms).
- Uploading YUV data in an order of Y, V, U, then uploading V is randomly slow(1ms to 100ms).
- 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?