Mesa (master): mesa: add KHR_no_error support for glGetImageHandleARB()

Samuel Pitoiset hakzsam at kemper.freedesktop.org
Sun Jun 18 12:25:42 UTC 2017


Module: Mesa
Branch: master
Commit: 304de4edb941e42aa37002b1ca598647f5cd248f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=304de4edb941e42aa37002b1ca598647f5cd248f

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Wed Jun 14 11:27:43 2017 +0200

mesa: add KHR_no_error support for glGetImageHandleARB()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>

---

 src/mapi/glapi/gen/ARB_bindless_texture.xml |  2 +-
 src/mesa/main/texturebindless.c             | 15 +++++++++++++++
 src/mesa/main/texturebindless.h             |  4 ++++
 3 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/src/mapi/glapi/gen/ARB_bindless_texture.xml b/src/mapi/glapi/gen/ARB_bindless_texture.xml
index 0f3de162de..762cadf6fe 100644
--- a/src/mapi/glapi/gen/ARB_bindless_texture.xml
+++ b/src/mapi/glapi/gen/ARB_bindless_texture.xml
@@ -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" />
diff --git a/src/mesa/main/texturebindless.c b/src/mesa/main/texturebindless.c
index a56d6e3b37..cb95ed07c5 100644
--- a/src/mesa/main/texturebindless.c
+++ b/src/mesa/main/texturebindless.c
@@ -772,6 +772,21 @@ _mesa_MakeTextureHandleNonResidentARB(GLuint64 handle)
 }
 
 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)
 {
diff --git a/src/mesa/main/texturebindless.h b/src/mesa/main/texturebindless.h
index 62c954b657..8a9fff6d57 100644
--- a/src/mesa/main/texturebindless.h
+++ b/src/mesa/main/texturebindless.h
@@ -92,6 +92,10 @@ 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);
 




More information about the mesa-commit mailing list