Graphics
Intel® graphics drivers and software, compatibility, troubleshooting, performance, and optimization
20622 Discussions

GLES2 - TexStorage2DEXT reports INVALID_ENUM with BGRA8_EXT

thokra1
Beginner
760 Views

-------------------------------------------------------------------------------------------------

System Used: Dell
CPU SKU: i7-8850
GPU SKU: Intel(R) UHD Graphics 630
Processor Line: H-Series
Graphics Driver Version: Build 26.20.100.7870
Operating System: Windows 10
OS Version: 1903(Build 18362.657)
API: OpenGL ES2
Occurs on non-Intel GPUs?: No

Steps to Reproduce:
-------------------------------
1. glGenTextures(1, &name)
2. glBindTexture(GL_TEXTURE_2D, name)
3. glTexStorage2DEXT(GL_TEXTURE_2D, ..., GL_BGRA8_EXT, ..., ...)

Expected Results:
-------------------------------

Successful allocation of the texture object's data store, i.e. no GL errors.

Actual Results:
-------------------------------

Driver reports GL_INVALID_ENUM when calling glTexStorage2DEXT with GL_BGRA8_EXT as internal format

Additional Information:
-------------------------------

Hey everyone! 

While hunting a bug when using Skia with our ES2/WebGL1 backend, I came across what I believe is a bug in the GLES implementation.

We're creating a native ES context with WGL_EXT_create_context_es2_profile. Our intention is to pass a BGRA8 texture to Skia as its backend texture. Since GL_EXT_texture_storage and GL_EXT_texture_format_BGRA8888 are both supported, we're creating an immutable texture with BGRA8_EXT as its internal format, which, according to the defined interactions in GL_EXT_texture_storage, is legal.

The driver's response is, however: "Error has been generated. GL error GL_INVALID_ENUM in TexStorage2DEXT: (ID: 1461266306) Generic error"

With GLES3.x, the situation is kind-of in a gray area because GL_EXT_texture_format_BGRA8888 doesn't explicitly state that TexStorage2D can receive BGRA8_EXT as an internal format (in contrast to APPLE_texture_format_BGRA8888). Still, for ES2 with the above mentioned extensions, support is mandatory.

Update: It has been pointed out to me by ImgTec that I missed a crucial detail in the extension that sets it apart from the APPLE one: BGRA_EXT ist defined both as an external and an internal format for TexImage2D and thus it must be legal for TexStorage2D, since the latter is specified in terms of the former. The APPLE extension has to state this divergence explicitly, because they explicitly do not support BGRA_EXT as an internal format and thus introduce BGRA8_EXT specifically for TexStorage2D. This is all in regard to the ES3 core APIs - it does not cover TexStorage2DEXT.

Thank you!

0 Kudos
0 Replies
Reply