diff options
author | dan sinclair <dsinclair@google.com> | 2019-09-28 00:07:43 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-28 00:07:43 -0400 |
commit | d65b37551cc61bbc489064e22db2d1faa319c298 (patch) | |
tree | 857c6d7489907290a545077cf569e9631d561b8c /src/vkscript/command_parser.cc | |
parent | 791e8dff42f5cc101756a5812e79b5cf5243771f (diff) | |
download | amber-d65b37551cc61bbc489064e22db2d1faa319c298.tar.gz |
Use FormatParser where possible. (#675)
This CL replaces a lot of manually created formats with ones created by
the format parser.
Diffstat (limited to 'src/vkscript/command_parser.cc')
-rw-r--r-- | src/vkscript/command_parser.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vkscript/command_parser.cc b/src/vkscript/command_parser.cc index f9bdfa1..b60993f 100644 --- a/src/vkscript/command_parser.cc +++ b/src/vkscript/command_parser.cc @@ -22,6 +22,7 @@ #include <utility> #include "src/command_data.h" +#include "src/format_parser.h" #include "src/make_unique.h" #include "src/tokenizer.h" #include "src/vkscript/datum_type_parser.h" @@ -638,9 +639,8 @@ Result CommandParser::ProcessSSBO() { // Set a default format into the buffer if needed. if (!buf->GetFormat()) { - auto fmt = MakeUnique<Format>(); - fmt->SetFormatType(FormatType::kR8_SINT); - fmt->AddComponent(FormatComponentType::kR, FormatMode::kSInt, 8); + FormatParser fp; + auto fmt = fp.Parse("R8_SINT"); buf->SetFormat(std::move(fmt)); // This has to come after the SetFormat() call because SetFormat() resets // the value back to false. |