[msl] Add polyfill for textureSampleCompareLevel
Add MSL member function definitions for `sample_compare()` with
explicit LOD.
The WGSL function does not actually take a LOD argument and implicitly
samples from level 0, so we have to insert a new argument for this
one.
Bug: 42251016
Change-Id: I4e25b327f9629344f33131d142bad202aa106255
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/193661
Reviewed-by: dan sinclair <dsinclair@chromium.org>
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.ir.msl
index 32ad9bc..8e0c7f7 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl.expected.ir.msl
@@ -1,45 +1,39 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+ depth2d_array<float, access::sample> arg_0;
+ sampler arg_1;
+ device float* prevent_dce;
+};
+struct VertexOutput {
+ float4 pos;
+ float prevent_dce;
+};
+struct vertex_main_outputs {
+ float4 VertexOutput_pos [[position]];
+ float VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
+};
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: { # root
- %arg_0:ptr<handle, texture_depth_2d_array, read> = var @binding_point(1, 0)
- %arg_1:ptr<handle, sampler_comparison, read> = var @binding_point(1, 1)
- %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+float textureSampleCompareLevel_1116ed(tint_module_vars_struct tint_module_vars) {
+ float res = tint_module_vars.arg_0.sample_compare(tint_module_vars.arg_1, float2(1.0f), 1, 1.0f, level(0u));
+ return res;
}
-
-%textureSampleCompareLevel_1116ed = func():void {
- $B2: {
- %5:texture_depth_2d_array = load %arg_0
- %6:sampler_comparison = load %arg_1
- %7:f32 = textureSampleCompareLevel %5, %6, vec2<f32>(1.0f), 1i, 1.0f
- %res:ptr<function, f32, read_write> = var, %7
- %9:f32 = load %res
- store %prevent_dce, %9
- ret
- }
+fragment void fragment_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_1116ed(tint_module_vars);
}
-%vertex_main = @vertex func():vec4<f32> [@position] {
- $B3: {
- %11:void = call %textureSampleCompareLevel_1116ed
- ret vec4<f32>(0.0f)
- }
+kernel void compute_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_1116ed(tint_module_vars);
}
-%fragment_main = @fragment func():void {
- $B4: {
- %13:void = call %textureSampleCompareLevel_1116ed
- ret
- }
+VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+ VertexOutput out = {};
+ out.pos = float4(0.0f);
+ out.prevent_dce = textureSampleCompareLevel_1116ed(tint_module_vars);
+ return out;
}
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
- $B5: {
- %15:void = call %textureSampleCompareLevel_1116ed
- ret
- }
+vertex vertex_main_outputs vertex_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1};
+ VertexOutput const v = vertex_main_inner(tint_module_vars);
+ return vertex_main_outputs{.VertexOutput_pos=v.pos, .VertexOutput_prevent_dce=v.prevent_dce};
}
-
-unhandled variable address space
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.ir.msl
index d1b7778..65506c1 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl.expected.ir.msl
@@ -1,45 +1,39 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+ depthcube<float, access::sample> arg_0;
+ sampler arg_1;
+ device float* prevent_dce;
+};
+struct VertexOutput {
+ float4 pos;
+ float prevent_dce;
+};
+struct vertex_main_outputs {
+ float4 VertexOutput_pos [[position]];
+ float VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
+};
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: { # root
- %arg_0:ptr<handle, texture_depth_cube, read> = var @binding_point(1, 0)
- %arg_1:ptr<handle, sampler_comparison, read> = var @binding_point(1, 1)
- %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+float textureSampleCompareLevel_1568e3(tint_module_vars_struct tint_module_vars) {
+ float res = tint_module_vars.arg_0.sample_compare(tint_module_vars.arg_1, float3(1.0f), 1.0f, level(0u));
+ return res;
}
-
-%textureSampleCompareLevel_1568e3 = func():void {
- $B2: {
- %5:texture_depth_cube = load %arg_0
- %6:sampler_comparison = load %arg_1
- %7:f32 = textureSampleCompareLevel %5, %6, vec3<f32>(1.0f), 1.0f
- %res:ptr<function, f32, read_write> = var, %7
- %9:f32 = load %res
- store %prevent_dce, %9
- ret
- }
+fragment void fragment_main(depthcube<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_1568e3(tint_module_vars);
}
-%vertex_main = @vertex func():vec4<f32> [@position] {
- $B3: {
- %11:void = call %textureSampleCompareLevel_1568e3
- ret vec4<f32>(0.0f)
- }
+kernel void compute_main(depthcube<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_1568e3(tint_module_vars);
}
-%fragment_main = @fragment func():void {
- $B4: {
- %13:void = call %textureSampleCompareLevel_1568e3
- ret
- }
+VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+ VertexOutput out = {};
+ out.pos = float4(0.0f);
+ out.prevent_dce = textureSampleCompareLevel_1568e3(tint_module_vars);
+ return out;
}
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
- $B5: {
- %15:void = call %textureSampleCompareLevel_1568e3
- ret
- }
+vertex vertex_main_outputs vertex_main(depthcube<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1};
+ VertexOutput const v = vertex_main_inner(tint_module_vars);
+ return vertex_main_outputs{.VertexOutput_pos=v.pos, .VertexOutput_prevent_dce=v.prevent_dce};
}
-
-unhandled variable address space
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.ir.msl
index db9bb2c..9fa738b 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl.expected.ir.msl
@@ -1,45 +1,39 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+ depth2d<float, access::sample> arg_0;
+ sampler arg_1;
+ device float* prevent_dce;
+};
+struct VertexOutput {
+ float4 pos;
+ float prevent_dce;
+};
+struct vertex_main_outputs {
+ float4 VertexOutput_pos [[position]];
+ float VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
+};
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: { # root
- %arg_0:ptr<handle, texture_depth_2d, read> = var @binding_point(1, 0)
- %arg_1:ptr<handle, sampler_comparison, read> = var @binding_point(1, 1)
- %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+float textureSampleCompareLevel_2ad2b1(tint_module_vars_struct tint_module_vars) {
+ float res = tint_module_vars.arg_0.sample_compare(tint_module_vars.arg_1, float2(1.0f), 1.0f, level(0u));
+ return res;
}
-
-%textureSampleCompareLevel_2ad2b1 = func():void {
- $B2: {
- %5:texture_depth_2d = load %arg_0
- %6:sampler_comparison = load %arg_1
- %7:f32 = textureSampleCompareLevel %5, %6, vec2<f32>(1.0f), 1.0f
- %res:ptr<function, f32, read_write> = var, %7
- %9:f32 = load %res
- store %prevent_dce, %9
- ret
- }
+fragment void fragment_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_2ad2b1(tint_module_vars);
}
-%vertex_main = @vertex func():vec4<f32> [@position] {
- $B3: {
- %11:void = call %textureSampleCompareLevel_2ad2b1
- ret vec4<f32>(0.0f)
- }
+kernel void compute_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_2ad2b1(tint_module_vars);
}
-%fragment_main = @fragment func():void {
- $B4: {
- %13:void = call %textureSampleCompareLevel_2ad2b1
- ret
- }
+VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+ VertexOutput out = {};
+ out.pos = float4(0.0f);
+ out.prevent_dce = textureSampleCompareLevel_2ad2b1(tint_module_vars);
+ return out;
}
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
- $B5: {
- %15:void = call %textureSampleCompareLevel_2ad2b1
- ret
- }
+vertex vertex_main_outputs vertex_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1};
+ VertexOutput const v = vertex_main_inner(tint_module_vars);
+ return vertex_main_outputs{.VertexOutput_pos=v.pos, .VertexOutput_prevent_dce=v.prevent_dce};
}
-
-unhandled variable address space
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.ir.msl
index d5c0d62..2b6f5d4 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl.expected.ir.msl
@@ -1,45 +1,39 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+ depthcube_array<float, access::sample> arg_0;
+ sampler arg_1;
+ device float* prevent_dce;
+};
+struct VertexOutput {
+ float4 pos;
+ float prevent_dce;
+};
+struct vertex_main_outputs {
+ float4 VertexOutput_pos [[position]];
+ float VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
+};
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: { # root
- %arg_0:ptr<handle, texture_depth_cube_array, read> = var @binding_point(1, 0)
- %arg_1:ptr<handle, sampler_comparison, read> = var @binding_point(1, 1)
- %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+float textureSampleCompareLevel_4cf3a2(tint_module_vars_struct tint_module_vars) {
+ float res = tint_module_vars.arg_0.sample_compare(tint_module_vars.arg_1, float3(1.0f), 1, 1.0f, level(0u));
+ return res;
}
-
-%textureSampleCompareLevel_4cf3a2 = func():void {
- $B2: {
- %5:texture_depth_cube_array = load %arg_0
- %6:sampler_comparison = load %arg_1
- %7:f32 = textureSampleCompareLevel %5, %6, vec3<f32>(1.0f), 1i, 1.0f
- %res:ptr<function, f32, read_write> = var, %7
- %9:f32 = load %res
- store %prevent_dce, %9
- ret
- }
+fragment void fragment_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_4cf3a2(tint_module_vars);
}
-%vertex_main = @vertex func():vec4<f32> [@position] {
- $B3: {
- %11:void = call %textureSampleCompareLevel_4cf3a2
- ret vec4<f32>(0.0f)
- }
+kernel void compute_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_4cf3a2(tint_module_vars);
}
-%fragment_main = @fragment func():void {
- $B4: {
- %13:void = call %textureSampleCompareLevel_4cf3a2
- ret
- }
+VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+ VertexOutput out = {};
+ out.pos = float4(0.0f);
+ out.prevent_dce = textureSampleCompareLevel_4cf3a2(tint_module_vars);
+ return out;
}
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
- $B5: {
- %15:void = call %textureSampleCompareLevel_4cf3a2
- ret
- }
+vertex vertex_main_outputs vertex_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1};
+ VertexOutput const v = vertex_main_inner(tint_module_vars);
+ return vertex_main_outputs{.VertexOutput_pos=v.pos, .VertexOutput_prevent_dce=v.prevent_dce};
}
-
-unhandled variable address space
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.ir.msl
index 4d0b81a..2d030e6 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7dc3c0.wgsl.expected.ir.msl
@@ -1,45 +1,39 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+ depth2d_array<float, access::sample> arg_0;
+ sampler arg_1;
+ device float* prevent_dce;
+};
+struct VertexOutput {
+ float4 pos;
+ float prevent_dce;
+};
+struct vertex_main_outputs {
+ float4 VertexOutput_pos [[position]];
+ float VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
+};
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: { # root
- %arg_0:ptr<handle, texture_depth_2d_array, read> = var @binding_point(1, 0)
- %arg_1:ptr<handle, sampler_comparison, read> = var @binding_point(1, 1)
- %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+float textureSampleCompareLevel_7dc3c0(tint_module_vars_struct tint_module_vars) {
+ float res = tint_module_vars.arg_0.sample_compare(tint_module_vars.arg_1, float2(1.0f), 1u, 1.0f, level(0u));
+ return res;
}
-
-%textureSampleCompareLevel_7dc3c0 = func():void {
- $B2: {
- %5:texture_depth_2d_array = load %arg_0
- %6:sampler_comparison = load %arg_1
- %7:f32 = textureSampleCompareLevel %5, %6, vec2<f32>(1.0f), 1u, 1.0f
- %res:ptr<function, f32, read_write> = var, %7
- %9:f32 = load %res
- store %prevent_dce, %9
- ret
- }
+fragment void fragment_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_7dc3c0(tint_module_vars);
}
-%vertex_main = @vertex func():vec4<f32> [@position] {
- $B3: {
- %11:void = call %textureSampleCompareLevel_7dc3c0
- ret vec4<f32>(0.0f)
- }
+kernel void compute_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_7dc3c0(tint_module_vars);
}
-%fragment_main = @fragment func():void {
- $B4: {
- %13:void = call %textureSampleCompareLevel_7dc3c0
- ret
- }
+VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+ VertexOutput out = {};
+ out.pos = float4(0.0f);
+ out.prevent_dce = textureSampleCompareLevel_7dc3c0(tint_module_vars);
+ return out;
}
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
- $B5: {
- %15:void = call %textureSampleCompareLevel_7dc3c0
- ret
- }
+vertex vertex_main_outputs vertex_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1};
+ VertexOutput const v = vertex_main_inner(tint_module_vars);
+ return vertex_main_outputs{.VertexOutput_pos=v.pos, .VertexOutput_prevent_dce=v.prevent_dce};
}
-
-unhandled variable address space
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.ir.msl
index 2b5e824..ffab64e 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl.expected.ir.msl
@@ -1,45 +1,39 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+ depth2d<float, access::sample> arg_0;
+ sampler arg_1;
+ device float* prevent_dce;
+};
+struct VertexOutput {
+ float4 pos;
+ float prevent_dce;
+};
+struct vertex_main_outputs {
+ float4 VertexOutput_pos [[position]];
+ float VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
+};
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: { # root
- %arg_0:ptr<handle, texture_depth_2d, read> = var @binding_point(1, 0)
- %arg_1:ptr<handle, sampler_comparison, read> = var @binding_point(1, 1)
- %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+float textureSampleCompareLevel_7f2b9a(tint_module_vars_struct tint_module_vars) {
+ float res = tint_module_vars.arg_0.sample_compare(tint_module_vars.arg_1, float2(1.0f), 1.0f, level(0u), int2(1));
+ return res;
}
-
-%textureSampleCompareLevel_7f2b9a = func():void {
- $B2: {
- %5:texture_depth_2d = load %arg_0
- %6:sampler_comparison = load %arg_1
- %7:f32 = textureSampleCompareLevel %5, %6, vec2<f32>(1.0f), 1.0f, vec2<i32>(1i)
- %res:ptr<function, f32, read_write> = var, %7
- %9:f32 = load %res
- store %prevent_dce, %9
- ret
- }
+fragment void fragment_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_7f2b9a(tint_module_vars);
}
-%vertex_main = @vertex func():vec4<f32> [@position] {
- $B3: {
- %11:void = call %textureSampleCompareLevel_7f2b9a
- ret vec4<f32>(0.0f)
- }
+kernel void compute_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_7f2b9a(tint_module_vars);
}
-%fragment_main = @fragment func():void {
- $B4: {
- %13:void = call %textureSampleCompareLevel_7f2b9a
- ret
- }
+VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+ VertexOutput out = {};
+ out.pos = float4(0.0f);
+ out.prevent_dce = textureSampleCompareLevel_7f2b9a(tint_module_vars);
+ return out;
}
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
- $B5: {
- %15:void = call %textureSampleCompareLevel_7f2b9a
- ret
- }
+vertex vertex_main_outputs vertex_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1};
+ VertexOutput const v = vertex_main_inner(tint_module_vars);
+ return vertex_main_outputs{.VertexOutput_pos=v.pos, .VertexOutput_prevent_dce=v.prevent_dce};
}
-
-unhandled variable address space
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.ir.msl
index bfa24b4..f8fd742 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/958c87.wgsl.expected.ir.msl
@@ -1,45 +1,39 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+ depthcube_array<float, access::sample> arg_0;
+ sampler arg_1;
+ device float* prevent_dce;
+};
+struct VertexOutput {
+ float4 pos;
+ float prevent_dce;
+};
+struct vertex_main_outputs {
+ float4 VertexOutput_pos [[position]];
+ float VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
+};
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: { # root
- %arg_0:ptr<handle, texture_depth_cube_array, read> = var @binding_point(1, 0)
- %arg_1:ptr<handle, sampler_comparison, read> = var @binding_point(1, 1)
- %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+float textureSampleCompareLevel_958c87(tint_module_vars_struct tint_module_vars) {
+ float res = tint_module_vars.arg_0.sample_compare(tint_module_vars.arg_1, float3(1.0f), 1u, 1.0f, level(0u));
+ return res;
}
-
-%textureSampleCompareLevel_958c87 = func():void {
- $B2: {
- %5:texture_depth_cube_array = load %arg_0
- %6:sampler_comparison = load %arg_1
- %7:f32 = textureSampleCompareLevel %5, %6, vec3<f32>(1.0f), 1u, 1.0f
- %res:ptr<function, f32, read_write> = var, %7
- %9:f32 = load %res
- store %prevent_dce, %9
- ret
- }
+fragment void fragment_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_958c87(tint_module_vars);
}
-%vertex_main = @vertex func():vec4<f32> [@position] {
- $B3: {
- %11:void = call %textureSampleCompareLevel_958c87
- ret vec4<f32>(0.0f)
- }
+kernel void compute_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_958c87(tint_module_vars);
}
-%fragment_main = @fragment func():void {
- $B4: {
- %13:void = call %textureSampleCompareLevel_958c87
- ret
- }
+VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+ VertexOutput out = {};
+ out.pos = float4(0.0f);
+ out.prevent_dce = textureSampleCompareLevel_958c87(tint_module_vars);
+ return out;
}
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
- $B5: {
- %15:void = call %textureSampleCompareLevel_958c87
- ret
- }
+vertex vertex_main_outputs vertex_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1};
+ VertexOutput const v = vertex_main_inner(tint_module_vars);
+ return vertex_main_outputs{.VertexOutput_pos=v.pos, .VertexOutput_prevent_dce=v.prevent_dce};
}
-
-unhandled variable address space
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.ir.msl
index 56b75ff..8550f8d 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl.expected.ir.msl
@@ -1,45 +1,39 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+ depth2d_array<float, access::sample> arg_0;
+ sampler arg_1;
+ device float* prevent_dce;
+};
+struct VertexOutput {
+ float4 pos;
+ float prevent_dce;
+};
+struct vertex_main_outputs {
+ float4 VertexOutput_pos [[position]];
+ float VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
+};
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: { # root
- %arg_0:ptr<handle, texture_depth_2d_array, read> = var @binding_point(1, 0)
- %arg_1:ptr<handle, sampler_comparison, read> = var @binding_point(1, 1)
- %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+float textureSampleCompareLevel_b6e47c(tint_module_vars_struct tint_module_vars) {
+ float res = tint_module_vars.arg_0.sample_compare(tint_module_vars.arg_1, float2(1.0f), 1, 1.0f, level(0u), int2(1));
+ return res;
}
-
-%textureSampleCompareLevel_b6e47c = func():void {
- $B2: {
- %5:texture_depth_2d_array = load %arg_0
- %6:sampler_comparison = load %arg_1
- %7:f32 = textureSampleCompareLevel %5, %6, vec2<f32>(1.0f), 1i, 1.0f, vec2<i32>(1i)
- %res:ptr<function, f32, read_write> = var, %7
- %9:f32 = load %res
- store %prevent_dce, %9
- ret
- }
+fragment void fragment_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_b6e47c(tint_module_vars);
}
-%vertex_main = @vertex func():vec4<f32> [@position] {
- $B3: {
- %11:void = call %textureSampleCompareLevel_b6e47c
- ret vec4<f32>(0.0f)
- }
+kernel void compute_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_b6e47c(tint_module_vars);
}
-%fragment_main = @fragment func():void {
- $B4: {
- %13:void = call %textureSampleCompareLevel_b6e47c
- ret
- }
+VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+ VertexOutput out = {};
+ out.pos = float4(0.0f);
+ out.prevent_dce = textureSampleCompareLevel_b6e47c(tint_module_vars);
+ return out;
}
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
- $B5: {
- %15:void = call %textureSampleCompareLevel_b6e47c
- ret
- }
+vertex vertex_main_outputs vertex_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1};
+ VertexOutput const v = vertex_main_inner(tint_module_vars);
+ return vertex_main_outputs{.VertexOutput_pos=v.pos, .VertexOutput_prevent_dce=v.prevent_dce};
}
-
-unhandled variable address space
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.ir.msl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.ir.msl
index 1d421ef..b770067 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/bcb3dd.wgsl.expected.ir.msl
@@ -1,45 +1,39 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+ depth2d_array<float, access::sample> arg_0;
+ sampler arg_1;
+ device float* prevent_dce;
+};
+struct VertexOutput {
+ float4 pos;
+ float prevent_dce;
+};
+struct vertex_main_outputs {
+ float4 VertexOutput_pos [[position]];
+ float VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
+};
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: { # root
- %arg_0:ptr<handle, texture_depth_2d_array, read> = var @binding_point(1, 0)
- %arg_1:ptr<handle, sampler_comparison, read> = var @binding_point(1, 1)
- %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+float textureSampleCompareLevel_bcb3dd(tint_module_vars_struct tint_module_vars) {
+ float res = tint_module_vars.arg_0.sample_compare(tint_module_vars.arg_1, float2(1.0f), 1u, 1.0f, level(0u), int2(1));
+ return res;
}
-
-%textureSampleCompareLevel_bcb3dd = func():void {
- $B2: {
- %5:texture_depth_2d_array = load %arg_0
- %6:sampler_comparison = load %arg_1
- %7:f32 = textureSampleCompareLevel %5, %6, vec2<f32>(1.0f), 1u, 1.0f, vec2<i32>(1i)
- %res:ptr<function, f32, read_write> = var, %7
- %9:f32 = load %res
- store %prevent_dce, %9
- ret
- }
+fragment void fragment_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_bcb3dd(tint_module_vars);
}
-%vertex_main = @vertex func():vec4<f32> [@position] {
- $B3: {
- %11:void = call %textureSampleCompareLevel_bcb3dd
- ret vec4<f32>(0.0f)
- }
+kernel void compute_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_bcb3dd(tint_module_vars);
}
-%fragment_main = @fragment func():void {
- $B4: {
- %13:void = call %textureSampleCompareLevel_bcb3dd
- ret
- }
+VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+ VertexOutput out = {};
+ out.pos = float4(0.0f);
+ out.prevent_dce = textureSampleCompareLevel_bcb3dd(tint_module_vars);
+ return out;
}
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
- $B5: {
- %15:void = call %textureSampleCompareLevel_bcb3dd
- ret
- }
+vertex vertex_main_outputs vertex_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1};
+ VertexOutput const v = vertex_main_inner(tint_module_vars);
+ return vertex_main_outputs{.VertexOutput_pos=v.pos, .VertexOutput_prevent_dce=v.prevent_dce};
}
-
-unhandled variable address space
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.ir.msl
index e858897..0d33ad5 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/1116ed.wgsl.expected.ir.msl
@@ -1,51 +1,45 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+ depth2d_array<float, access::sample> arg_0;
+ sampler arg_1;
+ device float* prevent_dce;
+};
+struct VertexOutput {
+ float4 pos;
+ float prevent_dce;
+};
+struct vertex_main_outputs {
+ float4 VertexOutput_pos [[position]];
+ float VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
+};
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: { # root
- %arg_0:ptr<handle, texture_depth_2d_array, read> = var @binding_point(1, 0)
- %arg_1:ptr<handle, sampler_comparison, read> = var @binding_point(1, 1)
- %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+float textureSampleCompareLevel_1116ed(tint_module_vars_struct tint_module_vars) {
+ float2 arg_2 = float2(1.0f);
+ int arg_3 = 1;
+ float arg_4 = 1.0f;
+ float2 const v = arg_2;
+ int const v_1 = arg_3;
+ float const v_2 = arg_4;
+ float res = tint_module_vars.arg_0.sample_compare(tint_module_vars.arg_1, v, v_1, v_2, level(0u));
+ return res;
}
-
-%textureSampleCompareLevel_1116ed = func():void {
- $B2: {
- %arg_2:ptr<function, vec2<f32>, read_write> = var, vec2<f32>(1.0f)
- %arg_3:ptr<function, i32, read_write> = var, 1i
- %arg_4:ptr<function, f32, read_write> = var, 1.0f
- %8:texture_depth_2d_array = load %arg_0
- %9:sampler_comparison = load %arg_1
- %10:vec2<f32> = load %arg_2
- %11:i32 = load %arg_3
- %12:f32 = load %arg_4
- %13:f32 = textureSampleCompareLevel %8, %9, %10, %11, %12
- %res:ptr<function, f32, read_write> = var, %13
- %15:f32 = load %res
- store %prevent_dce, %15
- ret
- }
+fragment void fragment_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_1116ed(tint_module_vars);
}
-%vertex_main = @vertex func():vec4<f32> [@position] {
- $B3: {
- %17:void = call %textureSampleCompareLevel_1116ed
- ret vec4<f32>(0.0f)
- }
+kernel void compute_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_1116ed(tint_module_vars);
}
-%fragment_main = @fragment func():void {
- $B4: {
- %19:void = call %textureSampleCompareLevel_1116ed
- ret
- }
+VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+ VertexOutput out = {};
+ out.pos = float4(0.0f);
+ out.prevent_dce = textureSampleCompareLevel_1116ed(tint_module_vars);
+ return out;
}
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
- $B5: {
- %21:void = call %textureSampleCompareLevel_1116ed
- ret
- }
+vertex vertex_main_outputs vertex_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1};
+ VertexOutput const v_3 = vertex_main_inner(tint_module_vars);
+ return vertex_main_outputs{.VertexOutput_pos=v_3.pos, .VertexOutput_prevent_dce=v_3.prevent_dce};
}
-
-unhandled variable address space
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.ir.msl
index dca0fd3..661aa0f 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/1568e3.wgsl.expected.ir.msl
@@ -1,49 +1,43 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+ depthcube<float, access::sample> arg_0;
+ sampler arg_1;
+ device float* prevent_dce;
+};
+struct VertexOutput {
+ float4 pos;
+ float prevent_dce;
+};
+struct vertex_main_outputs {
+ float4 VertexOutput_pos [[position]];
+ float VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
+};
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: { # root
- %arg_0:ptr<handle, texture_depth_cube, read> = var @binding_point(1, 0)
- %arg_1:ptr<handle, sampler_comparison, read> = var @binding_point(1, 1)
- %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+float textureSampleCompareLevel_1568e3(tint_module_vars_struct tint_module_vars) {
+ float3 arg_2 = float3(1.0f);
+ float arg_3 = 1.0f;
+ float3 const v = arg_2;
+ float const v_1 = arg_3;
+ float res = tint_module_vars.arg_0.sample_compare(tint_module_vars.arg_1, v, v_1, level(0u));
+ return res;
}
-
-%textureSampleCompareLevel_1568e3 = func():void {
- $B2: {
- %arg_2:ptr<function, vec3<f32>, read_write> = var, vec3<f32>(1.0f)
- %arg_3:ptr<function, f32, read_write> = var, 1.0f
- %7:texture_depth_cube = load %arg_0
- %8:sampler_comparison = load %arg_1
- %9:vec3<f32> = load %arg_2
- %10:f32 = load %arg_3
- %11:f32 = textureSampleCompareLevel %7, %8, %9, %10
- %res:ptr<function, f32, read_write> = var, %11
- %13:f32 = load %res
- store %prevent_dce, %13
- ret
- }
+fragment void fragment_main(depthcube<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_1568e3(tint_module_vars);
}
-%vertex_main = @vertex func():vec4<f32> [@position] {
- $B3: {
- %15:void = call %textureSampleCompareLevel_1568e3
- ret vec4<f32>(0.0f)
- }
+kernel void compute_main(depthcube<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_1568e3(tint_module_vars);
}
-%fragment_main = @fragment func():void {
- $B4: {
- %17:void = call %textureSampleCompareLevel_1568e3
- ret
- }
+VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+ VertexOutput out = {};
+ out.pos = float4(0.0f);
+ out.prevent_dce = textureSampleCompareLevel_1568e3(tint_module_vars);
+ return out;
}
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
- $B5: {
- %19:void = call %textureSampleCompareLevel_1568e3
- ret
- }
+vertex vertex_main_outputs vertex_main(depthcube<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1};
+ VertexOutput const v_2 = vertex_main_inner(tint_module_vars);
+ return vertex_main_outputs{.VertexOutput_pos=v_2.pos, .VertexOutput_prevent_dce=v_2.prevent_dce};
}
-
-unhandled variable address space
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.ir.msl
index 50be548..c998df3 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/2ad2b1.wgsl.expected.ir.msl
@@ -1,49 +1,43 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+ depth2d<float, access::sample> arg_0;
+ sampler arg_1;
+ device float* prevent_dce;
+};
+struct VertexOutput {
+ float4 pos;
+ float prevent_dce;
+};
+struct vertex_main_outputs {
+ float4 VertexOutput_pos [[position]];
+ float VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
+};
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: { # root
- %arg_0:ptr<handle, texture_depth_2d, read> = var @binding_point(1, 0)
- %arg_1:ptr<handle, sampler_comparison, read> = var @binding_point(1, 1)
- %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+float textureSampleCompareLevel_2ad2b1(tint_module_vars_struct tint_module_vars) {
+ float2 arg_2 = float2(1.0f);
+ float arg_3 = 1.0f;
+ float2 const v = arg_2;
+ float const v_1 = arg_3;
+ float res = tint_module_vars.arg_0.sample_compare(tint_module_vars.arg_1, v, v_1, level(0u));
+ return res;
}
-
-%textureSampleCompareLevel_2ad2b1 = func():void {
- $B2: {
- %arg_2:ptr<function, vec2<f32>, read_write> = var, vec2<f32>(1.0f)
- %arg_3:ptr<function, f32, read_write> = var, 1.0f
- %7:texture_depth_2d = load %arg_0
- %8:sampler_comparison = load %arg_1
- %9:vec2<f32> = load %arg_2
- %10:f32 = load %arg_3
- %11:f32 = textureSampleCompareLevel %7, %8, %9, %10
- %res:ptr<function, f32, read_write> = var, %11
- %13:f32 = load %res
- store %prevent_dce, %13
- ret
- }
+fragment void fragment_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_2ad2b1(tint_module_vars);
}
-%vertex_main = @vertex func():vec4<f32> [@position] {
- $B3: {
- %15:void = call %textureSampleCompareLevel_2ad2b1
- ret vec4<f32>(0.0f)
- }
+kernel void compute_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_2ad2b1(tint_module_vars);
}
-%fragment_main = @fragment func():void {
- $B4: {
- %17:void = call %textureSampleCompareLevel_2ad2b1
- ret
- }
+VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+ VertexOutput out = {};
+ out.pos = float4(0.0f);
+ out.prevent_dce = textureSampleCompareLevel_2ad2b1(tint_module_vars);
+ return out;
}
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
- $B5: {
- %19:void = call %textureSampleCompareLevel_2ad2b1
- ret
- }
+vertex vertex_main_outputs vertex_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1};
+ VertexOutput const v_2 = vertex_main_inner(tint_module_vars);
+ return vertex_main_outputs{.VertexOutput_pos=v_2.pos, .VertexOutput_prevent_dce=v_2.prevent_dce};
}
-
-unhandled variable address space
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.ir.msl
index 4a9df88..18853ea 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/4cf3a2.wgsl.expected.ir.msl
@@ -1,51 +1,45 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+ depthcube_array<float, access::sample> arg_0;
+ sampler arg_1;
+ device float* prevent_dce;
+};
+struct VertexOutput {
+ float4 pos;
+ float prevent_dce;
+};
+struct vertex_main_outputs {
+ float4 VertexOutput_pos [[position]];
+ float VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
+};
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: { # root
- %arg_0:ptr<handle, texture_depth_cube_array, read> = var @binding_point(1, 0)
- %arg_1:ptr<handle, sampler_comparison, read> = var @binding_point(1, 1)
- %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+float textureSampleCompareLevel_4cf3a2(tint_module_vars_struct tint_module_vars) {
+ float3 arg_2 = float3(1.0f);
+ int arg_3 = 1;
+ float arg_4 = 1.0f;
+ float3 const v = arg_2;
+ int const v_1 = arg_3;
+ float const v_2 = arg_4;
+ float res = tint_module_vars.arg_0.sample_compare(tint_module_vars.arg_1, v, v_1, v_2, level(0u));
+ return res;
}
-
-%textureSampleCompareLevel_4cf3a2 = func():void {
- $B2: {
- %arg_2:ptr<function, vec3<f32>, read_write> = var, vec3<f32>(1.0f)
- %arg_3:ptr<function, i32, read_write> = var, 1i
- %arg_4:ptr<function, f32, read_write> = var, 1.0f
- %8:texture_depth_cube_array = load %arg_0
- %9:sampler_comparison = load %arg_1
- %10:vec3<f32> = load %arg_2
- %11:i32 = load %arg_3
- %12:f32 = load %arg_4
- %13:f32 = textureSampleCompareLevel %8, %9, %10, %11, %12
- %res:ptr<function, f32, read_write> = var, %13
- %15:f32 = load %res
- store %prevent_dce, %15
- ret
- }
+fragment void fragment_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_4cf3a2(tint_module_vars);
}
-%vertex_main = @vertex func():vec4<f32> [@position] {
- $B3: {
- %17:void = call %textureSampleCompareLevel_4cf3a2
- ret vec4<f32>(0.0f)
- }
+kernel void compute_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_4cf3a2(tint_module_vars);
}
-%fragment_main = @fragment func():void {
- $B4: {
- %19:void = call %textureSampleCompareLevel_4cf3a2
- ret
- }
+VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+ VertexOutput out = {};
+ out.pos = float4(0.0f);
+ out.prevent_dce = textureSampleCompareLevel_4cf3a2(tint_module_vars);
+ return out;
}
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
- $B5: {
- %21:void = call %textureSampleCompareLevel_4cf3a2
- ret
- }
+vertex vertex_main_outputs vertex_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1};
+ VertexOutput const v_3 = vertex_main_inner(tint_module_vars);
+ return vertex_main_outputs{.VertexOutput_pos=v_3.pos, .VertexOutput_prevent_dce=v_3.prevent_dce};
}
-
-unhandled variable address space
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.ir.msl
index 8e6f626..1cb5ea7 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/7dc3c0.wgsl.expected.ir.msl
@@ -1,51 +1,45 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+ depth2d_array<float, access::sample> arg_0;
+ sampler arg_1;
+ device float* prevent_dce;
+};
+struct VertexOutput {
+ float4 pos;
+ float prevent_dce;
+};
+struct vertex_main_outputs {
+ float4 VertexOutput_pos [[position]];
+ float VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
+};
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: { # root
- %arg_0:ptr<handle, texture_depth_2d_array, read> = var @binding_point(1, 0)
- %arg_1:ptr<handle, sampler_comparison, read> = var @binding_point(1, 1)
- %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+float textureSampleCompareLevel_7dc3c0(tint_module_vars_struct tint_module_vars) {
+ float2 arg_2 = float2(1.0f);
+ uint arg_3 = 1u;
+ float arg_4 = 1.0f;
+ float2 const v = arg_2;
+ uint const v_1 = arg_3;
+ float const v_2 = arg_4;
+ float res = tint_module_vars.arg_0.sample_compare(tint_module_vars.arg_1, v, v_1, v_2, level(0u));
+ return res;
}
-
-%textureSampleCompareLevel_7dc3c0 = func():void {
- $B2: {
- %arg_2:ptr<function, vec2<f32>, read_write> = var, vec2<f32>(1.0f)
- %arg_3:ptr<function, u32, read_write> = var, 1u
- %arg_4:ptr<function, f32, read_write> = var, 1.0f
- %8:texture_depth_2d_array = load %arg_0
- %9:sampler_comparison = load %arg_1
- %10:vec2<f32> = load %arg_2
- %11:u32 = load %arg_3
- %12:f32 = load %arg_4
- %13:f32 = textureSampleCompareLevel %8, %9, %10, %11, %12
- %res:ptr<function, f32, read_write> = var, %13
- %15:f32 = load %res
- store %prevent_dce, %15
- ret
- }
+fragment void fragment_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_7dc3c0(tint_module_vars);
}
-%vertex_main = @vertex func():vec4<f32> [@position] {
- $B3: {
- %17:void = call %textureSampleCompareLevel_7dc3c0
- ret vec4<f32>(0.0f)
- }
+kernel void compute_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_7dc3c0(tint_module_vars);
}
-%fragment_main = @fragment func():void {
- $B4: {
- %19:void = call %textureSampleCompareLevel_7dc3c0
- ret
- }
+VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+ VertexOutput out = {};
+ out.pos = float4(0.0f);
+ out.prevent_dce = textureSampleCompareLevel_7dc3c0(tint_module_vars);
+ return out;
}
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
- $B5: {
- %21:void = call %textureSampleCompareLevel_7dc3c0
- ret
- }
+vertex vertex_main_outputs vertex_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1};
+ VertexOutput const v_3 = vertex_main_inner(tint_module_vars);
+ return vertex_main_outputs{.VertexOutput_pos=v_3.pos, .VertexOutput_prevent_dce=v_3.prevent_dce};
}
-
-unhandled variable address space
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.ir.msl
index b4e1932..16a48d3 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/7f2b9a.wgsl.expected.ir.msl
@@ -1,49 +1,43 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+ depth2d<float, access::sample> arg_0;
+ sampler arg_1;
+ device float* prevent_dce;
+};
+struct VertexOutput {
+ float4 pos;
+ float prevent_dce;
+};
+struct vertex_main_outputs {
+ float4 VertexOutput_pos [[position]];
+ float VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
+};
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: { # root
- %arg_0:ptr<handle, texture_depth_2d, read> = var @binding_point(1, 0)
- %arg_1:ptr<handle, sampler_comparison, read> = var @binding_point(1, 1)
- %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+float textureSampleCompareLevel_7f2b9a(tint_module_vars_struct tint_module_vars) {
+ float2 arg_2 = float2(1.0f);
+ float arg_3 = 1.0f;
+ float2 const v = arg_2;
+ float const v_1 = arg_3;
+ float res = tint_module_vars.arg_0.sample_compare(tint_module_vars.arg_1, v, v_1, level(0u), int2(1));
+ return res;
}
-
-%textureSampleCompareLevel_7f2b9a = func():void {
- $B2: {
- %arg_2:ptr<function, vec2<f32>, read_write> = var, vec2<f32>(1.0f)
- %arg_3:ptr<function, f32, read_write> = var, 1.0f
- %7:texture_depth_2d = load %arg_0
- %8:sampler_comparison = load %arg_1
- %9:vec2<f32> = load %arg_2
- %10:f32 = load %arg_3
- %11:f32 = textureSampleCompareLevel %7, %8, %9, %10, vec2<i32>(1i)
- %res:ptr<function, f32, read_write> = var, %11
- %13:f32 = load %res
- store %prevent_dce, %13
- ret
- }
+fragment void fragment_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_7f2b9a(tint_module_vars);
}
-%vertex_main = @vertex func():vec4<f32> [@position] {
- $B3: {
- %15:void = call %textureSampleCompareLevel_7f2b9a
- ret vec4<f32>(0.0f)
- }
+kernel void compute_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_7f2b9a(tint_module_vars);
}
-%fragment_main = @fragment func():void {
- $B4: {
- %17:void = call %textureSampleCompareLevel_7f2b9a
- ret
- }
+VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+ VertexOutput out = {};
+ out.pos = float4(0.0f);
+ out.prevent_dce = textureSampleCompareLevel_7f2b9a(tint_module_vars);
+ return out;
}
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
- $B5: {
- %19:void = call %textureSampleCompareLevel_7f2b9a
- ret
- }
+vertex vertex_main_outputs vertex_main(depth2d<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1};
+ VertexOutput const v_2 = vertex_main_inner(tint_module_vars);
+ return vertex_main_outputs{.VertexOutput_pos=v_2.pos, .VertexOutput_prevent_dce=v_2.prevent_dce};
}
-
-unhandled variable address space
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.ir.msl
index e8e8d35..0ff6a77 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/958c87.wgsl.expected.ir.msl
@@ -1,51 +1,45 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+ depthcube_array<float, access::sample> arg_0;
+ sampler arg_1;
+ device float* prevent_dce;
+};
+struct VertexOutput {
+ float4 pos;
+ float prevent_dce;
+};
+struct vertex_main_outputs {
+ float4 VertexOutput_pos [[position]];
+ float VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
+};
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: { # root
- %arg_0:ptr<handle, texture_depth_cube_array, read> = var @binding_point(1, 0)
- %arg_1:ptr<handle, sampler_comparison, read> = var @binding_point(1, 1)
- %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+float textureSampleCompareLevel_958c87(tint_module_vars_struct tint_module_vars) {
+ float3 arg_2 = float3(1.0f);
+ uint arg_3 = 1u;
+ float arg_4 = 1.0f;
+ float3 const v = arg_2;
+ uint const v_1 = arg_3;
+ float const v_2 = arg_4;
+ float res = tint_module_vars.arg_0.sample_compare(tint_module_vars.arg_1, v, v_1, v_2, level(0u));
+ return res;
}
-
-%textureSampleCompareLevel_958c87 = func():void {
- $B2: {
- %arg_2:ptr<function, vec3<f32>, read_write> = var, vec3<f32>(1.0f)
- %arg_3:ptr<function, u32, read_write> = var, 1u
- %arg_4:ptr<function, f32, read_write> = var, 1.0f
- %8:texture_depth_cube_array = load %arg_0
- %9:sampler_comparison = load %arg_1
- %10:vec3<f32> = load %arg_2
- %11:u32 = load %arg_3
- %12:f32 = load %arg_4
- %13:f32 = textureSampleCompareLevel %8, %9, %10, %11, %12
- %res:ptr<function, f32, read_write> = var, %13
- %15:f32 = load %res
- store %prevent_dce, %15
- ret
- }
+fragment void fragment_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_958c87(tint_module_vars);
}
-%vertex_main = @vertex func():vec4<f32> [@position] {
- $B3: {
- %17:void = call %textureSampleCompareLevel_958c87
- ret vec4<f32>(0.0f)
- }
+kernel void compute_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_958c87(tint_module_vars);
}
-%fragment_main = @fragment func():void {
- $B4: {
- %19:void = call %textureSampleCompareLevel_958c87
- ret
- }
+VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+ VertexOutput out = {};
+ out.pos = float4(0.0f);
+ out.prevent_dce = textureSampleCompareLevel_958c87(tint_module_vars);
+ return out;
}
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
- $B5: {
- %21:void = call %textureSampleCompareLevel_958c87
- ret
- }
+vertex vertex_main_outputs vertex_main(depthcube_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1};
+ VertexOutput const v_3 = vertex_main_inner(tint_module_vars);
+ return vertex_main_outputs{.VertexOutput_pos=v_3.pos, .VertexOutput_prevent_dce=v_3.prevent_dce};
}
-
-unhandled variable address space
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.ir.msl
index 7d63c65..0b2e0b4 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/b6e47c.wgsl.expected.ir.msl
@@ -1,51 +1,45 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+ depth2d_array<float, access::sample> arg_0;
+ sampler arg_1;
+ device float* prevent_dce;
+};
+struct VertexOutput {
+ float4 pos;
+ float prevent_dce;
+};
+struct vertex_main_outputs {
+ float4 VertexOutput_pos [[position]];
+ float VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
+};
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: { # root
- %arg_0:ptr<handle, texture_depth_2d_array, read> = var @binding_point(1, 0)
- %arg_1:ptr<handle, sampler_comparison, read> = var @binding_point(1, 1)
- %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+float textureSampleCompareLevel_b6e47c(tint_module_vars_struct tint_module_vars) {
+ float2 arg_2 = float2(1.0f);
+ int arg_3 = 1;
+ float arg_4 = 1.0f;
+ float2 const v = arg_2;
+ int const v_1 = arg_3;
+ float const v_2 = arg_4;
+ float res = tint_module_vars.arg_0.sample_compare(tint_module_vars.arg_1, v, v_1, v_2, level(0u), int2(1));
+ return res;
}
-
-%textureSampleCompareLevel_b6e47c = func():void {
- $B2: {
- %arg_2:ptr<function, vec2<f32>, read_write> = var, vec2<f32>(1.0f)
- %arg_3:ptr<function, i32, read_write> = var, 1i
- %arg_4:ptr<function, f32, read_write> = var, 1.0f
- %8:texture_depth_2d_array = load %arg_0
- %9:sampler_comparison = load %arg_1
- %10:vec2<f32> = load %arg_2
- %11:i32 = load %arg_3
- %12:f32 = load %arg_4
- %13:f32 = textureSampleCompareLevel %8, %9, %10, %11, %12, vec2<i32>(1i)
- %res:ptr<function, f32, read_write> = var, %13
- %15:f32 = load %res
- store %prevent_dce, %15
- ret
- }
+fragment void fragment_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_b6e47c(tint_module_vars);
}
-%vertex_main = @vertex func():vec4<f32> [@position] {
- $B3: {
- %17:void = call %textureSampleCompareLevel_b6e47c
- ret vec4<f32>(0.0f)
- }
+kernel void compute_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_b6e47c(tint_module_vars);
}
-%fragment_main = @fragment func():void {
- $B4: {
- %19:void = call %textureSampleCompareLevel_b6e47c
- ret
- }
+VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+ VertexOutput out = {};
+ out.pos = float4(0.0f);
+ out.prevent_dce = textureSampleCompareLevel_b6e47c(tint_module_vars);
+ return out;
}
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
- $B5: {
- %21:void = call %textureSampleCompareLevel_b6e47c
- ret
- }
+vertex vertex_main_outputs vertex_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1};
+ VertexOutput const v_3 = vertex_main_inner(tint_module_vars);
+ return vertex_main_outputs{.VertexOutput_pos=v_3.pos, .VertexOutput_prevent_dce=v_3.prevent_dce};
}
-
-unhandled variable address space
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.ir.msl b/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.ir.msl
index 0eeb62e..c34421c 100644
--- a/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.ir.msl
+++ b/test/tint/builtins/gen/var/textureSampleCompareLevel/bcb3dd.wgsl.expected.ir.msl
@@ -1,51 +1,45 @@
-SKIP: FAILED
+#include <metal_stdlib>
+using namespace metal;
+struct tint_module_vars_struct {
+ depth2d_array<float, access::sample> arg_0;
+ sampler arg_1;
+ device float* prevent_dce;
+};
+struct VertexOutput {
+ float4 pos;
+ float prevent_dce;
+};
+struct vertex_main_outputs {
+ float4 VertexOutput_pos [[position]];
+ float VertexOutput_prevent_dce [[user(locn0)]] [[flat]];
+};
-../../src/tint/lang/msl/writer/printer/printer.cc:500 internal compiler error: $B1: { # root
- %arg_0:ptr<handle, texture_depth_2d_array, read> = var @binding_point(1, 0)
- %arg_1:ptr<handle, sampler_comparison, read> = var @binding_point(1, 1)
- %prevent_dce:ptr<storage, f32, read_write> = var @binding_point(2, 0)
+float textureSampleCompareLevel_bcb3dd(tint_module_vars_struct tint_module_vars) {
+ float2 arg_2 = float2(1.0f);
+ uint arg_3 = 1u;
+ float arg_4 = 1.0f;
+ float2 const v = arg_2;
+ uint const v_1 = arg_3;
+ float const v_2 = arg_4;
+ float res = tint_module_vars.arg_0.sample_compare(tint_module_vars.arg_1, v, v_1, v_2, level(0u), int2(1));
+ return res;
}
-
-%textureSampleCompareLevel_bcb3dd = func():void {
- $B2: {
- %arg_2:ptr<function, vec2<f32>, read_write> = var, vec2<f32>(1.0f)
- %arg_3:ptr<function, u32, read_write> = var, 1u
- %arg_4:ptr<function, f32, read_write> = var, 1.0f
- %8:texture_depth_2d_array = load %arg_0
- %9:sampler_comparison = load %arg_1
- %10:vec2<f32> = load %arg_2
- %11:u32 = load %arg_3
- %12:f32 = load %arg_4
- %13:f32 = textureSampleCompareLevel %8, %9, %10, %11, %12, vec2<i32>(1i)
- %res:ptr<function, f32, read_write> = var, %13
- %15:f32 = load %res
- store %prevent_dce, %15
- ret
- }
+fragment void fragment_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_bcb3dd(tint_module_vars);
}
-%vertex_main = @vertex func():vec4<f32> [@position] {
- $B3: {
- %17:void = call %textureSampleCompareLevel_bcb3dd
- ret vec4<f32>(0.0f)
- }
+kernel void compute_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]], device float* prevent_dce [[buffer(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1, .prevent_dce=prevent_dce};
+ (*tint_module_vars.prevent_dce) = textureSampleCompareLevel_bcb3dd(tint_module_vars);
}
-%fragment_main = @fragment func():void {
- $B4: {
- %19:void = call %textureSampleCompareLevel_bcb3dd
- ret
- }
+VertexOutput vertex_main_inner(tint_module_vars_struct tint_module_vars) {
+ VertexOutput out = {};
+ out.pos = float4(0.0f);
+ out.prevent_dce = textureSampleCompareLevel_bcb3dd(tint_module_vars);
+ return out;
}
-%compute_main = @compute @workgroup_size(1, 1, 1) func():void {
- $B5: {
- %21:void = call %textureSampleCompareLevel_bcb3dd
- ret
- }
+vertex vertex_main_outputs vertex_main(depth2d_array<float, access::sample> arg_0 [[texture(0)]], sampler arg_1 [[sampler(0)]]) {
+ tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.arg_0=arg_0, .arg_1=arg_1};
+ VertexOutput const v_3 = vertex_main_inner(tint_module_vars);
+ return vertex_main_outputs{.VertexOutput_pos=v_3.pos, .VertexOutput_prevent_dce=v_3.prevent_dce};
}
-
-unhandled variable address space
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/unittest/reader/spirv/ImageSampleDrefExplicitLod_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageSampleDrefExplicitLod_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.ir.msl
deleted file mode 100644
index e9d3747..0000000
--- a/test/tint/unittest/reader/spirv/ImageSampleDrefExplicitLod_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.ir.msl
+++ /dev/null
@@ -1,9 +0,0 @@
-SKIP: FAILED
-
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureSampleCompareLevel
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/unittest/reader/spirv/ImageSampleDrefExplicitLod_SpvParserHandleTest_SampledImageAccessTest_Variable_1.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageSampleDrefExplicitLod_SpvParserHandleTest_SampledImageAccessTest_Variable_1.spvasm.expected.ir.msl
deleted file mode 100644
index e9d3747..0000000
--- a/test/tint/unittest/reader/spirv/ImageSampleDrefExplicitLod_SpvParserHandleTest_SampledImageAccessTest_Variable_1.spvasm.expected.ir.msl
+++ /dev/null
@@ -1,9 +0,0 @@
-SKIP: FAILED
-
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureSampleCompareLevel
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/unittest/reader/spirv/ImageSampleDrefExplicitLod_SpvParserHandleTest_SampledImageAccessTest_Variable_2.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageSampleDrefExplicitLod_SpvParserHandleTest_SampledImageAccessTest_Variable_2.spvasm.expected.ir.msl
deleted file mode 100644
index e9d3747..0000000
--- a/test/tint/unittest/reader/spirv/ImageSampleDrefExplicitLod_SpvParserHandleTest_SampledImageAccessTest_Variable_2.spvasm.expected.ir.msl
+++ /dev/null
@@ -1,9 +0,0 @@
-SKIP: FAILED
-
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureSampleCompareLevel
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/unittest/reader/spirv/ImageSampleDrefExplicitLod_SpvParserHandleTest_SampledImageAccessTest_Variable_3.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageSampleDrefExplicitLod_SpvParserHandleTest_SampledImageAccessTest_Variable_3.spvasm.expected.ir.msl
deleted file mode 100644
index e9d3747..0000000
--- a/test/tint/unittest/reader/spirv/ImageSampleDrefExplicitLod_SpvParserHandleTest_SampledImageAccessTest_Variable_3.spvasm.expected.ir.msl
+++ /dev/null
@@ -1,9 +0,0 @@
-SKIP: FAILED
-
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureSampleCompareLevel
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/unittest/reader/spirv/ImageSampleDrefExplicitLod_SpvParserHandleTest_SampledImageAccessTest_Variable_4.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageSampleDrefExplicitLod_SpvParserHandleTest_SampledImageAccessTest_Variable_4.spvasm.expected.ir.msl
deleted file mode 100644
index e9d3747..0000000
--- a/test/tint/unittest/reader/spirv/ImageSampleDrefExplicitLod_SpvParserHandleTest_SampledImageAccessTest_Variable_4.spvasm.expected.ir.msl
+++ /dev/null
@@ -1,9 +0,0 @@
-SKIP: FAILED
-
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureSampleCompareLevel
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/unittest/reader/spirv/ImageSampleDrefExplicitLod_SpvParserHandleTest_SampledImageAccessTest_Variable_5.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageSampleDrefExplicitLod_SpvParserHandleTest_SampledImageAccessTest_Variable_5.spvasm.expected.ir.msl
deleted file mode 100644
index e9d3747..0000000
--- a/test/tint/unittest/reader/spirv/ImageSampleDrefExplicitLod_SpvParserHandleTest_SampledImageAccessTest_Variable_5.spvasm.expected.ir.msl
+++ /dev/null
@@ -1,9 +0,0 @@
-SKIP: FAILED
-
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureSampleCompareLevel
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/unittest/reader/spirv/ImageSampleProjDrefExplicitLod_CheckForLod0_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_0.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageSampleProjDrefExplicitLod_CheckForLod0_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_0.spvasm.expected.ir.msl
deleted file mode 100644
index e9d3747..0000000
--- a/test/tint/unittest/reader/spirv/ImageSampleProjDrefExplicitLod_CheckForLod0_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_0.spvasm.expected.ir.msl
+++ /dev/null
@@ -1,9 +0,0 @@
-SKIP: FAILED
-
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureSampleCompareLevel
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/unittest/reader/spirv/ImageSampleProjDrefExplicitLod_CheckForLod0_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_1.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/ImageSampleProjDrefExplicitLod_CheckForLod0_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_1.spvasm.expected.ir.msl
deleted file mode 100644
index e9d3747..0000000
--- a/test/tint/unittest/reader/spirv/ImageSampleProjDrefExplicitLod_CheckForLod0_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_1.spvasm.expected.ir.msl
+++ /dev/null
@@ -1,9 +0,0 @@
-SKIP: FAILED
-
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureSampleCompareLevel
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************
diff --git a/test/tint/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_9.spvasm.expected.ir.msl b/test/tint/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_9.spvasm.expected.ir.msl
deleted file mode 100644
index e9d3747..0000000
--- a/test/tint/unittest/reader/spirv/Samples_SpvParserHandleTest_RegisterHandleUsage_SampledImage_Variable_9.spvasm.expected.ir.msl
+++ /dev/null
@@ -1,9 +0,0 @@
-SKIP: FAILED
-
-../../src/tint/lang/msl/writer/printer/printer.cc:924 internal compiler error: TINT_UNREACHABLE unhandled: textureSampleCompareLevel
-********************************************************************
-* The tint shader compiler has encountered an unexpected error. *
-* *
-* Please help us fix this issue by submitting a bug report at *
-* crbug.com/tint with the source program that triggered the bug. *
-********************************************************************