diff options
author | Dave Airlie <airlied@redhat.com> | 2009-03-22 19:11:46 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-03-22 19:11:46 +1000 |
commit | c607a664dd005c001afda1fff1a68d41925fa86e (patch) | |
tree | 2c782c69823205ac215687f0f74ab82f8b1275c8 /src/mesa/drivers/dri/radeon/radeon_fbo.c | |
parent | 06cb6f7aa799e25b4a53f8c547a8f4ca909fe245 (diff) |
radeon fbo: add draw offset calcs
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_fbo.c')
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_fbo.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index a55a563340..7342f2295e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -377,24 +377,28 @@ radeon_update_wrapper(GLcontext *ctx, struct radeon_renderbuffer *rrb, struct gl_texture_image *texImage) { if (texImage->TexFormat == &_mesa_texformat_argb8888) { + rrb->cpp = 4; rrb->base._ActualFormat = GL_RGBA8; rrb->base._BaseFormat = GL_RGBA; rrb->base.DataType = GL_UNSIGNED_BYTE; DBG("Render to RGBA8 texture OK\n"); } else if (texImage->TexFormat == &_mesa_texformat_rgb565) { + rrb->cpp = 2; rrb->base._ActualFormat = GL_RGB5; rrb->base._BaseFormat = GL_RGB; rrb->base.DataType = GL_UNSIGNED_SHORT; DBG("Render to RGB5 texture OK\n"); } else if (texImage->TexFormat == &_mesa_texformat_z16) { + rrb->cpp = 2; rrb->base._ActualFormat = GL_DEPTH_COMPONENT16; rrb->base._BaseFormat = GL_DEPTH_COMPONENT; rrb->base.DataType = GL_UNSIGNED_SHORT; DBG("Render to DEPTH16 texture OK\n"); } else if (texImage->TexFormat == &_mesa_texformat_s8_z24) { + rrb->cpp = 4; rrb->base._ActualFormat = GL_DEPTH24_STENCIL8_EXT; rrb->base._BaseFormat = GL_DEPTH_STENCIL_EXT; rrb->base.DataType = GL_UNSIGNED_INT_24_8_EXT; @@ -406,6 +410,7 @@ radeon_update_wrapper(GLcontext *ctx, struct radeon_renderbuffer *rrb, return GL_FALSE; } + rrb->pitch = texImage->Width * rrb->cpp; rrb->base.InternalFormat = rrb->base._ActualFormat; rrb->base.Width = texImage->Width; rrb->base.Height = texImage->Height; @@ -488,7 +493,7 @@ radeon_render_texture(GLcontext * ctx, return; } - DBG("Begin render texture tid %x tex=%u w=%d h=%d refcount=%d\n", + fprintf(stderr,"Begin render texture tid %x tex=%u w=%d h=%d refcount=%d\n", _glthread_GetID(), att->Texture->Name, newImage->Width, newImage->Height, rrb->base.RefCount); @@ -514,7 +519,7 @@ radeon_render_texture(GLcontext * ctx, } /* store that offset in the region */ - //TODO radeon_image->mt->draw_offset = imageOffset; + rrb->draw_offset = imageOffset; /* update drawing region, etc */ radeon_draw_buffer(ctx, fb); |