summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe/sp_tex_tile_cache.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-09-27 15:05:29 -0600
committerBrian Paul <brianp@vmware.com>2010-09-27 15:06:23 -0600
commitde2dfce0d97aca1b6242eb4db5d6e4b78301bb49 (patch)
treeae1913f54ec024e41b8b837956169f6646a7c205 /src/gallium/drivers/softpipe/sp_tex_tile_cache.c
parent3446af01798bd4bfcdb68f984a3ecd8f7ff9a4a4 (diff)
softpipe: fix swizzling of texture border color
We ask the texture tile cache to swizzle the color for us since that's where the view/swizzling info is available.
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_tex_tile_cache.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_tex_tile_cache.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gallium/drivers/softpipe/sp_tex_tile_cache.c b/src/gallium/drivers/softpipe/sp_tex_tile_cache.c
index eb74f14a7be..e817c0c8cf5 100644
--- a/src/gallium/drivers/softpipe/sp_tex_tile_cache.c
+++ b/src/gallium/drivers/softpipe/sp_tex_tile_cache.c
@@ -298,3 +298,23 @@ sp_find_cached_tile_tex(struct softpipe_tex_tile_cache *tc,
+/**
+ * Return the swizzled border color.
+ */
+const float *
+sp_tex_tile_cache_border_color(struct softpipe_tex_tile_cache *tc,
+ const float border_color[4])
+{
+ float rgba01[6];
+
+ COPY_4V(rgba01, border_color);
+ rgba01[PIPE_SWIZZLE_ZERO] = 0.0f;
+ rgba01[PIPE_SWIZZLE_ONE] = 1.0f;
+
+ tc->swz_border_color[0] = rgba01[tc->swizzle_r];
+ tc->swz_border_color[1] = rgba01[tc->swizzle_g];
+ tc->swz_border_color[2] = rgba01[tc->swizzle_b];
+ tc->swz_border_color[3] = rgba01[tc->swizzle_a];
+
+ return tc->swz_border_color;
+}