diff options
author | Timothy Arceri <[email protected]> | 2017-04-21 13:29:46 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-04-22 10:01:15 +1000 |
commit | 622a68ed3e36a6b56db35df62c5913d2d54d5ed6 (patch) | |
tree | 974998286efcf4ed0528766666b54013e8e07c62 /src/mesa/main/transformfeedback.c | |
parent | 0cc8c81902dffdd0c2e1f74e7828a6132cb70b9f (diff) |
mesa: remove fallback RefCount == 0 pattern
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 <[email protected]>
Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/mesa/main/transformfeedback.c')
-rw-r--r-- | src/mesa/main/transformfeedback.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c index 96f3df1c961..131014ff653 100644 --- a/src/mesa/main/transformfeedback.c +++ b/src/mesa/main/transformfeedback.c @@ -110,16 +110,12 @@ reference_transform_feedback_object(struct gl_transform_feedback_object **ptr, assert(!*ptr); if (obj) { + assert(obj->RefCount > 0); + /* reference new object */ - if (obj->RefCount == 0) { - _mesa_problem(NULL, "referencing deleted transform feedback object"); - *ptr = NULL; - } - else { - obj->RefCount++; - obj->EverBound = GL_TRUE; - *ptr = obj; - } + obj->RefCount++; + obj->EverBound = GL_TRUE; + *ptr = obj; } } |