[Mesa-dev] [PATCH V2 13/15] mesa: add framebuffer_texture_no_error() helper

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


To be used to add KHR_no_error support while sharing code between
the DSA and non-DSA OpenGL function.
---
 src/mesa/main/fbobject.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 7f16597..f4df151 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -3581,20 +3581,42 @@ _mesa_NamedFramebufferTextureLayer(GLuint framebuffer, GLenum attachment,
    struct gl_renderbuffer_attachment *att =
       _mesa_get_and_validate_attachment(ctx, fb, attachment, func);
    if (!att)
       return;
 
    _mesa_framebuffer_texture(ctx, fb, attachment, att, texObj, textarget,
                              level, layer, GL_FALSE);
 }
 
 
+static void
+framebuffer_texture_no_error(struct gl_context *ctx,
+                             struct gl_framebuffer *fb, GLenum attachment,
+                             GLuint texture, GLint level, const char *func)
+{
+   /* Get the texture object */
+   struct gl_texture_object *texObj =
+      get_texture_for_framebuffer(ctx, texture);
+
+   struct gl_renderbuffer_attachment *att =
+      get_attachment(ctx, fb, attachment, NULL);
+
+   GLboolean layered = GL_FALSE;
+   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(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";
-- 
2.9.3



More information about the mesa-dev mailing list