BATCH_LOCALS(&r300->radeon);
struct radeon_renderbuffer *rrb;
uint32_t cbpitch;
+ uint32_t offset = r300->radeon.state.color.draw_offset;
rrb = radeon_get_colorbuffer(&r300->radeon);
if (!rrb || !rrb->bo) {
BEGIN_BATCH_NO_AUTOSTATE(6);
OUT_BATCH_REGSEQ(R300_RB3D_COLOROFFSET0, 1);
- OUT_BATCH_RELOC(0, rrb->bo, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0);
+ OUT_BATCH_RELOC(offset, rrb->bo, offset, 0, RADEON_GEM_DOMAIN_VRAM, 0);
OUT_BATCH_REGSEQ(R300_RB3D_COLORPITCH0, 1);
OUT_BATCH(cbpitch);
END_BATCH();
radeonContextPtr radeon = RADEON_CONTEXT(ctx);
struct radeon_renderbuffer *rrbDepth = NULL, *rrbStencil = NULL,
*rrbColor = NULL;
+ uint32_t offset = 0;
if (!fb) {
/* user FBO in theory */
struct radeon_renderbuffer *rrb;
rrb = (void *)fb->_ColorDrawBuffers[0];
+ offset = rrb->draw_offset;
rrbColor = rrb;
radeon->constant_cliprect = GL_TRUE;
}
radeon->state.depth.rrb = rrbDepth;
radeon->state.color.rrb = rrbColor;
+ radeon->state.color.draw_offset = offset;
/* update viewport since it depends on window size */
if (ctx->Driver.Viewport) {
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;
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;
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);
}
/* 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);