summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/compiler/radeon_compiler_util.h
diff options
context:
space:
mode:
authorTom Stellard <tstellar@gmail.com>2011-01-29 14:37:58 -0800
committerTom Stellard <tstellar@gmail.com>2011-01-29 21:32:02 -0800
commit8f32c6cfc6503dd234f09fb06941803866c23c65 (patch)
treeffb12340d9104119f34c2b3035eb350d930ae150 /src/mesa/drivers/dri/r300/compiler/radeon_compiler_util.h
parentdebc45bca07a5dfad4199079f080b35c19f00e85 (diff)
r300/compiler: Standardize the number of bits used by swizzle fields
Swizzles are now defined everywhere as a field with 12 bits that contains 4 channels worth of meaningful information. Any channel that is unused is set to RC_SWIZZLE_UNUSED. This change is necessary because rgb instructions and alpha instructions were initializing channels that would never be used (channel 3 for rgb and channels 1-3 for alpha) with 0 (aka RC_SWIZZLE_X). This made it impossible to use generic helper functions for swizzles, because sometimes a channel value of 0 meant unused and other times it meant RC_SWIZZLE_X. All hacks that tried to guess how many channels were relevant have also been removed.
Diffstat (limited to 'src/mesa/drivers/dri/r300/compiler/radeon_compiler_util.h')
-rw-r--r--src/mesa/drivers/dri/r300/compiler/radeon_compiler_util.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_compiler_util.h b/src/mesa/drivers/dri/r300/compiler/radeon_compiler_util.h
index 461ab9ffb1..dd0f6c6615 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_compiler_util.h
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_compiler_util.h
@@ -10,6 +10,8 @@ unsigned int rc_swizzle_to_writemask(unsigned int swz);
rc_swizzle get_swz(unsigned int swz, rc_swizzle idx);
+unsigned int rc_init_swizzle(unsigned int initial_value, unsigned int channels);
+
unsigned int combine_swizzles4(unsigned int src,
rc_swizzle swz_x, rc_swizzle swz_y,
rc_swizzle swz_z, rc_swizzle swz_w);
@@ -32,7 +34,7 @@ unsigned int rc_src_reads_dst_mask(
unsigned int dst_idx,
unsigned int dst_mask);
-unsigned int rc_source_type_swz(unsigned int swizzle, unsigned int channels);
+unsigned int rc_source_type_swz(unsigned int swizzle);
unsigned int rc_source_type_mask(unsigned int mask);