From 2cee6cf5d787c6874b0dab15ee3e3ce8a77675a8 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Tue, 14 May 2019 10:55:50 +0200 Subject: [PATCH] formats: Make sure each format is tested with a clean error state v2: make check anassert (Erik) Signed-off-by: Gert Wollny Reviewed-by: Erik Faye-Lund --- src/vrend_formats.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vrend_formats.c b/src/vrend_formats.c index 26b7f9d..1f7b008 100644 --- a/src/vrend_formats.c +++ b/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) {