diff options
author | Marek Olšák <[email protected]> | 2016-04-16 14:05:47 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-04-22 01:30:39 +0200 |
commit | fb523cb6ad3ffef22ab4b9cce9e53859c17c5739 (patch) | |
tree | 45b67da368c4c387329e5887ab6d49d61f0b85a9 /src/gallium/tests/graw | |
parent | ed23335a313dfc9cec26999c0adffe3ab3a73a58 (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/tests/graw')
-rw-r--r-- | src/gallium/tests/graw/graw_util.h | 8 | ||||
-rw-r--r-- | src/gallium/tests/graw/tex-srgb.c | 16 | ||||
-rw-r--r-- | src/gallium/tests/graw/tex-swizzle.c | 22 |
3 files changed, 23 insertions, 23 deletions
diff --git a/src/gallium/tests/graw/graw_util.h b/src/gallium/tests/graw/graw_util.h index 3c7dbd061cc..5d72bb9d4a7 100644 --- a/src/gallium/tests/graw/graw_util.h +++ b/src/gallium/tests/graw/graw_util.h @@ -315,10 +315,10 @@ graw_util_create_simple_sampler_view(const struct graw_info *info, memset(&sv_temp, 0, sizeof(sv_temp)); sv_temp.format = texture->format; sv_temp.texture = texture; - sv_temp.swizzle_r = PIPE_SWIZZLE_RED; - sv_temp.swizzle_g = PIPE_SWIZZLE_GREEN; - sv_temp.swizzle_b = PIPE_SWIZZLE_BLUE; - sv_temp.swizzle_a = PIPE_SWIZZLE_ALPHA; + sv_temp.swizzle_r = PIPE_SWIZZLE_X; + sv_temp.swizzle_g = PIPE_SWIZZLE_Y; + sv_temp.swizzle_b = PIPE_SWIZZLE_Z; + sv_temp.swizzle_a = PIPE_SWIZZLE_W; sv = info->ctx->create_sampler_view(info->ctx, texture, &sv_temp); diff --git a/src/gallium/tests/graw/tex-srgb.c b/src/gallium/tests/graw/tex-srgb.c index 3b43bcbf73e..9d3af94800e 100644 --- a/src/gallium/tests/graw/tex-srgb.c +++ b/src/gallium/tests/graw/tex-srgb.c @@ -176,10 +176,10 @@ static void init_tex( void ) memset(&sv_temp, 0, sizeof sv_temp); sv_temp.format = PIPE_FORMAT_B8G8R8A8_UNORM; sv_temp.texture = texture; - sv_temp.swizzle_r = PIPE_SWIZZLE_RED; - sv_temp.swizzle_g = PIPE_SWIZZLE_GREEN; - sv_temp.swizzle_b = PIPE_SWIZZLE_BLUE; - sv_temp.swizzle_a = PIPE_SWIZZLE_ALPHA; + sv_temp.swizzle_r = PIPE_SWIZZLE_X; + sv_temp.swizzle_g = PIPE_SWIZZLE_Y; + sv_temp.swizzle_b = PIPE_SWIZZLE_Z; + sv_temp.swizzle_a = PIPE_SWIZZLE_W; linear_sv = info.ctx->create_sampler_view(info.ctx, texture, &sv_temp); if (linear_sv == NULL) exit(0); @@ -191,10 +191,10 @@ static void init_tex( void ) memset(&sv_temp, 0, sizeof sv_temp); sv_temp.format = PIPE_FORMAT_B8G8R8A8_SRGB; sv_temp.texture = texture; - sv_temp.swizzle_r = PIPE_SWIZZLE_RED; - sv_temp.swizzle_g = PIPE_SWIZZLE_GREEN; - sv_temp.swizzle_b = PIPE_SWIZZLE_BLUE; - sv_temp.swizzle_a = PIPE_SWIZZLE_ALPHA; + sv_temp.swizzle_r = PIPE_SWIZZLE_X; + sv_temp.swizzle_g = PIPE_SWIZZLE_Y; + sv_temp.swizzle_b = PIPE_SWIZZLE_Z; + sv_temp.swizzle_a = PIPE_SWIZZLE_W; srgb_sv = info.ctx->create_sampler_view(info.ctx, texture, &sv_temp); if (srgb_sv == NULL) exit(0); diff --git a/src/gallium/tests/graw/tex-swizzle.c b/src/gallium/tests/graw/tex-swizzle.c index 8b472c9364c..bc56a9570fc 100644 --- a/src/gallium/tests/graw/tex-swizzle.c +++ b/src/gallium/tests/graw/tex-swizzle.c @@ -182,19 +182,19 @@ char_to_swizzle(char c) { switch (c) { case 'r': - return PIPE_SWIZZLE_RED; + return PIPE_SWIZZLE_X; case 'g': - return PIPE_SWIZZLE_GREEN; + return PIPE_SWIZZLE_Y; case 'b': - return PIPE_SWIZZLE_BLUE; + return PIPE_SWIZZLE_Z; case 'a': - return PIPE_SWIZZLE_ALPHA; + return PIPE_SWIZZLE_W; case '0': - return PIPE_SWIZZLE_ZERO; + return PIPE_SWIZZLE_0; case '1': - return PIPE_SWIZZLE_ONE; + return PIPE_SWIZZLE_1; default: - return PIPE_SWIZZLE_RED; + return PIPE_SWIZZLE_X; } } @@ -205,10 +205,10 @@ int main(int argc, char *argv[]) uint swizzle[4]; int i; - swizzle[0] = PIPE_SWIZZLE_RED; - swizzle[1] = PIPE_SWIZZLE_GREEN; - swizzle[2] = PIPE_SWIZZLE_BLUE; - swizzle[3] = PIPE_SWIZZLE_ALPHA; + swizzle[0] = PIPE_SWIZZLE_X; + swizzle[1] = PIPE_SWIZZLE_Y; + swizzle[2] = PIPE_SWIZZLE_Z; + swizzle[3] = PIPE_SWIZZLE_W; for (i = 1; i < argc; i++) { swizzle[i-1] = char_to_swizzle(argv[i][0]); |