dawn-cmake/test/tint/expressions/swizzle/write/vec3/f32.wgsl.expected.msl
dan sinclair 6c167a0dc7 msl: Promote local private vars to function scope
If a module-scope private variable is only referenced within a single
function, promote it to a function scope declaration instead of
passing it as a parameter. This reduces the number of a function
parameters that are needed in some cases.

Bug: tint:1509
Change-Id: I8951f6216bc7e4cf5abfda314bea1e9ed3ded560
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94002
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2022-06-28 02:06:05 +00:00

16 lines
243 B
Plaintext

#include <metal_stdlib>
using namespace metal;
struct S {
float3 v;
};
void f() {
thread S 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;
}