mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-11 22:44:04 +00:00
writer/wgsl: Emit atomic types
Bug: tint:892 Change-Id: Ie483167bcf669e5f2d6b5489a915584fc3678183 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/54649 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include "src/ast/access.h"
|
||||
#include "src/ast/alias.h"
|
||||
#include "src/ast/array.h"
|
||||
#include "src/ast/atomic.h"
|
||||
#include "src/ast/bool.h"
|
||||
#include "src/ast/bool_literal.h"
|
||||
#include "src/ast/call_statement.h"
|
||||
@@ -409,6 +410,12 @@ bool GeneratorImpl::EmitType(const ast::Type* ty) {
|
||||
return false;
|
||||
}
|
||||
out_ << ">";
|
||||
} else if (auto* atomic = ty->As<ast::Atomic>()) {
|
||||
out_ << "atomic<";
|
||||
if (!EmitType(atomic->type())) {
|
||||
return false;
|
||||
}
|
||||
out_ << ">";
|
||||
} else if (auto* sampler = ty->As<ast::Sampler>()) {
|
||||
out_ << "sampler";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user