diff options
author | Dave Airlie <[email protected]> | 2014-01-28 23:15:29 +0000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2014-02-05 10:49:41 +1000 |
commit | 7863611de3305208effe96fbbef5eaf49b60c904 (patch) | |
tree | 3f137a46c6508c367b95743c24d28cca90c0c76d /src/gallium/drivers/r600/r600_state.c | |
parent | f89394be986843a65150ae9bef761b73e58fd1ba (diff) |
r600g: port the layered surface rendering patch from radeonsi
This just makes r600 and evergreen do what the radeonsi codepaths do
for layered rendering. This makes the 2d amd_vertex_shader_layer test
pass on evergreen.
Signed-off-by: Dave Airlie <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_state.c')
-rw-r--r-- | src/gallium/drivers/r600/r600_state.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index 98e69247bf0..e0c801e60ed 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -1264,6 +1264,7 @@ static void r600_init_color_surface(struct r600_context *rctx, unsigned level = surf->base.u.tex.level; unsigned pitch, slice; unsigned color_info; + unsigned color_view; unsigned format, swap, ntype, endian; unsigned offset; const struct util_format_description *desc; @@ -1277,10 +1278,15 @@ static void r600_init_color_surface(struct r600_context *rctx, } offset = rtex->surface.level[level].offset; - if (rtex->surface.level[level].mode < RADEON_SURF_MODE_1D) { + if (rtex->surface.level[level].mode == RADEON_SURF_MODE_LINEAR) { + assert(surf->base.u.tex.first_layer == surf->base.u.tex.last_layer); offset += rtex->surface.level[level].slice_size * - surf->base.u.tex.first_layer; - } + surf->base.u.tex.first_layer; + color_view = 0; + } else + color_view = S_028080_SLICE_START(surf->base.u.tex.first_layer) | + S_028080_SLICE_MAX(surf->base.u.tex.last_layer); + pitch = rtex->surface.level[level].nblk_x / 8 - 1; slice = (rtex->surface.level[level].nblk_x * rtex->surface.level[level].nblk_y) / 64; if (slice) { @@ -1466,14 +1472,7 @@ static void r600_init_color_surface(struct r600_context *rctx, } surf->cb_color_info = color_info; - - if (rtex->surface.level[level].mode < RADEON_SURF_MODE_1D) { - surf->cb_color_view = 0; - } else { - surf->cb_color_view = S_028080_SLICE_START(surf->base.u.tex.first_layer) | - S_028080_SLICE_MAX(surf->base.u.tex.last_layer); - } - + surf->cb_color_view = color_view; surf->color_initialized = true; } |