Skip to content

Commit

Permalink
[WGSL] Atomics should return the size and alignment of their underlyi…
Browse files Browse the repository at this point in the history
…ng type

https://bugs.webkit.org/show_bug.cgi?id=262736
<radar://116544747>

Reviewed by Tadeu Zagallo.

Return the size and alignment of the underlying type.

* Source/WebGPU/WGSL/Types.cpp:
(WGSL::Type::size const):
(WGSL::Type::alignment const):

Canonical link: https://commits.webkit.org/268953@main
  • Loading branch information
mwyrzykowski committed Oct 6, 2023
1 parent 29536df commit 325c996
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Source/WebGPU/WGSL/Types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,9 @@ unsigned Type::size() const
[&](const Pointer&) -> unsigned {
RELEASE_ASSERT_NOT_REACHED();
},
[&](const Atomic&) -> unsigned {
RELEASE_ASSERT_NOT_REACHED();
[&](const Atomic& a) -> unsigned {
RELEASE_ASSERT(a.element);
return a.element->size();
},
[&](const TypeConstructor&) -> unsigned {
RELEASE_ASSERT_NOT_REACHED();
Expand Down Expand Up @@ -383,8 +384,9 @@ unsigned Type::alignment() const
[&](const Pointer&) -> unsigned {
RELEASE_ASSERT_NOT_REACHED();
},
[&](const Atomic&) -> unsigned {
RELEASE_ASSERT_NOT_REACHED();
[&](const Atomic& a) -> unsigned {
RELEASE_ASSERT(a.element);
return a.element->alignment();
},
[&](const TypeConstructor&) -> unsigned {
RELEASE_ASSERT_NOT_REACHED();
Expand Down

0 comments on commit 325c996

Please sign in to comment.