mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-16 12:21:35 +00:00
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>
17 lines
503 B
Plaintext
17 lines
503 B
Plaintext
#include <metal_stdlib>
|
|
|
|
using namespace metal;
|
|
void foo(int maybe_zero) {
|
|
thread int tint_symbol = 0;
|
|
thread float tint_symbol_1 = 0.0f;
|
|
tint_symbol = (tint_symbol / 0);
|
|
tint_symbol = (tint_symbol % 0);
|
|
tint_symbol = (tint_symbol / maybe_zero);
|
|
tint_symbol = (tint_symbol % maybe_zero);
|
|
tint_symbol_1 = (tint_symbol_1 / 0.0f);
|
|
tint_symbol_1 = fmod(tint_symbol_1, 0.0f);
|
|
tint_symbol_1 = (tint_symbol_1 / float(maybe_zero));
|
|
tint_symbol_1 = fmod(tint_symbol_1, float(maybe_zero));
|
|
}
|
|
|