summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_sampler.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-04-16 14:05:47 +0200
committerMarek Olšák <[email protected]>2016-04-22 01:30:39 +0200
commitfb523cb6ad3ffef22ab4b9cce9e53859c17c5739 (patch)
tree45b67da368c4c387329e5887ab6d49d61f0b85a9 /src/gallium/auxiliary/util/u_sampler.c
parented23335a313dfc9cec26999c0adffe3ab3a73a58 (diff)
gallium: merge PIPE_SWIZZLE_* and UTIL_FORMAT_SWIZZLE_*
Use PIPE_SWIZZLE_* everywhere. Use X/Y/Z/W/0/1 instead of RED, GREEN, BLUE, ALPHA, ZERO, ONE. The new enum is called pipe_swizzle. Acked-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util/u_sampler.c')
-rw-r--r--src/gallium/auxiliary/util/u_sampler.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gallium/auxiliary/util/u_sampler.c b/src/gallium/auxiliary/util/u_sampler.c
index 86799fdd559..5da1d5fdff2 100644
--- a/src/gallium/auxiliary/util/u_sampler.c
+++ b/src/gallium/auxiliary/util/u_sampler.c
@@ -52,10 +52,10 @@ default_template(struct pipe_sampler_view *view,
view->u.tex.first_layer = 0;
view->u.tex.last_layer = texture->target == PIPE_TEXTURE_3D ?
texture->depth0 - 1 : texture->array_size - 1;
- view->swizzle_r = PIPE_SWIZZLE_RED;
- view->swizzle_g = PIPE_SWIZZLE_GREEN;
- view->swizzle_b = PIPE_SWIZZLE_BLUE;
- view->swizzle_a = PIPE_SWIZZLE_ALPHA;
+ view->swizzle_r = PIPE_SWIZZLE_X;
+ view->swizzle_g = PIPE_SWIZZLE_Y;
+ view->swizzle_b = PIPE_SWIZZLE_Z;
+ view->swizzle_a = PIPE_SWIZZLE_W;
/* Override default green and blue component expansion to the requested
* one.
@@ -66,7 +66,7 @@ default_template(struct pipe_sampler_view *view,
* components.
*
* To make it look less hackish, one would have to add
- * UTIL_FORMAT_SWIZZLE_EXPAND to indicate components for expansion
+ * PIPE_SWIZZLE_EXPAND to indicate components for expansion
* and then override without exceptions or favoring one component
* over another.
*/
@@ -75,10 +75,10 @@ default_template(struct pipe_sampler_view *view,
assert(desc);
if (desc) {
- if (desc->swizzle[1] == UTIL_FORMAT_SWIZZLE_0) {
+ if (desc->swizzle[1] == PIPE_SWIZZLE_0) {
view->swizzle_g = expand_green_blue;
}
- if (desc->swizzle[2] == UTIL_FORMAT_SWIZZLE_0) {
+ if (desc->swizzle[2] == PIPE_SWIZZLE_0) {
view->swizzle_b = expand_green_blue;
}
}
@@ -94,7 +94,7 @@ u_sampler_view_default_template(struct pipe_sampler_view *view,
default_template(view,
texture,
format,
- PIPE_SWIZZLE_ZERO);
+ PIPE_SWIZZLE_0);
}
void
@@ -106,5 +106,5 @@ u_sampler_view_default_dx9_template(struct pipe_sampler_view *view,
default_template(view,
texture,
format,
- PIPE_SWIZZLE_ONE);
+ PIPE_SWIZZLE_1);
}