diff options
author | Chia-I Wu <[email protected]> | 2010-12-04 11:23:41 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2010-12-04 13:20:38 +0800 |
commit | a19eaaa6c1956add5343295af7e9f682efa08d74 (patch) | |
tree | ca79287516d05c96ab4755fc905a03e857d83add /src/gallium/state_trackers/vega/asm_fill.h | |
parent | 3b4c8886539b02653761f092a387c27b5c562496 (diff) |
st/vega: Move masking after blending.
Masking should happen after blending. The shader is not entirely
correct, but leave it as is for now.
Diffstat (limited to 'src/gallium/state_trackers/vega/asm_fill.h')
-rw-r--r-- | src/gallium/state_trackers/vega/asm_fill.h | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/src/gallium/state_trackers/vega/asm_fill.h b/src/gallium/state_trackers/vega/asm_fill.h index 19a2d93fe59..22ad6ac39a5 100644 --- a/src/gallium/state_trackers/vega/asm_fill.h +++ b/src/gallium/state_trackers/vega/asm_fill.h @@ -174,38 +174,6 @@ paint_degenerate( struct ureg_program *ureg, } static INLINE void -color_transform( struct ureg_program *ureg, - struct ureg_dst *out, - struct ureg_src *in, - struct ureg_src *sampler, - struct ureg_dst *temp, - struct ureg_src *constant) -{ - ureg_MAD(ureg, temp[1], ureg_src(temp[0]), constant[0], constant[1]); - /* clamp to [0.0f, 1.0f] */ - ureg_CLAMP(ureg, temp[1], - ureg_src(temp[1]), - ureg_scalar(constant[3], TGSI_SWIZZLE_X), - ureg_scalar(constant[3], TGSI_SWIZZLE_Y)); - ureg_MOV(ureg, *out, ureg_src(temp[1])); -} - -static INLINE void -mask( struct ureg_program *ureg, - struct ureg_dst *out, - struct ureg_src *in, - struct ureg_src *sampler, - struct ureg_dst *temp, - struct ureg_src *constant) -{ - ureg_TEX(ureg, temp[1], TGSI_TEXTURE_2D, in[0], sampler[1]); - ureg_MUL(ureg, ureg_writemask(temp[0], TGSI_WRITEMASK_W), - ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W), - ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W)); - ureg_MOV(ureg, *out, ureg_src(temp[0])); -} - -static INLINE void image_normal( struct ureg_program *ureg, struct ureg_dst *out, struct ureg_src *in, @@ -242,6 +210,23 @@ image_stencil( struct ureg_program *ureg, ureg_MUL(ureg, *out, ureg_src(temp[0]), ureg_src(temp[1])); } +static INLINE void +color_transform( struct ureg_program *ureg, + struct ureg_dst *out, + struct ureg_src *in, + struct ureg_src *sampler, + struct ureg_dst *temp, + struct ureg_src *constant) +{ + ureg_MAD(ureg, temp[1], ureg_src(temp[0]), constant[0], constant[1]); + /* clamp to [0.0f, 1.0f] */ + ureg_CLAMP(ureg, temp[1], + ureg_src(temp[1]), + ureg_scalar(constant[3], TGSI_SWIZZLE_X), + ureg_scalar(constant[3], TGSI_SWIZZLE_Y)); + ureg_MOV(ureg, *out, ureg_src(temp[1])); +} + /** * Emit instructions for the specified blend mode. Colors should be * premultiplied. Two temporary registers are required. @@ -396,6 +381,21 @@ blend_lighten( struct ureg_program *ureg, } static INLINE void +mask( struct ureg_program *ureg, + struct ureg_dst *out, + struct ureg_src *in, + struct ureg_src *sampler, + struct ureg_dst *temp, + struct ureg_src *constant) +{ + ureg_TEX(ureg, temp[1], TGSI_TEXTURE_2D, in[0], sampler[1]); + ureg_MUL(ureg, ureg_writemask(temp[0], TGSI_WRITEMASK_W), + ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W), + ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W)); + ureg_MOV(ureg, *out, ureg_src(temp[0])); +} + +static INLINE void premultiply( struct ureg_program *ureg, struct ureg_dst *out, struct ureg_src *in, @@ -500,11 +500,6 @@ static const struct shader_asm_info shaders_color_transform_asm[] = { VG_FALSE, 0, 4, 0, 0, 0, 2} }; -static const struct shader_asm_info shaders_mask_asm[] = { - {VEGA_MASK_SHADER, mask, - VG_TRUE, 0, 0, 1, 1, 0, 2} -}; - /* extra blend modes */ static const struct shader_asm_info shaders_blend_asm[] = { {VEGA_BLEND_MULTIPLY_SHADER, blend_multiply, @@ -517,6 +512,11 @@ static const struct shader_asm_info shaders_blend_asm[] = { VG_TRUE, 3, 1, 2, 1, 0, 4}, }; +static const struct shader_asm_info shaders_mask_asm[] = { + {VEGA_MASK_SHADER, mask, + VG_TRUE, 0, 0, 1, 1, 0, 2} +}; + /* premultiply */ static const struct shader_asm_info shaders_premultiply_asm[] = { {VEGA_PREMULTIPLY_SHADER, premultiply, |