summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2009-10-05 15:46:47 +0100
committerKeith Whitwell <[email protected]>2009-10-05 15:51:55 +0100
commit6a085184ebf251f145181796e317ffa179a38bae (patch)
tree83e9b4c6dde173446e5bbf7a013f534c1f87a4d8 /src/gallium
parent0b032eabc77d0e28fc0746cbd8ffb94859fd130d (diff)
util: add lost code to util_make_fragment_tex_shader_writemask()
This got ported to ureg at some point, but lost the code that distinguishes it from regular util_make_fragment_tex_shader().
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/util/u_simple_shaders.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/util/u_simple_shaders.c b/src/gallium/auxiliary/util/u_simple_shaders.c
index 0d706f9449d..1c8b157d91f 100644
--- a/src/gallium/auxiliary/util/u_simple_shaders.c
+++ b/src/gallium/auxiliary/util/u_simple_shaders.c
@@ -108,7 +108,15 @@ util_make_fragment_tex_shader_writemask(struct pipe_context *pipe,
TGSI_SEMANTIC_COLOR,
0 );
- ureg_TEX( ureg, out, TGSI_TEXTURE_2D, tex, sampler );
+ if (writemask != TGSI_WRITEMASK_XYZW) {
+ struct ureg_src imm = ureg_imm4f( ureg, 0, 0, 0, 1 );
+
+ ureg_MOV( ureg, out, imm );
+ }
+
+ ureg_TEX( ureg,
+ ureg_writemask(out, writemask),
+ TGSI_TEXTURE_2D, tex, sampler );
ureg_END( ureg );
return ureg_create_shader_and_destroy( ureg, pipe );