[Mesa-dev] [PATCH 29/32] swr: [rasterizer codegen] Fix generation of knobs
Tim Rowley
timothy.o.rowley at intel.com
Thu Mar 16 19:09:54 UTC 2017
---
src/gallium/drivers/swr/Makefile.am | 10 +++++-----
src/gallium/drivers/swr/SConscript | 4 ++--
src/gallium/drivers/swr/rasterizer/codegen/gen_backends.py | 2 ++
src/gallium/drivers/swr/rasterizer/codegen/gen_knobs.py | 2 ++
.../drivers/swr/rasterizer/codegen/gen_llvm_ir_macros.py | 2 ++
.../swr/rasterizer/codegen/templates/backend_template.cpp | 3 +++
.../swr/rasterizer/codegen/templates/gen_builder_template.hpp | 3 +++
.../codegen/templates/{knobs.template => knobs_template.cpp} | 5 ++++-
8 files changed, 23 insertions(+), 8 deletions(-)
rename src/gallium/drivers/swr/rasterizer/codegen/templates/{knobs.template => knobs_template.cpp} (98%)
diff --git a/src/gallium/drivers/swr/Makefile.am b/src/gallium/drivers/swr/Makefile.am
index f9fda31..771f1a8 100644
--- a/src/gallium/drivers/swr/Makefile.am
+++ b/src/gallium/drivers/swr/Makefile.am
@@ -71,19 +71,19 @@ swr_context_llvm.h: rasterizer/codegen/gen_llvm_types.py swr_context.h
--input $(srcdir)/swr_context.h \
--output swr_context_llvm.h
-rasterizer/codegen/gen_knobs.cpp: rasterizer/codegen/gen_knobs.py rasterizer/codegen/knob_defs.py rasterizer/codegen/templates/knobs.template
+rasterizer/codegen/gen_knobs.cpp: rasterizer/codegen/gen_knobs.py rasterizer/codegen/knob_defs.py rasterizer/codegen/templates/knobs_template.cpp
$(MKDIR_GEN)
$(PYTHON_GEN) \
$(srcdir)/rasterizer/codegen/gen_knobs.py \
- --input $(srcdir)/rasterizer/codegen/templates/knobs.template \
+ --input $(srcdir)/rasterizer/codegen/templates/knobs_template.cpp \
--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/knobs.template
+rasterizer/codegen/gen_knobs.h: rasterizer/codegen/gen_knobs.py rasterizer/codegen/knob_defs.py rasterizer/codegen/templates/knobs_template.cpp
$(MKDIR_GEN)
$(PYTHON_GEN) \
$(srcdir)/rasterizer/codegen/gen_knobs.py \
- --input $(srcdir)/rasterizer/codegen/templates/knobs.template \
+ --input $(srcdir)/rasterizer/codegen/templates/knobs_template.cpp \
--output rasterizer/codegen/gen_knobs.h \
--gen_h
@@ -258,7 +258,7 @@ EXTRA_DIST = \
rasterizer/codegen/mako/runtime.py \
rasterizer/codegen/mako/template.py \
rasterizer/codegen/mako/util.py \
- rasterizer/codegen/templates/knobs.template \
+ rasterizer/codegen/templates/knobs_template.cpp \
rasterizer/codegen/templates/ar_event_h.template \
rasterizer/codegen/templates/ar_event_cpp.template \
rasterizer/codegen/templates/ar_eventhandler_h.template \
diff --git a/src/gallium/drivers/swr/SConscript b/src/gallium/drivers/swr/SConscript
index 6e228f4..754e678 100644
--- a/src/gallium/drivers/swr/SConscript
+++ b/src/gallium/drivers/swr/SConscript
@@ -51,14 +51,14 @@ swrroot = '#src/gallium/drivers/swr/'
env.CodeGenerate(
target = 'rasterizer/codegen/gen_knobs.cpp',
script = swrroot + 'rasterizer/codegen/gen_knobs.py',
- source = 'rasterizer/codegen/templates/knobs.template',
+ source = 'rasterizer/codegen/templates/knobs_template.cpp',
command = python_cmd + ' $SCRIPT --input $SOURCE --output $TARGET --gen_cpp'
)
env.CodeGenerate(
target = 'rasterizer/codegen/gen_knobs.h',
script = swrroot + 'rasterizer/codegen/gen_knobs.py',
- source = 'rasterizer/codegen/templates/knobs.template',
+ source = 'rasterizer/codegen/templates/knobs_template.cpp',
command = python_cmd + ' $SCRIPT --input $SOURCE --output $TARGET --gen_h'
)
diff --git a/src/gallium/drivers/swr/rasterizer/codegen/gen_backends.py b/src/gallium/drivers/swr/rasterizer/codegen/gen_backends.py
index d6367ca..c889ea5 100644
--- a/src/gallium/drivers/swr/rasterizer/codegen/gen_backends.py
+++ b/src/gallium/drivers/swr/rasterizer/codegen/gen_backends.py
@@ -103,6 +103,7 @@ def main(args=sys.argv[1:]):
write_template_to_file(
templateCpp,
baseCppName % str(fileNum),
+ cmdline=sys.argv,
fileNum=fileNum,
funcList=chunkedList[fileNum])
@@ -114,6 +115,7 @@ def main(args=sys.argv[1:]):
write_template_to_file(
templateCmake,
cmakeFile,
+ cmdline=sys.argv,
numFiles=numFiles,
baseCppName=baseCppName.replace('\\','/'))
diff --git a/src/gallium/drivers/swr/rasterizer/codegen/gen_knobs.py b/src/gallium/drivers/swr/rasterizer/codegen/gen_knobs.py
index 225082e..50afdcd 100644
--- a/src/gallium/drivers/swr/rasterizer/codegen/gen_knobs.py
+++ b/src/gallium/drivers/swr/rasterizer/codegen/gen_knobs.py
@@ -62,6 +62,7 @@ def main(args=sys.argv[1:]):
if args.gen_h:
write_template_to_file(args.input,
args.output,
+ cmdline=sys.argv,
filename='gen_knobs',
knobs=knob_defs.KNOBS,
includes=['core/knobs_init.h', 'common/os.h', 'sstream', 'iomanip'],
@@ -70,6 +71,7 @@ def main(args=sys.argv[1:]):
if args.gen_cpp:
write_template_to_file(args.input,
args.output,
+ cmdline=sys.argv,
filename='gen_knobs',
knobs=knob_defs.KNOBS,
includes=['core/knobs_init.h', 'common/os.h', 'sstream', 'iomanip'],
diff --git a/src/gallium/drivers/swr/rasterizer/codegen/gen_llvm_ir_macros.py b/src/gallium/drivers/swr/rasterizer/codegen/gen_llvm_ir_macros.py
index 202dada..cfd6394 100644
--- a/src/gallium/drivers/swr/rasterizer/codegen/gen_llvm_ir_macros.py
+++ b/src/gallium/drivers/swr/rasterizer/codegen/gen_llvm_ir_macros.py
@@ -218,6 +218,7 @@ def generate_gen_h(functions, output_dir):
write_template_to_file(
template,
output_filename,
+ cmdline=sys.argv,
comment='Builder IR Wrappers',
filename=filename,
functions=templfuncs,
@@ -244,6 +245,7 @@ def generate_x86_h(output_dir):
write_template_to_file(
template,
output_filename,
+ cmdline=sys.argv,
comment='x86 intrinsics',
filename=filename,
functions=functions,
diff --git a/src/gallium/drivers/swr/rasterizer/codegen/templates/backend_template.cpp b/src/gallium/drivers/swr/rasterizer/codegen/templates/backend_template.cpp
index bb770fa..4eb4ad4 100644
--- a/src/gallium/drivers/swr/rasterizer/codegen/templates/backend_template.cpp
+++ b/src/gallium/drivers/swr/rasterizer/codegen/templates/backend_template.cpp
@@ -26,6 +26,9 @@
//
// DO NOT EDIT
//
+// Generation Command Line:
+// ${'\n// '.join(cmdline)}
+//
//============================================================================
#include "core/backend.h"
diff --git a/src/gallium/drivers/swr/rasterizer/codegen/templates/gen_builder_template.hpp b/src/gallium/drivers/swr/rasterizer/codegen/templates/gen_builder_template.hpp
index 6a56eb1..2e95758 100644
--- a/src/gallium/drivers/swr/rasterizer/codegen/templates/gen_builder_template.hpp
+++ b/src/gallium/drivers/swr/rasterizer/codegen/templates/gen_builder_template.hpp
@@ -26,6 +26,9 @@
//
// DO NOT EDIT
//
+// Generation Command Line:
+// ${'\n// '.join(cmdline)}
+//
//============================================================================
#pragma once
diff --git a/src/gallium/drivers/swr/rasterizer/codegen/templates/knobs.template b/src/gallium/drivers/swr/rasterizer/codegen/templates/knobs_template.cpp
similarity index 98%
rename from src/gallium/drivers/swr/rasterizer/codegen/templates/knobs.template
rename to src/gallium/drivers/swr/rasterizer/codegen/templates/knobs_template.cpp
index 1ae45e5..99294d2 100644
--- a/src/gallium/drivers/swr/rasterizer/codegen/templates/knobs.template
+++ b/src/gallium/drivers/swr/rasterizer/codegen/templates/knobs_template.cpp
@@ -24,7 +24,7 @@
%>/******************************************************************************
*
-* Copyright 2015-2016
+* Copyright 2015-2017
* Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -49,6 +49,9 @@
*
* ======================= AUTO GENERATED: DO NOT EDIT !!! ====================
*
+* Generation Command Line:
+* ${'\n* '.join(cmdline)}
+*
******************************************************************************/
%if gen_header:
#pragma once
--
2.7.4
More information about the mesa-dev
mailing list