[Mesa-dev] [PATCH v2 15/17] swr/rast: split gen_knobs templates into .h/.cpp

Emil Velikov emil.l.velikov at gmail.com
Wed Aug 2 10:17:50 UTC 2017


On 1 August 2017 at 20:44, Tim Rowley <timothy.o.rowley at intel.com> wrote:
> Switch to a 1:1 mapping template:generated for future maintenance.
> ---
>  src/gallium/drivers/swr/Makefile.am                |   3 +-
>  src/gallium/drivers/swr/SConscript                 |   2 +-
>  .../drivers/swr/rasterizer/codegen/gen_knobs.py    |  14 +-
>  .../swr/rasterizer/codegen/templates/gen_knobs.cpp | 108 --------------
>  .../swr/rasterizer/codegen/templates/gen_knobs.h   | 157 +++++++++++++++++++++
>  5 files changed, 166 insertions(+), 118 deletions(-)
>  create mode 100644 src/gallium/drivers/swr/rasterizer/codegen/templates/gen_knobs.h
>
> diff --git a/src/gallium/drivers/swr/Makefile.am b/src/gallium/drivers/swr/Makefile.am
> index 73fe904..b20f128 100644
> --- a/src/gallium/drivers/swr/Makefile.am
> +++ b/src/gallium/drivers/swr/Makefile.am
> @@ -115,7 +115,7 @@ rasterizer/codegen/gen_knobs.cpp: rasterizer/codegen/gen_knobs.py rasterizer/cod
>                 --output rasterizer/codegen/gen_knobs.cpp \
>                 --gen_cpp
>
> -rasterizer/codegen/gen_knobs.h: rasterizer/codegen/gen_knobs.py rasterizer/codegen/knob_defs.py rasterizer/codegen/templates/gen_knobs.cpp rasterizer/codegen/gen_common.py
> +rasterizer/codegen/gen_knobs.h: rasterizer/codegen/gen_knobs.py rasterizer/codegen/knob_defs.py rasterizer/codegen/templates/gen_knobs.h rasterizer/codegen/gen_common.py
>         $(MKDIR_GEN)
>         $(PYTHON_GEN) \
>                 $(srcdir)/rasterizer/codegen/gen_knobs.py \
> @@ -347,5 +347,6 @@ EXTRA_DIST = \
>         rasterizer/codegen/templates/gen_builder.hpp \
>         rasterizer/codegen/templates/gen_header_init.hpp \
>         rasterizer/codegen/templates/gen_knobs.cpp \
> +       rasterizer/codegen/templates/gen_knobs.h \
>         rasterizer/codegen/templates/gen_llvm.hpp \
>         rasterizer/codegen/templates/gen_rasterizer.cpp
> diff --git a/src/gallium/drivers/swr/SConscript b/src/gallium/drivers/swr/SConscript
> index c578d7a..b394cbc 100644
> --- a/src/gallium/drivers/swr/SConscript
> +++ b/src/gallium/drivers/swr/SConscript
> @@ -54,7 +54,7 @@ env.CodeGenerate(
>      command = python_cmd + ' $SCRIPT --output $TARGET --gen_h'
>  )
>  Depends('rasterizer/codegen/gen_knobs.h',
> -        swrroot + 'rasterizer/codegen/templates/gen_knobs.cpp')
> +        swrroot + 'rasterizer/codegen/templates/gen_knobs.h')
>
Thanks for the respin/cleanup Tim!

The build bits look correct, haven't verified the python split but it
seems spot on.
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>

Emil


More information about the mesa-dev mailing list