summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2010-09-12 10:14:50 +0100
committerJosé Fonseca <[email protected]>2010-09-12 10:15:48 +0100
commit853953dc3c5bd2ef9cca904c9cabc4a0ef037b16 (patch)
tree72e0f1241024fc1dc406db31d4c4d3632cbc7957
parentb5fcf0c8e07e666523b007fab1d0fc18c2c89241 (diff)
llvmpipe: Only generate the whole shader specialization for opaque shaders.
If not opaque, then the color buffer will have to be read any way, therefore the specialization is pointless.
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_fs.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index 3a6011c7842..1bcc16dd6dd 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -850,9 +850,15 @@ generate_variant(struct llvmpipe_context *lp,
lp_debug_fs_variant(variant);
}
- generate_fragment(lp, shader, variant, RAST_WHOLE);
generate_fragment(lp, shader, variant, RAST_EDGE_TEST);
+ if (variant->opaque) {
+ /* Specialized shader, which doesn't need to read the color buffer. */
+ generate_fragment(lp, shader, variant, RAST_WHOLE);
+ } else {
+ variant->jit_function[RAST_WHOLE] = variant->jit_function[RAST_EDGE_TEST];
+ }
+
return variant;
}