dawn-cmake/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.msl
James Price 0f1efe04c3 writer/msl: Fix texture intrinsic generation
Wrap the texture expression in parentheses when it has lower
precendence than the function call operator.

Cast integer coordinates to unsigned integers as required by MSL.

Fixed: tint:536
Change-Id: I957e6be3c51044959e25e0be96c2d2c65db18187
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/53962
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2021-06-11 12:46:26 +00:00

28 lines
762 B
Plaintext

#include <metal_stdlib>
using namespace metal;
struct tint_symbol {
float4 value [[position]];
};
void textureNumLayers_ee942f(texture2d_array<uint, access::write> tint_symbol_2) {
int res = int(tint_symbol_2.get_array_size());
}
vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
textureNumLayers_ee942f(tint_symbol_3);
tint_symbol const tint_symbol_1 = {.value=float4()};
return tint_symbol_1;
}
fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
textureNumLayers_ee942f(tint_symbol_4);
return;
}
kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
textureNumLayers_ee942f(tint_symbol_5);
return;
}