summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2012-02-04 17:55:56 +0000
committerDave Airlie <[email protected]>2012-02-15 19:25:27 +0000
commitc89b471f8cd3da6c07eb437caabb2e648027f8bb (patch)
treebee6294bff9485a265793e5a50cfcab246520638 /src/gallium
parent66bf25f1a2cc8343640cdfc4242d882bc00b9e3b (diff)
llvmpipe: fix fogcoord writing (v2)
this fixes the fogcoord related piglit tests, like I fixed them in softpipe. Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c
index 8a55e17920e..f0646acc9cf 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
@@ -510,7 +510,7 @@ generate_vs(struct draw_llvm *llvm,
sampler,
&llvm->draw->vs.vertex_shader->info);
- if (clamp_vertex_color) {
+ {
LLVMValueRef out;
unsigned chan, attrib;
struct lp_build_context bld;
@@ -523,9 +523,17 @@ generate_vs(struct draw_llvm *llvm,
switch (info->output_semantic_name[attrib]) {
case TGSI_SEMANTIC_COLOR:
case TGSI_SEMANTIC_BCOLOR:
- out = LLVMBuildLoad(builder, outputs[attrib][chan], "");
- out = lp_build_clamp(&bld, out, bld.zero, bld.one);
- LLVMBuildStore(builder, out, outputs[attrib][chan]);
+ if (clamp_vertex_color) {
+ out = LLVMBuildLoad(builder, outputs[attrib][chan], "");
+ out = lp_build_clamp(&bld, out, bld.zero, bld.one);
+ LLVMBuildStore(builder, out, outputs[attrib][chan]);
+ }
+ break;
+ case TGSI_SEMANTIC_FOG:
+ if (chan == 1 || chan == 2)
+ LLVMBuildStore(builder, bld.zero, outputs[attrib][chan]);
+ else if (chan == 3)
+ LLVMBuildStore(builder, bld.one, outputs[attrib][chan]);
break;
}
}