aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo
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/ilo
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/ilo')
-rw-r--r--src/gallium/drivers/ilo/ilo_shader.c32
-rw-r--r--src/gallium/drivers/ilo/shader/ilo_shader_fs.c12
-rw-r--r--src/gallium/drivers/ilo/shader/ilo_shader_vs.c12
3 files changed, 28 insertions, 28 deletions
diff --git a/src/gallium/drivers/ilo/ilo_shader.c b/src/gallium/drivers/ilo/ilo_shader.c
index c61716dc791..4eab174e433 100644
--- a/src/gallium/drivers/ilo/ilo_shader.c
+++ b/src/gallium/drivers/ilo/ilo_shader.c
@@ -265,16 +265,16 @@ ilo_shader_variant_init(struct ilo_shader_variant *variant,
variant->sampler_view_swizzles[i].a = view->swizzle_a;
}
else if (info->shadow_samplers & (1 << i)) {
- variant->sampler_view_swizzles[i].r = PIPE_SWIZZLE_RED;
- variant->sampler_view_swizzles[i].g = PIPE_SWIZZLE_RED;
- variant->sampler_view_swizzles[i].b = PIPE_SWIZZLE_RED;
- variant->sampler_view_swizzles[i].a = PIPE_SWIZZLE_ONE;
+ variant->sampler_view_swizzles[i].r = PIPE_SWIZZLE_X;
+ variant->sampler_view_swizzles[i].g = PIPE_SWIZZLE_X;
+ variant->sampler_view_swizzles[i].b = PIPE_SWIZZLE_X;
+ variant->sampler_view_swizzles[i].a = PIPE_SWIZZLE_1;
}
else {
- variant->sampler_view_swizzles[i].r = PIPE_SWIZZLE_RED;
- variant->sampler_view_swizzles[i].g = PIPE_SWIZZLE_GREEN;
- variant->sampler_view_swizzles[i].b = PIPE_SWIZZLE_BLUE;
- variant->sampler_view_swizzles[i].a = PIPE_SWIZZLE_ALPHA;
+ variant->sampler_view_swizzles[i].r = PIPE_SWIZZLE_X;
+ variant->sampler_view_swizzles[i].g = PIPE_SWIZZLE_Y;
+ variant->sampler_view_swizzles[i].b = PIPE_SWIZZLE_Z;
+ variant->sampler_view_swizzles[i].a = PIPE_SWIZZLE_W;
}
/*
@@ -323,16 +323,16 @@ ilo_shader_variant_guess(struct ilo_shader_variant *variant,
variant->num_sampler_views = info->num_samplers;
for (i = 0; i < info->num_samplers; i++) {
if (info->shadow_samplers & (1 << i)) {
- variant->sampler_view_swizzles[i].r = PIPE_SWIZZLE_RED;
- variant->sampler_view_swizzles[i].g = PIPE_SWIZZLE_RED;
- variant->sampler_view_swizzles[i].b = PIPE_SWIZZLE_RED;
- variant->sampler_view_swizzles[i].a = PIPE_SWIZZLE_ONE;
+ variant->sampler_view_swizzles[i].r = PIPE_SWIZZLE_X;
+ variant->sampler_view_swizzles[i].g = PIPE_SWIZZLE_X;
+ variant->sampler_view_swizzles[i].b = PIPE_SWIZZLE_X;
+ variant->sampler_view_swizzles[i].a = PIPE_SWIZZLE_1;
}
else {
- variant->sampler_view_swizzles[i].r = PIPE_SWIZZLE_RED;
- variant->sampler_view_swizzles[i].g = PIPE_SWIZZLE_GREEN;
- variant->sampler_view_swizzles[i].b = PIPE_SWIZZLE_BLUE;
- variant->sampler_view_swizzles[i].a = PIPE_SWIZZLE_ALPHA;
+ variant->sampler_view_swizzles[i].r = PIPE_SWIZZLE_X;
+ variant->sampler_view_swizzles[i].g = PIPE_SWIZZLE_Y;
+ variant->sampler_view_swizzles[i].b = PIPE_SWIZZLE_Z;
+ variant->sampler_view_swizzles[i].a = PIPE_SWIZZLE_W;
}
}
}
diff --git a/src/gallium/drivers/ilo/shader/ilo_shader_fs.c b/src/gallium/drivers/ilo/shader/ilo_shader_fs.c
index 6c8f1b5222e..d2b205a370d 100644
--- a/src/gallium/drivers/ilo/shader/ilo_shader_fs.c
+++ b/src/gallium/drivers/ilo/shader/ilo_shader_fs.c
@@ -1143,19 +1143,19 @@ fs_lower_opcode_tgsi_sampling(struct fs_compile_context *fcc,
swizzles[3] = fcc->variant->sampler_view_swizzles[sampler_index].a;
}
else {
- swizzles[0] = PIPE_SWIZZLE_RED;
- swizzles[1] = PIPE_SWIZZLE_GREEN;
- swizzles[2] = PIPE_SWIZZLE_BLUE;
- swizzles[3] = PIPE_SWIZZLE_ALPHA;
+ swizzles[0] = PIPE_SWIZZLE_X;
+ swizzles[1] = PIPE_SWIZZLE_Y;
+ swizzles[2] = PIPE_SWIZZLE_Z;
+ swizzles[3] = PIPE_SWIZZLE_W;
}
/* swizzle the results */
for (i = 0; i < 4; i++) {
switch (swizzles[i]) {
- case PIPE_SWIZZLE_ZERO:
+ case PIPE_SWIZZLE_0:
tc_MOV(tc, dst[i], tsrc_imm_f(0.0f));
break;
- case PIPE_SWIZZLE_ONE:
+ case PIPE_SWIZZLE_1:
tc_MOV(tc, dst[i], tsrc_imm_f(1.0f));
break;
default:
diff --git a/src/gallium/drivers/ilo/shader/ilo_shader_vs.c b/src/gallium/drivers/ilo/shader/ilo_shader_vs.c
index 2b46d44f5be..514e636f327 100644
--- a/src/gallium/drivers/ilo/shader/ilo_shader_vs.c
+++ b/src/gallium/drivers/ilo/shader/ilo_shader_vs.c
@@ -610,10 +610,10 @@ vs_lower_opcode_tgsi_sampling(struct vs_compile_context *vcc,
swizzles[3] = vcc->variant->sampler_view_swizzles[sampler_index].a;
}
else {
- swizzles[0] = PIPE_SWIZZLE_RED;
- swizzles[1] = PIPE_SWIZZLE_GREEN;
- swizzles[2] = PIPE_SWIZZLE_BLUE;
- swizzles[3] = PIPE_SWIZZLE_ALPHA;
+ swizzles[0] = PIPE_SWIZZLE_X;
+ swizzles[1] = PIPE_SWIZZLE_Y;
+ swizzles[2] = PIPE_SWIZZLE_Z;
+ swizzles[3] = PIPE_SWIZZLE_W;
}
swizzle_zero_mask = 0;
@@ -621,11 +621,11 @@ vs_lower_opcode_tgsi_sampling(struct vs_compile_context *vcc,
swizzle_normal_mask = 0;
for (i = 0; i < 4; i++) {
switch (swizzles[i]) {
- case PIPE_SWIZZLE_ZERO:
+ case PIPE_SWIZZLE_0:
swizzle_zero_mask |= 1 << i;
swizzles[i] = i;
break;
- case PIPE_SWIZZLE_ONE:
+ case PIPE_SWIZZLE_1:
swizzle_one_mask |= 1 << i;
swizzles[i] = i;
break;