[Mesa-dev] [PATCH 01/16] i965/miptree: Set refcount before failing via _release()
Topi Pohjolainen
topi.pohjolainen at gmail.com
Mon Jul 17 13:34:52 UTC 2017
Otherwise one wraps uint to UINT_MAX via -1.
Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 6135fda1be..b9a00caad2 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -707,6 +707,8 @@ make_surface(struct brw_context *brw, GLenum target, mesa_format format,
return NULL;
}
+ mt->refcount = 1;
+
if (target == GL_TEXTURE_CUBE_MAP ||
target == GL_TEXTURE_CUBE_MAP_ARRAY)
isl_usage_flags |= ISL_SURF_USAGE_CUBE_BIT;
@@ -751,7 +753,6 @@ make_surface(struct brw_context *brw, GLenum target, mesa_format format,
mt->last_level = last_level;
mt->target = target;
mt->format = format;
- mt->refcount = 1;
mt->aux_state = NULL;
return mt;
--
2.11.0
More information about the mesa-dev
mailing list