[webgpu] fix indices type when it's 4D (#22758)

### Description

Fix indices type from `array<u32, 4>` to `vec4<u32>` when the variable
is 4D.
This commit is contained in:
Yulong Wang 2024-11-07 08:10:05 -08:00 committed by GitHub
parent 6a295eb75b
commit a436b3af1a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -81,8 +81,8 @@ constexpr static const auto ELEMENT_TYPE = details::_to_std_array(ELEMENT_TYPE_A
inline std::string GetIndicesType(int rank) {
return rank < 2 ? "u32"
: (rank < 4 ? MakeStringWithClassicLocale("vec", rank, "<u32>")
: MakeStringWithClassicLocale("array<u32, ", rank, ">"));
: (rank <= 4 ? MakeStringWithClassicLocale("vec", rank, "<u32>")
: MakeStringWithClassicLocale("array<u32, ", rank, ">"));
}
} // namespace