From: José Fonseca Date: Sun, 12 Sep 2010 09:14:50 +0000 (+0100) Subject: llvmpipe: Only generate the whole shader specialization for opaque shaders. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=853953dc3c5bd2ef9cca904c9cabc4a0ef037b16;p=mesa.git 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. --- 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; }