[Mesa-dev] [PATCH 071/101] mesa: add KHR_no_error support to glDetachShader() and glDetachObjectARB()

Samuel Pitoiset samuel.pitoiset at gmail.com
Fri Jul 21 17:40:20 UTC 2017


Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/mapi/glapi/gen/gl_API.xml |  4 ++--
 src/mesa/main/shaderapi.c     | 23 +++++++++++++++++++++++
 src/mesa/main/shaderapi.h     |  6 ++++++
 3 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
index 53b234b2f9..3e2bdc1736 100644
--- a/src/mapi/glapi/gen/gl_API.xml
+++ b/src/mapi/glapi/gen/gl_API.xml
@@ -5334,7 +5334,7 @@
         <glx ignore="true"/>
     </function>
 
-    <function name="DetachShader" es2="2.0">
+    <function name="DetachShader" es2="2.0" no_error="true">
         <param name="program" type="GLuint"/>
         <param name="shader" type="GLuint"/>
         <glx ignore="true"/>
@@ -7681,7 +7681,7 @@
         <glx ignore="true"/>
     </function>
 
-    <function name="DetachObjectARB">
+    <function name="DetachObjectARB" no_error="true">
         <param name="containerObj" type="GLhandleARB"/>
         <param name="attachedObj" type="GLhandleARB"/>
         <glx ignore="true"/>
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 29e2ed75a5..e690e4731f 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -504,6 +504,13 @@ detach_shader_error(struct gl_context *ctx, GLuint program, GLuint shader)
 }
 
 
+static void
+detach_shader_no_error(struct gl_context *ctx, GLuint program, GLuint shader)
+{
+   detach_shader(ctx, program, shader, true);
+}
+
+
 /**
  * Return list of shaders attached to shader program.
  */
@@ -1508,6 +1515,14 @@ _mesa_DeleteShader(GLuint name)
 
 
 void GLAPIENTRY
+_mesa_DetachObjectARB_no_error(GLhandleARB program, GLhandleARB shader)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   detach_shader_no_error(ctx, program, shader);
+}
+
+
+void GLAPIENTRY
 _mesa_DetachObjectARB(GLhandleARB program, GLhandleARB shader)
 {
    GET_CURRENT_CONTEXT(ctx);
@@ -1516,6 +1531,14 @@ _mesa_DetachObjectARB(GLhandleARB program, GLhandleARB shader)
 
 
 void GLAPIENTRY
+_mesa_DetachShader_no_error(GLuint program, GLuint shader)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   detach_shader_no_error(ctx, program, shader);
+}
+
+
+void GLAPIENTRY
 _mesa_DetachShader(GLuint program, GLuint shader)
 {
    GET_CURRENT_CONTEXT(ctx);
diff --git a/src/mesa/main/shaderapi.h b/src/mesa/main/shaderapi.h
index ae53021d91..e4c3bd2e76 100644
--- a/src/mesa/main/shaderapi.h
+++ b/src/mesa/main/shaderapi.h
@@ -95,6 +95,9 @@ _mesa_CreateShaderObjectARB(GLenum type);
 extern void GLAPIENTRY
 _mesa_DeleteObjectARB(GLhandleARB obj);
 
+void GLAPIENTRY
+_mesa_DetachObjectARB_no_error(GLhandleARB, GLhandleARB);
+
 extern void GLAPIENTRY
 _mesa_DetachObjectARB(GLhandleARB, GLhandleARB);
 
@@ -193,6 +196,9 @@ _mesa_DeleteProgram(GLuint program);
 extern void GLAPIENTRY
 _mesa_DeleteShader(GLuint shader);
 
+void GLAPIENTRY
+_mesa_DetachShader_no_error(GLuint program, GLuint shader);
+
 extern void GLAPIENTRY
 _mesa_DetachShader(GLuint program, GLuint shader);
 
-- 
2.13.3



More information about the mesa-dev mailing list