mesa: add KHR_no_error support for glGetImageHandleARB()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 14 Jun 2017 09:27:43 +0000 (11:27 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Sun, 18 Jun 2017 12:21:04 +0000 (14:21 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mapi/glapi/gen/ARB_bindless_texture.xml
src/mesa/main/texturebindless.c
src/mesa/main/texturebindless.h

index 0f3de162de7bc3b0c6630bef972b9d8f5a0789af..762cadf6fea1144ee0e76d9e24298662fc061a84 100644 (file)
@@ -27,7 +27,7 @@
       <param name="handle" type="GLuint64" />
    </function>
 
-   <function name="GetImageHandleARB">
+   <function name="GetImageHandleARB" no_error="true">
       <return type="GLuint64"/>
       <param name="texture" type="GLuint" />
       <param name="level" type="GLint" />
index a56d6e3b370626c6b805c2028cfc6b6c948ff626..cb95ed07c5aeaada2df8e41ebbea9951e74e8862 100644 (file)
@@ -771,6 +771,21 @@ _mesa_MakeTextureHandleNonResidentARB(GLuint64 handle)
    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)
index 62c954b6576eb1a02dc69ad6c71d5efe534e171f..8a9fff6d57ec763331ecd7d570a54eb4c3f08712 100644 (file)
@@ -91,6 +91,10 @@ _mesa_MakeTextureHandleNonResidentARB_no_error(GLuint64 handle);
 void GLAPIENTRY
 _mesa_MakeTextureHandleNonResidentARB(GLuint64 handle);
 
+GLuint64 GLAPIENTRY
+_mesa_GetImageHandleARB_no_error(GLuint texture, GLint level, GLboolean layered,
+                                 GLint layer, GLenum format);
+
 GLuint64 GLAPIENTRY
 _mesa_GetImageHandleARB(GLuint texture, GLint level, GLboolean layered,
                         GLint layer, GLenum format);