mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-06-01 12:11:34 +00:00
Fixes MSL 1.2 error: 'auto' return without trailing return type; deduced return types are a C++14 extension Bug: tint:1327 Change-Id: I5956aadf6b28b605b07c9681716ac4b3e31d804a Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/71683 Reviewed-by: David Neto <dneto@google.com> Reviewed-by: James Price <jrprice@google.com> Commit-Queue: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com>
27 lines
599 B
Plaintext
27 lines
599 B
Plaintext
#include <metal_stdlib>
|
|
|
|
using namespace metal;
|
|
|
|
template<typename T, int N, int M>
|
|
inline vec<T, M> operator*(matrix<T, N, M> lhs, packed_vec<T, N> rhs) {
|
|
return lhs * vec<T, N>(rhs);
|
|
}
|
|
|
|
template<typename T, int N, int M>
|
|
inline vec<T, N> operator*(packed_vec<T, M> lhs, matrix<T, N, M> rhs) {
|
|
return vec<T, M>(lhs) * rhs;
|
|
}
|
|
|
|
struct S {
|
|
/* 0x0000 */ packed_float3 v;
|
|
/* 0x000c */ int8_t tint_pad[4];
|
|
};
|
|
|
|
void f(device S* const tint_symbol) {
|
|
(*(tint_symbol)).v = float3(1.0f, 2.0f, 3.0f);
|
|
(*(tint_symbol)).v[0] = 1.0f;
|
|
(*(tint_symbol)).v[1] = 2.0f;
|
|
(*(tint_symbol)).v[2] = 3.0f;
|
|
}
|
|
|