mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-17 12:51:28 +00:00
There's a reason the overload of `ctx.Replace()` that takes a pointer to the replacement is deprecated - it doesn't play well when used as part of another replacement. Switch to using the callback overload of Replace() to fix bad transform output. Bug: tint:1386647 Change-Id: I94292eeb65d24d7b2446b16b8b4ad13bdd27965a Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/111000 Auto-Submit: Ben Clayton <bclayton@google.com> Commit-Queue: James Price <jrprice@google.com> Reviewed-by: James Price <jrprice@google.com> Kokoro: Kokoro <noreply+kokoro@google.com>
18 lines
407 B
Plaintext
18 lines
407 B
Plaintext
#include <metal_stdlib>
|
|
|
|
using namespace metal;
|
|
struct S {
|
|
/* 0x0000 */ int4 a;
|
|
};
|
|
|
|
int4 tint_mod(int4 lhs, int rhs) {
|
|
int4 const r = int4(rhs);
|
|
return (lhs % select(r, int4(1), ((r == int4(0)) | ((lhs == int4((-2147483647 - 1))) & (r == int4(-1))))));
|
|
}
|
|
|
|
void foo(device S* const tint_symbol_1) {
|
|
int4 const tint_symbol = tint_mod((*(tint_symbol_1)).a, 2);
|
|
(*(tint_symbol_1)).a = tint_symbol;
|
|
}
|
|
|