r600g: use depth format from pipe_surface, not pipe_resource
authorMarek Olšák <maraeo@gmail.com>
Sat, 7 Jul 2012 16:41:01 +0000 (18:41 +0200)
committerMarek Olšák <maraeo@gmail.com>
Mon, 9 Jul 2012 11:57:59 +0000 (13:57 +0200)
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_state.c

index f0fdd2b9770eabf036a4b3fc7c8589bc731ecf28..15727986ea8c50b6c3db309fec20ff230d3422c4 100644 (file)
@@ -1533,7 +1533,7 @@ static void evergreen_db(struct r600_context *rctx, struct r600_pipe_state *rsta
        level = surf->base.u.tex.level;
        rtex = (struct r600_resource_texture*)surf->base.texture;
        first_layer = surf->base.u.tex.first_layer;
-       format = r600_translate_dbformat(rtex->real_format);
+       format = r600_translate_dbformat(surf->base.format);
 
        offset = r600_resource_va(rctx->context.screen, surf->base.texture);
        /* XXX remove this once tiling is properly supported */
@@ -2546,7 +2546,7 @@ void evergreen_polygon_offset_update(struct r600_context *rctx)
                float offset_units = rctx->rasterizer->offset_units;
                unsigned offset_db_fmt_cntl = 0, depth;
 
-               switch (rctx->framebuffer.zsbuf->texture->format) {
+               switch (rctx->framebuffer.zsbuf->format) {
                case PIPE_FORMAT_Z24X8_UNORM:
                case PIPE_FORMAT_Z24_UNORM_S8_UINT:
                        depth = -24;
index bb72bf8035971265d1fe0721a1fdb8f4fc19d365..3fd77daae7d8fa0091db4e21138480acf1f3f233 100644 (file)
@@ -637,7 +637,7 @@ void r600_polygon_offset_update(struct r600_context *rctx)
                float offset_units = rctx->rasterizer->offset_units;
                unsigned offset_db_fmt_cntl = 0, depth;
 
-               switch (rctx->framebuffer.zsbuf->texture->format) {
+               switch (rctx->framebuffer.zsbuf->format) {
                case PIPE_FORMAT_Z24X8_UNORM:
                case PIPE_FORMAT_Z24_UNORM_S8_UINT:
                        depth = -24;
@@ -1611,7 +1611,7 @@ static void r600_db(struct r600_context *rctx, struct r600_pipe_state *rstate,
                }
        }
 
-       format = r600_translate_dbformat(state->zsbuf->texture->format);
+       format = r600_translate_dbformat(state->zsbuf->format);
 
        r600_pipe_state_add_reg_bo(rstate, R_02800C_DB_DEPTH_BASE,
                                offset >> 8, &rtex->resource, RADEON_USAGE_READWRITE);