X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmain%2Ftexobj.h;h=1faae6f7e3032964e105112f3b92629f81549ac9;hb=636d01bd61cac83e13c3c64874e7e34e828ca93a;hp=476a17537a30d397db6f8023e4905880e5405730;hpb=e9375cd0e895ac2c3e7ff17f18da7a7f8cd3a82d;p=mesa.git diff --git a/src/mesa/main/texobj.h b/src/mesa/main/texobj.h index 476a17537a3..1faae6f7e30 100644 --- a/src/mesa/main/texobj.h +++ b/src/mesa/main/texobj.h @@ -32,6 +32,7 @@ #define TEXTOBJ_H +#include "compiler.h" #include "glheader.h" struct gl_context; @@ -64,8 +65,17 @@ _mesa_clear_texture_object(struct gl_context *ctx, struct gl_texture_object *obj); extern void +_mesa_reference_texobj_(struct gl_texture_object **ptr, + struct gl_texture_object *tex); + +static INLINE void _mesa_reference_texobj(struct gl_texture_object **ptr, - struct gl_texture_object *tex); + struct gl_texture_object *tex) +{ + if (*ptr != tex) + _mesa_reference_texobj_(ptr, tex); +} + extern void _mesa_test_texobj_completeness( const struct gl_context *ctx,