summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/xorg/xorg_exa_tgsi.c
diff options
context:
space:
mode:
authorZack Rusin <zackr@vmware.com>2009-10-22 11:49:19 -0400
committerZack Rusin <zackr@vmware.com>2009-10-22 11:53:10 -0400
commitc4af8ce69e1a7105b0178da8a085b73ab984e432 (patch)
tree873ff5b0d4306fe591483071736937b1a195153d /src/gallium/state_trackers/xorg/xorg_exa_tgsi.c
parent4e2bdd66352cf9a2e951bb21151edee25c8c0a8c (diff)
st/xorg: lots of render fixes
fixes all the blend modes, fixes flushing/finishing semantics, adds acceleration for the component alpha modes that we can support, fixes src in mask shader and general cleanups
Diffstat (limited to 'src/gallium/state_trackers/xorg/xorg_exa_tgsi.c')
-rw-r--r--src/gallium/state_trackers/xorg/xorg_exa_tgsi.c37
1 files changed, 11 insertions, 26 deletions
diff --git a/src/gallium/state_trackers/xorg/xorg_exa_tgsi.c b/src/gallium/state_trackers/xorg/xorg_exa_tgsi.c
index 8c9b674b4b..041f4f96dc 100644
--- a/src/gallium/state_trackers/xorg/xorg_exa_tgsi.c
+++ b/src/gallium/state_trackers/xorg/xorg_exa_tgsi.c
@@ -50,36 +50,20 @@ struct xorg_shaders {
struct cso_hash *fs_hash;
};
-static const char over_op[] =
- "SUB TEMP[3], CONST[0].wwww, TEMP[1].wwww\n"
- "MAD TEMP[3], TEMP[0], TEMP[3], TEMP[0]\n";
-
-
-static INLINE void
-create_preamble(struct ureg_program *ureg)
-{
-}
-
-
static INLINE void
src_in_mask(struct ureg_program *ureg,
struct ureg_dst dst,
struct ureg_src src,
- struct ureg_src mask)
+ struct ureg_src mask,
+ boolean component_alpha)
{
-#if 0
- /* MUL dst, src, mask.a */
- ureg_MUL(ureg, dst, src,
- ureg_scalar(mask, TGSI_SWIZZLE_W));
-#else
- /* MOV dst, src */
- /* MUL dst.a, src.a, mask.a */
- ureg_MOV(ureg, dst, src);
- ureg_MUL(ureg,
- ureg_writemask(dst, TGSI_WRITEMASK_W),
- ureg_scalar(src, TGSI_SWIZZLE_W),
- ureg_scalar(mask, TGSI_SWIZZLE_W));
-#endif
+ if (component_alpha) {
+ ureg_MUL(ureg, dst, src, mask);
+ }
+ else {
+ ureg_MUL(ureg, dst, src,
+ ureg_scalar(mask, TGSI_SWIZZLE_W));
+ }
}
static struct ureg_src
@@ -305,6 +289,7 @@ create_fs(struct pipe_context *pipe,
boolean is_solid = fs_traits & FS_SOLID_FILL;
boolean is_lingrad = fs_traits & FS_LINGRAD_FILL;
boolean is_radgrad = fs_traits & FS_RADGRAD_FILL;
+ boolean is_comp_alpha = fs_traits & FS_COMPONENT_ALPHA;
ureg = ureg_create(TGSI_PROCESSOR_FRAGMENT);
if (ureg == NULL)
@@ -401,7 +386,7 @@ create_fs(struct pipe_context *pipe,
ureg_TEX(ureg, mask,
TGSI_TEXTURE_2D, mask_pos, mask_sampler);
/* src IN mask */
- src_in_mask(ureg, out, ureg_src(src), ureg_src(mask));
+ src_in_mask(ureg, out, ureg_src(src), ureg_src(mask), is_comp_alpha);
ureg_release_temporary(ureg, mask);
}