summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r600/evergreen_state.c
diff options
context:
space:
mode:
authorHenri Verbeet <hverbeet@gmail.com>2011-02-01 01:17:02 +0100
committerHenri Verbeet <hverbeet@gmail.com>2011-02-01 01:19:16 +0100
commitd171ae086bae37279251a1d6f32e16e333cfc154 (patch)
tree295c72155f6f54eab2a259784de25b59ab48b3af /src/gallium/drivers/r600/evergreen_state.c
parent5e19b5ad16b2761fe9d8877318f2fc97b229335c (diff)
r600g: Actually use the info from the flushed depth texture when creating a sampler view on a depth texture.
R600/R700 was using incorrect tiling information from the (compressed) depth buffer. Evergreen worked anyway because tiling doesn't work.
Diffstat (limited to 'src/gallium/drivers/r600/evergreen_state.c')
-rw-r--r--src/gallium/drivers/r600/evergreen_state.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
index 1afbf892cf..5a923db3df 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -380,18 +380,15 @@ static struct pipe_sampler_view *evergreen_create_sampler_view(struct pipe_conte
if (desc == NULL) {
R600_ERR("unknow format %d\n", state->format);
}
- tmp = (struct r600_resource_texture*)texture;
- rbuffer = &tmp->resource;
- bo[0] = rbuffer->bo;
- bo[1] = rbuffer->bo;
- /* FIXME depth texture decompression */
+ tmp = (struct r600_resource_texture *)texture;
if (tmp->depth) {
r600_texture_depth_flush(ctx, texture);
- tmp = (struct r600_resource_texture*)texture;
- rbuffer = &tmp->flushed_depth_texture->resource;
- bo[0] = rbuffer->bo;
- bo[1] = rbuffer->bo;
+ tmp = tmp->flushed_depth_texture;
}
+ rbuffer = &tmp->resource;
+ bo[0] = rbuffer->bo;
+ bo[1] = rbuffer->bo;
+
pitch = align(tmp->pitch_in_pixels[0], 8);
/* FIXME properly handle first level != 0 */