From a62808085a09bbf45519567e3a3a83aa485821f6 Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Thu, 18 Apr 2013 10:08:50 -0700 Subject: [PATCH] mesa: add renderbuffer attachment Layered field If glFramebufferTexture is used, then the framebuffer attachment is layered. Signed-off-by: Jordan Justen Reviewed-by: Brian Paul --- src/mesa/main/fbobject.c | 16 +++++++++------- src/mesa/main/fbobject.h | 3 ++- src/mesa/main/mtypes.h | 1 + 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 645a8a3..7984661 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -351,7 +351,8 @@ _mesa_set_texture_attachment(struct gl_context *ctx, struct gl_framebuffer *fb, struct gl_renderbuffer_attachment *att, struct gl_texture_object *texObj, - GLenum texTarget, GLuint level, GLuint zoffset) + GLenum texTarget, GLuint level, GLuint zoffset, + GLboolean layered) { if (att->Texture == texObj) { /* re-attaching same texture */ @@ -373,6 +374,7 @@ _mesa_set_texture_attachment(struct gl_context *ctx, att->TextureLevel = level; att->CubeMapFace = _mesa_tex_target_to_face(texTarget); att->Zoffset = zoffset; + att->Layered = layered; att->Complete = GL_FALSE; if (_mesa_get_attachment_teximage(att)) { @@ -2103,7 +2105,7 @@ reuse_framebuffer_texture_attachment(struct gl_framebuffer *fb, static void framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, - GLint level, GLint zoffset) + GLint level, GLint zoffset, GLboolean layered) { struct gl_renderbuffer_attachment *att; struct gl_texture_object *texObj = NULL; @@ -2230,7 +2232,7 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target, BUFFER_DEPTH); } else { _mesa_set_texture_attachment(ctx, fb, att, texObj, textarget, - level, zoffset); + level, zoffset, layered); if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { /* Above we created a new renderbuffer and attached it to the * depth attachment point. Now attach it to the stencil attachment @@ -2296,7 +2298,7 @@ _mesa_FramebufferTexture1D(GLenum target, GLenum attachment, } framebuffer_texture(ctx, "1D", target, attachment, textarget, texture, - level, 0); + level, 0, GL_FALSE); } @@ -2347,7 +2349,7 @@ _mesa_FramebufferTexture2D(GLenum target, GLenum attachment, } framebuffer_texture(ctx, "2D", target, attachment, textarget, texture, - level, 0); + level, 0, GL_FALSE); } @@ -2365,7 +2367,7 @@ _mesa_FramebufferTexture3D(GLenum target, GLenum attachment, } framebuffer_texture(ctx, "3D", target, attachment, textarget, texture, - level, zoffset); + level, zoffset, GL_FALSE); } @@ -2376,7 +2378,7 @@ _mesa_FramebufferTextureLayer(GLenum target, GLenum attachment, GET_CURRENT_CONTEXT(ctx); framebuffer_texture(ctx, "Layer", target, attachment, 0, texture, - level, layer); + level, layer, GL_FALSE); } diff --git a/src/mesa/main/fbobject.h b/src/mesa/main/fbobject.h index 9e934ad..5ebbb35 100644 --- a/src/mesa/main/fbobject.h +++ b/src/mesa/main/fbobject.h @@ -99,7 +99,8 @@ _mesa_set_texture_attachment(struct gl_context *ctx, struct gl_framebuffer *fb, struct gl_renderbuffer_attachment *att, struct gl_texture_object *texObj, - GLenum texTarget, GLuint level, GLuint zoffset); + GLenum texTarget, GLuint level, GLuint zoffset, + GLboolean layered); extern void _mesa_set_renderbuffer_attachment(struct gl_context *ctx, diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 130c7b7..8dda8e2 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2610,6 +2610,7 @@ struct gl_renderbuffer_attachment GLuint CubeMapFace; /**< 0 .. 5, for cube map textures. */ GLuint Zoffset; /**< Slice for 3D textures, or layer for both 1D * and 2D array textures */ + GLboolean Layered; }; -- 2.7.4