diff options
author | Brian Paul <[email protected]> | 2018-05-17 19:57:21 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2018-05-18 09:09:41 -0600 |
commit | 42aee8f4f68d9fd3ece5ece57f23f63a60e7d1fa (patch) | |
tree | e2dba54712e91e11b80a679f2a481016e3735874 | |
parent | 03c4816093b5ca1f72436fdb9576893690cfdd0e (diff) |
llvmpipe: fix check for a no-op shader
The tgsi_info.num_tokens fix broke llvmpipe's detection of no-op shaders.
Fix the code to check for num_instructions <= 1 instead.
Fixes: 8fde9429c36b75 ("tgsi: fix incorrect tgsi_shader_info::num_tokens
computation")
Tested-by: Roland Scheidegger <[email protected]>
Reviewed-by: Roland Scheidegger <[email protected]>
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_state_fs.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index 74b8d4dd96e..91b68e7c96e 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -2843,7 +2843,8 @@ generate_variant(struct llvmpipe_context *lp, !shader->info.base.writes_samplemask ? TRUE : FALSE; - if ((shader->info.base.num_tokens <= 1) && + /* if num_instructions == 1, it's a nop shader with only an END instruction */ + if ((shader->info.base.num_instructions <= 1) && !key->depth.enabled && !key->stencil[0].enabled) { variant->ps_inv_multiplier = 0; } else { @@ -3478,7 +3479,8 @@ llvmpipe_init_fs_funcs(struct llvmpipe_context *llvmpipe) boolean llvmpipe_rasterization_disabled(struct llvmpipe_context *lp) { - boolean null_fs = !lp->fs || lp->fs->info.base.num_tokens <= 1; + /* if num_instructions == 1, it's a nop shader with only an END instruction */ + boolean null_fs = !lp->fs || lp->fs->info.base.num_instructions <= 1; return (null_fs && !lp->depth_stencil->depth.enabled && |