Mesa (master): mesa: add KHR_no_error support for glMake{Image, Texture}Handle*ResidentARB()

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


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

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

mesa: add KHR_no_error support for glMake{Image,Texture}Handle*ResidentARB()

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 |  8 +++---
 src/mesa/main/texturebindless.c             | 44 +++++++++++++++++++++++++++++
 src/mesa/main/texturebindless.h             | 14 +++++++++
 3 files changed, 62 insertions(+), 4 deletions(-)

diff --git a/src/mapi/glapi/gen/ARB_bindless_texture.xml b/src/mapi/glapi/gen/ARB_bindless_texture.xml
index 916e198a1e..bc82ef9d68 100644
--- a/src/mapi/glapi/gen/ARB_bindless_texture.xml
+++ b/src/mapi/glapi/gen/ARB_bindless_texture.xml
@@ -19,11 +19,11 @@
       <param name="sampler" type="GLuint" />
    </function>
 
-   <function name="MakeTextureHandleResidentARB">
+   <function name="MakeTextureHandleResidentARB" no_error="true">
       <param name="handle" type="GLuint64" />
    </function>
 
-   <function name="MakeTextureHandleNonResidentARB">
+   <function name="MakeTextureHandleNonResidentARB" no_error="true">
       <param name="handle" type="GLuint64" />
    </function>
 
@@ -36,12 +36,12 @@
       <param name="format" type="GLenum" />
    </function>
 
-   <function name="MakeImageHandleResidentARB">
+   <function name="MakeImageHandleResidentARB" no_error="true">
       <param name="handle" type="GLuint64" />
       <param name="access" type="GLenum" />
    </function>
 
-   <function name="MakeImageHandleNonResidentARB">
+   <function name="MakeImageHandleNonResidentARB" no_error="true">
       <param name="handle" type="GLuint64" />
    </function>
 
diff --git a/src/mesa/main/texturebindless.c b/src/mesa/main/texturebindless.c
index dac6c569a5..5c606e9f4b 100644
--- a/src/mesa/main/texturebindless.c
+++ b/src/mesa/main/texturebindless.c
@@ -649,6 +649,17 @@ _mesa_GetTextureSamplerHandleARB(GLuint texture, GLuint sampler)
 }
 
 void GLAPIENTRY
+_mesa_MakeTextureHandleResidentARB_no_error(GLuint64 handle)
+{
+   struct gl_texture_handle_object *texHandleObj;
+
+   GET_CURRENT_CONTEXT(ctx);
+
+   texHandleObj = lookup_texture_handle(ctx, handle);
+   make_texture_handle_resident(ctx, texHandleObj, true);
+}
+
+void GLAPIENTRY
 _mesa_MakeTextureHandleResidentARB(GLuint64 handle)
 {
    struct gl_texture_handle_object *texHandleObj;
@@ -684,6 +695,17 @@ _mesa_MakeTextureHandleResidentARB(GLuint64 handle)
 }
 
 void GLAPIENTRY
+_mesa_MakeTextureHandleNonResidentARB_no_error(GLuint64 handle)
+{
+   struct gl_texture_handle_object *texHandleObj;
+
+   GET_CURRENT_CONTEXT(ctx);
+
+   texHandleObj = lookup_texture_handle(ctx, handle);
+   make_texture_handle_resident(ctx, texHandleObj, false);
+}
+
+void GLAPIENTRY
 _mesa_MakeTextureHandleNonResidentARB(GLuint64 handle)
 {
    struct gl_texture_handle_object *texHandleObj;
@@ -790,6 +812,17 @@ _mesa_GetImageHandleARB(GLuint texture, GLint level, GLboolean layered,
 }
 
 void GLAPIENTRY
+_mesa_MakeImageHandleResidentARB_no_error(GLuint64 handle, GLenum access)
+{
+   struct gl_image_handle_object *imgHandleObj;
+
+   GET_CURRENT_CONTEXT(ctx);
+
+   imgHandleObj = lookup_image_handle(ctx, handle);
+   make_image_handle_resident(ctx, imgHandleObj, access, true);
+}
+
+void GLAPIENTRY
 _mesa_MakeImageHandleResidentARB(GLuint64 handle, GLenum access)
 {
    struct gl_image_handle_object *imgHandleObj;
@@ -834,6 +867,17 @@ _mesa_MakeImageHandleResidentARB(GLuint64 handle, GLenum access)
 }
 
 void GLAPIENTRY
+_mesa_MakeImageHandleNonResidentARB_no_error(GLuint64 handle)
+{
+   struct gl_image_handle_object *imgHandleObj;
+
+   GET_CURRENT_CONTEXT(ctx);
+
+   imgHandleObj = lookup_image_handle(ctx, handle);
+   make_image_handle_resident(ctx, imgHandleObj, GL_READ_ONLY, false);
+}
+
+void GLAPIENTRY
 _mesa_MakeImageHandleNonResidentARB(GLuint64 handle)
 {
    struct gl_image_handle_object *imgHandleObj;
diff --git a/src/mesa/main/texturebindless.h b/src/mesa/main/texturebindless.h
index 0fcea61d43..467105ef41 100644
--- a/src/mesa/main/texturebindless.h
+++ b/src/mesa/main/texturebindless.h
@@ -73,7 +73,14 @@ GLuint64 GLAPIENTRY
 _mesa_GetTextureSamplerHandleARB(GLuint texture, GLuint sampler);
 
 void GLAPIENTRY
+_mesa_MakeTextureHandleResidentARB_no_error(GLuint64 handle);
+
+void GLAPIENTRY
 _mesa_MakeTextureHandleResidentARB(GLuint64 handle);
+
+void GLAPIENTRY
+_mesa_MakeTextureHandleNonResidentARB_no_error(GLuint64 handle);
+
 void GLAPIENTRY
 _mesa_MakeTextureHandleNonResidentARB(GLuint64 handle);
 
@@ -82,7 +89,14 @@ _mesa_GetImageHandleARB(GLuint texture, GLint level, GLboolean layered,
                         GLint layer, GLenum format);
 
 void GLAPIENTRY
+_mesa_MakeImageHandleResidentARB_no_error(GLuint64 handle, GLenum access);
+
+void GLAPIENTRY
 _mesa_MakeImageHandleResidentARB(GLuint64 handle, GLenum access);
+
+void GLAPIENTRY
+_mesa_MakeImageHandleNonResidentARB_no_error(GLuint64 handle);
+
 void GLAPIENTRY
 _mesa_MakeImageHandleNonResidentARB(GLuint64 handle);
 




More information about the mesa-commit mailing list