[Mesa-dev] [PATCH V2 14/15] mesa: add KHR_no_error support for FramebufferTexture

Timothy Arceri tarceri at itsqueeze.com
Wed May 10 01:56:57 UTC 2017


V2: use the framebuffer_texture_no_error() helper
---
 src/mapi/glapi/gen/GL3x.xml |  2 +-
 src/mesa/main/fbobject.c    | 14 ++++++++++++++
 src/mesa/main/fbobject.h    |  3 +++
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/src/mapi/glapi/gen/GL3x.xml b/src/mapi/glapi/gen/GL3x.xml
index d2c768d..10c157e 100644
--- a/src/mapi/glapi/gen/GL3x.xml
+++ b/src/mapi/glapi/gen/GL3x.xml
@@ -600,21 +600,21 @@
     <param name="index" type="GLuint"/>
     <param name="data" type="GLint64 *"/>
   </function>
 
   <function name="GetBufferParameteri64v" es2="3.0">
     <param name="target" type="GLenum"/>
     <param name="pname" type="GLenum"/>
     <param name="params" type="GLint64 *"/>
   </function>
 
-  <function name="FramebufferTexture" es2="3.2">
+  <function name="FramebufferTexture" es2="3.2" no_error="true">
     <param name="target" type="GLenum"/>
     <param name="attachment" type="GLenum"/>
     <param name="texture" type="GLuint"/>
     <param name="level" type="GLint"/>
   </function>
 
 </category>
 
 
 <category name="3.3">
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index f4df151..6dcd547 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -3604,20 +3604,34 @@ framebuffer_texture_no_error(struct gl_context *ctx,
    if (texObj) {
       check_layered_texture_target(ctx, texObj->Target, func, &layered);
    }
 
    _mesa_framebuffer_texture(ctx, fb, attachment, att, texObj, 0, level,
                              0, layered);
 }
 
 
 void GLAPIENTRY
+_mesa_FramebufferTexture_no_error(GLenum target, GLenum attachment,
+                                  GLuint texture, GLint level)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   /* Get the framebuffer object */
+   struct gl_framebuffer *fb = get_framebuffer_target(ctx, target);
+
+   framebuffer_texture_no_error(ctx, fb, attachment, texture, level,
+                                "FramebufferTexture");
+}
+
+
+void GLAPIENTRY
 _mesa_FramebufferTexture(GLenum target, GLenum attachment,
                          GLuint texture, GLint level)
 {
    GET_CURRENT_CONTEXT(ctx);
    struct gl_framebuffer *fb;
    struct gl_texture_object *texObj;
    GLboolean layered = GL_FALSE;
 
    const char *func = "FramebufferTexture";
 
diff --git a/src/mesa/main/fbobject.h b/src/mesa/main/fbobject.h
index a2f9264..1d064f8 100644
--- a/src/mesa/main/fbobject.h
+++ b/src/mesa/main/fbobject.h
@@ -251,20 +251,23 @@ _mesa_FramebufferTextureLayer(GLenum target, GLenum attachment,
 extern void GLAPIENTRY
 _mesa_NamedFramebufferTextureLayer_no_error(GLuint framebuffer,
                                             GLenum attachment,
                                             GLuint texture, GLint level,
                                             GLint layer);
 extern void GLAPIENTRY
 _mesa_NamedFramebufferTextureLayer(GLuint framebuffer, GLenum attachment,
                                    GLuint texture, GLint level, GLint layer);
 
 extern void GLAPIENTRY
+_mesa_FramebufferTexture_no_error(GLenum target, GLenum attachment,
+                                  GLuint texture, GLint level);
+extern void GLAPIENTRY
 _mesa_FramebufferTexture(GLenum target, GLenum attachment,
                          GLuint texture, GLint level);
 
 extern void GLAPIENTRY
 _mesa_NamedFramebufferTexture(GLuint framebuffer, GLenum attachment,
                               GLuint texture, GLint level);
 
 extern void GLAPIENTRY
 _mesa_FramebufferRenderbuffer(GLenum target, GLenum attachment,
                                  GLenum renderbuffertarget,
-- 
2.9.3



More information about the mesa-dev mailing list