diff options
author | Lepton Wu <lepton@chromium.org> | 2018-05-18 09:19:06 -0700 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2018-05-21 14:22:35 +1000 |
commit | fd0ed163379a97fe877926d383704bb0421b27f9 (patch) | |
tree | 9faa574b9ab2164febf78ebc8057fdb2b7a9872f | |
parent | 01d02cee1bf54fd355c080f49dec10bbff80af6b (diff) |
vrend: handle GL_INVALID_ENUM when trying format.
It seems under some GPU/profile, GL_INVALID_ENUM is generated
instead of GL_INVALID_VALUE for unsupported internal format.
This is even conflicted in reference documents. Just handle
them at same time.
From:
https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml
GL_INVALID_ENUM is generated if internalFormat is not one of the accepted
resolution and format symbolic constants.
From:
https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glTexImage2D.xhtml
GL_INVALID_VALUE is generated if internalFormat is not one of the accepted
resolution and format symbolic constants.
Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | src/vrend_formats.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vrend_formats.c b/src/vrend_formats.c index cf32f6f..0be213a 100644 --- a/src/vrend_formats.c +++ b/src/vrend_formats.c @@ -286,7 +286,7 @@ static void vrend_add_formats(struct vrend_format_table *table, int num_entries) glTexImage2D(GL_TEXTURE_2D, 0, table[i].internalformat, 32, 32, 0, table[i].glformat, table[i].gltype, NULL); status = glGetError(); - if (status == GL_INVALID_VALUE) { + if (status == GL_INVALID_VALUE || status == GL_INVALID_ENUM) { struct vrend_format_table *entry = NULL; uint8_t swizzle[4]; binding = VREND_BIND_SAMPLER | VREND_BIND_RENDER | VREND_BIND_NEED_SWIZZLE; |