[Mesa-dev] [PATCH 01/20] st/glsl_to_nir: disable io type lowering for stages other than vs and fs

Timothy Arceri tarceri at itsqueeze.com
Wed Nov 15 11:00:49 UTC 2017


On 15/11/17 21:39, Nicolai Hähnle wrote:
> On 10.11.2017 04:13, Timothy Arceri wrote:
>> This is too simple and breaks gs and I'm not sure its required there
>> anyway.
> 
> Can you add an example for what breaks?

It breaks because it removes the outer array on gs inputs.

I have an updated series which makes use of the more fully featured 
array splitting pass from my nir linking series instead of this. It 
still needs some cleaning up but I hope to send out the new series 
sometime tomorrow.

https://github.com/tarceri/Mesa/compare/radeonsi_nir_v7


> 
> Thanks,
> Nicolai
> 
> 
>> ---
>>   src/mesa/state_tracker/st_glsl_to_nir.cpp | 5 ++++-
>>   1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp 
>> b/src/mesa/state_tracker/st_glsl_to_nir.cpp
>> index 6c474cb718..d478725fbe 100644
>> --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
>> +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
>> @@ -359,21 +359,24 @@ sort_varyings(struct exec_list *var_list)
>>    * variant lowering.
>>    */
>>   void
>>   st_finalize_nir(struct st_context *st, struct gl_program *prog,
>>                   struct gl_shader_program *shader_program, nir_shader 
>> *nir)
>>   {
>>      struct pipe_screen *screen = st->pipe->screen;
>>      NIR_PASS_V(nir, nir_split_var_copies);
>>      NIR_PASS_V(nir, nir_lower_var_copies);
>> -   NIR_PASS_V(nir, nir_lower_io_types);
>> +
>> +   if (nir->info.stage == MESA_SHADER_VERTEX ||
>> +       nir->info.stage == MESA_SHADER_FRAGMENT)
>> +      NIR_PASS_V(nir, nir_lower_io_types);
>>      if (nir->info.stage == MESA_SHADER_VERTEX) {
>>         /* Needs special handling so drvloc matches the vbo state: */
>>         st_nir_assign_vs_in_locations(prog, nir);
>>         /* Re-lower global vars, to deal with any dead VS inputs. */
>>         NIR_PASS_V(nir, nir_lower_global_vars_to_local);
>>         sort_varyings(&nir->outputs);
>>         nir_assign_var_locations(&nir->outputs,
>>                                  &nir->num_outputs,
>>
> 
> 


More information about the mesa-dev mailing list