summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/common/meta.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-03-17 16:45:48 -0700
committerEric Anholt <[email protected]>2014-04-15 14:34:22 -0700
commitbb3f983d102bf09b8315f50494633bf489721a52 (patch)
treebd74ad40ec6c81f7e267539759e3c3a894b26d98 /src/mesa/drivers/common/meta.c
parentcd808ac848227b850a80c1adbb43ce57ca7d673a (diff)
meta: Infer bind_fbo_image parameters from an incoming image.
Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/common/meta.c')
-rw-r--r--src/mesa/drivers/common/meta.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index ca5d851fff1..6dc71c9d542 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -94,9 +94,12 @@ static void meta_decompress_cleanup(struct decompress_state *decompress);
static void meta_drawpix_cleanup(struct drawpix_state *drawpix);
void
-_mesa_meta_bind_fbo_image(struct gl_texture_object *texObj, GLenum target,
- GLuint level, GLuint layer)
+_mesa_meta_bind_fbo_image(struct gl_texture_image *texImage, GLuint layer)
{
+ struct gl_texture_object *texObj = texImage->TexObject;
+ int level = texImage->Level;
+ GLenum target = texObj->Target;
+
switch (target) {
case GL_TEXTURE_1D:
_mesa_FramebufferTexture1D(GL_FRAMEBUFFER,
@@ -115,6 +118,9 @@ _mesa_meta_bind_fbo_image(struct gl_texture_object *texObj, GLenum target,
layer);
break;
default: /* 2D / cube */
+ if (target == GL_TEXTURE_CUBE_MAP)
+ target = GL_TEXTURE_CUBE_MAP_POSITIVE_X + texImage->Face;
+
_mesa_FramebufferTexture2D(GL_FRAMEBUFFER,
GL_COLOR_ATTACHMENT0,
target,