summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-12-16 17:38:16 -0700
committerBrian Paul <brianp@vmware.com>2010-12-16 17:40:09 -0700
commit9d9f8aba0aa51f707ac1d451fb8a89bb95676ab1 (patch)
tree281d1342c0f92799e90fdd2ca6d77336df138630 /src
parent3ecf47af1252ad10f98d5ce488cc1b91fab64c25 (diff)
softpipe: fix depth texture sampling regression
We need to keep using the pipe_get_tile_swizzle() even though there's no swizzling because we need to explicitly pass in the surface format. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32459
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/softpipe/sp_tex_tile_cache.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/gallium/drivers/softpipe/sp_tex_tile_cache.c b/src/gallium/drivers/softpipe/sp_tex_tile_cache.c
index e5708a1c88..6fd324ffe5 100644
--- a/src/gallium/drivers/softpipe/sp_tex_tile_cache.c
+++ b/src/gallium/drivers/softpipe/sp_tex_tile_cache.c
@@ -278,15 +278,23 @@ sp_find_cached_tile_tex(struct softpipe_tex_tile_cache *tc,
tc->tex_z = addr.bits.z;
}
- /* get tile from the transfer (view into texture) */
- pipe_get_tile_rgba(tc->pipe,
- tc->tex_trans,
- addr.bits.x * TILE_SIZE,
- addr.bits.y * TILE_SIZE,
- TILE_SIZE,
- TILE_SIZE,
- (float *) tile->data.color);
-
+ /* get tile from the transfer (view into texture)
+ * Note we're using the swizzle version of this fuction only because
+ * we need to pass the texture cache's format explicitly.
+ */
+ pipe_get_tile_swizzle(tc->pipe,
+ tc->tex_trans,
+ addr.bits.x * TILE_SIZE,
+ addr.bits.y * TILE_SIZE,
+ TILE_SIZE,
+ TILE_SIZE,
+ PIPE_SWIZZLE_RED,
+ PIPE_SWIZZLE_GREEN,
+ PIPE_SWIZZLE_BLUE,
+ PIPE_SWIZZLE_ALPHA,
+ tc->format,
+ (float *) tile->data.color);
+
tile->addr = addr;
}