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 <dneto@google.com>
Auto-Submit: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
diff --git a/src/reader/spirv/parser_impl.h b/src/reader/spirv/parser_impl.h
index 27255c7..5e5e5dd 100644
--- a/src/reader/spirv/parser_impl.h
+++ b/src/reader/spirv/parser_impl.h
@@ -102,6 +102,14 @@
/// @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 @@
/// 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