From cae53b24d7a739647193711e9a16c7face7ec72a Mon Sep 17 00:00:00 2001 From: Tim Rowley Date: Mon, 26 Jun 2017 13:00:27 -0500 Subject: swr/rast: Split backend.cpp to improve compile time Hardcode split to four files currently. Decreases swr build time on a quad-core by ~10%. Reviewed-by: Bruce Cherniak --- .../drivers/swr/rasterizer/codegen/gen_backends.py | 19 ++++++++++ .../rasterizer/codegen/templates/gen_backend.cpp | 1 + .../codegen/templates/gen_header_init.hpp | 43 ++++++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 src/gallium/drivers/swr/rasterizer/codegen/templates/gen_header_init.hpp (limited to 'src/gallium/drivers/swr/rasterizer/codegen') diff --git a/src/gallium/drivers/swr/rasterizer/codegen/gen_backends.py b/src/gallium/drivers/swr/rasterizer/codegen/gen_backends.py index f65f7648c41..3f0790c8dae 100644 --- a/src/gallium/drivers/swr/rasterizer/codegen/gen_backends.py +++ b/src/gallium/drivers/swr/rasterizer/codegen/gen_backends.py @@ -35,7 +35,9 @@ def main(args=sys.argv[1:]): parser.add_argument('--dim', help='gBackendPixelRateTable array dimensions', nargs='+', type=int, required=True) parser.add_argument('--outdir', help='output directory', nargs='?', type=str, default=thisDir) parser.add_argument('--split', help='how many lines of initialization per file [0=no split]', nargs='?', type=int, default='512') + parser.add_argument('--numfiles', help='how many output files to generate', nargs='?', type=int, default='0') parser.add_argument('--cpp', help='Generate cpp file(s)', action='store_true', default=False) + parser.add_argument('--hpp', help='Generate hpp file', action='store_true', default=False) parser.add_argument('--cmake', help='Generate cmake file', action='store_true', default=False) args = parser.parse_args(args); @@ -43,11 +45,14 @@ def main(args=sys.argv[1:]): class backendStrs : def __init__(self) : self.outFileName = 'gen_BackendPixelRate%s.cpp' + self.outHeaderName = 'gen_BackendPixelRate.hpp' self.functionTableName = 'gBackendPixelRateTable' self.funcInstanceHeader = ' = BackendPixelRate