diff options
author | dan sinclair <dsinclair@google.com> | 2019-09-19 13:21:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-19 13:21:19 -0400 |
commit | 1c8cc31a5bd3a7b075b7bc1c64972d2cc7b4af64 (patch) | |
tree | 16efcb7a14f84942be741510f24eb3ae87df1d56 /src/pipeline.cc | |
parent | 190ada84226b26023df785875192cab5e408f027 (diff) | |
download | amber-1c8cc31a5bd3a7b075b7bc1c64972d2cc7b4af64.tar.gz |
Create Format directly instead of going through DatumType. (#658)
This CL switches some DatumType uses to directly creating Formats
instead of converting after creation.
Diffstat (limited to 'src/pipeline.cc')
-rw-r--r-- | src/pipeline.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/pipeline.cc b/src/pipeline.cc index 5b94161..b9685f7 100644 --- a/src/pipeline.cc +++ b/src/pipeline.cc @@ -540,9 +540,10 @@ Result Pipeline::GenerateOpenCLPodBuffers() { : BufferType::kUniform); // Use an 8-bit type because all the data in the descriptor map is // byte-based and it simplifies the logic for sizing below. - DatumType char_type; - char_type.SetType(DataType::kUint8); - buffer->SetFormat(char_type.AsFormat()); + auto fmt = MakeUnique<Format>(); + fmt->AddComponent(FormatComponentType::kR, FormatMode::kUInt, 8); + + buffer->SetFormat(std::move(fmt)); buffer->SetName(GetName() + "_pod_buffer_" + std::to_string(descriptor_set) + "_" + std::to_string(binding)); |