diff options
Diffstat (limited to 'src/mesa/main/texobj.c')
-rw-r--r-- | src/mesa/main/texobj.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 868e4eb7a27..1877262ed65 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -43,6 +43,7 @@ #include "texstate.h" #include "mtypes.h" #include "program/prog_instruction.h" +#include "texturebindless.h" @@ -311,6 +312,7 @@ _mesa_initialize_texture_object( struct gl_context *ctx, obj->DepthMode = ctx->API == API_OPENGL_CORE ? GL_RED : GL_LUMINANCE; obj->StencilSampling = false; obj->Sampler.CubeMapSeamless = GL_FALSE; + obj->Sampler.HandleAllocated = GL_FALSE; obj->Swizzle[0] = GL_RED; obj->Swizzle[1] = GL_GREEN; obj->Swizzle[2] = GL_BLUE; @@ -320,6 +322,9 @@ _mesa_initialize_texture_object( struct gl_context *ctx, obj->BufferObjectFormat = GL_R8; obj->_BufferObjectFormat = MESA_FORMAT_R_UNORM8; obj->ImageFormatCompatibilityType = GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE; + + /* GL_ARB_bindless_texture */ + _mesa_init_texture_handles(obj); } @@ -397,6 +402,9 @@ _mesa_delete_texture_object(struct gl_context *ctx, } } + /* Delete all texture/image handles. */ + _mesa_delete_texture_handles(ctx, texObj); + _mesa_reference_buffer_object(ctx, &texObj->BufferObject, NULL); /* destroy the mutex -- it may have allocated memory (eg on bsd) */ @@ -1461,6 +1469,11 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *textures) */ unbind_texobj_from_image_units(ctx, delObj); + /* Make all handles that reference this texture object non-resident + * in the current context. + */ + _mesa_make_texture_handles_non_resident(ctx, delObj); + _mesa_unlock_texture(ctx, delObj); ctx->NewState |= _NEW_TEXTURE_OBJECT; |