From 622a68ed3e36a6b56db35df62c5913d2d54d5ed6 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Fri, 21 Apr 2017 13:29:46 +1000 Subject: mesa: remove fallback RefCount == 0 pattern MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We should never get here if this is 0 unless there is a bug. Replace the check with an assert. Reviewed-by: Nicolai Hähnle Reviewed-by: Samuel Pitoiset --- src/mesa/main/texobj.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/mesa/main/texobj.c') diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 00feb975522..af9baa976fc 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -566,16 +566,10 @@ _mesa_reference_texobj_(struct gl_texture_object **ptr, /* reference new texture */ assert(valid_texture_object(tex)); mtx_lock(&tex->Mutex); - if (tex->RefCount == 0) { - /* this texture's being deleted (look just above) */ - /* Not sure this can every really happen. Warn if it does. */ - _mesa_problem(NULL, "referencing deleted texture object"); - *ptr = NULL; - } - else { - tex->RefCount++; - *ptr = tex; - } + assert(tex->RefCount > 0); + + tex->RefCount++; + *ptr = tex; mtx_unlock(&tex->Mutex); } } -- cgit v1.2.3