mesa: add KHR_no_error support to glDetachShader() and glDetachObjectARB()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 19 Jul 2017 12:42:07 +0000 (14:42 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 31 Jul 2017 11:53:40 +0000 (13:53 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mapi/glapi/gen/gl_API.xml
src/mesa/main/shaderapi.c
src/mesa/main/shaderapi.h

index 53b234b2f9636da75ea63f41232f91b586f8c8c7..3e2bdc1736ec3f51526d852448bf8ddcb02da823 100644 (file)
         <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"/>
         <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"/>
index 29e2ed75a5ac83901de3ceb2dfd9bedc33d95f78..e690e4731fa73f04ec2ac6cebca5298957a646d3 100644 (file)
@@ -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.
  */
@@ -1507,6 +1514,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)
 {
@@ -1515,6 +1530,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)
 {
index ae53021d9148abd13759778e23af2cd7dd02b210..e4c3bd2e76e4f5a8220ea6fc246b098f204e21c4 100644 (file)
@@ -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);