Skip to content

RFC: fake texture view on GLES for some 2D textures

Non of the host systems I've looked at expose texture views, i.e. GLES <= 3.2 doesn't require it, and the according extension is not available (Somehow wonder why, in both cases I looked at, r600 and Intel, the GL code path supports it).

However, with the tests

dEQP-GLES31.functional.srgb_texture_decode.skip_decode.srgba8.conversion_gpu
dEQP-GLES31.functional.srgb_texture_decode.skip_decode.srgba8.toggled
dEQP-GLES31.functional.srgb_texture_decode.skip_decode.srgba8.multiple_textures

the host system creates texture views and then applies sampler states including setting GL_SKIP_DECODE_EXT and GL_DECODE_EXT . With GL also an non-SRGB texture view is created and the whole setting of the GL_SKIP_DECODE_EXT state seems moot, on GLES no texture view is created, and both states GL_SKIP_DECODE_EXT and GL_DECODE_EXT are applied to the same texture but with different samplers, but apparently this is not enough to really make the skip state remain active.

The workaround proposed in this patch is to create a fake texture view by using glCopyImageSubData which supports the same formats like glTextureView. I don't really think this is a good solution (hence RFC), but it gets the job done.

I'd also like to point out that the actual test, when run directly on the host, doesn't use sampler states nor texture views, and a better solution may be to let the host act more like the actual test was written, but I have to admit that so far I haven't been able to figure out why the host does what it does, i.e. why the texture view is created on the host.

I'll be off-line for the next week, so if anyone finds a better solution, don't hesitate to apply it.

Merge request reports