summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYonggang Luo <luoyonggang@gmail.com>2022-05-11 21:05:47 +0800
committerMarge Bot <emma+marge@anholt.net>2022-05-23 11:37:57 +0000
commit2e95139f0811aa631ccbc53ee7b0c72ce78c0d35 (patch)
tree4324e9d9c7b96be8b0abdfd1efd8cc84e6608f3a
parent127aeb2b2a46b319522ea1c91651d6327f90dac1 (diff)
vrend: Guard the error with GL_NO_ERROR for any possible glTexImage2D error
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Corentin Noël <corentin.noel@collabora.com> Part-of: <https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/799>
-rw-r--r--src/vrend_formats.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/vrend_formats.c b/src/vrend_formats.c
index 61b9f9f..50c393a 100644
--- a/src/vrend_formats.c
+++ b/src/vrend_formats.c
@@ -470,7 +470,13 @@ 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 || status == GL_INVALID_ENUM || status == GL_INVALID_OPERATION) {
+ /* Currently possible errors are:
+ * * GL_INVALID_VALUE
+ * * GL_INVALID_ENUM
+ * * GL_INVALID_OPERATION
+ * * GL_OUT_OF_MEMORY
+ */
+ if (status != GL_NO_ERROR) {
struct vrend_format_table *entry = NULL;
uint8_t swizzle[4];
binding = VIRGL_BIND_SAMPLER_VIEW | VIRGL_BIND_RENDER_TARGET;