mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-08 13:14:56 +00:00
Create SPIR-V writer skeleton.
This CL creates the skeleton for the SPIR-V writer. Bug: tint:5 Change-Id: I849d8766d32d48314a51096710272f9821e2c1c4 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16641 Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
#include "src/reader/wgsl/parser.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/validator.h"
|
||||
#include "src/writer/spv/generator.h"
|
||||
#include "src/writer/spirv/generator.h"
|
||||
#include "src/writer/wgsl/generator.h"
|
||||
#include "src/writer/writer.h"
|
||||
|
||||
@@ -280,7 +280,8 @@ int main(int argc, const char** argv) {
|
||||
|
||||
std::unique_ptr<tint::writer::Writer> writer;
|
||||
if (options.format == Format::kSpirv || options.format == Format::kSpvAsm) {
|
||||
writer = std::make_unique<tint::writer::spv::Generator>(std::move(module));
|
||||
writer =
|
||||
std::make_unique<tint::writer::spirv::Generator>(std::move(module));
|
||||
} else if (options.format == Format::kWgsl) {
|
||||
writer = std::make_unique<tint::writer::wgsl::Generator>(std::move(module));
|
||||
} else {
|
||||
@@ -294,12 +295,12 @@ int main(int argc, const char** argv) {
|
||||
}
|
||||
|
||||
if (options.format == Format::kSpvAsm) {
|
||||
auto w = static_cast<tint::writer::spv::Generator*>(writer.get());
|
||||
auto w = static_cast<tint::writer::spirv::Generator*>(writer.get());
|
||||
auto str = Disassemble(w->result());
|
||||
// TODO(dsinclair): Write to file if output_file given
|
||||
std::cout << str << std::endl;
|
||||
} else if (options.format == Format::kSpirv) {
|
||||
// auto w = static_cast<tint::writer::spv::Generator*>(writer.get());
|
||||
// auto w = static_cast<tint::writer::spirv::Generator*>(writer.get());
|
||||
// TODO(dsincliair): Write to to file
|
||||
} else if (options.format == Format::kWgsl) {
|
||||
auto w = static_cast<tint::writer::wgsl::Generator*>(writer.get());
|
||||
|
||||
Reference in New Issue
Block a user