Update DEPRECATED comments about offset decorations

Let's keep these for the SPIR-V reader case. The way things currently work is actually nicer than attempting to generate size / align decorations in the SPIR-V reader.

Change-Id: I83087c153e3b3056e737dcfbfd73ae6a0986bd7c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/44684
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
Ben Clayton
2021-03-15 20:34:22 +00:00
committed by Commit Bot service account
parent 822fa54d87
commit 2f9ced0341
3 changed files with 60 additions and 3 deletions

View File

@@ -21,8 +21,15 @@ namespace tint {
namespace ast {
/// A struct member offset decoration
// [DEPRECATED] - Replaced with StructMemberAlignDecoration and
// StructMemberSizeDecoration
/// @note The WGSL spec removed the `[[offset(n)]]` decoration for `[[size(n)]]`
/// and `[[align(n)]]` in https://github.com/gpuweb/gpuweb/pull/1447. However
/// this decoration is kept because the SPIR-V reader has to deal with absolute
/// offsets, and transforming these to size / align is complex and can be done
/// in a number of ways. The Resolver is responsible for consuming the size and
/// align decorations and transforming these into absolute offsets. It is
/// trivial for the Resolver to handle `[[offset(n)]]` or `[[size(n)]]` /
/// `[[align(n)]]` decorations, so this is what we do, keeping all the layout
/// logic in one place.
class StructMemberOffsetDecoration
: public Castable<StructMemberOffsetDecoration, Decoration> {
public: