diff options
author | Chia-I Wu <olv@lunarg.com> | 2010-12-01 11:54:58 +0800 |
---|---|---|
committer | Chia-I Wu <olv@lunarg.com> | 2010-12-01 16:46:01 +0800 |
commit | d7aa03b4feb7c30408b2ed3070e0fe33e2fd05ba (patch) | |
tree | b8038c3a6346729b8289775031566ecffc5c8829 /src/gallium/state_trackers/vega/asm_fill.h | |
parent | c530fd3f8a5b5ac6918dece5d9083b2fac4ef78e (diff) |
st/vega: Fix degenerate paints.
Fix the case that the two points of a linear gradient coincide, or the
case that the radius of a radial gradient is equal to or less than 0.
Diffstat (limited to 'src/gallium/state_trackers/vega/asm_fill.h')
-rw-r--r-- | src/gallium/state_trackers/vega/asm_fill.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/vega/asm_fill.h b/src/gallium/state_trackers/vega/asm_fill.h index 0e29aab88a..fcc953ced8 100644 --- a/src/gallium/state_trackers/vega/asm_fill.h +++ b/src/gallium/state_trackers/vega/asm_fill.h @@ -180,6 +180,18 @@ pattern( struct ureg_program *ureg, } static INLINE void +paint_degenerate( 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_MOV(ureg, temp[1], ureg_scalar(constant[3], TGSI_SWIZZLE_Y)); + ureg_TEX(ureg, *out, TGSI_TEXTURE_1D, ureg_src(temp[1]), sampler[0]); +} + +static INLINE void color_transform( struct ureg_program *ureg, struct ureg_dst *out, struct ureg_src *in, @@ -436,7 +448,9 @@ static const struct shader_asm_info shaders_paint_asm[] = { {VEGA_RADIAL_GRADIENT_SHADER, radial_grad, VG_TRUE, 2, 5, 0, 1, 0, 6}, {VEGA_PATTERN_SHADER, pattern, - VG_TRUE, 3, 4, 0, 1, 0, 5} + VG_TRUE, 3, 4, 0, 1, 0, 5}, + {VEGA_PAINT_DEGENERATE_SHADER, paint_degenerate, + VG_FALSE, 3, 1, 0, 1, 0, 2} }; /* image draw modes */ |