[Mesa-dev] [PATCH 4/5] radeonsi/nir: set FS properties only when scanning a fragment shader

Timothy Arceri tarceri at itsqueeze.com
Thu Apr 12 00:11:16 UTC 2018


Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>

On 11/04/18 20:56, Nicolai Hähnle wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
> 
> ---
>   src/gallium/drivers/radeonsi/si_shader_nir.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c
> index c0e08c79a56..b4fba8b8812 100644
> --- a/src/gallium/drivers/radeonsi/si_shader_nir.c
> +++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
> @@ -600,21 +600,22 @@ void si_nir_scan_shader(const struct nir_shader *nir,
>   				case TGSI_SEMANTIC_TESSOUTER:
>   					info->reads_tessfactor_outputs = true;
>   				break;
>   				default:
>   					info->reads_pervertex_outputs = true;
>   				}
>   			}
>   		}
>   
>   		unsigned loc = variable->data.location;
> -		if (loc == FRAG_RESULT_COLOR &&
> +		if (nir->info.stage == MESA_SHADER_FRAGMENT &&
> +		    loc == FRAG_RESULT_COLOR &&
>   		    nir->info.outputs_written & (1ull << loc)) {
>   			assert(attrib_count == 1);
>   			info->properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS] = true;
>   		}
>   	}
>   
>   	info->num_outputs = num_outputs;
>   
>   	struct set *ubo_set = _mesa_set_create(NULL, _mesa_hash_pointer,
>   					       _mesa_key_pointer_equal);
> 


More information about the mesa-dev mailing list