formats: Make sure each format is tested with a clean error state

v2: make check anassert (Erik)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
macos/master
Gert Wollny 6 years ago
parent 804dab8181
commit 2cee6cf5d7
  1. 4
      src/vrend_formats.c

@ -346,6 +346,10 @@ static void vrend_add_formats(struct vrend_format_table *table, int num_entries)
;/* do logic below */
}
/* The error state should be clear here */
status = glGetError();
assert(status == GL_NO_ERROR);
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) {

Loading…
Cancel
Save