diff options
author | Kenneth Graunke <[email protected]> | 2014-03-05 20:55:51 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2014-03-07 22:45:16 -0800 |
commit | 15b2f69b9c7d573bc978241da50549be4d3f2aca (patch) | |
tree | 6954cb4d230122c8537ca8eb7c769d8e31fc8327 /src/mesa | |
parent | be84d53d445419062173216ffc7e5e111fe23353 (diff) |
meta: Add a 'layer' argument to bind_fbo_image().
For array textures and 3D textures, this represents the layer to use.
Just pass 0 for now.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Reviewed-by: Anuj Phogat <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/common/meta_generate_mipmap.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/mesa/drivers/common/meta_generate_mipmap.c b/src/mesa/drivers/common/meta_generate_mipmap.c index 5bdf1270bca..6ca6f228976 100644 --- a/src/mesa/drivers/common/meta_generate_mipmap.c +++ b/src/mesa/drivers/common/meta_generate_mipmap.c @@ -48,7 +48,8 @@ * Bind a particular texture level/layer to mipmap->FBO's GL_COLOR_ATTACHMENT0. */ static void -bind_fbo_image(struct gl_texture_object *texObj, GLenum target, GLuint level) +bind_fbo_image(struct gl_texture_object *texObj, GLenum target, + GLuint level, GLuint layer) { switch (target) { case GL_TEXTURE_1D: @@ -58,13 +59,14 @@ bind_fbo_image(struct gl_texture_object *texObj, GLenum target, GLuint level) texObj->Name, level); break; + case GL_TEXTURE_1D_ARRAY: + case GL_TEXTURE_2D_ARRAY: case GL_TEXTURE_3D: - _mesa_FramebufferTexture3D(GL_FRAMEBUFFER, - GL_COLOR_ATTACHMENT0, - target, - texObj->Name, - level, - 0); /* XXX: Unfinished */ + _mesa_FramebufferTextureLayer(GL_FRAMEBUFFER, + GL_COLOR_ATTACHMENT0, + texObj->Name, + level, + layer); break; default: /* 2D / cube */ _mesa_FramebufferTexture2D(GL_FRAMEBUFFER, @@ -135,7 +137,7 @@ fallback_required(struct gl_context *ctx, GLenum target, _mesa_GenFramebuffers(1, &mipmap->FBO); _mesa_BindFramebuffer(GL_FRAMEBUFFER_EXT, mipmap->FBO); - bind_fbo_image(texObj, target, srcLevel); + bind_fbo_image(texObj, target, srcLevel, 0); status = _mesa_CheckFramebufferStatus(GL_FRAMEBUFFER_EXT); @@ -323,7 +325,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target, /* limit minification to src level */ _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, srcLevel); - bind_fbo_image(texObj, faceTarget, dstLevel); + bind_fbo_image(texObj, faceTarget, dstLevel, 0); _mesa_DrawBuffer(GL_COLOR_ATTACHMENT0_EXT); |