mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-04 11:15:46 +00:00
Metal 1.x does not support swizzling on packed_vec types. Use array-index for single element selection (permitted on LHS and RHS of assignment) Cast the packed_vec to a vec for multiple element swizzles (not permitted as the LHS of an assignment). Fixed: tint:1249 Change-Id: I70cbb0c22a935b06b3905d24484bdc2edfb95fc2 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/67060 Commit-Queue: Ben Clayton <bclayton@google.com> Kokoro: Ben Clayton <bclayton@google.com> Reviewed-by: James Price <jrprice@google.com>
15 lines
472 B
Plaintext
15 lines
472 B
Plaintext
#include <metal_stdlib>
|
|
|
|
using namespace metal;
|
|
kernel void tint_symbol(texture2d<uint, access::sample> tint_symbol_1 [[texture(0)]], texture2d<uint, access::write> tint_symbol_2 [[texture(1)]]) {
|
|
uint4 srcValue = 0u;
|
|
uint4 const x_22 = tint_symbol_1.read(uint2(int2(0, 0)), 0);
|
|
srcValue = x_22;
|
|
uint const x_24 = srcValue[0];
|
|
uint const x_25 = (x_24 + 1u);
|
|
uint4 const x_27 = srcValue;
|
|
tint_symbol_2.write(uint4(x_27).xxxx, uint2(int2(0, 0)));
|
|
return;
|
|
}
|
|
|