From ac16789ebae44f1bc8cad3db84b282cef12e9363 Mon Sep 17 00:00:00 2001 From: David Neto Date: Thu, 29 Apr 2021 19:47:05 +0000 Subject: [PATCH] spirv-reader: add option to use HLSL-style pipeline IO This is currently unused. Bug: tint:508 Change-Id: I9027d468496014123a41b9941cf9df35868b6e1a Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/49000 Commit-Queue: David Neto Auto-Submit: David Neto Kokoro: Kokoro Reviewed-by: James Price Reviewed-by: Ben Clayton --- src/reader/spirv/parser_impl.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/reader/spirv/parser_impl.h b/src/reader/spirv/parser_impl.h index 27255c71fa..5e5e5ddc1a 100644 --- a/src/reader/spirv/parser_impl.h +++ b/src/reader/spirv/parser_impl.h @@ -102,6 +102,14 @@ class ParserImpl : Reader { /// @returns the accumulated error string const std::string error() { return errors_.str(); } + /// Changes pipeline IO to be HLSL-style: as entry point parameters and + /// return. + /// TODO(crbug.com/tint/508): Once all this support has landed, switch + /// over to that, and remove the old support. + void SetHLSLStylePipelineIO() { hlsl_style_pipeline_io_ = true; } + /// @returns true if HLSL-style IO should be used. + bool UseHLSLStylePipelineIO() const { return hlsl_style_pipeline_io_; } + /// Builds an internal representation of the SPIR-V binary, /// and parses it into a Tint AST module. Diagnostics are emitted /// to the error stream. @@ -672,6 +680,10 @@ class ParserImpl : Reader { /// See also BuiltInPositionInfo which is a separate mechanism for a more /// complex case of replacing an entire structure. BuiltInsMap special_builtins_; + + /// This is temporary while this module is converted to use the new style + /// of pipeline IO. + bool hlsl_style_pipeline_io_ = false; }; } // namespace spirv