[spirv-writer] Add function variables

This Cl adds function variables to the SPIR-V output. This requires some
refactoring to split function instructions and variables apart in the
builder.

Bug: tint:5
Change-Id: I4d0045f5a02311cf9a2803929c66c648278e3734
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/18600
Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
dan sinclair
2020-04-01 23:40:53 +00:00
committed by dan sinclair
parent 790b2f6b32
commit baaf989452
9 changed files with 462 additions and 39 deletions

View File

@@ -224,9 +224,11 @@ std::string Disassemble(const std::vector<uint32_t>& data) {
tools.SetMessageConsumer(msg_consumer);
std::string result;
tools.Disassemble(data, &result,
SPV_BINARY_TO_TEXT_OPTION_INDENT |
SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES);
if (!tools.Disassemble(data, &result,
SPV_BINARY_TO_TEXT_OPTION_INDENT |
SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES)) {
std::cerr << spv_errors << std::endl;
}
return result;
}
#endif // TINT_BUILD_SPV_WRITER