summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/i915
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/drivers/i915
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/drivers/i915')
-rw-r--r--src/gallium/drivers/i915/i915_state_sampler.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/gallium/drivers/i915/i915_state_sampler.c b/src/gallium/drivers/i915/i915_state_sampler.c
index c874361dfd9..84ed1514630 100644
--- a/src/gallium/drivers/i915/i915_state_sampler.c
+++ b/src/gallium/drivers/i915/i915_state_sampler.c
@@ -193,10 +193,10 @@ struct i915_tracked_state i915_hw_samplers = {
static uint translate_texture_format(enum pipe_format pipeFormat,
const struct pipe_sampler_view* view)
{
- if ( (view->swizzle_r != PIPE_SWIZZLE_RED ||
- view->swizzle_g != PIPE_SWIZZLE_GREEN ||
- view->swizzle_b != PIPE_SWIZZLE_BLUE ||
- view->swizzle_a != PIPE_SWIZZLE_ALPHA ) &&
+ if ( (view->swizzle_r != PIPE_SWIZZLE_X ||
+ view->swizzle_g != PIPE_SWIZZLE_Y ||
+ view->swizzle_b != PIPE_SWIZZLE_Z ||
+ view->swizzle_a != PIPE_SWIZZLE_W ) &&
pipeFormat != PIPE_FORMAT_Z24_UNORM_S8_UINT &&
pipeFormat != PIPE_FORMAT_Z24X8_UNORM )
debug_printf("i915: unsupported texture swizzle for format %d\n", pipeFormat);
@@ -248,20 +248,20 @@ static uint translate_texture_format(enum pipe_format pipeFormat,
case PIPE_FORMAT_Z24_UNORM_S8_UINT:
case PIPE_FORMAT_Z24X8_UNORM:
{
- if ( view->swizzle_r == PIPE_SWIZZLE_RED &&
- view->swizzle_g == PIPE_SWIZZLE_RED &&
- view->swizzle_b == PIPE_SWIZZLE_RED &&
- view->swizzle_a == PIPE_SWIZZLE_ONE)
+ if ( view->swizzle_r == PIPE_SWIZZLE_X &&
+ view->swizzle_g == PIPE_SWIZZLE_X &&
+ view->swizzle_b == PIPE_SWIZZLE_X &&
+ view->swizzle_a == PIPE_SWIZZLE_1)
return (MAPSURF_32BIT | MT_32BIT_xA824);
- if ( view->swizzle_r == PIPE_SWIZZLE_RED &&
- view->swizzle_g == PIPE_SWIZZLE_RED &&
- view->swizzle_b == PIPE_SWIZZLE_RED &&
- view->swizzle_a == PIPE_SWIZZLE_RED)
+ if ( view->swizzle_r == PIPE_SWIZZLE_X &&
+ view->swizzle_g == PIPE_SWIZZLE_X &&
+ view->swizzle_b == PIPE_SWIZZLE_X &&
+ view->swizzle_a == PIPE_SWIZZLE_X)
return (MAPSURF_32BIT | MT_32BIT_xI824);
- if ( view->swizzle_r == PIPE_SWIZZLE_ZERO &&
- view->swizzle_g == PIPE_SWIZZLE_ZERO &&
- view->swizzle_b == PIPE_SWIZZLE_ZERO &&
- view->swizzle_a == PIPE_SWIZZLE_RED)
+ if ( view->swizzle_r == PIPE_SWIZZLE_0 &&
+ view->swizzle_g == PIPE_SWIZZLE_0 &&
+ view->swizzle_b == PIPE_SWIZZLE_0 &&
+ view->swizzle_a == PIPE_SWIZZLE_X)
return (MAPSURF_32BIT | MT_32BIT_xL824);
debug_printf("i915: unsupported depth swizzle %d %d %d %d\n",
view->swizzle_r,