mesa: add KHR_no_error support for glGetTexture*HandleARB()

It would be nice to have a no_error path for
_mesa_test_texobj_completeness() because this function doesn't
only test if the texture is complete.

Anyway, that seems enough for now and a bunch of checks are
skipped with this patch.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
This commit is contained in:
Samuel Pitoiset
2017-06-14 11:27:42 +02:00
parent 0fb2c89c71
commit 530ff887eb
3 changed files with 40 additions and 2 deletions

View File

@@ -532,6 +532,20 @@ is_sampler_border_color_valid(struct gl_sampler_object *samp)
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)
{
@@ -583,6 +597,23 @@ _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)
{