From: Roland Scheidegger Date: Wed, 22 May 2013 20:47:59 +0000 (+0200) Subject: llvmpipe: disable simple_shader optimization X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=80e2cc0f97f40c2af58980e3961c2b10b14c801e;p=mesa.git llvmpipe: disable simple_shader optimization This optimization disabled mask checks if the shader is simple enough. While this should work correctly, the problem is that it can hide real issues because shaders in practice are usually complex enough (8 instructions or 1 texture is already enough) so this doesn't get used, whereas dumbed-down tests which should hit all the same code paths suddenly do something quite different. This was the reason that bug 41787 could not be easily tracked as stencil test not working correctly (piglit would in fact have failed some tests without that optimization). So disable it for now, it's unclear if it's much of a win in any case. Reviewed-by: Jose Fonseca --- diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index 98a5a497703..a20cc780bf4 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -245,9 +245,14 @@ generate_fs_loop(struct gallivm_state *gallivm, LLVMValueRef outputs[PIPE_MAX_SHADER_OUTPUTS][TGSI_NUM_CHANNELS]; struct lp_build_for_loop_state loop_state; struct lp_build_mask_context mask; + /* + * TODO: figure out if simple_shader optimization is really worthwile to + * keep. Disabled because it may hide some real bugs in the (depth/stencil) + * code since tests tend to take another codepath than real shaders. + */ boolean simple_shader = (shader->info.base.file_count[TGSI_FILE_SAMPLER] == 0 && shader->info.base.num_inputs < 3 && - shader->info.base.num_instructions < 8); + shader->info.base.num_instructions < 8) && 0; const boolean dual_source_blend = key->blend.rt[0].blend_enable && util_blend_state_is_dual(&key->blend, 0); unsigned attrib;