summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_fbo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/state_tracker/st_cb_fbo.c')
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index e5c956d561..c02121fbd1 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -321,15 +321,13 @@ st_render_texture(GLcontext *ctx,
struct pipe_resource *pt = st_get_texobj_resource(att->Texture);
struct st_texture_object *stObj;
const struct gl_texture_image *texImage;
- GLint pt_level;
/* When would this fail? Perhaps assert? */
if (!pt)
return;
- /* The first gallium texture level = Mesa BaseLevel */
- pt_level = MAX2(0, (GLint) att->TextureLevel - att->Texture->BaseLevel);
- texImage = att->Texture->Image[att->CubeMapFace][pt_level];
+ /* get pointer to texture image we're rendeing to */
+ texImage = att->Texture->Image[att->CubeMapFace][att->TextureLevel];
/* create new renderbuffer which wraps the texture image */
rb = st_new_renderbuffer(ctx, 0);
@@ -350,7 +348,7 @@ st_render_texture(GLcontext *ctx,
/* point renderbuffer at texobject */
strb->rtt = stObj;
- strb->rtt_level = pt_level;
+ strb->rtt_level = att->TextureLevel;
strb->rtt_face = att->CubeMapFace;
strb->rtt_slice = att->Zoffset;