struct radeon_renderbuffer *rb;
if ((rb = (void *)draw->Attachment[BUFFER_FRONT_LEFT].Renderbuffer)) {
-
if (!rb->bo) {
rb->bo = radeon_bo_open(radeon->radeonScreen->bom,
radeon->radeonScreen->frontOffset,
rb->cpp = radeon->radeonScreen->cpp;
rb->pitch = radeon->radeonScreen->depthPitch * rb->cpp;
}
+ if ((rb = (void *)draw->Attachment[BUFFER_STENCIL].Renderbuffer)) {
+ if (!rb->bo) {
+ rb->bo = radeon_bo_open(radeon->radeonScreen->bom,
+ radeon->radeonScreen->depthOffset,
+ 0,
+ 0,
+ RADEON_GEM_DOMAIN_VRAM,
+ 0);
+ }
+ rb->cpp = radeon->radeonScreen->cpp;
+ rb->pitch = radeon->radeonScreen->depthPitch * rb->cpp;
+ }
}
static void
rb->cpp = radeon->radeonScreen->cpp;
rb->pitch = radeon->radeonScreen->depthPitch * rb->cpp;
}
+ if ((rb = (void *)draw->Attachment[BUFFER_STENCIL].Renderbuffer)) {
+ if (!rb->bo) {
+ rb->bo = radeon_bo_open(radeon->radeonScreen->bom,
+ radeon->radeonScreen->depthOffset +
+ radeon->radeonScreen->fbLocation,
+ size,
+ 4096,
+ RADEON_GEM_DOMAIN_VRAM,
+ 0);
+ }
+ rb->cpp = radeon->radeonScreen->cpp;
+ rb->pitch = radeon->radeonScreen->depthPitch * rb->cpp;
+ }
}
int i, count;
GLframebuffer *draw;
radeonContextPtr radeon;
+
+ if (RADEON_DEBUG & DEBUG_DRI)
+ fprintf(stderr, "enter %s, drawable %p\n", __func__, drawable);
draw = drawable->driverPrivate;
screen = context->driScreenPriv;
(void *)dfb->Attachment[BUFFER_BACK_LEFT].Renderbuffer;
radeon->state.depth.rrb =
(void *)dfb->Attachment[BUFFER_DEPTH].Renderbuffer;
+ } else {
+ radeon_make_renderbuffer_current(radeon, dfb);
}
if (RADEON_DEBUG & DEBUG_DRI)
- fprintf(stderr, "%s ctx %p\n", __FUNCTION__, radeon->glCtx);
+ fprintf(stderr, "%s ctx %p dfb %p rfb %p\n", __FUNCTION__, radeon->glCtx, dfb, rfb);
driUpdateFramebufferSize(radeon->glCtx, driDrawPriv);
if (driReadPriv != driDrawPriv)
driUpdateFramebufferSize(radeon->glCtx, driReadPriv);
- if (!driContextPriv->driScreenPriv->dri2.enabled) {
- radeon_make_renderbuffer_current(radeon, dfb);
- }
+
_mesa_make_current(radeon->glCtx, dfb, rfb);
radeon_bo_unref(image->bo);
image->bo = NULL;
}
+ if (timage->Data) {
+ _mesa_free_texmemory(timage->Data);
+ timage->Data = NULL;
+ }
}
/* Set Data pointer and additional data for mapped texture image */
static void teximage_set_map_data(radeon_texture_image *image)
{
radeon_mipmap_level *lvl = &image->mt->levels[image->mtlevel];
+
image->base.Data = image->mt->bo->ptr + lvl->faces[image->mtface].offset;
image->base.RowStride = lvl->rowstride / image->mt->bpp;
}
radeonTexObj* t = radeon_tex_obj(texObj);
int face, level;
- assert(texObj->_Complete);
+ // assert(texObj->_Complete);
assert(t->mt);
radeon_bo_map(t->mt->bo, GL_FALSE);
radeonTexObj* t = radeon_tex_obj(texObj);
int face, level;
- assert(texObj->_Complete);
+ // assert(texObj->_Complete);
assert(t->mt);
for(face = 0; face < t->mt->faces; ++face) {
if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
radeon_generate_mipmap(ctx, texObj->Target, texObj);
}
- radeon_teximage_unmap(image);
+
+ if (pixels)
+ radeon_teximage_unmap(image);
_mesa_unmap_teximage_pbo(ctx, packing);
assert(dstlvl->height == image->base.Height);
assert(dstlvl->depth == image->base.Depth);
+
radeon_bo_map(mt->bo, GL_TRUE);
dest = mt->bo->ptr + dstlvl->faces[face].offset;
assert(srclvl->rowstride == dstlvl->rowstride);
radeon_bo_map(image->mt->bo, GL_FALSE);
+
memcpy(dest,
image->mt->bo->ptr + srclvl->faces[face].offset,
dstlvl->size);
for(level = t->mt->firstLevel; level <= t->mt->lastLevel; ++level) {
radeon_texture_image *image = get_radeon_texture_image(texObj->Image[face][level]);
if (RADEON_DEBUG & DEBUG_TEXTURE)
- fprintf(stderr, " face %i, level %i... ", face, level);
+ fprintf(stderr, " face %i, level %i... %p vs %p ", face, level, t->mt, image->mt);
if (t->mt == image->mt) {
if (RADEON_DEBUG & DEBUG_TEXTURE)
fprintf(stderr, "OK\n");