mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-18 17:35:30 +00:00
Re-allow dynamic indexing of 'let' arrays and matrices
Spec change: https://github.com/gpuweb/gpuweb/pull/2427 Reverses: tint:867 This reverts and fixes commits:b6fdcc54df10442eff7dAdded a bunch of end-to-end tests. Fixed: tint:1352 Change-Id: I34968243bbec1cab838c8ba50a6f027146bbfd06 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/75401 Reviewed-by: David Neto <dneto@google.com> Reviewed-by: James Price <jrprice@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
committed by
Tint LUCI CQ
parent
294ce9394f
commit
3cbb136b8a
@@ -126,6 +126,13 @@ class Constant {
|
||||
return func(~0);
|
||||
}
|
||||
|
||||
/// @param index the index of the scalar value
|
||||
/// @return the value of the scalar `static_cast` to type T.
|
||||
template <typename T>
|
||||
T ElementAs(size_t index) const {
|
||||
return WithScalarAt(index, [](auto val) { return static_cast<T>(val); });
|
||||
}
|
||||
|
||||
private:
|
||||
const sem::Type* type_ = nullptr;
|
||||
const sem::Type* elem_type_ = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user