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>
This commit is contained in:
David Neto 2021-04-29 19:47:05 +00:00 committed by Commit Bot service account
parent 543d471889
commit ac16789eba
1 changed files with 12 additions and 0 deletions

View File

@ -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