writer/hlsl: Don't explode on unhandled member decorations
[[align(n)]], [[size(n)]] are valid decorations that should not cause the writer to fail. Instead of allow-listing these, just handle the cases it actually cares about. Fixed: tint:686 Change-Id: I7c60d251fcaee424fe1c1a1f1f58123eea8c99aa Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/46380 Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: James Price <jrprice@google.com>
This commit is contained in:
parent
02571d15e8
commit
ced00a2380
|
@ -2610,8 +2610,7 @@ bool GeneratorImpl::EmitStructType(std::ostream& out,
|
|||
out << " " << namer_.NameFor(builder_.Symbols().NameFor(mem->symbol()));
|
||||
}
|
||||
|
||||
if (mem->decorations().size() > 0) {
|
||||
auto* deco = mem->decorations()[0];
|
||||
for (auto* deco : mem->decorations()) {
|
||||
if (auto* location = deco->As<ast::LocationDecoration>()) {
|
||||
out << " : TEXCOORD" << location->value();
|
||||
} else if (auto* builtin = deco->As<ast::BuiltinDecoration>()) {
|
||||
|
@ -2621,11 +2620,6 @@ bool GeneratorImpl::EmitStructType(std::ostream& out,
|
|||
return false;
|
||||
}
|
||||
out << " : " << attr;
|
||||
} else if (deco->Is<ast::StructMemberOffsetDecoration>()) {
|
||||
// Nothing to do, offsets are handled at the point of access.
|
||||
} else {
|
||||
diagnostics_.add_error("unsupported struct member decoration");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue