r600g: Actually use the info from the flushed depth texture when creating a sampler...
authorHenri Verbeet <hverbeet@gmail.com>
Tue, 1 Feb 2011 00:17:02 +0000 (01:17 +0100)
committerHenri Verbeet <hverbeet@gmail.com>
Tue, 1 Feb 2011 00:19:16 +0000 (01:19 +0100)
R600/R700 was using incorrect tiling information from the (compressed) depth
buffer. Evergreen worked anyway because tiling doesn't work.

src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_state.c

index 1afbf892cfd25604223f00d0b0e77d917027ef9c..5a923db3dfb413fc0dcd9b82423e7c87d4ef20e5 100644 (file)
@@ -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 */
index 8c583b4f39a24e81c12f20d3dba4911e86e0659e..d23f242e56792d92097ab470d520248a7a1228cb 100644 (file)
@@ -428,18 +428,14 @@ static struct pipe_sampler_view *r600_create_sampler_view(struct pipe_context *c
        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);
        if (tmp->tiled) {
                array_mode = tmp->array_mode[0];