[Mesa-dev] [PATCH 03/16] nir: add lowering pass for y-transform

Rob Clark robdclark at gmail.com
Tue Apr 5 17:25:14 UTC 2016


On Tue, Apr 5, 2016 at 1:06 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> On 26 March 2016 at 21:02, Rob Clark <robdclark at gmail.com> wrote:
>> From: Rob Clark <robclark at freedesktop.org>
>>
>> Signed-off-by: Rob Clark <robclark at freedesktop.org>
>> Reviewed-by: Connor Abbott <cwabbott0 at gmail.com>
>> ---
>>  src/compiler/Makefile.sources                |   1 +
>>  src/compiler/nir/nir.h                       |  12 ++
>>  src/compiler/nir/nir_lower_wpos_ytransform.c | 310 +++++++++++++++++++++++++++
>>  3 files changed, 323 insertions(+)
>>  create mode 100644 src/compiler/nir/nir_lower_wpos_ytransform.c
>>
>> diff --git a/src/compiler/Makefile.sources b/src/compiler/Makefile.sources
>> index 1f85172..c6c1769 100644
>> --- a/src/compiler/Makefile.sources
>> +++ b/src/compiler/Makefile.sources
>> @@ -204,6 +204,7 @@ NIR_FILES = \
>>         nir/nir_lower_vars_to_ssa.c \
>>         nir/nir_lower_var_copies.c \
>>         nir/nir_lower_vec_to_movs.c \
>> +       nir/nir_lower_wpos_ytransform.c \
>>         nir/nir_metadata.c \
>>         nir/nir_move_vec_src_uses_to_dest.c \
>>         nir/nir_normalize_cubemap_coords.c \
>> diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
>> index 37d2907..d67213a 100644
>> --- a/src/compiler/nir/nir.h
>> +++ b/src/compiler/nir/nir.h
>> @@ -2244,6 +2244,18 @@ void nir_lower_clip_fs(nir_shader *shader, unsigned ucp_enables);
>>
>>  void nir_lower_two_sided_color(nir_shader *shader);
>>
>> +
>> +typedef struct nir_lower_wpos_ytransform_options {
>> +   int state_tokens[5];
>> +   bool fs_coord_origin_upper_left :1;
>> +   bool fs_coord_origin_lower_left :1;
>> +   bool fs_coord_pixel_center_integer :1;
>> +   bool fs_coord_pixel_center_half_integer :1;
>> +} nir_lower_wpos_ytransform_options;
>> +
>> +bool nir_lower_wpos_ytransform(nir_shader *shader,
>> +                               const nir_lower_wpos_ytransform_options *options);
>> +
> [Unrelated]
> I'm wondering if moving all the lowering passes out into a separate
> header won't be a good idea.
> Currently ~40 places use the passes, while "\<nir.*\.h\>" gets
> included in ~140 places
>
> Aiming towards "this is a great/terrible idea", not seeking a
> flamewar/bikeshed battles and alike.

+1000 for splitting it up somehow.. I'd suggested something similar on
irc a week or two back.  Right now it is one header that gets touched
a lot and triggers recompiling a whole lotta stuff ;-)

BR,
-R

> -Emil


More information about the mesa-dev mailing list