From 1c113ddcd7ebd925eb494a6055ae47a52fe280d9 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Fri, 17 Aug 2018 10:00:47 +0200 Subject: [PATCH] format: assert that the multi-sample check enters with a clean error state In order to ensure that all the errors in the initialization are handled before entering this routine assert on pre-existsing errors. Signed-off-by: Gert Wollny Reviewed-by: Jakob Bornecrantz Signed-off-by: Dave Airlie --- src/vrend_formats.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/vrend_formats.c b/src/vrend_formats.c index 418755b..731f759 100644 --- a/src/vrend_formats.c +++ b/src/vrend_formats.c @@ -475,6 +475,9 @@ unsigned vrend_renderer_query_multisample_caps(unsigned max_samples, struct virg int out_buf_offsets[4] = {0,1,2,4}; int lowest_working_ms_count_idx = -1; + assert(glGetError() == GL_NO_ERROR && + "Stale error state detected, please check for failures in initialization"); + glGenFramebuffers( 1, &fbo ); memset(caps->sample_locations, 0, 8 * sizeof(uint32_t));