Mesa (master): llvmpipe: Fix alpha test.
Jose Fonseca
jrfonseca at kemper.freedesktop.org
Thu Sep 10 12:35:55 UTC 2009
Module: Mesa
Branch: master
Commit: 6a405b4a21ac1fa45a93da37ce6b95d98d17f0e2
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6a405b4a21ac1fa45a93da37ce6b95d98d17f0e2
Author: José Fonseca <jfonseca at vmware.com>
Date: Thu Sep 10 13:35:39 2009 +0100
llvmpipe: Fix alpha test.
---
src/gallium/drivers/llvmpipe/lp_state_fs.c | 39 +++++++++------------------
1 files changed, 13 insertions(+), 26 deletions(-)
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index ccbccc8..618cf1f 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -216,24 +216,11 @@ generate_fs(struct llvmpipe_context *lp,
lp_build_flow_scope_begin(flow);
/* Declare the color and z variables */
- for (attrib = 0; attrib < shader->info.num_outputs; ++attrib) {
- for(chan = 0; chan < NUM_CHANNELS; ++chan) {
- boolean declare = FALSE;
- switch (shader->info.output_semantic_name[attrib]) {
- case TGSI_SEMANTIC_COLOR:
- declare = TRUE;
- break;
- case TGSI_SEMANTIC_POSITION:
- if(chan == 2)
- declare = TRUE;
- break;
- }
- if(declare) {
- outputs[attrib][chan] = LLVMGetUndef(vec_type);
- lp_build_flow_scope_declare(flow, &outputs[attrib][chan]);
- }
- }
+ for(chan = 0; chan < NUM_CHANNELS; ++chan) {
+ color[chan] = LLVMGetUndef(vec_type);
+ lp_build_flow_scope_declare(flow, &color[chan]);
}
+ lp_build_flow_scope_declare(flow, &z);
lp_build_mask_begin(&mask, flow, type, *pmask);
@@ -252,15 +239,6 @@ generate_fs(struct llvmpipe_context *lp,
consts_ptr, interp->pos, interp->inputs,
outputs, sampler);
- if(!early_depth_test)
- generate_depth(builder, key,
- type, &mask,
- z, depth_ptr);
-
- lp_build_mask_end(&mask);
-
- lp_build_flow_scope_end(flow);
-
for (attrib = 0; attrib < shader->info.num_outputs; ++attrib) {
for(chan = 0; chan < NUM_CHANNELS; ++chan) {
if(outputs[attrib][chan]) {
@@ -299,6 +277,15 @@ generate_fs(struct llvmpipe_context *lp,
}
}
+ if(!early_depth_test)
+ generate_depth(builder, key,
+ type, &mask,
+ z, depth_ptr);
+
+ lp_build_mask_end(&mask);
+
+ lp_build_flow_scope_end(flow);
+
lp_build_flow_destroy(flow);
*pmask = mask.value;
More information about the mesa-commit
mailing list