mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 13:20:14 +01:00
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: 8fde9429c3 ("tgsi: fix incorrect tgsi_shader_info::num_tokens
computation")
Tested-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
This commit is contained in:
parent
03c4816093
commit
42aee8f4f6
1 changed files with 4 additions and 2 deletions
|
|
@ -2843,7 +2843,8 @@ generate_variant(struct llvmpipe_context *lp,
|
||||||
!shader->info.base.writes_samplemask
|
!shader->info.base.writes_samplemask
|
||||||
? TRUE : FALSE;
|
? 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) {
|
!key->depth.enabled && !key->stencil[0].enabled) {
|
||||||
variant->ps_inv_multiplier = 0;
|
variant->ps_inv_multiplier = 0;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -3478,7 +3479,8 @@ llvmpipe_init_fs_funcs(struct llvmpipe_context *llvmpipe)
|
||||||
boolean
|
boolean
|
||||||
llvmpipe_rasterization_disabled(struct llvmpipe_context *lp)
|
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 &&
|
return (null_fs &&
|
||||||
!lp->depth_stencil->depth.enabled &&
|
!lp->depth_stencil->depth.enabled &&
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue