} else {
imgObj.Layered = GL_FALSE;
imgObj.Layer = 0;
+ imgObj._Layer = 0;
}
/* Request a new image handle from the driver. */
void
_mesa_free_shared_handles(struct gl_shared_state *shared)
{
- _mesa_hash_table_u64_destroy(shared->TextureHandles, NULL);
- _mesa_hash_table_u64_destroy(shared->ImageHandles, NULL);
+ if (shared->TextureHandles)
+ _mesa_hash_table_u64_destroy(shared->TextureHandles, NULL);
+
+ if (shared->ImageHandles)
+ _mesa_hash_table_u64_destroy(shared->ImageHandles, NULL);
+
mtx_destroy(&shared->HandlesMutex);
}
return GL_FALSE;
}
+GLuint64 GLAPIENTRY
+_mesa_GetTextureHandleARB_no_error(GLuint texture)
+{
+ struct gl_texture_object *texObj;
+
+ GET_CURRENT_CONTEXT(ctx);
+
+ texObj = _mesa_lookup_texture(ctx, texture);
+ if (!_mesa_is_texture_complete(texObj, &texObj->Sampler))
+ _mesa_test_texobj_completeness(ctx, texObj);
+
+ return get_texture_handle(ctx, texObj, &texObj->Sampler);
+}
+
GLuint64 GLAPIENTRY
_mesa_GetTextureHandleARB(GLuint texture)
{
return get_texture_handle(ctx, texObj, &texObj->Sampler);
}
+GLuint64 GLAPIENTRY
+_mesa_GetTextureSamplerHandleARB_no_error(GLuint texture, GLuint sampler)
+{
+ struct gl_texture_object *texObj;
+ struct gl_sampler_object *sampObj;
+
+ GET_CURRENT_CONTEXT(ctx);
+
+ texObj = _mesa_lookup_texture(ctx, texture);
+ sampObj = _mesa_lookup_samplerobj(ctx, sampler);
+
+ if (!_mesa_is_texture_complete(texObj, sampObj))
+ _mesa_test_texobj_completeness(ctx, texObj);
+
+ return get_texture_handle(ctx, texObj, sampObj);
+}
+
GLuint64 GLAPIENTRY
_mesa_GetTextureSamplerHandleARB(GLuint texture, GLuint sampler)
{
make_texture_handle_resident(ctx, texHandleObj, false);
}
+GLuint64 GLAPIENTRY
+_mesa_GetImageHandleARB_no_error(GLuint texture, GLint level, GLboolean layered,
+ GLint layer, GLenum format)
+{
+ struct gl_texture_object *texObj;
+
+ GET_CURRENT_CONTEXT(ctx);
+
+ texObj = _mesa_lookup_texture(ctx, texture);
+ if (!_mesa_is_texture_complete(texObj, &texObj->Sampler))
+ _mesa_test_texobj_completeness(ctx, texObj);
+
+ return get_image_handle(ctx, texObj, level, layered, layer, format);
+}
+
GLuint64 GLAPIENTRY
_mesa_GetImageHandleARB(GLuint texture, GLint level, GLboolean layered,
GLint layer, GLenum format)