summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2016-04-16 14:05:47 +0200
committerMarek Olšák <marek.olsak@amd.com>2016-04-22 01:30:39 +0200
commitfb523cb6ad3ffef22ab4b9cce9e53859c17c5739 (patch)
tree45b67da368c4c387329e5887ab6d49d61f0b85a9 /src/gallium/drivers/llvmpipe
parented23335a313dfc9cec26999c0adffe3ab3a73a58 (diff)
downloadexternal_mesa3d-fb523cb6ad3ffef22ab4b9cce9e53859c17c5739.zip
external_mesa3d-fb523cb6ad3ffef22ab4b9cce9e53859c17c5739.tar.gz
external_mesa3d-fb523cb6ad3ffef22ab4b9cce9e53859c17c5739.tar.bz2
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 <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/drivers/llvmpipe')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c8
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_depth.c8
-rw-r--r--src/gallium/drivers/llvmpipe/lp_screen.c2
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_fs.c2
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_setup.c4
5 files changed, 12 insertions, 12 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c b/src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c
index 564e19a..a57670d 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_blend_aos.c
@@ -255,13 +255,13 @@ lp_build_blend_factor(struct lp_build_blend_aos_context *bld,
LLVMValueRef rgb_factor_, alpha_factor_;
enum lp_build_blend_swizzle rgb_swizzle;
- if (alpha_swizzle == UTIL_FORMAT_SWIZZLE_X && num_channels == 1) {
+ if (alpha_swizzle == PIPE_SWIZZLE_X && num_channels == 1) {
return lp_build_blend_factor_unswizzled(bld, alpha_factor, TRUE);
}
rgb_factor_ = lp_build_blend_factor_unswizzled(bld, rgb_factor, FALSE);
- if (alpha_swizzle != UTIL_FORMAT_SWIZZLE_NONE) {
+ if (alpha_swizzle != PIPE_SWIZZLE_NONE) {
rgb_swizzle = lp_build_blend_factor_swizzle(rgb_factor);
alpha_factor_ = lp_build_blend_factor_unswizzled(bld, alpha_factor, TRUE);
return lp_build_blend_swizzle(bld, rgb_factor_, alpha_factor_, rgb_swizzle, alpha_swizzle, num_channels);
@@ -312,7 +312,7 @@ lp_build_blend_aos(struct gallivm_state *gallivm,
struct lp_build_blend_aos_context bld;
LLVMValueRef src_factor, dst_factor;
LLVMValueRef result;
- unsigned alpha_swizzle = UTIL_FORMAT_SWIZZLE_NONE;
+ unsigned alpha_swizzle = PIPE_SWIZZLE_NONE;
unsigned i;
desc = util_format_description(cbuf_format);
@@ -370,7 +370,7 @@ lp_build_blend_aos(struct gallivm_state *gallivm,
rgb_alpha_same,
false);
- if(state->rgb_func != state->alpha_func && nr_channels > 1 && alpha_swizzle != UTIL_FORMAT_SWIZZLE_NONE) {
+ if(state->rgb_func != state->alpha_func && nr_channels > 1 && alpha_swizzle != PIPE_SWIZZLE_NONE) {
LLVMValueRef alpha;
alpha = lp_build_blend(&bld.base,
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_depth.c b/src/gallium/drivers/llvmpipe/lp_bld_depth.c
index b25e041..0c27c2f 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_depth.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_depth.c
@@ -359,7 +359,7 @@ get_z_shift_and_mask(const struct util_format_description *format_desc,
z_swizzle = format_desc->swizzle[0];
- if (z_swizzle == UTIL_FORMAT_SWIZZLE_NONE)
+ if (z_swizzle == PIPE_SWIZZLE_NONE)
return FALSE;
*width = format_desc->channel[z_swizzle].size;
@@ -390,7 +390,7 @@ get_s_shift_and_mask(const struct util_format_description *format_desc,
s_swizzle = format_desc->swizzle[1];
- if (s_swizzle == UTIL_FORMAT_SWIZZLE_NONE)
+ if (s_swizzle == PIPE_SWIZZLE_NONE)
return FALSE;
/* just special case 64bit d/s format */
@@ -873,8 +873,8 @@ lp_build_depth_stencil_test(struct gallivm_state *gallivm,
const unsigned z_swizzle = format_desc->swizzle[0];
const unsigned s_swizzle = format_desc->swizzle[1];
- assert(z_swizzle != UTIL_FORMAT_SWIZZLE_NONE ||
- s_swizzle != UTIL_FORMAT_SWIZZLE_NONE);
+ assert(z_swizzle != PIPE_SWIZZLE_NONE ||
+ s_swizzle != PIPE_SWIZZLE_NONE);
assert(depth->enabled || stencil[0].enabled);
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
index cb681ba..4f61de8 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -475,7 +475,7 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen,
return FALSE;
/* TODO: Support stencil-only formats */
- if (format_desc->swizzle[0] == UTIL_FORMAT_SWIZZLE_NONE) {
+ if (format_desc->swizzle[0] == PIPE_SWIZZLE_NONE) {
return FALSE;
}
}
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index 93460a3..76cbb5b 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -3027,7 +3027,7 @@ make_variant_key(struct llvmpipe_context *lp,
* Also, force rgb/alpha func/factors match, to make AoS blending
* easier.
*/
- if (format_desc->swizzle[3] > UTIL_FORMAT_SWIZZLE_W ||
+ if (format_desc->swizzle[3] > PIPE_SWIZZLE_W ||
format_desc->swizzle[3] == format_desc->swizzle[0]) {
/* Doesn't cover mixed snorm/unorm but can't render to them anyway */
boolean clamped_zero = !util_format_is_float(format) &&
diff --git a/src/gallium/drivers/llvmpipe/lp_state_setup.c b/src/gallium/drivers/llvmpipe/lp_state_setup.c
index 6a4fbbb..fec0ec1 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_setup.c
@@ -135,8 +135,8 @@ emit_facing_coef(struct gallivm_state *gallivm,
LLVMValueRef a0_0 = args->facing;
LLVMValueRef a0_0f = LLVMBuildSIToFP(builder, a0_0, float_type, "");
LLVMValueRef a0, face_val;
- const unsigned char swizzles[4] = { PIPE_SWIZZLE_RED, PIPE_SWIZZLE_ZERO,
- PIPE_SWIZZLE_ZERO, PIPE_SWIZZLE_ZERO };
+ const unsigned char swizzles[4] = { PIPE_SWIZZLE_X, PIPE_SWIZZLE_0,
+ PIPE_SWIZZLE_0, PIPE_SWIZZLE_0 };
/* Our face val is either 1 or 0 so we do
* face = (val * 2) - 1
* to make it 1 or -1