mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 19:40:10 +01:00
i965/miptree: Set refcount before failing via _release()
Otherwise one wraps uint to UINT_MAX via -1.
Fixes: 3cf470f2b6 ("i965: Add isl based miptree creator")
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
This commit is contained in:
parent
c2bb39d8d6
commit
8fd18642e7
1 changed files with 2 additions and 1 deletions
|
|
@ -709,6 +709,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;
|
||||
|
|
@ -753,7 +755,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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue