[Mesa-dev] [PATCH 6/7] nir: fix missing increments of num_inputs/num_outputs

Rob Clark robdclark at gmail.com
Fri Nov 6 15:39:33 PST 2015


On Fri, Nov 6, 2015 at 6:23 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> On Fri, Nov 6, 2015 at 8:35 AM, Rob Clark <robdclark at gmail.com> wrote:
>> From: Rob Clark <robclark at freedesktop.org>
>>
>> Signed-off-by: Rob Clark <robclark at freedesktop.org>
>> ---
>>  src/glsl/nir/nir_lower_clip.c            | 2 ++
>>  src/glsl/nir/nir_lower_two_sided_color.c | 2 ++
>>  2 files changed, 4 insertions(+)
>>
>> diff --git a/src/glsl/nir/nir_lower_clip.c b/src/glsl/nir/nir_lower_clip.c
>> index 31ccfb2..4a91527 100644
>> --- a/src/glsl/nir/nir_lower_clip.c
>> +++ b/src/glsl/nir/nir_lower_clip.c
>> @@ -55,9 +55,11 @@ create_clipdist_var(nir_shader *shader, unsigned drvloc,
>>
>>     if (output) {
>>        exec_list_push_tail(&shader->outputs, &var->node);
>> +      shader->num_outputs++;
>>     }
>>     else {
>>        exec_list_push_tail(&shader->inputs, &var->node);
>> +      shader->num_inputs++;
>
> I'm not sure what I think about this.  Usually, num_inputs/outputs is
> set by nir_lower_io or similar.  They don't have to be vec4's.  In the
> i965 driver, FS inputs are in terms of floats.  Maybe tgsi_to_nir
> provides you those guarantees but we haven't for i965.

hmm, what do you recommend then?  There isn't really any
straightforward way to run this *prior* to lower_io... tgsi->nir gives
me something that is already i/o lowered, and what I'm doing so far w/
gallium support for glsl->nir is doing lower_io (and a few other
steps) in gallium so that the result the driver gets is equivalent to
tgsi->nir..

BR,
-R

> --Jason
>
>>     }
>>     return var;
>>  }
>> diff --git a/src/glsl/nir/nir_lower_two_sided_color.c b/src/glsl/nir/nir_lower_two_sided_color.c
>> index db519bf..269e252 100644
>> --- a/src/glsl/nir/nir_lower_two_sided_color.c
>> +++ b/src/glsl/nir/nir_lower_two_sided_color.c
>> @@ -60,6 +60,8 @@ create_input(nir_shader *shader, unsigned drvloc, gl_varying_slot slot)
>>
>>     exec_list_push_tail(&shader->inputs, &var->node);
>>
>> +   shader->num_inputs++;
>> +
>>     return var;
>>  }
>>
>> --
>> 2.5.0
>>


More information about the mesa-dev mailing list