haasn / libplacebo

Official mirror of libplacebo
http://libplacebo.org/
GNU Lesser General Public License v2.1
568 stars 72 forks source link

"lossless texture readback" check is broken on GLES? #291

Closed sfan5 closed 2 weeks ago

sfan5 commented 1 month ago

spotted this in an mpv-android user log, so I set out to investigate:

[ 192.388][v][vo/gpu-next/libplacebo]     GL_VERSION:  OpenGL ES 3.2 V@0530.49 (GIT@329cf4c2a7, I63533b1e29, 1675175164) (Date:01/31/23)
[ 192.388][v][vo/gpu-next/libplacebo]     GL_VENDOR:   Qualcomm
[ 192.388][v][vo/gpu-next/libplacebo]     GL_RENDERER: Adreno (TM) 660
[...]
[ 192.389][e][vo/gpu-next/libplacebo] GL: read framebuffer is a framebuffer object and the selected read buffer has no image attached
[ 192.389][e][vo/gpu-next/libplacebo] GL: read framebuffer is a framebuffer object and the selected read buffer has no image attached
[ 192.389][v][vo/gpu-next/libplacebo] GPU does not seem to support lossless texture readback, restricting readback capabilities! This is a GLES/driver limitation, there is little we can do to work around it.
[ 192.389][e][vo/gpu-next/libplacebo] pl_gpu_create_gl: OpenGL error: GL_INVALID_OPERATION
[ 192.390][w][vo/gpu-next/libplacebo] Encountered errors while detecting GPU capabilities... ignoring, but expect limitations/issues

code here: https://github.com/haasn/libplacebo/blob/756220c3ee760eb62c0b89172e80f713f89fe571/src/opengl/gpu.c#L247-L271

noticed two things:

sfan5 commented 1 month ago

for the second point: ES 3.2 spec, p. 409 grafik

this matches the logged error

sfan5 commented 1 month ago

I'll open a PR for the second problem everything. As it turns out GL_[A-Z]+_FRAMEBUFFER references are all over the code and are all not compliant with GLES 2.0.