tools: Return position from generated vertex shaders
This is required to generate valid MSL code, and will soon be
validated by Tint too.
Change-Id: I4c5f5c4ecb1c91131c934de1132217d9f6be1f8e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/53420
Auto-Submit: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
diff --git a/test/intrinsics/gen/abs/002533.wgsl b/test/intrinsics/gen/abs/002533.wgsl
index 26a968f..bc77230 100644
--- a/test/intrinsics/gen/abs/002533.wgsl
+++ b/test/intrinsics/gen/abs/002533.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
abs_002533();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/abs/002533.wgsl.expected.hlsl b/test/intrinsics/gen/abs/002533.wgsl.expected.hlsl
index 63a8d67..8f4024e 100644
--- a/test/intrinsics/gen/abs/002533.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/abs/002533.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void abs_002533() {
float4 res = abs(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
abs_002533();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/abs/002533.wgsl.expected.msl b/test/intrinsics/gen/abs/002533.wgsl.expected.msl
index 15940e8..1258a26 100644
--- a/test/intrinsics/gen/abs/002533.wgsl.expected.msl
+++ b/test/intrinsics/gen/abs/002533.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void abs_002533() {
float4 res = fabs(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
abs_002533();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/abs/002533.wgsl.expected.spvasm b/test/intrinsics/gen/abs/002533.wgsl.expected.spvasm
index 90cbf83..1c8872f 100644
--- a/test/intrinsics/gen/abs/002533.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/abs/002533.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %abs_002533 "abs_002533"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %abs_002533 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 FAbs %12
- OpStore %res %9
+ %abs_002533 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 FAbs %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %abs_002533
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %abs_002533
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %abs_002533
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %abs_002533
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %abs_002533
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/abs/002533.wgsl.expected.wgsl b/test/intrinsics/gen/abs/002533.wgsl.expected.wgsl
index 480a9de..60b2b6c 100644
--- a/test/intrinsics/gen/abs/002533.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/abs/002533.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
abs_002533();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/abs/005174.wgsl b/test/intrinsics/gen/abs/005174.wgsl
index 7384a15..a9b136a 100644
--- a/test/intrinsics/gen/abs/005174.wgsl
+++ b/test/intrinsics/gen/abs/005174.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
abs_005174();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/abs/005174.wgsl.expected.hlsl b/test/intrinsics/gen/abs/005174.wgsl.expected.hlsl
index 2733aae..b824ff5 100644
--- a/test/intrinsics/gen/abs/005174.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/abs/005174.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void abs_005174() {
float3 res = abs(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
abs_005174();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/abs/005174.wgsl.expected.msl b/test/intrinsics/gen/abs/005174.wgsl.expected.msl
index 333bdca..3babfb7 100644
--- a/test/intrinsics/gen/abs/005174.wgsl.expected.msl
+++ b/test/intrinsics/gen/abs/005174.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void abs_005174() {
float3 res = fabs(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
abs_005174();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/abs/005174.wgsl.expected.spvasm b/test/intrinsics/gen/abs/005174.wgsl.expected.spvasm
index 3c4c075..cf479cf 100644
--- a/test/intrinsics/gen/abs/005174.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/abs/005174.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %abs_005174 "abs_005174"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %abs_005174 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 FAbs %12
- OpStore %res %9
+ %abs_005174 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 FAbs %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %abs_005174
+ %26 = OpFunctionCall %void %abs_005174
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %abs_005174
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %abs_005174
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %abs_005174
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %abs_005174
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/abs/005174.wgsl.expected.wgsl b/test/intrinsics/gen/abs/005174.wgsl.expected.wgsl
index 0d0cb37..e99e224 100644
--- a/test/intrinsics/gen/abs/005174.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/abs/005174.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
abs_005174();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/abs/1ce782.wgsl b/test/intrinsics/gen/abs/1ce782.wgsl
index bc53763..de90d83 100644
--- a/test/intrinsics/gen/abs/1ce782.wgsl
+++ b/test/intrinsics/gen/abs/1ce782.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
abs_1ce782();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/abs/1ce782.wgsl.expected.hlsl b/test/intrinsics/gen/abs/1ce782.wgsl.expected.hlsl
index dc858cb..684aae1 100644
--- a/test/intrinsics/gen/abs/1ce782.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/abs/1ce782.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void abs_1ce782() {
uint4 res = abs(uint4(0u, 0u, 0u, 0u));
}
-void vertex_main() {
+tint_symbol vertex_main() {
abs_1ce782();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/abs/1ce782.wgsl.expected.msl b/test/intrinsics/gen/abs/1ce782.wgsl.expected.msl
index 5f35a13..987b8fb 100644
--- a/test/intrinsics/gen/abs/1ce782.wgsl.expected.msl
+++ b/test/intrinsics/gen/abs/1ce782.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void abs_1ce782() {
uint4 res = abs(uint4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
abs_1ce782();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/abs/1ce782.wgsl.expected.spvasm b/test/intrinsics/gen/abs/1ce782.wgsl.expected.spvasm
index d791e62..80b9133 100644
--- a/test/intrinsics/gen/abs/1ce782.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/abs/1ce782.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %abs_1ce782 "abs_1ce782"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v4uint = OpTypeVector %uint 4
- %13 = OpConstantNull %v4uint
+ %17 = OpConstantNull %v4uint
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %abs_1ce782 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %13
- %9 = OpExtInst %v4uint %12 SAbs %13
- OpStore %res %9
+ %abs_1ce782 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %17
+ %13 = OpExtInst %v4uint %16 SAbs %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %abs_1ce782
+ %27 = OpFunctionCall %void %abs_1ce782
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %abs_1ce782
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %abs_1ce782
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %abs_1ce782
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %abs_1ce782
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/abs/1ce782.wgsl.expected.wgsl b/test/intrinsics/gen/abs/1ce782.wgsl.expected.wgsl
index 5bf8abe..44b1f87f 100644
--- a/test/intrinsics/gen/abs/1ce782.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/abs/1ce782.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
abs_1ce782();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/abs/1e9d53.wgsl b/test/intrinsics/gen/abs/1e9d53.wgsl
index 4ad1136..4799dbf 100644
--- a/test/intrinsics/gen/abs/1e9d53.wgsl
+++ b/test/intrinsics/gen/abs/1e9d53.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
abs_1e9d53();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.hlsl b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.hlsl
index 5c0e701..b6a925e 100644
--- a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void abs_1e9d53() {
float2 res = abs(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
abs_1e9d53();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.msl b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.msl
index f126e82..944edf8 100644
--- a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.msl
+++ b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void abs_1e9d53() {
float2 res = fabs(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
abs_1e9d53();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.spvasm b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.spvasm
index 815fcf9..64cd558 100644
--- a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %abs_1e9d53 "abs_1e9d53"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %abs_1e9d53 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 FAbs %12
- OpStore %res %9
+ %abs_1e9d53 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 FAbs %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %abs_1e9d53
+ %26 = OpFunctionCall %void %abs_1e9d53
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %abs_1e9d53
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %abs_1e9d53
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %abs_1e9d53
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %abs_1e9d53
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.wgsl b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.wgsl
index 1e51a1f..1e7f60a 100644
--- a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
abs_1e9d53();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/abs/467cd1.wgsl b/test/intrinsics/gen/abs/467cd1.wgsl
index 422ee72..03cf6e4 100644
--- a/test/intrinsics/gen/abs/467cd1.wgsl
+++ b/test/intrinsics/gen/abs/467cd1.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
abs_467cd1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/abs/467cd1.wgsl.expected.hlsl b/test/intrinsics/gen/abs/467cd1.wgsl.expected.hlsl
index 0728dea..ac45548 100644
--- a/test/intrinsics/gen/abs/467cd1.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/abs/467cd1.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void abs_467cd1() {
uint res = abs(1u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
abs_467cd1();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/abs/467cd1.wgsl.expected.msl b/test/intrinsics/gen/abs/467cd1.wgsl.expected.msl
index 63d83b3..76477c2 100644
--- a/test/intrinsics/gen/abs/467cd1.wgsl.expected.msl
+++ b/test/intrinsics/gen/abs/467cd1.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void abs_467cd1() {
uint res = abs(1u);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
abs_467cd1();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/abs/467cd1.wgsl.expected.spvasm b/test/intrinsics/gen/abs/467cd1.wgsl.expected.spvasm
index 7af5b05..9ad9cb3 100644
--- a/test/intrinsics/gen/abs/467cd1.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/abs/467cd1.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %abs_467cd1 "abs_467cd1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%_ptr_Function_uint = OpTypePointer Function %uint
- %15 = OpConstantNull %uint
+ %19 = OpConstantNull %uint
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %abs_467cd1 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_uint Function %15
- %9 = OpExtInst %uint %11 SAbs %uint_1
- OpStore %res %9
+ %abs_467cd1 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %19
+ %13 = OpExtInst %uint %15 SAbs %uint_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %abs_467cd1
+ %27 = OpFunctionCall %void %abs_467cd1
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %abs_467cd1
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %abs_467cd1
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %abs_467cd1
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %abs_467cd1
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/abs/467cd1.wgsl.expected.wgsl b/test/intrinsics/gen/abs/467cd1.wgsl.expected.wgsl
index b40916d..c316c50 100644
--- a/test/intrinsics/gen/abs/467cd1.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/abs/467cd1.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
abs_467cd1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/abs/4ad288.wgsl b/test/intrinsics/gen/abs/4ad288.wgsl
index 0105439..08fcabc 100644
--- a/test/intrinsics/gen/abs/4ad288.wgsl
+++ b/test/intrinsics/gen/abs/4ad288.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
abs_4ad288();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/abs/4ad288.wgsl.expected.hlsl b/test/intrinsics/gen/abs/4ad288.wgsl.expected.hlsl
index e7ff244..6c6afef 100644
--- a/test/intrinsics/gen/abs/4ad288.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/abs/4ad288.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void abs_4ad288() {
int res = abs(1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
abs_4ad288();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/abs/4ad288.wgsl.expected.msl b/test/intrinsics/gen/abs/4ad288.wgsl.expected.msl
index c454219..081a994 100644
--- a/test/intrinsics/gen/abs/4ad288.wgsl.expected.msl
+++ b/test/intrinsics/gen/abs/4ad288.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void abs_4ad288() {
int res = abs(1);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
abs_4ad288();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/abs/4ad288.wgsl.expected.spvasm b/test/intrinsics/gen/abs/4ad288.wgsl.expected.spvasm
index bb37f07..a037803 100644
--- a/test/intrinsics/gen/abs/4ad288.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/abs/4ad288.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %abs_4ad288 "abs_4ad288"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_Function_int = OpTypePointer Function %int
- %15 = OpConstantNull %int
+ %19 = OpConstantNull %int
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %abs_4ad288 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %15
- %9 = OpExtInst %int %11 SAbs %int_1
- OpStore %res %9
+ %abs_4ad288 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %13 = OpExtInst %int %15 SAbs %int_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %abs_4ad288
+ %27 = OpFunctionCall %void %abs_4ad288
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %abs_4ad288
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %abs_4ad288
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %abs_4ad288
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %abs_4ad288
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/abs/4ad288.wgsl.expected.wgsl b/test/intrinsics/gen/abs/4ad288.wgsl.expected.wgsl
index 2842caf..c996801 100644
--- a/test/intrinsics/gen/abs/4ad288.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/abs/4ad288.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
abs_4ad288();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/abs/5ad50a.wgsl b/test/intrinsics/gen/abs/5ad50a.wgsl
index 5b305f8..a5d420f 100644
--- a/test/intrinsics/gen/abs/5ad50a.wgsl
+++ b/test/intrinsics/gen/abs/5ad50a.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
abs_5ad50a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.hlsl b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.hlsl
index 075e3cf..86eee8b 100644
--- a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void abs_5ad50a() {
int3 res = abs(int3(0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
abs_5ad50a();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.msl b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.msl
index 2d542b8..bcc027b 100644
--- a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.msl
+++ b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void abs_5ad50a() {
int3 res = abs(int3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
abs_5ad50a();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.spvasm b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.spvasm
index 3419005..f5a5d0c 100644
--- a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %abs_5ad50a "abs_5ad50a"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %13 = OpConstantNull %v3int
+ %17 = OpConstantNull %v3int
%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %abs_5ad50a = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %13
- %9 = OpExtInst %v3int %12 SAbs %13
- OpStore %res %9
+ %abs_5ad50a = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %17
+ %13 = OpExtInst %v3int %16 SAbs %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %abs_5ad50a
+ %27 = OpFunctionCall %void %abs_5ad50a
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %abs_5ad50a
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %abs_5ad50a
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %abs_5ad50a
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %abs_5ad50a
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.wgsl b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.wgsl
index ec7efb6..dd82456 100644
--- a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
abs_5ad50a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/abs/7326de.wgsl b/test/intrinsics/gen/abs/7326de.wgsl
index d32d55f..aff9ddc 100644
--- a/test/intrinsics/gen/abs/7326de.wgsl
+++ b/test/intrinsics/gen/abs/7326de.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
abs_7326de();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/abs/7326de.wgsl.expected.hlsl b/test/intrinsics/gen/abs/7326de.wgsl.expected.hlsl
index 1452464..48d4e3d 100644
--- a/test/intrinsics/gen/abs/7326de.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/abs/7326de.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void abs_7326de() {
uint3 res = abs(uint3(0u, 0u, 0u));
}
-void vertex_main() {
+tint_symbol vertex_main() {
abs_7326de();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/abs/7326de.wgsl.expected.msl b/test/intrinsics/gen/abs/7326de.wgsl.expected.msl
index 9c2eb81..3de8a49 100644
--- a/test/intrinsics/gen/abs/7326de.wgsl.expected.msl
+++ b/test/intrinsics/gen/abs/7326de.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void abs_7326de() {
uint3 res = abs(uint3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
abs_7326de();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/abs/7326de.wgsl.expected.spvasm b/test/intrinsics/gen/abs/7326de.wgsl.expected.spvasm
index 55422b3..4ea8984 100644
--- a/test/intrinsics/gen/abs/7326de.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/abs/7326de.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %abs_7326de "abs_7326de"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
- %13 = OpConstantNull %v3uint
+ %17 = OpConstantNull %v3uint
%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %abs_7326de = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3uint Function %13
- %9 = OpExtInst %v3uint %12 SAbs %13
- OpStore %res %9
+ %abs_7326de = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %17
+ %13 = OpExtInst %v3uint %16 SAbs %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %abs_7326de
+ %27 = OpFunctionCall %void %abs_7326de
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %abs_7326de
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %abs_7326de
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %abs_7326de
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %abs_7326de
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/abs/7326de.wgsl.expected.wgsl b/test/intrinsics/gen/abs/7326de.wgsl.expected.wgsl
index 0cd0f3c..c3c58bf 100644
--- a/test/intrinsics/gen/abs/7326de.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/abs/7326de.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
abs_7326de();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/abs/7f28e6.wgsl b/test/intrinsics/gen/abs/7f28e6.wgsl
index 60f0174..e90960a 100644
--- a/test/intrinsics/gen/abs/7f28e6.wgsl
+++ b/test/intrinsics/gen/abs/7f28e6.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
abs_7f28e6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.hlsl b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.hlsl
index c2394da..b73df9f 100644
--- a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void abs_7f28e6() {
uint2 res = abs(uint2(0u, 0u));
}
-void vertex_main() {
+tint_symbol vertex_main() {
abs_7f28e6();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.msl b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.msl
index 9ec6060..9c154aa 100644
--- a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.msl
+++ b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void abs_7f28e6() {
uint2 res = abs(uint2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
abs_7f28e6();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.spvasm b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.spvasm
index b3cffe1..fc456ae 100644
--- a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %abs_7f28e6 "abs_7f28e6"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v2uint = OpTypeVector %uint 2
- %13 = OpConstantNull %v2uint
+ %17 = OpConstantNull %v2uint
%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %abs_7f28e6 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2uint Function %13
- %9 = OpExtInst %v2uint %12 SAbs %13
- OpStore %res %9
+ %abs_7f28e6 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %17
+ %13 = OpExtInst %v2uint %16 SAbs %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %abs_7f28e6
+ %27 = OpFunctionCall %void %abs_7f28e6
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %abs_7f28e6
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %abs_7f28e6
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %abs_7f28e6
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %abs_7f28e6
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.wgsl b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.wgsl
index 53a7554..b45856f 100644
--- a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
abs_7f28e6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/abs/7faa9e.wgsl b/test/intrinsics/gen/abs/7faa9e.wgsl
index c676477..de36887 100644
--- a/test/intrinsics/gen/abs/7faa9e.wgsl
+++ b/test/intrinsics/gen/abs/7faa9e.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
abs_7faa9e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.hlsl b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.hlsl
index 80607a0..0f4908a 100644
--- a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void abs_7faa9e() {
int2 res = abs(int2(0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
abs_7faa9e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.msl b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.msl
index 9b60918..d4e4668 100644
--- a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.msl
+++ b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void abs_7faa9e() {
int2 res = abs(int2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
abs_7faa9e();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.spvasm b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.spvasm
index 76f9674..22d8436 100644
--- a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %abs_7faa9e "abs_7faa9e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %13 = OpConstantNull %v2int
+ %17 = OpConstantNull %v2int
%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %abs_7faa9e = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %13
- %9 = OpExtInst %v2int %12 SAbs %13
- OpStore %res %9
+ %abs_7faa9e = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %17
+ %13 = OpExtInst %v2int %16 SAbs %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %abs_7faa9e
+ %27 = OpFunctionCall %void %abs_7faa9e
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %abs_7faa9e
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %abs_7faa9e
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %abs_7faa9e
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %abs_7faa9e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.wgsl b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.wgsl
index c2f73f6..5ddcfb7 100644
--- a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
abs_7faa9e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/abs/9c80a6.wgsl b/test/intrinsics/gen/abs/9c80a6.wgsl
index 05e66e2..1aefbb5 100644
--- a/test/intrinsics/gen/abs/9c80a6.wgsl
+++ b/test/intrinsics/gen/abs/9c80a6.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
abs_9c80a6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.hlsl b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.hlsl
index fb08cab..4519edf 100644
--- a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void abs_9c80a6() {
int4 res = abs(int4(0, 0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
abs_9c80a6();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.msl b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.msl
index 26f8447..09179b9 100644
--- a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.msl
+++ b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void abs_9c80a6() {
int4 res = abs(int4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
abs_9c80a6();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.spvasm b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.spvasm
index c3806ce..b94f60d 100644
--- a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %abs_9c80a6 "abs_9c80a6"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v4int = OpTypeVector %int 4
- %13 = OpConstantNull %v4int
+ %17 = OpConstantNull %v4int
%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %abs_9c80a6 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %13
- %9 = OpExtInst %v4int %12 SAbs %13
- OpStore %res %9
+ %abs_9c80a6 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %17
+ %13 = OpExtInst %v4int %16 SAbs %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %abs_9c80a6
+ %27 = OpFunctionCall %void %abs_9c80a6
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %abs_9c80a6
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %abs_9c80a6
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %abs_9c80a6
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %abs_9c80a6
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.wgsl b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.wgsl
index 797774c..7561c57 100644
--- a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
abs_9c80a6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/abs/b96037.wgsl b/test/intrinsics/gen/abs/b96037.wgsl
index cd0e431..90b2e83 100644
--- a/test/intrinsics/gen/abs/b96037.wgsl
+++ b/test/intrinsics/gen/abs/b96037.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
abs_b96037();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/abs/b96037.wgsl.expected.hlsl b/test/intrinsics/gen/abs/b96037.wgsl.expected.hlsl
index 655840a..83e60ba 100644
--- a/test/intrinsics/gen/abs/b96037.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/abs/b96037.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void abs_b96037() {
float res = abs(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
abs_b96037();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/abs/b96037.wgsl.expected.msl b/test/intrinsics/gen/abs/b96037.wgsl.expected.msl
index f2db329..86cbf29 100644
--- a/test/intrinsics/gen/abs/b96037.wgsl.expected.msl
+++ b/test/intrinsics/gen/abs/b96037.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void abs_b96037() {
float res = fabs(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
abs_b96037();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/abs/b96037.wgsl.expected.spvasm b/test/intrinsics/gen/abs/b96037.wgsl.expected.spvasm
index af85239..694ea15 100644
--- a/test/intrinsics/gen/abs/b96037.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/abs/b96037.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %abs_b96037 "abs_b96037"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
- %abs_b96037 = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+ %abs_b96037 = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 FAbs %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 FAbs %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %abs_b96037
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %abs_b96037
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %abs_b96037
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %abs_b96037
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %abs_b96037
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %abs_b96037
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/abs/b96037.wgsl.expected.wgsl b/test/intrinsics/gen/abs/b96037.wgsl.expected.wgsl
index 112c0a18..ff5f274 100644
--- a/test/intrinsics/gen/abs/b96037.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/abs/b96037.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
abs_b96037();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/acos/489247.wgsl b/test/intrinsics/gen/acos/489247.wgsl
index 091f732..a05a97d 100644
--- a/test/intrinsics/gen/acos/489247.wgsl
+++ b/test/intrinsics/gen/acos/489247.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
acos_489247();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/acos/489247.wgsl.expected.hlsl b/test/intrinsics/gen/acos/489247.wgsl.expected.hlsl
index f5c0610..e32b25a 100644
--- a/test/intrinsics/gen/acos/489247.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/acos/489247.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void acos_489247() {
float res = acos(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
acos_489247();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/acos/489247.wgsl.expected.msl b/test/intrinsics/gen/acos/489247.wgsl.expected.msl
index 1f9a49d..8a12c8a 100644
--- a/test/intrinsics/gen/acos/489247.wgsl.expected.msl
+++ b/test/intrinsics/gen/acos/489247.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void acos_489247() {
float res = acos(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
acos_489247();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/acos/489247.wgsl.expected.spvasm b/test/intrinsics/gen/acos/489247.wgsl.expected.spvasm
index 55b3432..e4b8879 100644
--- a/test/intrinsics/gen/acos/489247.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/acos/489247.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %acos_489247 "acos_489247"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%acos_489247 = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+%acos_489247 = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Acos %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Acos %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %acos_489247
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %acos_489247
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %acos_489247
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %acos_489247
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %acos_489247
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %acos_489247
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/acos/489247.wgsl.expected.wgsl b/test/intrinsics/gen/acos/489247.wgsl.expected.wgsl
index 4c8f3cc..23c4b4b 100644
--- a/test/intrinsics/gen/acos/489247.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/acos/489247.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
acos_489247();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/acos/8e2acf.wgsl b/test/intrinsics/gen/acos/8e2acf.wgsl
index 0c15ac2..1df912c 100644
--- a/test/intrinsics/gen/acos/8e2acf.wgsl
+++ b/test/intrinsics/gen/acos/8e2acf.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
acos_8e2acf();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.hlsl b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.hlsl
index df055b2..1a192bc 100644
--- a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void acos_8e2acf() {
float4 res = acos(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
acos_8e2acf();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.msl b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.msl
index 56875a7..fe56d67 100644
--- a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.msl
+++ b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void acos_8e2acf() {
float4 res = acos(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
acos_8e2acf();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.spvasm b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.spvasm
index 0b7021c..da5d306 100644
--- a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %acos_8e2acf "acos_8e2acf"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%acos_8e2acf = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Acos %12
- OpStore %res %9
+%acos_8e2acf = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Acos %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %acos_8e2acf
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %acos_8e2acf
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %acos_8e2acf
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %acos_8e2acf
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %acos_8e2acf
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.wgsl b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.wgsl
index 8cce3c5..807d161 100644
--- a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
acos_8e2acf();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/acos/a610c4.wgsl b/test/intrinsics/gen/acos/a610c4.wgsl
index d55e6bc..13f8f130 100644
--- a/test/intrinsics/gen/acos/a610c4.wgsl
+++ b/test/intrinsics/gen/acos/a610c4.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
acos_a610c4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/acos/a610c4.wgsl.expected.hlsl b/test/intrinsics/gen/acos/a610c4.wgsl.expected.hlsl
index d30ba41..c6b468c 100644
--- a/test/intrinsics/gen/acos/a610c4.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/acos/a610c4.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void acos_a610c4() {
float3 res = acos(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
acos_a610c4();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/acos/a610c4.wgsl.expected.msl b/test/intrinsics/gen/acos/a610c4.wgsl.expected.msl
index d5e7574..aaf328f 100644
--- a/test/intrinsics/gen/acos/a610c4.wgsl.expected.msl
+++ b/test/intrinsics/gen/acos/a610c4.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void acos_a610c4() {
float3 res = acos(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
acos_a610c4();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/acos/a610c4.wgsl.expected.spvasm b/test/intrinsics/gen/acos/a610c4.wgsl.expected.spvasm
index 1f6a492..df7fe1e 100644
--- a/test/intrinsics/gen/acos/a610c4.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/acos/a610c4.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %acos_a610c4 "acos_a610c4"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%acos_a610c4 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Acos %12
- OpStore %res %9
+%acos_a610c4 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Acos %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %acos_a610c4
+ %26 = OpFunctionCall %void %acos_a610c4
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %acos_a610c4
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %acos_a610c4
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %acos_a610c4
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %acos_a610c4
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/acos/a610c4.wgsl.expected.wgsl b/test/intrinsics/gen/acos/a610c4.wgsl.expected.wgsl
index 8c17039..e5b9390 100644
--- a/test/intrinsics/gen/acos/a610c4.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/acos/a610c4.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
acos_a610c4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/acos/dfc915.wgsl b/test/intrinsics/gen/acos/dfc915.wgsl
index d6962e0..239f89d 100644
--- a/test/intrinsics/gen/acos/dfc915.wgsl
+++ b/test/intrinsics/gen/acos/dfc915.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
acos_dfc915();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/acos/dfc915.wgsl.expected.hlsl b/test/intrinsics/gen/acos/dfc915.wgsl.expected.hlsl
index 9ae2fb0..3ba6714 100644
--- a/test/intrinsics/gen/acos/dfc915.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/acos/dfc915.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void acos_dfc915() {
float2 res = acos(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
acos_dfc915();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/acos/dfc915.wgsl.expected.msl b/test/intrinsics/gen/acos/dfc915.wgsl.expected.msl
index f0b5e6d..9257d33 100644
--- a/test/intrinsics/gen/acos/dfc915.wgsl.expected.msl
+++ b/test/intrinsics/gen/acos/dfc915.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void acos_dfc915() {
float2 res = acos(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
acos_dfc915();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/acos/dfc915.wgsl.expected.spvasm b/test/intrinsics/gen/acos/dfc915.wgsl.expected.spvasm
index 47e584d..117ffe9 100644
--- a/test/intrinsics/gen/acos/dfc915.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/acos/dfc915.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %acos_dfc915 "acos_dfc915"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%acos_dfc915 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Acos %12
- OpStore %res %9
+%acos_dfc915 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Acos %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %acos_dfc915
+ %26 = OpFunctionCall %void %acos_dfc915
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %acos_dfc915
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %acos_dfc915
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %acos_dfc915
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %acos_dfc915
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/acos/dfc915.wgsl.expected.wgsl b/test/intrinsics/gen/acos/dfc915.wgsl.expected.wgsl
index 2ee1383..d865232 100644
--- a/test/intrinsics/gen/acos/dfc915.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/acos/dfc915.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
acos_dfc915();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/all/986c7b.wgsl b/test/intrinsics/gen/all/986c7b.wgsl
index ccef722..9fe2e69 100644
--- a/test/intrinsics/gen/all/986c7b.wgsl
+++ b/test/intrinsics/gen/all/986c7b.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
all_986c7b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/all/986c7b.wgsl.expected.hlsl b/test/intrinsics/gen/all/986c7b.wgsl.expected.hlsl
index ddb983b..ed1d460 100644
--- a/test/intrinsics/gen/all/986c7b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/all/986c7b.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void all_986c7b() {
bool res = all(vector<bool, 4>(false, false, false, false));
}
-void vertex_main() {
+tint_symbol vertex_main() {
all_986c7b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/all/986c7b.wgsl.expected.msl b/test/intrinsics/gen/all/986c7b.wgsl.expected.msl
index 702a365..022b58e 100644
--- a/test/intrinsics/gen/all/986c7b.wgsl.expected.msl
+++ b/test/intrinsics/gen/all/986c7b.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void all_986c7b() {
bool res = all(bool4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
all_986c7b();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/all/986c7b.wgsl.expected.spvasm b/test/intrinsics/gen/all/986c7b.wgsl.expected.spvasm
index 2c6a391..c2fce04a 100644
--- a/test/intrinsics/gen/all/986c7b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/all/986c7b.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %all_986c7b "all_986c7b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
%v4bool = OpTypeVector %bool 4
- %12 = OpConstantNull %v4bool
+ %16 = OpConstantNull %v4bool
%_ptr_Function_bool = OpTypePointer Function %bool
- %15 = OpConstantNull %bool
+ %19 = OpConstantNull %bool
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %all_986c7b = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_bool Function %15
- %9 = OpAll %bool %12
- OpStore %res %9
+ %all_986c7b = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_bool Function %19
+ %13 = OpAll %bool %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %all_986c7b
+ %27 = OpFunctionCall %void %all_986c7b
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %all_986c7b
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %all_986c7b
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %all_986c7b
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %all_986c7b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/all/986c7b.wgsl.expected.wgsl b/test/intrinsics/gen/all/986c7b.wgsl.expected.wgsl
index 16db50e..242ced4 100644
--- a/test/intrinsics/gen/all/986c7b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/all/986c7b.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
all_986c7b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/all/bd2dba.wgsl b/test/intrinsics/gen/all/bd2dba.wgsl
index 69853b7..4f0dbd2 100644
--- a/test/intrinsics/gen/all/bd2dba.wgsl
+++ b/test/intrinsics/gen/all/bd2dba.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
all_bd2dba();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/all/bd2dba.wgsl.expected.hlsl b/test/intrinsics/gen/all/bd2dba.wgsl.expected.hlsl
index f49a0e7..93b3bba 100644
--- a/test/intrinsics/gen/all/bd2dba.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/all/bd2dba.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void all_bd2dba() {
bool res = all(vector<bool, 3>(false, false, false));
}
-void vertex_main() {
+tint_symbol vertex_main() {
all_bd2dba();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/all/bd2dba.wgsl.expected.msl b/test/intrinsics/gen/all/bd2dba.wgsl.expected.msl
index 3425ed2..9ad60e3 100644
--- a/test/intrinsics/gen/all/bd2dba.wgsl.expected.msl
+++ b/test/intrinsics/gen/all/bd2dba.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void all_bd2dba() {
bool res = all(bool3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
all_bd2dba();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/all/bd2dba.wgsl.expected.spvasm b/test/intrinsics/gen/all/bd2dba.wgsl.expected.spvasm
index 8c95c45..b9224d4 100644
--- a/test/intrinsics/gen/all/bd2dba.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/all/bd2dba.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %all_bd2dba "all_bd2dba"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
%v3bool = OpTypeVector %bool 3
- %12 = OpConstantNull %v3bool
+ %16 = OpConstantNull %v3bool
%_ptr_Function_bool = OpTypePointer Function %bool
- %15 = OpConstantNull %bool
+ %19 = OpConstantNull %bool
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %all_bd2dba = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_bool Function %15
- %9 = OpAll %bool %12
- OpStore %res %9
+ %all_bd2dba = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_bool Function %19
+ %13 = OpAll %bool %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %all_bd2dba
+ %27 = OpFunctionCall %void %all_bd2dba
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %all_bd2dba
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %all_bd2dba
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %all_bd2dba
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %all_bd2dba
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/all/bd2dba.wgsl.expected.wgsl b/test/intrinsics/gen/all/bd2dba.wgsl.expected.wgsl
index 718116c..a730330 100644
--- a/test/intrinsics/gen/all/bd2dba.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/all/bd2dba.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
all_bd2dba();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/all/f46790.wgsl b/test/intrinsics/gen/all/f46790.wgsl
index 541a718c..a41b8dc 100644
--- a/test/intrinsics/gen/all/f46790.wgsl
+++ b/test/intrinsics/gen/all/f46790.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
all_f46790();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/all/f46790.wgsl.expected.hlsl b/test/intrinsics/gen/all/f46790.wgsl.expected.hlsl
index 6b954b6..d4d0393 100644
--- a/test/intrinsics/gen/all/f46790.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/all/f46790.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void all_f46790() {
bool res = all(vector<bool, 2>(false, false));
}
-void vertex_main() {
+tint_symbol vertex_main() {
all_f46790();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/all/f46790.wgsl.expected.msl b/test/intrinsics/gen/all/f46790.wgsl.expected.msl
index 3c9019a..f2813f5 100644
--- a/test/intrinsics/gen/all/f46790.wgsl.expected.msl
+++ b/test/intrinsics/gen/all/f46790.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void all_f46790() {
bool res = all(bool2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
all_f46790();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/all/f46790.wgsl.expected.spvasm b/test/intrinsics/gen/all/f46790.wgsl.expected.spvasm
index 081db4a..0fe4165 100644
--- a/test/intrinsics/gen/all/f46790.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/all/f46790.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %all_f46790 "all_f46790"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
%v2bool = OpTypeVector %bool 2
- %12 = OpConstantNull %v2bool
+ %16 = OpConstantNull %v2bool
%_ptr_Function_bool = OpTypePointer Function %bool
- %15 = OpConstantNull %bool
+ %19 = OpConstantNull %bool
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %all_f46790 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_bool Function %15
- %9 = OpAll %bool %12
- OpStore %res %9
+ %all_f46790 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_bool Function %19
+ %13 = OpAll %bool %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %all_f46790
+ %27 = OpFunctionCall %void %all_f46790
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %all_f46790
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %all_f46790
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %all_f46790
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %all_f46790
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/all/f46790.wgsl.expected.wgsl b/test/intrinsics/gen/all/f46790.wgsl.expected.wgsl
index 2b156ae..aa07e02 100644
--- a/test/intrinsics/gen/all/f46790.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/all/f46790.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
all_f46790();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/any/083428.wgsl b/test/intrinsics/gen/any/083428.wgsl
index 9453c9c..c31c551 100644
--- a/test/intrinsics/gen/any/083428.wgsl
+++ b/test/intrinsics/gen/any/083428.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
any_083428();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/any/083428.wgsl.expected.hlsl b/test/intrinsics/gen/any/083428.wgsl.expected.hlsl
index 10dfae8..e70364e 100644
--- a/test/intrinsics/gen/any/083428.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/any/083428.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void any_083428() {
bool res = any(vector<bool, 4>(false, false, false, false));
}
-void vertex_main() {
+tint_symbol vertex_main() {
any_083428();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/any/083428.wgsl.expected.msl b/test/intrinsics/gen/any/083428.wgsl.expected.msl
index 0810792..3b69c0a 100644
--- a/test/intrinsics/gen/any/083428.wgsl.expected.msl
+++ b/test/intrinsics/gen/any/083428.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void any_083428() {
bool res = any(bool4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
any_083428();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/any/083428.wgsl.expected.spvasm b/test/intrinsics/gen/any/083428.wgsl.expected.spvasm
index 8ed460e..29ba54d 100644
--- a/test/intrinsics/gen/any/083428.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/any/083428.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %any_083428 "any_083428"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
%v4bool = OpTypeVector %bool 4
- %12 = OpConstantNull %v4bool
+ %16 = OpConstantNull %v4bool
%_ptr_Function_bool = OpTypePointer Function %bool
- %15 = OpConstantNull %bool
+ %19 = OpConstantNull %bool
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %any_083428 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_bool Function %15
- %9 = OpAny %bool %12
- OpStore %res %9
+ %any_083428 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_bool Function %19
+ %13 = OpAny %bool %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %any_083428
+ %27 = OpFunctionCall %void %any_083428
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %any_083428
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %any_083428
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %any_083428
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %any_083428
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/any/083428.wgsl.expected.wgsl b/test/intrinsics/gen/any/083428.wgsl.expected.wgsl
index aa9e120..c70201f 100644
--- a/test/intrinsics/gen/any/083428.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/any/083428.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
any_083428();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/any/0e3e58.wgsl b/test/intrinsics/gen/any/0e3e58.wgsl
index 16806ad..b7f4db2 100644
--- a/test/intrinsics/gen/any/0e3e58.wgsl
+++ b/test/intrinsics/gen/any/0e3e58.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
any_0e3e58();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/any/0e3e58.wgsl.expected.hlsl b/test/intrinsics/gen/any/0e3e58.wgsl.expected.hlsl
index a1f2000..0b9d54a 100644
--- a/test/intrinsics/gen/any/0e3e58.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/any/0e3e58.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void any_0e3e58() {
bool res = any(vector<bool, 2>(false, false));
}
-void vertex_main() {
+tint_symbol vertex_main() {
any_0e3e58();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/any/0e3e58.wgsl.expected.msl b/test/intrinsics/gen/any/0e3e58.wgsl.expected.msl
index b9ba7b2..8efaca1 100644
--- a/test/intrinsics/gen/any/0e3e58.wgsl.expected.msl
+++ b/test/intrinsics/gen/any/0e3e58.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void any_0e3e58() {
bool res = any(bool2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
any_0e3e58();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/any/0e3e58.wgsl.expected.spvasm b/test/intrinsics/gen/any/0e3e58.wgsl.expected.spvasm
index 1bfea9e..3e772c9 100644
--- a/test/intrinsics/gen/any/0e3e58.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/any/0e3e58.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %any_0e3e58 "any_0e3e58"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
%v2bool = OpTypeVector %bool 2
- %12 = OpConstantNull %v2bool
+ %16 = OpConstantNull %v2bool
%_ptr_Function_bool = OpTypePointer Function %bool
- %15 = OpConstantNull %bool
+ %19 = OpConstantNull %bool
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %any_0e3e58 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_bool Function %15
- %9 = OpAny %bool %12
- OpStore %res %9
+ %any_0e3e58 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_bool Function %19
+ %13 = OpAny %bool %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %any_0e3e58
+ %27 = OpFunctionCall %void %any_0e3e58
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %any_0e3e58
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %any_0e3e58
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %any_0e3e58
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %any_0e3e58
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/any/0e3e58.wgsl.expected.wgsl b/test/intrinsics/gen/any/0e3e58.wgsl.expected.wgsl
index 7a8e246..cdb87db 100644
--- a/test/intrinsics/gen/any/0e3e58.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/any/0e3e58.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
any_0e3e58();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/any/e755c1.wgsl b/test/intrinsics/gen/any/e755c1.wgsl
index e1cef53..622c1ea 100644
--- a/test/intrinsics/gen/any/e755c1.wgsl
+++ b/test/intrinsics/gen/any/e755c1.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
any_e755c1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/any/e755c1.wgsl.expected.hlsl b/test/intrinsics/gen/any/e755c1.wgsl.expected.hlsl
index 677e6d5..1130198 100644
--- a/test/intrinsics/gen/any/e755c1.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/any/e755c1.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void any_e755c1() {
bool res = any(vector<bool, 3>(false, false, false));
}
-void vertex_main() {
+tint_symbol vertex_main() {
any_e755c1();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/any/e755c1.wgsl.expected.msl b/test/intrinsics/gen/any/e755c1.wgsl.expected.msl
index 33f9409..0814a03 100644
--- a/test/intrinsics/gen/any/e755c1.wgsl.expected.msl
+++ b/test/intrinsics/gen/any/e755c1.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void any_e755c1() {
bool res = any(bool3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
any_e755c1();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/any/e755c1.wgsl.expected.spvasm b/test/intrinsics/gen/any/e755c1.wgsl.expected.spvasm
index 613d10b..29c726f 100644
--- a/test/intrinsics/gen/any/e755c1.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/any/e755c1.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %any_e755c1 "any_e755c1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
%v3bool = OpTypeVector %bool 3
- %12 = OpConstantNull %v3bool
+ %16 = OpConstantNull %v3bool
%_ptr_Function_bool = OpTypePointer Function %bool
- %15 = OpConstantNull %bool
+ %19 = OpConstantNull %bool
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %any_e755c1 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_bool Function %15
- %9 = OpAny %bool %12
- OpStore %res %9
+ %any_e755c1 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_bool Function %19
+ %13 = OpAny %bool %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %any_e755c1
+ %27 = OpFunctionCall %void %any_e755c1
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %any_e755c1
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %any_e755c1
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %any_e755c1
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %any_e755c1
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/any/e755c1.wgsl.expected.wgsl b/test/intrinsics/gen/any/e755c1.wgsl.expected.wgsl
index ab6f7a7e..fae0df6 100644
--- a/test/intrinsics/gen/any/e755c1.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/any/e755c1.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
any_e755c1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/arrayLength/647a40.wgsl b/test/intrinsics/gen/arrayLength/647a40.wgsl
index 84239ad..3fa6e38 100644
--- a/test/intrinsics/gen/arrayLength/647a40.wgsl
+++ b/test/intrinsics/gen/arrayLength/647a40.wgsl
@@ -32,8 +32,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
arrayLength_647a40();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.hlsl b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.hlsl
index 3d51ff4..859f61e 100644
--- a/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.hlsl
@@ -1,16 +1,20 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
ByteAddressBuffer sb : register(t0, space0);
void arrayLength_647a40() {
- uint tint_symbol_1 = 0u;
- sb.GetDimensions(tint_symbol_1);
- const uint tint_symbol_2 = ((tint_symbol_1 - 0u) / 4u);
- uint res = tint_symbol_2;
+ uint tint_symbol_2 = 0u;
+ sb.GetDimensions(tint_symbol_2);
+ const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
+ uint res = tint_symbol_3;
}
-void vertex_main() {
+tint_symbol vertex_main() {
arrayLength_647a40();
- return;
+ const tint_symbol tint_symbol_4 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_4;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.spvasm b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.spvasm
index 4f70f0b..518d2d7 100644
--- a/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -14,8 +14,11 @@
OpName %SB "SB"
OpMemberName %SB 0 "arg_0"
OpName %sb "sb"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %arrayLength_647a40 "arrayLength_647a40"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -26,6 +29,7 @@
OpDecorate %sb NonWritable
OpDecorate %sb DescriptorSet 0
OpDecorate %sb Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -35,31 +39,43 @@
%SB = OpTypeStruct %_runtimearr_uint
%_ptr_StorageBuffer_SB = OpTypePointer StorageBuffer %SB
%sb = OpVariable %_ptr_StorageBuffer_SB StorageBuffer
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %13 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %13
%void = OpTypeVoid
- %10 = OpTypeFunction %void
+ %14 = OpTypeFunction %void
%_ptr_Function_uint = OpTypePointer Function %uint
- %17 = OpConstantNull %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%arrayLength_647a40 = OpFunction %void None %10
- %13 = OpLabel
- %res = OpVariable %_ptr_Function_uint Function %17
- %14 = OpArrayLength %uint %sb 0
- OpStore %res %14
+%arrayLength_647a40 = OpFunction %void None %14
+ %17 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpArrayLength %uint %sb 0
+ OpStore %res %18
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %10
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %14
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %arrayLength_647a40
+ %29 = OpFunctionCall %void %arrayLength_647a40
+ %30 = OpFunctionCall %void %tint_symbol_2 %13
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %10
- %23 = OpLabel
- %24 = OpFunctionCall %void %arrayLength_647a40
+%fragment_main = OpFunction %void None %14
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %arrayLength_647a40
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %10
- %26 = OpLabel
- %27 = OpFunctionCall %void %arrayLength_647a40
+%compute_main = OpFunction %void None %14
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %arrayLength_647a40
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.wgsl b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.wgsl
index 4f420f8..2719716 100644
--- a/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.wgsl
@@ -10,8 +10,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
arrayLength_647a40();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/arrayLength/721c9d.wgsl b/test/intrinsics/gen/arrayLength/721c9d.wgsl
index a502bf7..1bf15a8 100644
--- a/test/intrinsics/gen/arrayLength/721c9d.wgsl
+++ b/test/intrinsics/gen/arrayLength/721c9d.wgsl
@@ -32,8 +32,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
arrayLength_721c9d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.hlsl b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.hlsl
index e7770ff..5565005 100644
--- a/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.hlsl
@@ -1,16 +1,20 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
ByteAddressBuffer sb : register(t0, space0);
void arrayLength_721c9d() {
- uint tint_symbol_1 = 0u;
- sb.GetDimensions(tint_symbol_1);
- const uint tint_symbol_2 = ((tint_symbol_1 - 0u) / 4u);
- uint res = tint_symbol_2;
+ uint tint_symbol_2 = 0u;
+ sb.GetDimensions(tint_symbol_2);
+ const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
+ uint res = tint_symbol_3;
}
-void vertex_main() {
+tint_symbol vertex_main() {
arrayLength_721c9d();
- return;
+ const tint_symbol tint_symbol_4 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_4;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.spvasm b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.spvasm
index 40294aa..d41bd3b 100644
--- a/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -14,8 +14,11 @@
OpName %SB "SB"
OpMemberName %SB 0 "arg_0"
OpName %sb "sb"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %arrayLength_721c9d "arrayLength_721c9d"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -26,6 +29,7 @@
OpDecorate %sb NonWritable
OpDecorate %sb DescriptorSet 0
OpDecorate %sb Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -35,32 +39,44 @@
%SB = OpTypeStruct %_runtimearr_int
%_ptr_StorageBuffer_SB = OpTypePointer StorageBuffer %SB
%sb = OpVariable %_ptr_StorageBuffer_SB StorageBuffer
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %13 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %13
%void = OpTypeVoid
- %10 = OpTypeFunction %void
+ %14 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%_ptr_Function_uint = OpTypePointer Function %uint
- %18 = OpConstantNull %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%arrayLength_721c9d = OpFunction %void None %10
- %13 = OpLabel
- %res = OpVariable %_ptr_Function_uint Function %18
- %14 = OpArrayLength %uint %sb 0
- OpStore %res %14
+%arrayLength_721c9d = OpFunction %void None %14
+ %17 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %18 = OpArrayLength %uint %sb 0
+ OpStore %res %18
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %10
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %14
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %arrayLength_721c9d
+ %30 = OpFunctionCall %void %arrayLength_721c9d
+ %31 = OpFunctionCall %void %tint_symbol_2 %13
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %10
- %24 = OpLabel
- %25 = OpFunctionCall %void %arrayLength_721c9d
+%fragment_main = OpFunction %void None %14
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %arrayLength_721c9d
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %10
- %27 = OpLabel
- %28 = OpFunctionCall %void %arrayLength_721c9d
+%compute_main = OpFunction %void None %14
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %arrayLength_721c9d
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.wgsl b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.wgsl
index 57222b1..963e865 100644
--- a/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.wgsl
@@ -10,8 +10,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
arrayLength_721c9d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/arrayLength/b083be.wgsl b/test/intrinsics/gen/arrayLength/b083be.wgsl
index 87e31e0..a48b181 100644
--- a/test/intrinsics/gen/arrayLength/b083be.wgsl
+++ b/test/intrinsics/gen/arrayLength/b083be.wgsl
@@ -32,8 +32,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
arrayLength_b083be();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.hlsl b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.hlsl
index 25c9fd0..141f4de 100644
--- a/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.hlsl
@@ -1,16 +1,20 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
ByteAddressBuffer sb : register(t0, space0);
void arrayLength_b083be() {
- uint tint_symbol_1 = 0u;
- sb.GetDimensions(tint_symbol_1);
- const uint tint_symbol_2 = ((tint_symbol_1 - 0u) / 4u);
- uint res = tint_symbol_2;
+ uint tint_symbol_2 = 0u;
+ sb.GetDimensions(tint_symbol_2);
+ const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
+ uint res = tint_symbol_3;
}
-void vertex_main() {
+tint_symbol vertex_main() {
arrayLength_b083be();
- return;
+ const tint_symbol tint_symbol_4 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_4;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.spvasm b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.spvasm
index 33c66cb..b3a291f 100644
--- a/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -14,8 +14,11 @@
OpName %SB "SB"
OpMemberName %SB 0 "arg_0"
OpName %sb "sb"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %arrayLength_b083be "arrayLength_b083be"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -26,6 +29,7 @@
OpDecorate %sb NonWritable
OpDecorate %sb DescriptorSet 0
OpDecorate %sb Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -34,32 +38,44 @@
%SB = OpTypeStruct %_runtimearr_float
%_ptr_StorageBuffer_SB = OpTypePointer StorageBuffer %SB
%sb = OpVariable %_ptr_StorageBuffer_SB StorageBuffer
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%_ptr_Function_uint = OpTypePointer Function %uint
- %17 = OpConstantNull %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%arrayLength_b083be = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_uint Function %17
- %13 = OpArrayLength %uint %sb 0
- OpStore %res %13
+%arrayLength_b083be = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %17 = OpArrayLength %uint %sb 0
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %arrayLength_b083be
+ %29 = OpFunctionCall %void %arrayLength_b083be
+ %30 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %23 = OpLabel
- %24 = OpFunctionCall %void %arrayLength_b083be
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %arrayLength_b083be
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %arrayLength_b083be
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %arrayLength_b083be
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.wgsl b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.wgsl
index 0e15631..0701189 100644
--- a/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.wgsl
@@ -10,8 +10,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
arrayLength_b083be();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/asin/064953.wgsl b/test/intrinsics/gen/asin/064953.wgsl
index ce34400..f9e97c9 100644
--- a/test/intrinsics/gen/asin/064953.wgsl
+++ b/test/intrinsics/gen/asin/064953.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
asin_064953();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/asin/064953.wgsl.expected.hlsl b/test/intrinsics/gen/asin/064953.wgsl.expected.hlsl
index 1e260dc..e996d43 100644
--- a/test/intrinsics/gen/asin/064953.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/asin/064953.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void asin_064953() {
float4 res = asin(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
asin_064953();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/asin/064953.wgsl.expected.msl b/test/intrinsics/gen/asin/064953.wgsl.expected.msl
index ea21d8a..3a5bbeb 100644
--- a/test/intrinsics/gen/asin/064953.wgsl.expected.msl
+++ b/test/intrinsics/gen/asin/064953.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void asin_064953() {
float4 res = asin(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
asin_064953();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/asin/064953.wgsl.expected.spvasm b/test/intrinsics/gen/asin/064953.wgsl.expected.spvasm
index e98a980..4f4bd4c 100644
--- a/test/intrinsics/gen/asin/064953.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/asin/064953.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %asin_064953 "asin_064953"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%asin_064953 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Asin %12
- OpStore %res %9
+%asin_064953 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Asin %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %asin_064953
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %asin_064953
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %asin_064953
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %asin_064953
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %asin_064953
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/asin/064953.wgsl.expected.wgsl b/test/intrinsics/gen/asin/064953.wgsl.expected.wgsl
index 0746a72..f81fc33 100644
--- a/test/intrinsics/gen/asin/064953.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/asin/064953.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
asin_064953();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/asin/7b6a44.wgsl b/test/intrinsics/gen/asin/7b6a44.wgsl
index 1d522fa..7129798 100644
--- a/test/intrinsics/gen/asin/7b6a44.wgsl
+++ b/test/intrinsics/gen/asin/7b6a44.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
asin_7b6a44();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.hlsl b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.hlsl
index a013ed1..e829039 100644
--- a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void asin_7b6a44() {
float2 res = asin(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
asin_7b6a44();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.msl b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.msl
index 8e9f1e5..ae9dd48 100644
--- a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.msl
+++ b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void asin_7b6a44() {
float2 res = asin(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
asin_7b6a44();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.spvasm b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.spvasm
index aca13be..bf48d2d 100644
--- a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %asin_7b6a44 "asin_7b6a44"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%asin_7b6a44 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Asin %12
- OpStore %res %9
+%asin_7b6a44 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Asin %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %asin_7b6a44
+ %26 = OpFunctionCall %void %asin_7b6a44
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %asin_7b6a44
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %asin_7b6a44
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %asin_7b6a44
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %asin_7b6a44
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.wgsl b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.wgsl
index 20048a9..7216c55 100644
--- a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
asin_7b6a44();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/asin/8cd9c9.wgsl b/test/intrinsics/gen/asin/8cd9c9.wgsl
index 047d99f..e39903b 100644
--- a/test/intrinsics/gen/asin/8cd9c9.wgsl
+++ b/test/intrinsics/gen/asin/8cd9c9.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
asin_8cd9c9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.hlsl b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.hlsl
index 9215dcd..a1f8642 100644
--- a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void asin_8cd9c9() {
float3 res = asin(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
asin_8cd9c9();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.msl b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.msl
index 07bd712..e246b62 100644
--- a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.msl
+++ b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void asin_8cd9c9() {
float3 res = asin(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
asin_8cd9c9();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.spvasm b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.spvasm
index ca65452..2b16759 100644
--- a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %asin_8cd9c9 "asin_8cd9c9"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%asin_8cd9c9 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Asin %12
- OpStore %res %9
+%asin_8cd9c9 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Asin %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %asin_8cd9c9
+ %26 = OpFunctionCall %void %asin_8cd9c9
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %asin_8cd9c9
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %asin_8cd9c9
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %asin_8cd9c9
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %asin_8cd9c9
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.wgsl b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.wgsl
index a86e69f..99cc885 100644
--- a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
asin_8cd9c9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/asin/c0c272.wgsl b/test/intrinsics/gen/asin/c0c272.wgsl
index 6c7f9d6..a707190 100644
--- a/test/intrinsics/gen/asin/c0c272.wgsl
+++ b/test/intrinsics/gen/asin/c0c272.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
asin_c0c272();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/asin/c0c272.wgsl.expected.hlsl b/test/intrinsics/gen/asin/c0c272.wgsl.expected.hlsl
index 2c5b742..5899931 100644
--- a/test/intrinsics/gen/asin/c0c272.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/asin/c0c272.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void asin_c0c272() {
float res = asin(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
asin_c0c272();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/asin/c0c272.wgsl.expected.msl b/test/intrinsics/gen/asin/c0c272.wgsl.expected.msl
index 87b650d..8a7e083 100644
--- a/test/intrinsics/gen/asin/c0c272.wgsl.expected.msl
+++ b/test/intrinsics/gen/asin/c0c272.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void asin_c0c272() {
float res = asin(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
asin_c0c272();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/asin/c0c272.wgsl.expected.spvasm b/test/intrinsics/gen/asin/c0c272.wgsl.expected.spvasm
index 7c1af87..6b5ec45 100644
--- a/test/intrinsics/gen/asin/c0c272.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/asin/c0c272.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %asin_c0c272 "asin_c0c272"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%asin_c0c272 = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+%asin_c0c272 = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Asin %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Asin %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %asin_c0c272
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %asin_c0c272
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %asin_c0c272
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %asin_c0c272
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %asin_c0c272
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %asin_c0c272
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/asin/c0c272.wgsl.expected.wgsl b/test/intrinsics/gen/asin/c0c272.wgsl.expected.wgsl
index dc482f3..053a48b 100644
--- a/test/intrinsics/gen/asin/c0c272.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/asin/c0c272.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
asin_c0c272();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/atan/02979a.wgsl b/test/intrinsics/gen/atan/02979a.wgsl
index 0756a8c..5baf309 100644
--- a/test/intrinsics/gen/atan/02979a.wgsl
+++ b/test/intrinsics/gen/atan/02979a.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
atan_02979a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/atan/02979a.wgsl.expected.hlsl b/test/intrinsics/gen/atan/02979a.wgsl.expected.hlsl
index 03255a9..bf84852 100644
--- a/test/intrinsics/gen/atan/02979a.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/atan/02979a.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void atan_02979a() {
float res = atan(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
atan_02979a();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/atan/02979a.wgsl.expected.msl b/test/intrinsics/gen/atan/02979a.wgsl.expected.msl
index ad8db82..411c3bd 100644
--- a/test/intrinsics/gen/atan/02979a.wgsl.expected.msl
+++ b/test/intrinsics/gen/atan/02979a.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void atan_02979a() {
float res = atan(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
atan_02979a();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/atan/02979a.wgsl.expected.spvasm b/test/intrinsics/gen/atan/02979a.wgsl.expected.spvasm
index 5b3a53c..190f8b8 100644
--- a/test/intrinsics/gen/atan/02979a.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/atan/02979a.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %atan_02979a "atan_02979a"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%atan_02979a = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+%atan_02979a = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Atan %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Atan %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %atan_02979a
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %atan_02979a
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %atan_02979a
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %atan_02979a
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %atan_02979a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %atan_02979a
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/atan/02979a.wgsl.expected.wgsl b/test/intrinsics/gen/atan/02979a.wgsl.expected.wgsl
index 02da0b0..c2a4ab4 100644
--- a/test/intrinsics/gen/atan/02979a.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/atan/02979a.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
atan_02979a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/atan/331e6d.wgsl b/test/intrinsics/gen/atan/331e6d.wgsl
index 2b4def5..9b8db52 100644
--- a/test/intrinsics/gen/atan/331e6d.wgsl
+++ b/test/intrinsics/gen/atan/331e6d.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
atan_331e6d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/atan/331e6d.wgsl.expected.hlsl b/test/intrinsics/gen/atan/331e6d.wgsl.expected.hlsl
index 69a677d..25f15a7 100644
--- a/test/intrinsics/gen/atan/331e6d.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/atan/331e6d.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void atan_331e6d() {
float3 res = atan(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
atan_331e6d();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/atan/331e6d.wgsl.expected.msl b/test/intrinsics/gen/atan/331e6d.wgsl.expected.msl
index 77fe0cb..0978363 100644
--- a/test/intrinsics/gen/atan/331e6d.wgsl.expected.msl
+++ b/test/intrinsics/gen/atan/331e6d.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void atan_331e6d() {
float3 res = atan(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
atan_331e6d();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/atan/331e6d.wgsl.expected.spvasm b/test/intrinsics/gen/atan/331e6d.wgsl.expected.spvasm
index 1a1c43d..09d84b5 100644
--- a/test/intrinsics/gen/atan/331e6d.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/atan/331e6d.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %atan_331e6d "atan_331e6d"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%atan_331e6d = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Atan %12
- OpStore %res %9
+%atan_331e6d = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Atan %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %atan_331e6d
+ %26 = OpFunctionCall %void %atan_331e6d
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %atan_331e6d
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %atan_331e6d
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %atan_331e6d
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %atan_331e6d
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/atan/331e6d.wgsl.expected.wgsl b/test/intrinsics/gen/atan/331e6d.wgsl.expected.wgsl
index dd33001..3740d19 100644
--- a/test/intrinsics/gen/atan/331e6d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/atan/331e6d.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
atan_331e6d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/atan/a8b696.wgsl b/test/intrinsics/gen/atan/a8b696.wgsl
index ab30f52..e72a052 100644
--- a/test/intrinsics/gen/atan/a8b696.wgsl
+++ b/test/intrinsics/gen/atan/a8b696.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
atan_a8b696();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/atan/a8b696.wgsl.expected.hlsl b/test/intrinsics/gen/atan/a8b696.wgsl.expected.hlsl
index 10825e8..abebf34 100644
--- a/test/intrinsics/gen/atan/a8b696.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/atan/a8b696.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void atan_a8b696() {
float4 res = atan(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
atan_a8b696();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/atan/a8b696.wgsl.expected.msl b/test/intrinsics/gen/atan/a8b696.wgsl.expected.msl
index 3c5b1d7..16ab64a 100644
--- a/test/intrinsics/gen/atan/a8b696.wgsl.expected.msl
+++ b/test/intrinsics/gen/atan/a8b696.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void atan_a8b696() {
float4 res = atan(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
atan_a8b696();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/atan/a8b696.wgsl.expected.spvasm b/test/intrinsics/gen/atan/a8b696.wgsl.expected.spvasm
index 88f6765..745878f 100644
--- a/test/intrinsics/gen/atan/a8b696.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/atan/a8b696.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %atan_a8b696 "atan_a8b696"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%atan_a8b696 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Atan %12
- OpStore %res %9
+%atan_a8b696 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Atan %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %atan_a8b696
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %atan_a8b696
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %atan_a8b696
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %atan_a8b696
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %atan_a8b696
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/atan/a8b696.wgsl.expected.wgsl b/test/intrinsics/gen/atan/a8b696.wgsl.expected.wgsl
index 22e4087..ef893a2 100644
--- a/test/intrinsics/gen/atan/a8b696.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/atan/a8b696.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
atan_a8b696();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/atan/ad96e4.wgsl b/test/intrinsics/gen/atan/ad96e4.wgsl
index 0ed39c1..7d6cc73 100644
--- a/test/intrinsics/gen/atan/ad96e4.wgsl
+++ b/test/intrinsics/gen/atan/ad96e4.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
atan_ad96e4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.hlsl b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.hlsl
index 32b7f36..c76ef0e 100644
--- a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void atan_ad96e4() {
float2 res = atan(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
atan_ad96e4();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.msl b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.msl
index d4b1639..080c24a 100644
--- a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.msl
+++ b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void atan_ad96e4() {
float2 res = atan(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
atan_ad96e4();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.spvasm b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.spvasm
index 4c1efbf..6148168 100644
--- a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %atan_ad96e4 "atan_ad96e4"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%atan_ad96e4 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Atan %12
- OpStore %res %9
+%atan_ad96e4 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Atan %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %atan_ad96e4
+ %26 = OpFunctionCall %void %atan_ad96e4
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %atan_ad96e4
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %atan_ad96e4
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %atan_ad96e4
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %atan_ad96e4
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.wgsl b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.wgsl
index 4806af3..3b7a634 100644
--- a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
atan_ad96e4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/atan2/57fb13.wgsl b/test/intrinsics/gen/atan2/57fb13.wgsl
index 0d662ca..b0d0d36 100644
--- a/test/intrinsics/gen/atan2/57fb13.wgsl
+++ b/test/intrinsics/gen/atan2/57fb13.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
atan2_57fb13();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/atan2/57fb13.wgsl.expected.msl b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.msl
index e6adbc9..f647ab6 100644
--- a/test/intrinsics/gen/atan2/57fb13.wgsl.expected.msl
+++ b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void atan2_57fb13() {
float2 res = atan2(float2(), float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
atan2_57fb13();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/atan2/57fb13.wgsl.expected.spvasm b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.spvasm
index 5ad6a7b..a43a400 100644
--- a/test/intrinsics/gen/atan2/57fb13.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %atan2_57fb13 "atan2_57fb13"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%atan2_57fb13 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Atan2 %12 %12
- OpStore %res %9
+%atan2_57fb13 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Atan2 %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %atan2_57fb13
+ %26 = OpFunctionCall %void %atan2_57fb13
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %atan2_57fb13
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %atan2_57fb13
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %atan2_57fb13
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %atan2_57fb13
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/atan2/57fb13.wgsl.expected.wgsl b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.wgsl
index 9eeb50e..8dfa7ad 100644
--- a/test/intrinsics/gen/atan2/57fb13.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
atan2_57fb13();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/atan2/96057c.wgsl b/test/intrinsics/gen/atan2/96057c.wgsl
index c48ea4d..8a8ef1e 100644
--- a/test/intrinsics/gen/atan2/96057c.wgsl
+++ b/test/intrinsics/gen/atan2/96057c.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
atan2_96057c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/atan2/96057c.wgsl.expected.hlsl b/test/intrinsics/gen/atan2/96057c.wgsl.expected.hlsl
index 6148ace..7663e32 100644
--- a/test/intrinsics/gen/atan2/96057c.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/atan2/96057c.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void atan2_96057c() {
float res = atan2(1.0f, 1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
atan2_96057c();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/atan2/96057c.wgsl.expected.msl b/test/intrinsics/gen/atan2/96057c.wgsl.expected.msl
index 6dd610f..eda44b5 100644
--- a/test/intrinsics/gen/atan2/96057c.wgsl.expected.msl
+++ b/test/intrinsics/gen/atan2/96057c.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void atan2_96057c() {
float res = atan2(1.0f, 1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
atan2_96057c();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/atan2/96057c.wgsl.expected.spvasm b/test/intrinsics/gen/atan2/96057c.wgsl.expected.spvasm
index 2d93e05..6f09ee6 100644
--- a/test/intrinsics/gen/atan2/96057c.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/atan2/96057c.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %atan2_96057c "atan2_96057c"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%atan2_96057c = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+%atan2_96057c = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Atan2 %float_1 %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Atan2 %float_1 %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %atan2_96057c
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %atan2_96057c
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %atan2_96057c
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %atan2_96057c
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %atan2_96057c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %atan2_96057c
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/atan2/96057c.wgsl.expected.wgsl b/test/intrinsics/gen/atan2/96057c.wgsl.expected.wgsl
index 5196c86..a8fa052 100644
--- a/test/intrinsics/gen/atan2/96057c.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/atan2/96057c.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
atan2_96057c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/atan2/a70d0d.wgsl b/test/intrinsics/gen/atan2/a70d0d.wgsl
index 9803266..f94c541 100644
--- a/test/intrinsics/gen/atan2/a70d0d.wgsl
+++ b/test/intrinsics/gen/atan2/a70d0d.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
atan2_a70d0d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.msl b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.msl
index 867ab02..6a52430 100644
--- a/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.msl
+++ b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void atan2_a70d0d() {
float3 res = atan2(float3(), float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
atan2_a70d0d();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.spvasm b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.spvasm
index 8a2ce3a..1ddf165 100644
--- a/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %atan2_a70d0d "atan2_a70d0d"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%atan2_a70d0d = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Atan2 %12 %12
- OpStore %res %9
+%atan2_a70d0d = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Atan2 %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %atan2_a70d0d
+ %26 = OpFunctionCall %void %atan2_a70d0d
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %atan2_a70d0d
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %atan2_a70d0d
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %atan2_a70d0d
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %atan2_a70d0d
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.wgsl b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.wgsl
index 81cbd0b..53cc60e 100644
--- a/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
atan2_a70d0d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/atan2/ae713e.wgsl b/test/intrinsics/gen/atan2/ae713e.wgsl
index 19090fd..d0edde7 100644
--- a/test/intrinsics/gen/atan2/ae713e.wgsl
+++ b/test/intrinsics/gen/atan2/ae713e.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
atan2_ae713e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/atan2/ae713e.wgsl.expected.msl b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.msl
index 5afdaf1..9aa0aa7 100644
--- a/test/intrinsics/gen/atan2/ae713e.wgsl.expected.msl
+++ b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void atan2_ae713e() {
float4 res = atan2(float4(), float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
atan2_ae713e();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/atan2/ae713e.wgsl.expected.spvasm b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.spvasm
index f97c71e..8ecfa94 100644
--- a/test/intrinsics/gen/atan2/ae713e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %atan2_ae713e "atan2_ae713e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%atan2_ae713e = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Atan2 %12 %12
- OpStore %res %9
+%atan2_ae713e = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Atan2 %8 %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %atan2_ae713e
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %atan2_ae713e
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %atan2_ae713e
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %atan2_ae713e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %atan2_ae713e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/atan2/ae713e.wgsl.expected.wgsl b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.wgsl
index 1f36d2f..10880ff 100644
--- a/test/intrinsics/gen/atan2/ae713e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
atan2_ae713e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/ceil/34064b.wgsl b/test/intrinsics/gen/ceil/34064b.wgsl
index 3a761a8..30dce203 100644
--- a/test/intrinsics/gen/ceil/34064b.wgsl
+++ b/test/intrinsics/gen/ceil/34064b.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
ceil_34064b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/ceil/34064b.wgsl.expected.hlsl b/test/intrinsics/gen/ceil/34064b.wgsl.expected.hlsl
index 8a08ba8e..83a777c 100644
--- a/test/intrinsics/gen/ceil/34064b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/ceil/34064b.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void ceil_34064b() {
float3 res = ceil(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
ceil_34064b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/ceil/34064b.wgsl.expected.msl b/test/intrinsics/gen/ceil/34064b.wgsl.expected.msl
index bdee65c..6a9eba0 100644
--- a/test/intrinsics/gen/ceil/34064b.wgsl.expected.msl
+++ b/test/intrinsics/gen/ceil/34064b.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void ceil_34064b() {
float3 res = ceil(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
ceil_34064b();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/ceil/34064b.wgsl.expected.spvasm b/test/intrinsics/gen/ceil/34064b.wgsl.expected.spvasm
index 93ef755..ddfaf87 100644
--- a/test/intrinsics/gen/ceil/34064b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/ceil/34064b.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %ceil_34064b "ceil_34064b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%ceil_34064b = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Ceil %12
- OpStore %res %9
+%ceil_34064b = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Ceil %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %ceil_34064b
+ %26 = OpFunctionCall %void %ceil_34064b
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %ceil_34064b
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %ceil_34064b
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %ceil_34064b
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %ceil_34064b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/ceil/34064b.wgsl.expected.wgsl b/test/intrinsics/gen/ceil/34064b.wgsl.expected.wgsl
index db216bd..745dd84 100644
--- a/test/intrinsics/gen/ceil/34064b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/ceil/34064b.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
ceil_34064b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/ceil/678655.wgsl b/test/intrinsics/gen/ceil/678655.wgsl
index d6fd59e..d3abe6d 100644
--- a/test/intrinsics/gen/ceil/678655.wgsl
+++ b/test/intrinsics/gen/ceil/678655.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
ceil_678655();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/ceil/678655.wgsl.expected.hlsl b/test/intrinsics/gen/ceil/678655.wgsl.expected.hlsl
index a464471..6c0838e 100644
--- a/test/intrinsics/gen/ceil/678655.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/ceil/678655.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void ceil_678655() {
float res = ceil(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
ceil_678655();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/ceil/678655.wgsl.expected.msl b/test/intrinsics/gen/ceil/678655.wgsl.expected.msl
index 2ee1b99..1dc8a90 100644
--- a/test/intrinsics/gen/ceil/678655.wgsl.expected.msl
+++ b/test/intrinsics/gen/ceil/678655.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void ceil_678655() {
float res = ceil(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
ceil_678655();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/ceil/678655.wgsl.expected.spvasm b/test/intrinsics/gen/ceil/678655.wgsl.expected.spvasm
index 7e9d904..81b81aa 100644
--- a/test/intrinsics/gen/ceil/678655.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/ceil/678655.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %ceil_678655 "ceil_678655"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%ceil_678655 = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+%ceil_678655 = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Ceil %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Ceil %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %ceil_678655
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %ceil_678655
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %ceil_678655
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %ceil_678655
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %ceil_678655
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %ceil_678655
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/ceil/678655.wgsl.expected.wgsl b/test/intrinsics/gen/ceil/678655.wgsl.expected.wgsl
index 93141ee..c4c8b8c 100644
--- a/test/intrinsics/gen/ceil/678655.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/ceil/678655.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
ceil_678655();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/ceil/96f597.wgsl b/test/intrinsics/gen/ceil/96f597.wgsl
index 8be5f58..8015830 100644
--- a/test/intrinsics/gen/ceil/96f597.wgsl
+++ b/test/intrinsics/gen/ceil/96f597.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
ceil_96f597();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/ceil/96f597.wgsl.expected.hlsl b/test/intrinsics/gen/ceil/96f597.wgsl.expected.hlsl
index 0c6ec13..f27af89 100644
--- a/test/intrinsics/gen/ceil/96f597.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/ceil/96f597.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void ceil_96f597() {
float2 res = ceil(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
ceil_96f597();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/ceil/96f597.wgsl.expected.msl b/test/intrinsics/gen/ceil/96f597.wgsl.expected.msl
index e7fac87..355e7c3 100644
--- a/test/intrinsics/gen/ceil/96f597.wgsl.expected.msl
+++ b/test/intrinsics/gen/ceil/96f597.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void ceil_96f597() {
float2 res = ceil(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
ceil_96f597();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/ceil/96f597.wgsl.expected.spvasm b/test/intrinsics/gen/ceil/96f597.wgsl.expected.spvasm
index 2c6fc2d..cb88aba 100644
--- a/test/intrinsics/gen/ceil/96f597.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/ceil/96f597.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %ceil_96f597 "ceil_96f597"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%ceil_96f597 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Ceil %12
- OpStore %res %9
+%ceil_96f597 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Ceil %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %ceil_96f597
+ %26 = OpFunctionCall %void %ceil_96f597
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %ceil_96f597
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %ceil_96f597
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %ceil_96f597
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %ceil_96f597
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/ceil/96f597.wgsl.expected.wgsl b/test/intrinsics/gen/ceil/96f597.wgsl.expected.wgsl
index 0f19eb3..0865977 100644
--- a/test/intrinsics/gen/ceil/96f597.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/ceil/96f597.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
ceil_96f597();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/ceil/b74c16.wgsl b/test/intrinsics/gen/ceil/b74c16.wgsl
index bff6a37..c1e2ed4 100644
--- a/test/intrinsics/gen/ceil/b74c16.wgsl
+++ b/test/intrinsics/gen/ceil/b74c16.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
ceil_b74c16();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.hlsl b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.hlsl
index 8a24e8fd..77772ec 100644
--- a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void ceil_b74c16() {
float4 res = ceil(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
ceil_b74c16();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.msl b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.msl
index 85755c8..982d1d0 100644
--- a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.msl
+++ b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void ceil_b74c16() {
float4 res = ceil(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
ceil_b74c16();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.spvasm b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.spvasm
index 8acc0f5..8014539 100644
--- a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %ceil_b74c16 "ceil_b74c16"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%ceil_b74c16 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Ceil %12
- OpStore %res %9
+%ceil_b74c16 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Ceil %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %ceil_b74c16
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %ceil_b74c16
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %ceil_b74c16
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %ceil_b74c16
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %ceil_b74c16
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.wgsl b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.wgsl
index 31a84dc..054a6f3 100644
--- a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
ceil_b74c16();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/clamp/0acf8f.wgsl b/test/intrinsics/gen/clamp/0acf8f.wgsl
index 1cd0210..1936ba5 100644
--- a/test/intrinsics/gen/clamp/0acf8f.wgsl
+++ b/test/intrinsics/gen/clamp/0acf8f.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
clamp_0acf8f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.hlsl
index 842215f..46ebedc 100644
--- a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void clamp_0acf8f() {
float2 res = clamp(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
clamp_0acf8f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.msl b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.msl
index a037369..dce861e 100644
--- a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.msl
+++ b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void clamp_0acf8f() {
float2 res = clamp(float2(), float2(), float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
clamp_0acf8f();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.spvasm
index 407ba2e..67d351d 100644
--- a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %clamp_0acf8f "clamp_0acf8f"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%clamp_0acf8f = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 NClamp %12 %12 %12
- OpStore %res %9
+%clamp_0acf8f = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 NClamp %16 %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %clamp_0acf8f
+ %26 = OpFunctionCall %void %clamp_0acf8f
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %clamp_0acf8f
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %clamp_0acf8f
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %clamp_0acf8f
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %clamp_0acf8f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.wgsl
index bddaa44..5c83671 100644
--- a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
clamp_0acf8f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/clamp/1a32e3.wgsl b/test/intrinsics/gen/clamp/1a32e3.wgsl
index 09c42a5..8444c85 100644
--- a/test/intrinsics/gen/clamp/1a32e3.wgsl
+++ b/test/intrinsics/gen/clamp/1a32e3.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
clamp_1a32e3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.hlsl
index 55b87de..7041713 100644
--- a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void clamp_1a32e3() {
int4 res = clamp(int4(0, 0, 0, 0), int4(0, 0, 0, 0), int4(0, 0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
clamp_1a32e3();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.msl b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.msl
index c0bea6f..062a582 100644
--- a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.msl
+++ b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void clamp_1a32e3() {
int4 res = clamp(int4(), int4(), int4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
clamp_1a32e3();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.spvasm
index 3359379..975e522 100644
--- a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %clamp_1a32e3 "clamp_1a32e3"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v4int = OpTypeVector %int 4
- %13 = OpConstantNull %v4int
+ %17 = OpConstantNull %v4int
%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%clamp_1a32e3 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %13
- %9 = OpExtInst %v4int %12 SClamp %13 %13 %13
- OpStore %res %9
+%clamp_1a32e3 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %17
+ %13 = OpExtInst %v4int %16 SClamp %17 %17 %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %clamp_1a32e3
+ %27 = OpFunctionCall %void %clamp_1a32e3
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %clamp_1a32e3
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %clamp_1a32e3
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %clamp_1a32e3
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %clamp_1a32e3
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.wgsl
index 27ba95d..b06bed0 100644
--- a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
clamp_1a32e3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/clamp/2bd567.wgsl b/test/intrinsics/gen/clamp/2bd567.wgsl
index 53f74c8..d400623 100644
--- a/test/intrinsics/gen/clamp/2bd567.wgsl
+++ b/test/intrinsics/gen/clamp/2bd567.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
clamp_2bd567();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.hlsl
index 6650a46..2957e22 100644
--- a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void clamp_2bd567() {
float res = clamp(1.0f, 1.0f, 1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
clamp_2bd567();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.msl b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.msl
index fd397f1..533e9e4 100644
--- a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.msl
+++ b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void clamp_2bd567() {
float res = clamp(1.0f, 1.0f, 1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
clamp_2bd567();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.spvasm
index 74eb006..011022b 100644
--- a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %clamp_2bd567 "clamp_2bd567"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%clamp_2bd567 = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+%clamp_2bd567 = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 NClamp %float_1 %float_1 %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 NClamp %float_1 %float_1 %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %clamp_2bd567
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %clamp_2bd567
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %clamp_2bd567
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %clamp_2bd567
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %clamp_2bd567
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %clamp_2bd567
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.wgsl
index 84ab121..709aec4 100644
--- a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
clamp_2bd567();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/clamp/2bde41.wgsl b/test/intrinsics/gen/clamp/2bde41.wgsl
index d3e75b0..9c84393 100644
--- a/test/intrinsics/gen/clamp/2bde41.wgsl
+++ b/test/intrinsics/gen/clamp/2bde41.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
clamp_2bde41();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.hlsl
index f6485cb..d8a1a6b 100644
--- a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void clamp_2bde41() {
float4 res = clamp(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
clamp_2bde41();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.msl b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.msl
index 300b88a..aa99935 100644
--- a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.msl
+++ b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void clamp_2bde41() {
float4 res = clamp(float4(), float4(), float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
clamp_2bde41();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.spvasm
index 893bd08..a6e8276 100644
--- a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %clamp_2bde41 "clamp_2bde41"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%clamp_2bde41 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 NClamp %12 %12 %12
- OpStore %res %9
+%clamp_2bde41 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 NClamp %8 %8 %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %clamp_2bde41
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %clamp_2bde41
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %clamp_2bde41
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %clamp_2bde41
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %clamp_2bde41
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.wgsl
index 5956f67..25ecf8f 100644
--- a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
clamp_2bde41();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/clamp/548fc7.wgsl b/test/intrinsics/gen/clamp/548fc7.wgsl
index c1c22c5..73c3086 100644
--- a/test/intrinsics/gen/clamp/548fc7.wgsl
+++ b/test/intrinsics/gen/clamp/548fc7.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
clamp_548fc7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.hlsl
index 019054e..d8be53e 100644
--- a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void clamp_548fc7() {
uint3 res = clamp(uint3(0u, 0u, 0u), uint3(0u, 0u, 0u), uint3(0u, 0u, 0u));
}
-void vertex_main() {
+tint_symbol vertex_main() {
clamp_548fc7();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.msl b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.msl
index cd95893..ecfc1ad 100644
--- a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.msl
+++ b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void clamp_548fc7() {
uint3 res = clamp(uint3(), uint3(), uint3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
clamp_548fc7();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.spvasm
index 37f7fb7..dbcf07d 100644
--- a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %clamp_548fc7 "clamp_548fc7"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
- %13 = OpConstantNull %v3uint
+ %17 = OpConstantNull %v3uint
%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%clamp_548fc7 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3uint Function %13
- %9 = OpExtInst %v3uint %12 UClamp %13 %13 %13
- OpStore %res %9
+%clamp_548fc7 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %17
+ %13 = OpExtInst %v3uint %16 UClamp %17 %17 %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %clamp_548fc7
+ %27 = OpFunctionCall %void %clamp_548fc7
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %clamp_548fc7
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %clamp_548fc7
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %clamp_548fc7
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %clamp_548fc7
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.wgsl
index 0a5ebca1..3639559 100644
--- a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
clamp_548fc7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/clamp/5f0819.wgsl b/test/intrinsics/gen/clamp/5f0819.wgsl
index 3f832c6..0e88782 100644
--- a/test/intrinsics/gen/clamp/5f0819.wgsl
+++ b/test/intrinsics/gen/clamp/5f0819.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
clamp_5f0819();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.hlsl
index 4c53393..402bbab 100644
--- a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void clamp_5f0819() {
int3 res = clamp(int3(0, 0, 0), int3(0, 0, 0), int3(0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
clamp_5f0819();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.msl b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.msl
index 758dfaf..5a6317d 100644
--- a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.msl
+++ b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void clamp_5f0819() {
int3 res = clamp(int3(), int3(), int3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
clamp_5f0819();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.spvasm
index 4d75c73..06500aa 100644
--- a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %clamp_5f0819 "clamp_5f0819"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %13 = OpConstantNull %v3int
+ %17 = OpConstantNull %v3int
%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%clamp_5f0819 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %13
- %9 = OpExtInst %v3int %12 SClamp %13 %13 %13
- OpStore %res %9
+%clamp_5f0819 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %17
+ %13 = OpExtInst %v3int %16 SClamp %17 %17 %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %clamp_5f0819
+ %27 = OpFunctionCall %void %clamp_5f0819
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %clamp_5f0819
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %clamp_5f0819
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %clamp_5f0819
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %clamp_5f0819
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.wgsl
index 5490dff..9316046 100644
--- a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
clamp_5f0819();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/clamp/6c1749.wgsl b/test/intrinsics/gen/clamp/6c1749.wgsl
index 50c6ecb..25c8a4f 100644
--- a/test/intrinsics/gen/clamp/6c1749.wgsl
+++ b/test/intrinsics/gen/clamp/6c1749.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
clamp_6c1749();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.hlsl
index df70177..19fa755 100644
--- a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void clamp_6c1749() {
int2 res = clamp(int2(0, 0), int2(0, 0), int2(0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
clamp_6c1749();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.msl b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.msl
index 34397b6..654a545 100644
--- a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.msl
+++ b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void clamp_6c1749() {
int2 res = clamp(int2(), int2(), int2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
clamp_6c1749();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.spvasm
index 892edaf..eac8825 100644
--- a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %clamp_6c1749 "clamp_6c1749"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %13 = OpConstantNull %v2int
+ %17 = OpConstantNull %v2int
%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%clamp_6c1749 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %13
- %9 = OpExtInst %v2int %12 SClamp %13 %13 %13
- OpStore %res %9
+%clamp_6c1749 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %17
+ %13 = OpExtInst %v2int %16 SClamp %17 %17 %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %clamp_6c1749
+ %27 = OpFunctionCall %void %clamp_6c1749
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %clamp_6c1749
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %clamp_6c1749
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %clamp_6c1749
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %clamp_6c1749
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.wgsl
index bc424ec..39d43eb 100644
--- a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
clamp_6c1749();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/clamp/7706d7.wgsl b/test/intrinsics/gen/clamp/7706d7.wgsl
index 20b0214..ac7eb5d 100644
--- a/test/intrinsics/gen/clamp/7706d7.wgsl
+++ b/test/intrinsics/gen/clamp/7706d7.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
clamp_7706d7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.hlsl
index ac8e422..48fa122 100644
--- a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void clamp_7706d7() {
uint2 res = clamp(uint2(0u, 0u), uint2(0u, 0u), uint2(0u, 0u));
}
-void vertex_main() {
+tint_symbol vertex_main() {
clamp_7706d7();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.msl b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.msl
index 4faae26..634bdf5 100644
--- a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.msl
+++ b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void clamp_7706d7() {
uint2 res = clamp(uint2(), uint2(), uint2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
clamp_7706d7();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.spvasm
index 5ecc8de..df66b69 100644
--- a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %clamp_7706d7 "clamp_7706d7"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v2uint = OpTypeVector %uint 2
- %13 = OpConstantNull %v2uint
+ %17 = OpConstantNull %v2uint
%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%clamp_7706d7 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2uint Function %13
- %9 = OpExtInst %v2uint %12 UClamp %13 %13 %13
- OpStore %res %9
+%clamp_7706d7 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %17
+ %13 = OpExtInst %v2uint %16 UClamp %17 %17 %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %clamp_7706d7
+ %27 = OpFunctionCall %void %clamp_7706d7
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %clamp_7706d7
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %clamp_7706d7
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %clamp_7706d7
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %clamp_7706d7
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.wgsl
index 76996d8..433ed74 100644
--- a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
clamp_7706d7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/clamp/867397.wgsl b/test/intrinsics/gen/clamp/867397.wgsl
index 51dbf3a..4bde313 100644
--- a/test/intrinsics/gen/clamp/867397.wgsl
+++ b/test/intrinsics/gen/clamp/867397.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
clamp_867397();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/clamp/867397.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/867397.wgsl.expected.hlsl
index fb3b131..e7b719f 100644
--- a/test/intrinsics/gen/clamp/867397.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/clamp/867397.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void clamp_867397() {
float3 res = clamp(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
clamp_867397();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/clamp/867397.wgsl.expected.msl b/test/intrinsics/gen/clamp/867397.wgsl.expected.msl
index a3647ec..6c8eeef 100644
--- a/test/intrinsics/gen/clamp/867397.wgsl.expected.msl
+++ b/test/intrinsics/gen/clamp/867397.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void clamp_867397() {
float3 res = clamp(float3(), float3(), float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
clamp_867397();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/clamp/867397.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/867397.wgsl.expected.spvasm
index f635487..d0a9730 100644
--- a/test/intrinsics/gen/clamp/867397.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/clamp/867397.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %clamp_867397 "clamp_867397"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%clamp_867397 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 NClamp %12 %12 %12
- OpStore %res %9
+%clamp_867397 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 NClamp %16 %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %clamp_867397
+ %26 = OpFunctionCall %void %clamp_867397
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %clamp_867397
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %clamp_867397
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %clamp_867397
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %clamp_867397
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/clamp/867397.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/867397.wgsl.expected.wgsl
index ee22ec7..bec2952 100644
--- a/test/intrinsics/gen/clamp/867397.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/clamp/867397.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
clamp_867397();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/clamp/a2de25.wgsl b/test/intrinsics/gen/clamp/a2de25.wgsl
index 57398ae..731c9dd 100644
--- a/test/intrinsics/gen/clamp/a2de25.wgsl
+++ b/test/intrinsics/gen/clamp/a2de25.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
clamp_a2de25();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.hlsl
index d051684..382350e 100644
--- a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void clamp_a2de25() {
uint res = clamp(1u, 1u, 1u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
clamp_a2de25();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.msl b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.msl
index 723dcce..00bbc2a 100644
--- a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.msl
+++ b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void clamp_a2de25() {
uint res = clamp(1u, 1u, 1u);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
clamp_a2de25();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.spvasm
index 1e40fa9..5c38de7 100644
--- a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %clamp_a2de25 "clamp_a2de25"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%_ptr_Function_uint = OpTypePointer Function %uint
- %15 = OpConstantNull %uint
+ %19 = OpConstantNull %uint
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%clamp_a2de25 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_uint Function %15
- %9 = OpExtInst %uint %11 UClamp %uint_1 %uint_1 %uint_1
- OpStore %res %9
+%clamp_a2de25 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %19
+ %13 = OpExtInst %uint %15 UClamp %uint_1 %uint_1 %uint_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %clamp_a2de25
+ %27 = OpFunctionCall %void %clamp_a2de25
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %clamp_a2de25
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %clamp_a2de25
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %clamp_a2de25
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %clamp_a2de25
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.wgsl
index dcc288b..235c5bf 100644
--- a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
clamp_a2de25();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/clamp/b07c65.wgsl b/test/intrinsics/gen/clamp/b07c65.wgsl
index 26037c0..76be61b 100644
--- a/test/intrinsics/gen/clamp/b07c65.wgsl
+++ b/test/intrinsics/gen/clamp/b07c65.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
clamp_b07c65();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.hlsl
index 1e0f3b7..4c2a7a4 100644
--- a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void clamp_b07c65() {
int res = clamp(1, 1, 1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
clamp_b07c65();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.msl b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.msl
index 66c5ed1..15d67e6 100644
--- a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.msl
+++ b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void clamp_b07c65() {
int res = clamp(1, 1, 1);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
clamp_b07c65();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.spvasm
index 766f948..ee90583 100644
--- a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %clamp_b07c65 "clamp_b07c65"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_Function_int = OpTypePointer Function %int
- %15 = OpConstantNull %int
+ %19 = OpConstantNull %int
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%clamp_b07c65 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %15
- %9 = OpExtInst %int %11 SClamp %int_1 %int_1 %int_1
- OpStore %res %9
+%clamp_b07c65 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %13 = OpExtInst %int %15 SClamp %int_1 %int_1 %int_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %clamp_b07c65
+ %27 = OpFunctionCall %void %clamp_b07c65
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %clamp_b07c65
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %clamp_b07c65
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %clamp_b07c65
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %clamp_b07c65
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.wgsl
index dcb8def..452feca 100644
--- a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
clamp_b07c65();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/clamp/bd43ce.wgsl b/test/intrinsics/gen/clamp/bd43ce.wgsl
index 312f5a4..90448ff 100644
--- a/test/intrinsics/gen/clamp/bd43ce.wgsl
+++ b/test/intrinsics/gen/clamp/bd43ce.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
clamp_bd43ce();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.hlsl
index aff6b0a..939b0e3 100644
--- a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void clamp_bd43ce() {
uint4 res = clamp(uint4(0u, 0u, 0u, 0u), uint4(0u, 0u, 0u, 0u), uint4(0u, 0u, 0u, 0u));
}
-void vertex_main() {
+tint_symbol vertex_main() {
clamp_bd43ce();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.msl b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.msl
index 6357503..7e2562c 100644
--- a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.msl
+++ b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void clamp_bd43ce() {
uint4 res = clamp(uint4(), uint4(), uint4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
clamp_bd43ce();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.spvasm
index 2d2fc1f..97c3f81 100644
--- a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %clamp_bd43ce "clamp_bd43ce"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v4uint = OpTypeVector %uint 4
- %13 = OpConstantNull %v4uint
+ %17 = OpConstantNull %v4uint
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%clamp_bd43ce = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %13
- %9 = OpExtInst %v4uint %12 UClamp %13 %13 %13
- OpStore %res %9
+%clamp_bd43ce = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %17
+ %13 = OpExtInst %v4uint %16 UClamp %17 %17 %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %clamp_bd43ce
+ %27 = OpFunctionCall %void %clamp_bd43ce
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %clamp_bd43ce
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %clamp_bd43ce
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %clamp_bd43ce
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %clamp_bd43ce
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.wgsl
index 83486f0..a36db41 100644
--- a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
clamp_bd43ce();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/cos/16dc15.wgsl b/test/intrinsics/gen/cos/16dc15.wgsl
index 3be644c..8c8563d 100644
--- a/test/intrinsics/gen/cos/16dc15.wgsl
+++ b/test/intrinsics/gen/cos/16dc15.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
cos_16dc15();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/cos/16dc15.wgsl.expected.hlsl b/test/intrinsics/gen/cos/16dc15.wgsl.expected.hlsl
index a7f1315..a13cac7 100644
--- a/test/intrinsics/gen/cos/16dc15.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/cos/16dc15.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void cos_16dc15() {
float3 res = cos(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
cos_16dc15();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/cos/16dc15.wgsl.expected.msl b/test/intrinsics/gen/cos/16dc15.wgsl.expected.msl
index f82f797..4aeac90 100644
--- a/test/intrinsics/gen/cos/16dc15.wgsl.expected.msl
+++ b/test/intrinsics/gen/cos/16dc15.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void cos_16dc15() {
float3 res = cos(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
cos_16dc15();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/cos/16dc15.wgsl.expected.spvasm b/test/intrinsics/gen/cos/16dc15.wgsl.expected.spvasm
index e9373f8..82fe4b0 100644
--- a/test/intrinsics/gen/cos/16dc15.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/cos/16dc15.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %cos_16dc15 "cos_16dc15"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %cos_16dc15 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Cos %12
- OpStore %res %9
+ %cos_16dc15 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Cos %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %cos_16dc15
+ %26 = OpFunctionCall %void %cos_16dc15
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %cos_16dc15
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %cos_16dc15
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %cos_16dc15
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %cos_16dc15
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/cos/16dc15.wgsl.expected.wgsl b/test/intrinsics/gen/cos/16dc15.wgsl.expected.wgsl
index 556d991..606aa66 100644
--- a/test/intrinsics/gen/cos/16dc15.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/cos/16dc15.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
cos_16dc15();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/cos/29d66d.wgsl b/test/intrinsics/gen/cos/29d66d.wgsl
index ac2ac10..d64c845 100644
--- a/test/intrinsics/gen/cos/29d66d.wgsl
+++ b/test/intrinsics/gen/cos/29d66d.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
cos_29d66d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/cos/29d66d.wgsl.expected.hlsl b/test/intrinsics/gen/cos/29d66d.wgsl.expected.hlsl
index 745c39d..15304cd 100644
--- a/test/intrinsics/gen/cos/29d66d.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/cos/29d66d.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void cos_29d66d() {
float4 res = cos(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
cos_29d66d();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/cos/29d66d.wgsl.expected.msl b/test/intrinsics/gen/cos/29d66d.wgsl.expected.msl
index a434cab..9c74fa2 100644
--- a/test/intrinsics/gen/cos/29d66d.wgsl.expected.msl
+++ b/test/intrinsics/gen/cos/29d66d.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void cos_29d66d() {
float4 res = cos(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
cos_29d66d();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/cos/29d66d.wgsl.expected.spvasm b/test/intrinsics/gen/cos/29d66d.wgsl.expected.spvasm
index b306467..1db9643f 100644
--- a/test/intrinsics/gen/cos/29d66d.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/cos/29d66d.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %cos_29d66d "cos_29d66d"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %cos_29d66d = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Cos %12
- OpStore %res %9
+ %cos_29d66d = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Cos %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %cos_29d66d
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %cos_29d66d
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %cos_29d66d
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %cos_29d66d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %cos_29d66d
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/cos/29d66d.wgsl.expected.wgsl b/test/intrinsics/gen/cos/29d66d.wgsl.expected.wgsl
index 1ae251c..7bfdb87 100644
--- a/test/intrinsics/gen/cos/29d66d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/cos/29d66d.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
cos_29d66d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/cos/c3b486.wgsl b/test/intrinsics/gen/cos/c3b486.wgsl
index dd860be..3401020 100644
--- a/test/intrinsics/gen/cos/c3b486.wgsl
+++ b/test/intrinsics/gen/cos/c3b486.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
cos_c3b486();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/cos/c3b486.wgsl.expected.hlsl b/test/intrinsics/gen/cos/c3b486.wgsl.expected.hlsl
index 98a4176..65bab61 100644
--- a/test/intrinsics/gen/cos/c3b486.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/cos/c3b486.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void cos_c3b486() {
float2 res = cos(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
cos_c3b486();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/cos/c3b486.wgsl.expected.msl b/test/intrinsics/gen/cos/c3b486.wgsl.expected.msl
index 2d82317..fa7aafc 100644
--- a/test/intrinsics/gen/cos/c3b486.wgsl.expected.msl
+++ b/test/intrinsics/gen/cos/c3b486.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void cos_c3b486() {
float2 res = cos(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
cos_c3b486();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/cos/c3b486.wgsl.expected.spvasm b/test/intrinsics/gen/cos/c3b486.wgsl.expected.spvasm
index 14f77a8..32f5010 100644
--- a/test/intrinsics/gen/cos/c3b486.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/cos/c3b486.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %cos_c3b486 "cos_c3b486"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %cos_c3b486 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Cos %12
- OpStore %res %9
+ %cos_c3b486 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Cos %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %cos_c3b486
+ %26 = OpFunctionCall %void %cos_c3b486
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %cos_c3b486
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %cos_c3b486
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %cos_c3b486
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %cos_c3b486
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/cos/c3b486.wgsl.expected.wgsl b/test/intrinsics/gen/cos/c3b486.wgsl.expected.wgsl
index 2d585d6..806a503 100644
--- a/test/intrinsics/gen/cos/c3b486.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/cos/c3b486.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
cos_c3b486();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/cos/c5c28e.wgsl b/test/intrinsics/gen/cos/c5c28e.wgsl
index 33bc9f4..0108752 100644
--- a/test/intrinsics/gen/cos/c5c28e.wgsl
+++ b/test/intrinsics/gen/cos/c5c28e.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
cos_c5c28e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.hlsl b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.hlsl
index fbd531b..162b46d 100644
--- a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void cos_c5c28e() {
float res = cos(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
cos_c5c28e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.msl b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.msl
index 0f1eba6..1650815 100644
--- a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.msl
+++ b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void cos_c5c28e() {
float res = cos(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
cos_c5c28e();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.spvasm b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.spvasm
index 1183128..00a2e61 100644
--- a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %cos_c5c28e "cos_c5c28e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
- %cos_c5c28e = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+ %cos_c5c28e = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Cos %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Cos %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %cos_c5c28e
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %cos_c5c28e
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %cos_c5c28e
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %cos_c5c28e
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %cos_c5c28e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %cos_c5c28e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.wgsl b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.wgsl
index b4a0453..a9170b8 100644
--- a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
cos_c5c28e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/cosh/377652.wgsl b/test/intrinsics/gen/cosh/377652.wgsl
index c4e548e..551803c 100644
--- a/test/intrinsics/gen/cosh/377652.wgsl
+++ b/test/intrinsics/gen/cosh/377652.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
cosh_377652();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/cosh/377652.wgsl.expected.hlsl b/test/intrinsics/gen/cosh/377652.wgsl.expected.hlsl
index 019f1f4..3a7fac1 100644
--- a/test/intrinsics/gen/cosh/377652.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/cosh/377652.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void cosh_377652() {
float3 res = cosh(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
cosh_377652();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/cosh/377652.wgsl.expected.msl b/test/intrinsics/gen/cosh/377652.wgsl.expected.msl
index 0fe5e89..f52361f 100644
--- a/test/intrinsics/gen/cosh/377652.wgsl.expected.msl
+++ b/test/intrinsics/gen/cosh/377652.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void cosh_377652() {
float3 res = cosh(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
cosh_377652();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/cosh/377652.wgsl.expected.spvasm b/test/intrinsics/gen/cosh/377652.wgsl.expected.spvasm
index e007f05..3a3dcec 100644
--- a/test/intrinsics/gen/cosh/377652.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/cosh/377652.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %cosh_377652 "cosh_377652"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%cosh_377652 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Cosh %12
- OpStore %res %9
+%cosh_377652 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Cosh %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %cosh_377652
+ %26 = OpFunctionCall %void %cosh_377652
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %cosh_377652
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %cosh_377652
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %cosh_377652
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %cosh_377652
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/cosh/377652.wgsl.expected.wgsl b/test/intrinsics/gen/cosh/377652.wgsl.expected.wgsl
index 29fffea..e2f0fec 100644
--- a/test/intrinsics/gen/cosh/377652.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/cosh/377652.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
cosh_377652();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/cosh/c13756.wgsl b/test/intrinsics/gen/cosh/c13756.wgsl
index 8d6aced..158c38a 100644
--- a/test/intrinsics/gen/cosh/c13756.wgsl
+++ b/test/intrinsics/gen/cosh/c13756.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
cosh_c13756();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/cosh/c13756.wgsl.expected.hlsl b/test/intrinsics/gen/cosh/c13756.wgsl.expected.hlsl
index 72480be..e69f553 100644
--- a/test/intrinsics/gen/cosh/c13756.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/cosh/c13756.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void cosh_c13756() {
float2 res = cosh(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
cosh_c13756();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/cosh/c13756.wgsl.expected.msl b/test/intrinsics/gen/cosh/c13756.wgsl.expected.msl
index 8d9d463..7cf7bca 100644
--- a/test/intrinsics/gen/cosh/c13756.wgsl.expected.msl
+++ b/test/intrinsics/gen/cosh/c13756.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void cosh_c13756() {
float2 res = cosh(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
cosh_c13756();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/cosh/c13756.wgsl.expected.spvasm b/test/intrinsics/gen/cosh/c13756.wgsl.expected.spvasm
index 7573451..e684a82 100644
--- a/test/intrinsics/gen/cosh/c13756.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/cosh/c13756.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %cosh_c13756 "cosh_c13756"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%cosh_c13756 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Cosh %12
- OpStore %res %9
+%cosh_c13756 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Cosh %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %cosh_c13756
+ %26 = OpFunctionCall %void %cosh_c13756
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %cosh_c13756
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %cosh_c13756
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %cosh_c13756
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %cosh_c13756
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/cosh/c13756.wgsl.expected.wgsl b/test/intrinsics/gen/cosh/c13756.wgsl.expected.wgsl
index 688528b..fff94ac 100644
--- a/test/intrinsics/gen/cosh/c13756.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/cosh/c13756.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
cosh_c13756();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/cosh/da92dd.wgsl b/test/intrinsics/gen/cosh/da92dd.wgsl
index da5876c..1af5147 100644
--- a/test/intrinsics/gen/cosh/da92dd.wgsl
+++ b/test/intrinsics/gen/cosh/da92dd.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
cosh_da92dd();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.hlsl b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.hlsl
index 0452df9..4fbccb7 100644
--- a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void cosh_da92dd() {
float res = cosh(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
cosh_da92dd();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.msl b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.msl
index 1455bf7..88231f2 100644
--- a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.msl
+++ b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void cosh_da92dd() {
float res = cosh(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
cosh_da92dd();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.spvasm b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.spvasm
index 3ff45d5..d5a08ab 100644
--- a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %cosh_da92dd "cosh_da92dd"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%cosh_da92dd = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+%cosh_da92dd = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Cosh %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Cosh %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %cosh_da92dd
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %cosh_da92dd
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %cosh_da92dd
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %cosh_da92dd
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %cosh_da92dd
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %cosh_da92dd
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.wgsl b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.wgsl
index b2c83f8..9a692e0 100644
--- a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
cosh_da92dd();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/cosh/e0c1de.wgsl b/test/intrinsics/gen/cosh/e0c1de.wgsl
index 39b3c46..63e4c5d 100644
--- a/test/intrinsics/gen/cosh/e0c1de.wgsl
+++ b/test/intrinsics/gen/cosh/e0c1de.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
cosh_e0c1de();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.hlsl b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.hlsl
index 02e0258..6cca3f0 100644
--- a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void cosh_e0c1de() {
float4 res = cosh(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
cosh_e0c1de();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.msl b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.msl
index aaf2735..9bc5d43 100644
--- a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.msl
+++ b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void cosh_e0c1de() {
float4 res = cosh(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
cosh_e0c1de();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.spvasm b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.spvasm
index 17ecea6..7c4a94e 100644
--- a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %cosh_e0c1de "cosh_e0c1de"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%cosh_e0c1de = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Cosh %12
- OpStore %res %9
+%cosh_e0c1de = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Cosh %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %cosh_e0c1de
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %cosh_e0c1de
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %cosh_e0c1de
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %cosh_e0c1de
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %cosh_e0c1de
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.wgsl b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.wgsl
index bb74a37..a7c9b7b 100644
--- a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
cosh_e0c1de();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/countOneBits/0d0e46.wgsl b/test/intrinsics/gen/countOneBits/0d0e46.wgsl
index 7dc18e7..a7376b8 100644
--- a/test/intrinsics/gen/countOneBits/0d0e46.wgsl
+++ b/test/intrinsics/gen/countOneBits/0d0e46.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
countOneBits_0d0e46();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.hlsl
index dcb86cd..3ecd142 100644
--- a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void countOneBits_0d0e46() {
uint4 res = countbits(uint4(0u, 0u, 0u, 0u));
}
-void vertex_main() {
+tint_symbol vertex_main() {
countOneBits_0d0e46();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.msl
index 54b1390..c08490e 100644
--- a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.msl
+++ b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void countOneBits_0d0e46() {
uint4 res = popcount(uint4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
countOneBits_0d0e46();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.spvasm
index e17d9f3..f55307b 100644
--- a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %countOneBits_0d0e46 "countOneBits_0d0e46"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v4uint = OpTypeVector %uint 4
- %12 = OpConstantNull %v4uint
+ %16 = OpConstantNull %v4uint
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%countOneBits_0d0e46 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %12
- %9 = OpBitCount %v4uint %12
- OpStore %res %9
+%countOneBits_0d0e46 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %16
+ %13 = OpBitCount %v4uint %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %countOneBits_0d0e46
+ %26 = OpFunctionCall %void %countOneBits_0d0e46
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %countOneBits_0d0e46
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %countOneBits_0d0e46
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %countOneBits_0d0e46
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %countOneBits_0d0e46
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.wgsl
index 561970b..bd1ed4f 100644
--- a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
countOneBits_0d0e46();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/countOneBits/0f7980.wgsl b/test/intrinsics/gen/countOneBits/0f7980.wgsl
index 6ffa27d..0c916cd 100644
--- a/test/intrinsics/gen/countOneBits/0f7980.wgsl
+++ b/test/intrinsics/gen/countOneBits/0f7980.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
countOneBits_0f7980();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.hlsl
index 1c0cab4..0b46abb 100644
--- a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void countOneBits_0f7980() {
int4 res = countbits(int4(0, 0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
countOneBits_0f7980();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.msl
index 2f29707..25b509d 100644
--- a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.msl
+++ b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void countOneBits_0f7980() {
int4 res = popcount(int4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
countOneBits_0f7980();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.spvasm
index e20c852..753cbc8 100644
--- a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %countOneBits_0f7980 "countOneBits_0f7980"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v4int = OpTypeVector %int 4
- %12 = OpConstantNull %v4int
+ %16 = OpConstantNull %v4int
%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%countOneBits_0f7980 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %12
- %9 = OpBitCount %v4int %12
- OpStore %res %9
+%countOneBits_0f7980 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %16
+ %13 = OpBitCount %v4int %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %countOneBits_0f7980
+ %26 = OpFunctionCall %void %countOneBits_0f7980
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %countOneBits_0f7980
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %countOneBits_0f7980
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %countOneBits_0f7980
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %countOneBits_0f7980
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.wgsl
index 79e2582..4daefd4 100644
--- a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
countOneBits_0f7980();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/countOneBits/65d2ae.wgsl b/test/intrinsics/gen/countOneBits/65d2ae.wgsl
index 3c07f8a..1ec2192 100644
--- a/test/intrinsics/gen/countOneBits/65d2ae.wgsl
+++ b/test/intrinsics/gen/countOneBits/65d2ae.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
countOneBits_65d2ae();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.hlsl
index 1158671..f45af04 100644
--- a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void countOneBits_65d2ae() {
int3 res = countbits(int3(0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
countOneBits_65d2ae();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.msl
index 1cf0ffd..aad3dd4 100644
--- a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.msl
+++ b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void countOneBits_65d2ae() {
int3 res = popcount(int3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
countOneBits_65d2ae();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.spvasm
index 57a52f3..165393b 100644
--- a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %countOneBits_65d2ae "countOneBits_65d2ae"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %12 = OpConstantNull %v3int
+ %16 = OpConstantNull %v3int
%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%countOneBits_65d2ae = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %12
- %9 = OpBitCount %v3int %12
- OpStore %res %9
+%countOneBits_65d2ae = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %16
+ %13 = OpBitCount %v3int %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %countOneBits_65d2ae
+ %26 = OpFunctionCall %void %countOneBits_65d2ae
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %countOneBits_65d2ae
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %countOneBits_65d2ae
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %countOneBits_65d2ae
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %countOneBits_65d2ae
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.wgsl
index 209dc7a..90ba75a 100644
--- a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
countOneBits_65d2ae();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/countOneBits/690cfc.wgsl b/test/intrinsics/gen/countOneBits/690cfc.wgsl
index f96143b..136459e 100644
--- a/test/intrinsics/gen/countOneBits/690cfc.wgsl
+++ b/test/intrinsics/gen/countOneBits/690cfc.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
countOneBits_690cfc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.hlsl
index be66422..e39e491 100644
--- a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void countOneBits_690cfc() {
uint3 res = countbits(uint3(0u, 0u, 0u));
}
-void vertex_main() {
+tint_symbol vertex_main() {
countOneBits_690cfc();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.msl
index fe38cf5..1ead1f9 100644
--- a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.msl
+++ b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void countOneBits_690cfc() {
uint3 res = popcount(uint3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
countOneBits_690cfc();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.spvasm
index 011e903..c11d998 100644
--- a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %countOneBits_690cfc "countOneBits_690cfc"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
- %12 = OpConstantNull %v3uint
+ %16 = OpConstantNull %v3uint
%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%countOneBits_690cfc = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3uint Function %12
- %9 = OpBitCount %v3uint %12
- OpStore %res %9
+%countOneBits_690cfc = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %16
+ %13 = OpBitCount %v3uint %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %countOneBits_690cfc
+ %26 = OpFunctionCall %void %countOneBits_690cfc
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %countOneBits_690cfc
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %countOneBits_690cfc
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %countOneBits_690cfc
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %countOneBits_690cfc
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.wgsl
index 3ac5ddb..7e005f8 100644
--- a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
countOneBits_690cfc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/countOneBits/94fd81.wgsl b/test/intrinsics/gen/countOneBits/94fd81.wgsl
index 368f3ea..0ce0bc3 100644
--- a/test/intrinsics/gen/countOneBits/94fd81.wgsl
+++ b/test/intrinsics/gen/countOneBits/94fd81.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
countOneBits_94fd81();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.hlsl
index 547cdad..582f6c3 100644
--- a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void countOneBits_94fd81() {
uint2 res = countbits(uint2(0u, 0u));
}
-void vertex_main() {
+tint_symbol vertex_main() {
countOneBits_94fd81();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.msl
index 8f12412..57d94f3 100644
--- a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.msl
+++ b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void countOneBits_94fd81() {
uint2 res = popcount(uint2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
countOneBits_94fd81();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.spvasm
index d388650..c5dd42e 100644
--- a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %countOneBits_94fd81 "countOneBits_94fd81"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v2uint = OpTypeVector %uint 2
- %12 = OpConstantNull %v2uint
+ %16 = OpConstantNull %v2uint
%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%countOneBits_94fd81 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2uint Function %12
- %9 = OpBitCount %v2uint %12
- OpStore %res %9
+%countOneBits_94fd81 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %16
+ %13 = OpBitCount %v2uint %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %countOneBits_94fd81
+ %26 = OpFunctionCall %void %countOneBits_94fd81
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %countOneBits_94fd81
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %countOneBits_94fd81
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %countOneBits_94fd81
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %countOneBits_94fd81
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.wgsl
index 69fa22d..2490a95 100644
--- a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
countOneBits_94fd81();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/countOneBits/ae44f9.wgsl b/test/intrinsics/gen/countOneBits/ae44f9.wgsl
index ab447ca..7379189 100644
--- a/test/intrinsics/gen/countOneBits/ae44f9.wgsl
+++ b/test/intrinsics/gen/countOneBits/ae44f9.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
countOneBits_ae44f9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.hlsl
index a9eebc6..95166f6 100644
--- a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void countOneBits_ae44f9() {
uint res = countbits(1u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
countOneBits_ae44f9();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.msl
index 4313675..8626141 100644
--- a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.msl
+++ b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void countOneBits_ae44f9() {
uint res = popcount(1u);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
countOneBits_ae44f9();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.spvasm
index 70edbdf..20b438f 100644
--- a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %countOneBits_ae44f9 "countOneBits_ae44f9"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%_ptr_Function_uint = OpTypePointer Function %uint
- %14 = OpConstantNull %uint
+ %18 = OpConstantNull %uint
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%countOneBits_ae44f9 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_uint Function %14
- %9 = OpBitCount %uint %uint_1
- OpStore %res %9
+%countOneBits_ae44f9 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %18
+ %13 = OpBitCount %uint %uint_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %countOneBits_ae44f9
+ %26 = OpFunctionCall %void %countOneBits_ae44f9
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %countOneBits_ae44f9
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %countOneBits_ae44f9
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %countOneBits_ae44f9
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %countOneBits_ae44f9
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.wgsl
index 323ceab..2d6fcb2 100644
--- a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
countOneBits_ae44f9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/countOneBits/af90e2.wgsl b/test/intrinsics/gen/countOneBits/af90e2.wgsl
index d6afd81..4eb7663 100644
--- a/test/intrinsics/gen/countOneBits/af90e2.wgsl
+++ b/test/intrinsics/gen/countOneBits/af90e2.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
countOneBits_af90e2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.hlsl
index a3c0bca..106a672 100644
--- a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void countOneBits_af90e2() {
int2 res = countbits(int2(0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
countOneBits_af90e2();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.msl
index 0c0e24b..3aeaa26 100644
--- a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.msl
+++ b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void countOneBits_af90e2() {
int2 res = popcount(int2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
countOneBits_af90e2();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.spvasm
index 1f79a2a..8e7d788 100644
--- a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %countOneBits_af90e2 "countOneBits_af90e2"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %12 = OpConstantNull %v2int
+ %16 = OpConstantNull %v2int
%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%countOneBits_af90e2 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %12
- %9 = OpBitCount %v2int %12
- OpStore %res %9
+%countOneBits_af90e2 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %16
+ %13 = OpBitCount %v2int %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %countOneBits_af90e2
+ %26 = OpFunctionCall %void %countOneBits_af90e2
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %countOneBits_af90e2
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %countOneBits_af90e2
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %countOneBits_af90e2
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %countOneBits_af90e2
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.wgsl
index 1f7759d..73f1efe 100644
--- a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
countOneBits_af90e2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/countOneBits/fd88b2.wgsl b/test/intrinsics/gen/countOneBits/fd88b2.wgsl
index c271a37..e7deb25 100644
--- a/test/intrinsics/gen/countOneBits/fd88b2.wgsl
+++ b/test/intrinsics/gen/countOneBits/fd88b2.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
countOneBits_fd88b2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.hlsl
index be5f778..91cbb87 100644
--- a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void countOneBits_fd88b2() {
int res = countbits(1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
countOneBits_fd88b2();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.msl
index 87cbb5c..7002fce 100644
--- a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.msl
+++ b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void countOneBits_fd88b2() {
int res = popcount(1);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
countOneBits_fd88b2();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.spvasm
index 32fdbfe..0030952 100644
--- a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %countOneBits_fd88b2 "countOneBits_fd88b2"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_Function_int = OpTypePointer Function %int
- %14 = OpConstantNull %int
+ %18 = OpConstantNull %int
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%countOneBits_fd88b2 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %14
- %9 = OpBitCount %int %int_1
- OpStore %res %9
+%countOneBits_fd88b2 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %18
+ %13 = OpBitCount %int %int_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %countOneBits_fd88b2
+ %26 = OpFunctionCall %void %countOneBits_fd88b2
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %countOneBits_fd88b2
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %countOneBits_fd88b2
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %countOneBits_fd88b2
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %countOneBits_fd88b2
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.wgsl
index 9e6e9e8..8f0dbd0 100644
--- a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
countOneBits_fd88b2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/cross/041cb0.wgsl b/test/intrinsics/gen/cross/041cb0.wgsl
index e2f5ddd..622c133 100644
--- a/test/intrinsics/gen/cross/041cb0.wgsl
+++ b/test/intrinsics/gen/cross/041cb0.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
cross_041cb0();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/cross/041cb0.wgsl.expected.hlsl b/test/intrinsics/gen/cross/041cb0.wgsl.expected.hlsl
index 59be0e9..0e27cd5 100644
--- a/test/intrinsics/gen/cross/041cb0.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/cross/041cb0.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void cross_041cb0() {
float3 res = cross(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
cross_041cb0();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/cross/041cb0.wgsl.expected.msl b/test/intrinsics/gen/cross/041cb0.wgsl.expected.msl
index fc8f311..a70d5f1 100644
--- a/test/intrinsics/gen/cross/041cb0.wgsl.expected.msl
+++ b/test/intrinsics/gen/cross/041cb0.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void cross_041cb0() {
float3 res = cross(float3(), float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
cross_041cb0();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/cross/041cb0.wgsl.expected.spvasm b/test/intrinsics/gen/cross/041cb0.wgsl.expected.spvasm
index e14592e..148a980 100644
--- a/test/intrinsics/gen/cross/041cb0.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/cross/041cb0.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %cross_041cb0 "cross_041cb0"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%cross_041cb0 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Cross %12 %12
- OpStore %res %9
+%cross_041cb0 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Cross %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %cross_041cb0
+ %26 = OpFunctionCall %void %cross_041cb0
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %cross_041cb0
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %cross_041cb0
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %cross_041cb0
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %cross_041cb0
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/cross/041cb0.wgsl.expected.wgsl b/test/intrinsics/gen/cross/041cb0.wgsl.expected.wgsl
index ef4b20f..9016e28 100644
--- a/test/intrinsics/gen/cross/041cb0.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/cross/041cb0.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
cross_041cb0();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/determinant/2b62ba.wgsl b/test/intrinsics/gen/determinant/2b62ba.wgsl
index 1b4b85d..3696f01 100644
--- a/test/intrinsics/gen/determinant/2b62ba.wgsl
+++ b/test/intrinsics/gen/determinant/2b62ba.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
determinant_2b62ba();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.hlsl b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.hlsl
index 45e0cf8..faf8357 100644
--- a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void determinant_2b62ba() {
float res = determinant(float3x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
determinant_2b62ba();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.msl b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.msl
index 22bfd58..d3fd820 100644
--- a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.msl
+++ b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void determinant_2b62ba() {
float res = determinant(float3x3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
determinant_2b62ba();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.spvasm b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.spvasm
index 763032a..1b4b47f 100644
--- a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %determinant_2b62ba "determinant_2b62ba"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
%mat3v3float = OpTypeMatrix %v3float 3
- %13 = OpConstantNull %mat3v3float
+ %17 = OpConstantNull %mat3v3float
%_ptr_Function_float = OpTypePointer Function %float
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%determinant_2b62ba = OpFunction %void None %5
- %8 = OpLabel
+%determinant_2b62ba = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Determinant %13
- OpStore %res %9
+ %13 = OpExtInst %float %14 Determinant %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %determinant_2b62ba
+ %27 = OpFunctionCall %void %determinant_2b62ba
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %determinant_2b62ba
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %determinant_2b62ba
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %determinant_2b62ba
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %determinant_2b62ba
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.wgsl b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.wgsl
index 0c79f28..5878b38 100644
--- a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
determinant_2b62ba();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/determinant/a0a87c.wgsl b/test/intrinsics/gen/determinant/a0a87c.wgsl
index d4d4a11..0506125 100644
--- a/test/intrinsics/gen/determinant/a0a87c.wgsl
+++ b/test/intrinsics/gen/determinant/a0a87c.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
determinant_a0a87c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.hlsl b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.hlsl
index 83bb751..f091946 100644
--- a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void determinant_a0a87c() {
float res = determinant(float4x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
determinant_a0a87c();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.msl b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.msl
index 0d17e9c..c53e2bd 100644
--- a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.msl
+++ b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void determinant_a0a87c() {
float res = determinant(float4x4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
determinant_a0a87c();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.spvasm b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.spvasm
index 44b6875..60df644 100644
--- a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.spvasm
@@ -1,54 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 34
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %determinant_a0a87c "determinant_a0a87c"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%mat4v4float = OpTypeMatrix %v4float 4
- %13 = OpConstantNull %mat4v4float
+ %16 = OpConstantNull %mat4v4float
%_ptr_Function_float = OpTypePointer Function %float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%determinant_a0a87c = OpFunction %void None %5
- %8 = OpLabel
+%determinant_a0a87c = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Determinant %13
- OpStore %res %9
+ %13 = OpExtInst %float %14 Determinant %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
- OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %determinant_a0a87c
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %determinant_a0a87c
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%vertex_main = OpFunction %void None %9
%24 = OpLabel
- %25 = OpFunctionCall %void %determinant_a0a87c
+ OpStore %tint_pointsize %float_1
+ %26 = OpFunctionCall %void %determinant_a0a87c
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %determinant_a0a87c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %determinant_a0a87c
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.wgsl b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.wgsl
index 402650f..394babb 100644
--- a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
determinant_a0a87c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/determinant/e19305.wgsl b/test/intrinsics/gen/determinant/e19305.wgsl
index 96a1fe0..02121e2 100644
--- a/test/intrinsics/gen/determinant/e19305.wgsl
+++ b/test/intrinsics/gen/determinant/e19305.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
determinant_e19305();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/determinant/e19305.wgsl.expected.hlsl b/test/intrinsics/gen/determinant/e19305.wgsl.expected.hlsl
index 90295a3..9159fdb 100644
--- a/test/intrinsics/gen/determinant/e19305.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/determinant/e19305.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void determinant_e19305() {
float res = determinant(float2x2(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
determinant_e19305();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/determinant/e19305.wgsl.expected.msl b/test/intrinsics/gen/determinant/e19305.wgsl.expected.msl
index 22919d4..025f871 100644
--- a/test/intrinsics/gen/determinant/e19305.wgsl.expected.msl
+++ b/test/intrinsics/gen/determinant/e19305.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void determinant_e19305() {
float res = determinant(float2x2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
determinant_e19305();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/determinant/e19305.wgsl.expected.spvasm b/test/intrinsics/gen/determinant/e19305.wgsl.expected.spvasm
index 80a1ded..2ce7c32 100644
--- a/test/intrinsics/gen/determinant/e19305.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/determinant/e19305.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %determinant_e19305 "determinant_e19305"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
%mat2v2float = OpTypeMatrix %v2float 2
- %13 = OpConstantNull %mat2v2float
+ %17 = OpConstantNull %mat2v2float
%_ptr_Function_float = OpTypePointer Function %float
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%determinant_e19305 = OpFunction %void None %5
- %8 = OpLabel
+%determinant_e19305 = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Determinant %13
- OpStore %res %9
+ %13 = OpExtInst %float %14 Determinant %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %determinant_e19305
+ %27 = OpFunctionCall %void %determinant_e19305
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %determinant_e19305
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %determinant_e19305
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %determinant_e19305
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %determinant_e19305
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/determinant/e19305.wgsl.expected.wgsl b/test/intrinsics/gen/determinant/e19305.wgsl.expected.wgsl
index f5cbf33..63be531 100644
--- a/test/intrinsics/gen/determinant/e19305.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/determinant/e19305.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
determinant_e19305();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/distance/0657d4.wgsl b/test/intrinsics/gen/distance/0657d4.wgsl
index 065497d..fdcb772 100644
--- a/test/intrinsics/gen/distance/0657d4.wgsl
+++ b/test/intrinsics/gen/distance/0657d4.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
distance_0657d4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/distance/0657d4.wgsl.expected.hlsl b/test/intrinsics/gen/distance/0657d4.wgsl.expected.hlsl
index 3237591..24476ae 100644
--- a/test/intrinsics/gen/distance/0657d4.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/distance/0657d4.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void distance_0657d4() {
float res = distance(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
distance_0657d4();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/distance/0657d4.wgsl.expected.msl b/test/intrinsics/gen/distance/0657d4.wgsl.expected.msl
index 5281fa5..a1f835f 100644
--- a/test/intrinsics/gen/distance/0657d4.wgsl.expected.msl
+++ b/test/intrinsics/gen/distance/0657d4.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void distance_0657d4() {
float res = distance(float3(), float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
distance_0657d4();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/distance/0657d4.wgsl.expected.spvasm b/test/intrinsics/gen/distance/0657d4.wgsl.expected.spvasm
index 510e6bb..7ed1ee6 100644
--- a/test/intrinsics/gen/distance/0657d4.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/distance/0657d4.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %distance_0657d4 "distance_0657d4"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_float = OpTypePointer Function %float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%distance_0657d4 = OpFunction %void None %5
- %8 = OpLabel
+%distance_0657d4 = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Distance %12 %12
- OpStore %res %9
+ %13 = OpExtInst %float %14 Distance %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %distance_0657d4
+ %26 = OpFunctionCall %void %distance_0657d4
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %distance_0657d4
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %distance_0657d4
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %distance_0657d4
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %distance_0657d4
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/distance/0657d4.wgsl.expected.wgsl b/test/intrinsics/gen/distance/0657d4.wgsl.expected.wgsl
index 314378f..fdc55c0 100644
--- a/test/intrinsics/gen/distance/0657d4.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/distance/0657d4.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
distance_0657d4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/distance/9646ea.wgsl b/test/intrinsics/gen/distance/9646ea.wgsl
index 9f4e7b1..9517083 100644
--- a/test/intrinsics/gen/distance/9646ea.wgsl
+++ b/test/intrinsics/gen/distance/9646ea.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
distance_9646ea();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/distance/9646ea.wgsl.expected.hlsl b/test/intrinsics/gen/distance/9646ea.wgsl.expected.hlsl
index f873195..ee84647 100644
--- a/test/intrinsics/gen/distance/9646ea.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/distance/9646ea.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void distance_9646ea() {
float res = distance(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
distance_9646ea();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/distance/9646ea.wgsl.expected.msl b/test/intrinsics/gen/distance/9646ea.wgsl.expected.msl
index 32611cd..6b6b77e 100644
--- a/test/intrinsics/gen/distance/9646ea.wgsl.expected.msl
+++ b/test/intrinsics/gen/distance/9646ea.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void distance_9646ea() {
float res = distance(float4(), float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
distance_9646ea();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/distance/9646ea.wgsl.expected.spvasm b/test/intrinsics/gen/distance/9646ea.wgsl.expected.spvasm
index d034af5..b8c7fa7 100644
--- a/test/intrinsics/gen/distance/9646ea.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/distance/9646ea.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %distance_9646ea "distance_9646ea"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_float = OpTypePointer Function %float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%distance_9646ea = OpFunction %void None %5
- %8 = OpLabel
+%distance_9646ea = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Distance %12 %12
- OpStore %res %9
+ %13 = OpExtInst %float %14 Distance %8 %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %distance_9646ea
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %distance_9646ea
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %distance_9646ea
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %distance_9646ea
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %distance_9646ea
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/distance/9646ea.wgsl.expected.wgsl b/test/intrinsics/gen/distance/9646ea.wgsl.expected.wgsl
index 39fe3d2..24ca425 100644
--- a/test/intrinsics/gen/distance/9646ea.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/distance/9646ea.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
distance_9646ea();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/distance/aa4055.wgsl b/test/intrinsics/gen/distance/aa4055.wgsl
index 8e8387a..5c208bb 100644
--- a/test/intrinsics/gen/distance/aa4055.wgsl
+++ b/test/intrinsics/gen/distance/aa4055.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
distance_aa4055();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/distance/aa4055.wgsl.expected.hlsl b/test/intrinsics/gen/distance/aa4055.wgsl.expected.hlsl
index 3f7e5a8..d23ef59 100644
--- a/test/intrinsics/gen/distance/aa4055.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/distance/aa4055.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void distance_aa4055() {
float res = distance(float2(0.0f, 0.0f), float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
distance_aa4055();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/distance/aa4055.wgsl.expected.msl b/test/intrinsics/gen/distance/aa4055.wgsl.expected.msl
index 5f2f493..bf66f8e 100644
--- a/test/intrinsics/gen/distance/aa4055.wgsl.expected.msl
+++ b/test/intrinsics/gen/distance/aa4055.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void distance_aa4055() {
float res = distance(float2(), float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
distance_aa4055();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/distance/aa4055.wgsl.expected.spvasm b/test/intrinsics/gen/distance/aa4055.wgsl.expected.spvasm
index 52ff97c..48e1a45 100644
--- a/test/intrinsics/gen/distance/aa4055.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/distance/aa4055.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %distance_aa4055 "distance_aa4055"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_float = OpTypePointer Function %float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%distance_aa4055 = OpFunction %void None %5
- %8 = OpLabel
+%distance_aa4055 = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Distance %12 %12
- OpStore %res %9
+ %13 = OpExtInst %float %14 Distance %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %distance_aa4055
+ %26 = OpFunctionCall %void %distance_aa4055
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %distance_aa4055
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %distance_aa4055
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %distance_aa4055
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %distance_aa4055
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/distance/aa4055.wgsl.expected.wgsl b/test/intrinsics/gen/distance/aa4055.wgsl.expected.wgsl
index f6f6826..8f8ad24 100644
--- a/test/intrinsics/gen/distance/aa4055.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/distance/aa4055.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
distance_aa4055();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/distance/cfed73.wgsl b/test/intrinsics/gen/distance/cfed73.wgsl
index 5fe662a..138bcc5 100644
--- a/test/intrinsics/gen/distance/cfed73.wgsl
+++ b/test/intrinsics/gen/distance/cfed73.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
distance_cfed73();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/distance/cfed73.wgsl.expected.hlsl b/test/intrinsics/gen/distance/cfed73.wgsl.expected.hlsl
index 7a90d54..82c8668 100644
--- a/test/intrinsics/gen/distance/cfed73.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/distance/cfed73.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void distance_cfed73() {
float res = distance(1.0f, 1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
distance_cfed73();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/distance/cfed73.wgsl.expected.spvasm b/test/intrinsics/gen/distance/cfed73.wgsl.expected.spvasm
index 29c44fb..8a87dee 100644
--- a/test/intrinsics/gen/distance/cfed73.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/distance/cfed73.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %distance_cfed73 "distance_cfed73"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%distance_cfed73 = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+%distance_cfed73 = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Distance %float_1 %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Distance %float_1 %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %distance_cfed73
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %distance_cfed73
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %distance_cfed73
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %distance_cfed73
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %distance_cfed73
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %distance_cfed73
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/distance/cfed73.wgsl.expected.wgsl b/test/intrinsics/gen/distance/cfed73.wgsl.expected.wgsl
index ff76b9d..4a519be 100644
--- a/test/intrinsics/gen/distance/cfed73.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/distance/cfed73.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
distance_cfed73();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/dot/0c577b.wgsl b/test/intrinsics/gen/dot/0c577b.wgsl
index 7d32e31..faf956a 100644
--- a/test/intrinsics/gen/dot/0c577b.wgsl
+++ b/test/intrinsics/gen/dot/0c577b.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
dot_0c577b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/dot/0c577b.wgsl.expected.hlsl b/test/intrinsics/gen/dot/0c577b.wgsl.expected.hlsl
index 2736edd..3da6b95 100644
--- a/test/intrinsics/gen/dot/0c577b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/dot/0c577b.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void dot_0c577b() {
float res = dot(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
dot_0c577b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/dot/0c577b.wgsl.expected.msl b/test/intrinsics/gen/dot/0c577b.wgsl.expected.msl
index 3758c7f..4ed2419 100644
--- a/test/intrinsics/gen/dot/0c577b.wgsl.expected.msl
+++ b/test/intrinsics/gen/dot/0c577b.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void dot_0c577b() {
float res = dot(float4(), float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
dot_0c577b();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/dot/0c577b.wgsl.expected.spvasm b/test/intrinsics/gen/dot/0c577b.wgsl.expected.spvasm
index 37383ec..a56518c 100644
--- a/test/intrinsics/gen/dot/0c577b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/dot/0c577b.wgsl.expected.spvasm
@@ -1,52 +1,66 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 24
+; Bound: 31
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %dot_0c577b "dot_0c577b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %11 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_float = OpTypePointer Function %float
+ %16 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %dot_0c577b = OpFunction %void None %5
- %8 = OpLabel
+ %dot_0c577b = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpDot %float %11 %11
- OpStore %res %9
+ %13 = OpDot %float %8 %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %17 = OpFunctionCall %void %dot_0c577b
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %16
+%tint_symbol = OpFunctionParameter %v4float
%19 = OpLabel
- %20 = OpFunctionCall %void %dot_0c577b
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %22 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ OpStore %tint_pointsize %float_1
%23 = OpFunctionCall %void %dot_0c577b
+ %24 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %dot_0c577b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %dot_0c577b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/dot/0c577b.wgsl.expected.wgsl b/test/intrinsics/gen/dot/0c577b.wgsl.expected.wgsl
index 09912d6..eeb08cd 100644
--- a/test/intrinsics/gen/dot/0c577b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/dot/0c577b.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
dot_0c577b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/dot/883f0e.wgsl b/test/intrinsics/gen/dot/883f0e.wgsl
index 74c9ab7..31eaa26 100644
--- a/test/intrinsics/gen/dot/883f0e.wgsl
+++ b/test/intrinsics/gen/dot/883f0e.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
dot_883f0e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/dot/883f0e.wgsl.expected.hlsl b/test/intrinsics/gen/dot/883f0e.wgsl.expected.hlsl
index c72475a..4d5aa8d 100644
--- a/test/intrinsics/gen/dot/883f0e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/dot/883f0e.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void dot_883f0e() {
float res = dot(float2(0.0f, 0.0f), float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
dot_883f0e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/dot/883f0e.wgsl.expected.msl b/test/intrinsics/gen/dot/883f0e.wgsl.expected.msl
index 260fee3..4326cad 100644
--- a/test/intrinsics/gen/dot/883f0e.wgsl.expected.msl
+++ b/test/intrinsics/gen/dot/883f0e.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void dot_883f0e() {
float res = dot(float2(), float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
dot_883f0e();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/dot/883f0e.wgsl.expected.spvasm b/test/intrinsics/gen/dot/883f0e.wgsl.expected.spvasm
index 7f313bf..f6a6f4f 100644
--- a/test/intrinsics/gen/dot/883f0e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/dot/883f0e.wgsl.expected.spvasm
@@ -1,52 +1,68 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 24
+; Bound: 33
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %dot_883f0e "dot_883f0e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %11 = OpConstantNull %v2float
+ %15 = OpConstantNull %v2float
%_ptr_Function_float = OpTypePointer Function %float
+ %18 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %dot_883f0e = OpFunction %void None %5
- %8 = OpLabel
+ %dot_883f0e = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpDot %float %11 %11
- OpStore %res %9
+ %13 = OpDot %float %15 %15
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
+ %21 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
OpStore %tint_pointsize %float_1
- %17 = OpFunctionCall %void %dot_883f0e
+ %25 = OpFunctionCall %void %dot_883f0e
+ %26 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %19 = OpLabel
- %20 = OpFunctionCall %void %dot_883f0e
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %dot_883f0e
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %22 = OpLabel
- %23 = OpFunctionCall %void %dot_883f0e
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %dot_883f0e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/dot/883f0e.wgsl.expected.wgsl b/test/intrinsics/gen/dot/883f0e.wgsl.expected.wgsl
index e0cfc73..7712379 100644
--- a/test/intrinsics/gen/dot/883f0e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/dot/883f0e.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
dot_883f0e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/dot/ba4246.wgsl b/test/intrinsics/gen/dot/ba4246.wgsl
index 11776b9..87e72fa 100644
--- a/test/intrinsics/gen/dot/ba4246.wgsl
+++ b/test/intrinsics/gen/dot/ba4246.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
dot_ba4246();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/dot/ba4246.wgsl.expected.hlsl b/test/intrinsics/gen/dot/ba4246.wgsl.expected.hlsl
index aa91fe7..8498c90 100644
--- a/test/intrinsics/gen/dot/ba4246.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/dot/ba4246.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void dot_ba4246() {
float res = dot(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
dot_ba4246();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/dot/ba4246.wgsl.expected.msl b/test/intrinsics/gen/dot/ba4246.wgsl.expected.msl
index 521557f..ff18b2d 100644
--- a/test/intrinsics/gen/dot/ba4246.wgsl.expected.msl
+++ b/test/intrinsics/gen/dot/ba4246.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void dot_ba4246() {
float res = dot(float3(), float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
dot_ba4246();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/dot/ba4246.wgsl.expected.spvasm b/test/intrinsics/gen/dot/ba4246.wgsl.expected.spvasm
index 613cb92..d522c0b 100644
--- a/test/intrinsics/gen/dot/ba4246.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/dot/ba4246.wgsl.expected.spvasm
@@ -1,52 +1,68 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 24
+; Bound: 33
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %dot_ba4246 "dot_ba4246"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %11 = OpConstantNull %v3float
+ %15 = OpConstantNull %v3float
%_ptr_Function_float = OpTypePointer Function %float
+ %18 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %dot_ba4246 = OpFunction %void None %5
- %8 = OpLabel
+ %dot_ba4246 = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpDot %float %11 %11
- OpStore %res %9
+ %13 = OpDot %float %15 %15
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
+ %21 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
OpStore %tint_pointsize %float_1
- %17 = OpFunctionCall %void %dot_ba4246
+ %25 = OpFunctionCall %void %dot_ba4246
+ %26 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %19 = OpLabel
- %20 = OpFunctionCall %void %dot_ba4246
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %dot_ba4246
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %22 = OpLabel
- %23 = OpFunctionCall %void %dot_ba4246
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %dot_ba4246
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/dot/ba4246.wgsl.expected.wgsl b/test/intrinsics/gen/dot/ba4246.wgsl.expected.wgsl
index a17c295..ad9f415 100644
--- a/test/intrinsics/gen/dot/ba4246.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/dot/ba4246.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
dot_ba4246();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/exp/0f70eb.wgsl b/test/intrinsics/gen/exp/0f70eb.wgsl
index a5de8fe..3447d81 100644
--- a/test/intrinsics/gen/exp/0f70eb.wgsl
+++ b/test/intrinsics/gen/exp/0f70eb.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
exp_0f70eb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.hlsl b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.hlsl
index 2739620..d9e0f37 100644
--- a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void exp_0f70eb() {
float4 res = exp(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
exp_0f70eb();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.msl b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.msl
index f019d60..53549b7 100644
--- a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.msl
+++ b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void exp_0f70eb() {
float4 res = exp(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
exp_0f70eb();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.spvasm b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.spvasm
index f331531..e82f059 100644
--- a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %exp_0f70eb "exp_0f70eb"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %exp_0f70eb = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Exp %12
- OpStore %res %9
+ %exp_0f70eb = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Exp %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %exp_0f70eb
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %exp_0f70eb
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %exp_0f70eb
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %exp_0f70eb
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %exp_0f70eb
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.wgsl b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.wgsl
index fcd1bf3..157d0ea 100644
--- a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
exp_0f70eb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/exp/1951e7.wgsl b/test/intrinsics/gen/exp/1951e7.wgsl
index 4377980..acd4e66 100644
--- a/test/intrinsics/gen/exp/1951e7.wgsl
+++ b/test/intrinsics/gen/exp/1951e7.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
exp_1951e7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/exp/1951e7.wgsl.expected.hlsl b/test/intrinsics/gen/exp/1951e7.wgsl.expected.hlsl
index a58d3e9..d080449 100644
--- a/test/intrinsics/gen/exp/1951e7.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/exp/1951e7.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void exp_1951e7() {
float2 res = exp(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
exp_1951e7();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/exp/1951e7.wgsl.expected.msl b/test/intrinsics/gen/exp/1951e7.wgsl.expected.msl
index 298ce08..726f80d 100644
--- a/test/intrinsics/gen/exp/1951e7.wgsl.expected.msl
+++ b/test/intrinsics/gen/exp/1951e7.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void exp_1951e7() {
float2 res = exp(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
exp_1951e7();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/exp/1951e7.wgsl.expected.spvasm b/test/intrinsics/gen/exp/1951e7.wgsl.expected.spvasm
index 61f4ab3..5439298 100644
--- a/test/intrinsics/gen/exp/1951e7.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/exp/1951e7.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %exp_1951e7 "exp_1951e7"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %exp_1951e7 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Exp %12
- OpStore %res %9
+ %exp_1951e7 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Exp %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %exp_1951e7
+ %26 = OpFunctionCall %void %exp_1951e7
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %exp_1951e7
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %exp_1951e7
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %exp_1951e7
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %exp_1951e7
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/exp/1951e7.wgsl.expected.wgsl b/test/intrinsics/gen/exp/1951e7.wgsl.expected.wgsl
index 3457951..618eb2c 100644
--- a/test/intrinsics/gen/exp/1951e7.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/exp/1951e7.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
exp_1951e7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/exp/771fd2.wgsl b/test/intrinsics/gen/exp/771fd2.wgsl
index 6138fb4..6c73d35 100644
--- a/test/intrinsics/gen/exp/771fd2.wgsl
+++ b/test/intrinsics/gen/exp/771fd2.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
exp_771fd2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/exp/771fd2.wgsl.expected.hlsl b/test/intrinsics/gen/exp/771fd2.wgsl.expected.hlsl
index 8c34c09..d6259fe 100644
--- a/test/intrinsics/gen/exp/771fd2.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/exp/771fd2.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void exp_771fd2() {
float res = exp(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
exp_771fd2();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/exp/771fd2.wgsl.expected.msl b/test/intrinsics/gen/exp/771fd2.wgsl.expected.msl
index 17e6c84..0a161db 100644
--- a/test/intrinsics/gen/exp/771fd2.wgsl.expected.msl
+++ b/test/intrinsics/gen/exp/771fd2.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void exp_771fd2() {
float res = exp(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
exp_771fd2();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/exp/771fd2.wgsl.expected.spvasm b/test/intrinsics/gen/exp/771fd2.wgsl.expected.spvasm
index cbfdf1c..5100cd0 100644
--- a/test/intrinsics/gen/exp/771fd2.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/exp/771fd2.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %exp_771fd2 "exp_771fd2"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
- %exp_771fd2 = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+ %exp_771fd2 = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Exp %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Exp %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %exp_771fd2
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %exp_771fd2
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %exp_771fd2
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %exp_771fd2
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %exp_771fd2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %exp_771fd2
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/exp/771fd2.wgsl.expected.wgsl b/test/intrinsics/gen/exp/771fd2.wgsl.expected.wgsl
index ca36b2c..6034699 100644
--- a/test/intrinsics/gen/exp/771fd2.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/exp/771fd2.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
exp_771fd2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/exp/d98450.wgsl b/test/intrinsics/gen/exp/d98450.wgsl
index 754d43a..078a208 100644
--- a/test/intrinsics/gen/exp/d98450.wgsl
+++ b/test/intrinsics/gen/exp/d98450.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
exp_d98450();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/exp/d98450.wgsl.expected.hlsl b/test/intrinsics/gen/exp/d98450.wgsl.expected.hlsl
index 1587672..d9ed452 100644
--- a/test/intrinsics/gen/exp/d98450.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/exp/d98450.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void exp_d98450() {
float3 res = exp(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
exp_d98450();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/exp/d98450.wgsl.expected.msl b/test/intrinsics/gen/exp/d98450.wgsl.expected.msl
index 7e0df49..1ec8727 100644
--- a/test/intrinsics/gen/exp/d98450.wgsl.expected.msl
+++ b/test/intrinsics/gen/exp/d98450.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void exp_d98450() {
float3 res = exp(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
exp_d98450();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/exp/d98450.wgsl.expected.spvasm b/test/intrinsics/gen/exp/d98450.wgsl.expected.spvasm
index 45cdde1..448017c 100644
--- a/test/intrinsics/gen/exp/d98450.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/exp/d98450.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %exp_d98450 "exp_d98450"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %exp_d98450 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Exp %12
- OpStore %res %9
+ %exp_d98450 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Exp %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %exp_d98450
+ %26 = OpFunctionCall %void %exp_d98450
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %exp_d98450
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %exp_d98450
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %exp_d98450
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %exp_d98450
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/exp/d98450.wgsl.expected.wgsl b/test/intrinsics/gen/exp/d98450.wgsl.expected.wgsl
index 3423169..332a462 100644
--- a/test/intrinsics/gen/exp/d98450.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/exp/d98450.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
exp_d98450();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/exp2/1f8680.wgsl b/test/intrinsics/gen/exp2/1f8680.wgsl
index ec8cb20..91fead5 100644
--- a/test/intrinsics/gen/exp2/1f8680.wgsl
+++ b/test/intrinsics/gen/exp2/1f8680.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
exp2_1f8680();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.hlsl b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.hlsl
index ca91ba5..5bc943f 100644
--- a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void exp2_1f8680() {
float3 res = exp2(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
exp2_1f8680();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.msl b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.msl
index fb80ff7..057b984 100644
--- a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.msl
+++ b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void exp2_1f8680() {
float3 res = exp2(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
exp2_1f8680();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.spvasm b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.spvasm
index 1b944c1..6e672de 100644
--- a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %exp2_1f8680 "exp2_1f8680"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%exp2_1f8680 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Exp2 %12
- OpStore %res %9
+%exp2_1f8680 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Exp2 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %exp2_1f8680
+ %26 = OpFunctionCall %void %exp2_1f8680
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %exp2_1f8680
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %exp2_1f8680
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %exp2_1f8680
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %exp2_1f8680
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.wgsl b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.wgsl
index 6d20071..a7bc4ba 100644
--- a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
exp2_1f8680();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/exp2/a9d0a7.wgsl b/test/intrinsics/gen/exp2/a9d0a7.wgsl
index d5e4df5..37cb66e 100644
--- a/test/intrinsics/gen/exp2/a9d0a7.wgsl
+++ b/test/intrinsics/gen/exp2/a9d0a7.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
exp2_a9d0a7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.hlsl b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.hlsl
index 6dfb8b8..9ddf6d9 100644
--- a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void exp2_a9d0a7() {
float4 res = exp2(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
exp2_a9d0a7();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.msl b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.msl
index f6114d4..ed2faac 100644
--- a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.msl
+++ b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void exp2_a9d0a7() {
float4 res = exp2(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
exp2_a9d0a7();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.spvasm b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.spvasm
index 6360aea..1193c23 100644
--- a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %exp2_a9d0a7 "exp2_a9d0a7"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%exp2_a9d0a7 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Exp2 %12
- OpStore %res %9
+%exp2_a9d0a7 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Exp2 %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %exp2_a9d0a7
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %exp2_a9d0a7
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %exp2_a9d0a7
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %exp2_a9d0a7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %exp2_a9d0a7
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.wgsl b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.wgsl
index 415b612..4a2227a 100644
--- a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
exp2_a9d0a7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/exp2/d6777c.wgsl b/test/intrinsics/gen/exp2/d6777c.wgsl
index 5e5cecb..337db93 100644
--- a/test/intrinsics/gen/exp2/d6777c.wgsl
+++ b/test/intrinsics/gen/exp2/d6777c.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
exp2_d6777c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.hlsl b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.hlsl
index 1a7cb5f..5354c3c 100644
--- a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void exp2_d6777c() {
float2 res = exp2(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
exp2_d6777c();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.msl b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.msl
index 48a5a46..6149c4d 100644
--- a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.msl
+++ b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void exp2_d6777c() {
float2 res = exp2(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
exp2_d6777c();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.spvasm b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.spvasm
index 4667d68..571bff0 100644
--- a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %exp2_d6777c "exp2_d6777c"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%exp2_d6777c = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Exp2 %12
- OpStore %res %9
+%exp2_d6777c = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Exp2 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %exp2_d6777c
+ %26 = OpFunctionCall %void %exp2_d6777c
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %exp2_d6777c
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %exp2_d6777c
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %exp2_d6777c
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %exp2_d6777c
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.wgsl b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.wgsl
index 189d7be..9f32c15 100644
--- a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
exp2_d6777c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/exp2/dea523.wgsl b/test/intrinsics/gen/exp2/dea523.wgsl
index 6c03918..a863fd9 100644
--- a/test/intrinsics/gen/exp2/dea523.wgsl
+++ b/test/intrinsics/gen/exp2/dea523.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
exp2_dea523();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/exp2/dea523.wgsl.expected.hlsl b/test/intrinsics/gen/exp2/dea523.wgsl.expected.hlsl
index 8b75b70..8ceb49d 100644
--- a/test/intrinsics/gen/exp2/dea523.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/exp2/dea523.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void exp2_dea523() {
float res = exp2(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
exp2_dea523();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/exp2/dea523.wgsl.expected.msl b/test/intrinsics/gen/exp2/dea523.wgsl.expected.msl
index d18c2ef..491945c 100644
--- a/test/intrinsics/gen/exp2/dea523.wgsl.expected.msl
+++ b/test/intrinsics/gen/exp2/dea523.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void exp2_dea523() {
float res = exp2(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
exp2_dea523();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/exp2/dea523.wgsl.expected.spvasm b/test/intrinsics/gen/exp2/dea523.wgsl.expected.spvasm
index 9ae8c98..dbeb361 100644
--- a/test/intrinsics/gen/exp2/dea523.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/exp2/dea523.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %exp2_dea523 "exp2_dea523"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%exp2_dea523 = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+%exp2_dea523 = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Exp2 %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Exp2 %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %exp2_dea523
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %exp2_dea523
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %exp2_dea523
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %exp2_dea523
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %exp2_dea523
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %exp2_dea523
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/exp2/dea523.wgsl.expected.wgsl b/test/intrinsics/gen/exp2/dea523.wgsl.expected.wgsl
index 136bc62..d6ca4f8 100644
--- a/test/intrinsics/gen/exp2/dea523.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/exp2/dea523.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
exp2_dea523();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/faceForward/5afbd5.wgsl b/test/intrinsics/gen/faceForward/5afbd5.wgsl
index e72c377..7d5ce9d 100644
--- a/test/intrinsics/gen/faceForward/5afbd5.wgsl
+++ b/test/intrinsics/gen/faceForward/5afbd5.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
faceForward_5afbd5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.hlsl b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.hlsl
index 9df71d6..c1705ac 100644
--- a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void faceForward_5afbd5() {
float3 res = faceforward(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
faceForward_5afbd5();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.msl b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.msl
index 4a95173..fcd07b6 100644
--- a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.msl
+++ b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void faceForward_5afbd5() {
float3 res = faceforward(float3(), float3(), float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
faceForward_5afbd5();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.spvasm b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.spvasm
index 90d4263..6fc0f18 100644
--- a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %faceForward_5afbd5 "faceForward_5afbd5"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%faceForward_5afbd5 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 FaceForward %12 %12 %12
- OpStore %res %9
+%faceForward_5afbd5 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 FaceForward %16 %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %faceForward_5afbd5
+ %26 = OpFunctionCall %void %faceForward_5afbd5
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %faceForward_5afbd5
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %faceForward_5afbd5
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %faceForward_5afbd5
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %faceForward_5afbd5
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.wgsl b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.wgsl
index 901d9f3..6f67502 100644
--- a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
faceForward_5afbd5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/faceForward/b316e5.wgsl b/test/intrinsics/gen/faceForward/b316e5.wgsl
index fb7a156..6a9c5cd 100644
--- a/test/intrinsics/gen/faceForward/b316e5.wgsl
+++ b/test/intrinsics/gen/faceForward/b316e5.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
faceForward_b316e5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.hlsl b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.hlsl
index c02347c..ad2397c 100644
--- a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void faceForward_b316e5() {
float4 res = faceforward(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
faceForward_b316e5();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.msl b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.msl
index 71972d7..1048b00 100644
--- a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.msl
+++ b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void faceForward_b316e5() {
float4 res = faceforward(float4(), float4(), float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
faceForward_b316e5();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.spvasm b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.spvasm
index 163e751..07f0358 100644
--- a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %faceForward_b316e5 "faceForward_b316e5"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%faceForward_b316e5 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 FaceForward %12 %12 %12
- OpStore %res %9
+%faceForward_b316e5 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 FaceForward %8 %8 %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %faceForward_b316e5
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %faceForward_b316e5
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %faceForward_b316e5
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %faceForward_b316e5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %faceForward_b316e5
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.wgsl b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.wgsl
index 904f610..b4b5130 100644
--- a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
faceForward_b316e5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/faceForward/e6908b.wgsl b/test/intrinsics/gen/faceForward/e6908b.wgsl
index deb3846..618f90e 100644
--- a/test/intrinsics/gen/faceForward/e6908b.wgsl
+++ b/test/intrinsics/gen/faceForward/e6908b.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
faceForward_e6908b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.hlsl b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.hlsl
index de0f89e..1f4c927 100644
--- a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void faceForward_e6908b() {
float2 res = faceforward(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
faceForward_e6908b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.msl b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.msl
index 2cfdf0e..ca8e6ef 100644
--- a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.msl
+++ b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void faceForward_e6908b() {
float2 res = faceforward(float2(), float2(), float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
faceForward_e6908b();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.spvasm b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.spvasm
index 861015d..8e98dee 100644
--- a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %faceForward_e6908b "faceForward_e6908b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%faceForward_e6908b = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 FaceForward %12 %12 %12
- OpStore %res %9
+%faceForward_e6908b = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 FaceForward %16 %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %faceForward_e6908b
+ %26 = OpFunctionCall %void %faceForward_e6908b
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %faceForward_e6908b
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %faceForward_e6908b
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %faceForward_e6908b
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %faceForward_e6908b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.wgsl b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.wgsl
index f232df2..d371e9d 100644
--- a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
faceForward_e6908b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/faceForward/fc994b.wgsl b/test/intrinsics/gen/faceForward/fc994b.wgsl
index 0616792..2872488 100644
--- a/test/intrinsics/gen/faceForward/fc994b.wgsl
+++ b/test/intrinsics/gen/faceForward/fc994b.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
faceForward_fc994b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.hlsl b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.hlsl
index 88f1341..9516896 100644
--- a/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void faceForward_fc994b() {
float res = faceforward(1.0f, 1.0f, 1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
faceForward_fc994b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.spvasm b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.spvasm
index fc9853e..17367a4 100644
--- a/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %faceForward_fc994b "faceForward_fc994b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%faceForward_fc994b = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+%faceForward_fc994b = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 FaceForward %float_1 %float_1 %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 FaceForward %float_1 %float_1 %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %faceForward_fc994b
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %faceForward_fc994b
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %faceForward_fc994b
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %faceForward_fc994b
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %faceForward_fc994b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %faceForward_fc994b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.wgsl b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.wgsl
index 3dc67f3..903874a 100644
--- a/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
faceForward_fc994b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/floor/3bccc4.wgsl b/test/intrinsics/gen/floor/3bccc4.wgsl
index c5a4e52..c1a54d8 100644
--- a/test/intrinsics/gen/floor/3bccc4.wgsl
+++ b/test/intrinsics/gen/floor/3bccc4.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
floor_3bccc4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.hlsl b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.hlsl
index 529d56a..4a90889 100644
--- a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void floor_3bccc4() {
float4 res = floor(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
floor_3bccc4();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.msl b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.msl
index 5b5e7e4..7802674 100644
--- a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.msl
+++ b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void floor_3bccc4() {
float4 res = floor(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
floor_3bccc4();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.spvasm b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.spvasm
index baf11b1..634a08a 100644
--- a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %floor_3bccc4 "floor_3bccc4"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%floor_3bccc4 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Floor %12
- OpStore %res %9
+%floor_3bccc4 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Floor %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %floor_3bccc4
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %floor_3bccc4
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %floor_3bccc4
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %floor_3bccc4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %floor_3bccc4
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.wgsl b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.wgsl
index 574e6b1..aed6b00 100644
--- a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
floor_3bccc4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/floor/5fc9ac.wgsl b/test/intrinsics/gen/floor/5fc9ac.wgsl
index 06d4b49..1d06253 100644
--- a/test/intrinsics/gen/floor/5fc9ac.wgsl
+++ b/test/intrinsics/gen/floor/5fc9ac.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
floor_5fc9ac();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.hlsl b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.hlsl
index 241394d..dc36184 100644
--- a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void floor_5fc9ac() {
float2 res = floor(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
floor_5fc9ac();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.msl b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.msl
index c337a9c..36b78f8 100644
--- a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.msl
+++ b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void floor_5fc9ac() {
float2 res = floor(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
floor_5fc9ac();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.spvasm b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.spvasm
index 81c4d3b..9d25150 100644
--- a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %floor_5fc9ac "floor_5fc9ac"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%floor_5fc9ac = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Floor %12
- OpStore %res %9
+%floor_5fc9ac = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Floor %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %floor_5fc9ac
+ %26 = OpFunctionCall %void %floor_5fc9ac
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %floor_5fc9ac
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %floor_5fc9ac
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %floor_5fc9ac
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %floor_5fc9ac
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.wgsl b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.wgsl
index 40d3dcb..604a9a8 100644
--- a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
floor_5fc9ac();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/floor/60d7ea.wgsl b/test/intrinsics/gen/floor/60d7ea.wgsl
index e04571b..72519ad 100644
--- a/test/intrinsics/gen/floor/60d7ea.wgsl
+++ b/test/intrinsics/gen/floor/60d7ea.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
floor_60d7ea();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.hlsl b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.hlsl
index 85d68ae..1fd8e71 100644
--- a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void floor_60d7ea() {
float3 res = floor(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
floor_60d7ea();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.msl b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.msl
index 3cb741a..95b42aa 100644
--- a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.msl
+++ b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void floor_60d7ea() {
float3 res = floor(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
floor_60d7ea();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.spvasm b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.spvasm
index 28b16f2..77ecc59 100644
--- a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %floor_60d7ea "floor_60d7ea"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%floor_60d7ea = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Floor %12
- OpStore %res %9
+%floor_60d7ea = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Floor %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %floor_60d7ea
+ %26 = OpFunctionCall %void %floor_60d7ea
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %floor_60d7ea
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %floor_60d7ea
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %floor_60d7ea
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %floor_60d7ea
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.wgsl b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.wgsl
index f21f972..70593b9 100644
--- a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
floor_60d7ea();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/floor/66f154.wgsl b/test/intrinsics/gen/floor/66f154.wgsl
index d0f5f33..aad7b62 100644
--- a/test/intrinsics/gen/floor/66f154.wgsl
+++ b/test/intrinsics/gen/floor/66f154.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
floor_66f154();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/floor/66f154.wgsl.expected.hlsl b/test/intrinsics/gen/floor/66f154.wgsl.expected.hlsl
index 7fb4b6d..dc573b6 100644
--- a/test/intrinsics/gen/floor/66f154.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/floor/66f154.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void floor_66f154() {
float res = floor(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
floor_66f154();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/floor/66f154.wgsl.expected.msl b/test/intrinsics/gen/floor/66f154.wgsl.expected.msl
index 4f57a10..c93a90e 100644
--- a/test/intrinsics/gen/floor/66f154.wgsl.expected.msl
+++ b/test/intrinsics/gen/floor/66f154.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void floor_66f154() {
float res = floor(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
floor_66f154();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/floor/66f154.wgsl.expected.spvasm b/test/intrinsics/gen/floor/66f154.wgsl.expected.spvasm
index ea32487..76ab1fd 100644
--- a/test/intrinsics/gen/floor/66f154.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/floor/66f154.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %floor_66f154 "floor_66f154"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%floor_66f154 = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+%floor_66f154 = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Floor %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Floor %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %floor_66f154
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %floor_66f154
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %floor_66f154
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %floor_66f154
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %floor_66f154
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %floor_66f154
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/floor/66f154.wgsl.expected.wgsl b/test/intrinsics/gen/floor/66f154.wgsl.expected.wgsl
index 0dc4d13..efa80cd 100644
--- a/test/intrinsics/gen/floor/66f154.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/floor/66f154.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
floor_66f154();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fma/26a7a9.wgsl b/test/intrinsics/gen/fma/26a7a9.wgsl
index 2660eeb..3f65bf1 100644
--- a/test/intrinsics/gen/fma/26a7a9.wgsl
+++ b/test/intrinsics/gen/fma/26a7a9.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fma_26a7a9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fma/26a7a9.wgsl.expected.msl b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.msl
index a1a1a5e..2acc8ac 100644
--- a/test/intrinsics/gen/fma/26a7a9.wgsl.expected.msl
+++ b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void fma_26a7a9() {
float2 res = fma(float2(), float2(), float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
fma_26a7a9();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/fma/26a7a9.wgsl.expected.spvasm b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.spvasm
index 89f91ac..888ebb3 100644
--- a/test/intrinsics/gen/fma/26a7a9.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %fma_26a7a9 "fma_26a7a9"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %fma_26a7a9 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Fma %12 %12 %12
- OpStore %res %9
+ %fma_26a7a9 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Fma %16 %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %fma_26a7a9
+ %26 = OpFunctionCall %void %fma_26a7a9
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %fma_26a7a9
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %fma_26a7a9
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %fma_26a7a9
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %fma_26a7a9
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/fma/26a7a9.wgsl.expected.wgsl b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.wgsl
index aab4068..7a261aa 100644
--- a/test/intrinsics/gen/fma/26a7a9.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fma_26a7a9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fma/6a3283.wgsl b/test/intrinsics/gen/fma/6a3283.wgsl
index 8ec1137..12df6a4 100644
--- a/test/intrinsics/gen/fma/6a3283.wgsl
+++ b/test/intrinsics/gen/fma/6a3283.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fma_6a3283();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fma/6a3283.wgsl.expected.msl b/test/intrinsics/gen/fma/6a3283.wgsl.expected.msl
index c45bd40..962630d 100644
--- a/test/intrinsics/gen/fma/6a3283.wgsl.expected.msl
+++ b/test/intrinsics/gen/fma/6a3283.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void fma_6a3283() {
float4 res = fma(float4(), float4(), float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
fma_6a3283();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/fma/6a3283.wgsl.expected.spvasm b/test/intrinsics/gen/fma/6a3283.wgsl.expected.spvasm
index 160fecc..5fd44fa 100644
--- a/test/intrinsics/gen/fma/6a3283.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/fma/6a3283.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %fma_6a3283 "fma_6a3283"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %fma_6a3283 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Fma %12 %12 %12
- OpStore %res %9
+ %fma_6a3283 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Fma %8 %8 %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %fma_6a3283
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %fma_6a3283
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %fma_6a3283
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %fma_6a3283
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %fma_6a3283
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/fma/6a3283.wgsl.expected.wgsl b/test/intrinsics/gen/fma/6a3283.wgsl.expected.wgsl
index f8e9f34..486fc18 100644
--- a/test/intrinsics/gen/fma/6a3283.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/fma/6a3283.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fma_6a3283();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fma/c10ba3.wgsl b/test/intrinsics/gen/fma/c10ba3.wgsl
index 9bc8727..ba357a5 100644
--- a/test/intrinsics/gen/fma/c10ba3.wgsl
+++ b/test/intrinsics/gen/fma/c10ba3.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fma_c10ba3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fma/c10ba3.wgsl.expected.msl b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.msl
index 0ad9e9c..b0409f3 100644
--- a/test/intrinsics/gen/fma/c10ba3.wgsl.expected.msl
+++ b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void fma_c10ba3() {
float res = fma(1.0f, 1.0f, 1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
fma_c10ba3();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/fma/c10ba3.wgsl.expected.spvasm b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.spvasm
index cd28d8e..96b804d 100644
--- a/test/intrinsics/gen/fma/c10ba3.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %fma_c10ba3 "fma_c10ba3"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
- %fma_c10ba3 = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+ %fma_c10ba3 = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Fma %float_1 %float_1 %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Fma %float_1 %float_1 %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %fma_c10ba3
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %fma_c10ba3
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %fma_c10ba3
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %fma_c10ba3
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %fma_c10ba3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %fma_c10ba3
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/fma/c10ba3.wgsl.expected.wgsl b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.wgsl
index 58f5b94..8b26867 100644
--- a/test/intrinsics/gen/fma/c10ba3.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fma_c10ba3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fma/e17c5c.wgsl b/test/intrinsics/gen/fma/e17c5c.wgsl
index 2f788d3..5e85b45 100644
--- a/test/intrinsics/gen/fma/e17c5c.wgsl
+++ b/test/intrinsics/gen/fma/e17c5c.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fma_e17c5c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fma/e17c5c.wgsl.expected.msl b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.msl
index fb58389..c40dff0 100644
--- a/test/intrinsics/gen/fma/e17c5c.wgsl.expected.msl
+++ b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void fma_e17c5c() {
float3 res = fma(float3(), float3(), float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
fma_e17c5c();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/fma/e17c5c.wgsl.expected.spvasm b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.spvasm
index f533975..88e17ec 100644
--- a/test/intrinsics/gen/fma/e17c5c.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %fma_e17c5c "fma_e17c5c"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %fma_e17c5c = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Fma %12 %12 %12
- OpStore %res %9
+ %fma_e17c5c = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Fma %16 %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %fma_e17c5c
+ %26 = OpFunctionCall %void %fma_e17c5c
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %fma_e17c5c
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %fma_e17c5c
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %fma_e17c5c
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %fma_e17c5c
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/fma/e17c5c.wgsl.expected.wgsl b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.wgsl
index 23ed6e2..36f4d35 100644
--- a/test/intrinsics/gen/fma/e17c5c.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fma_e17c5c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fract/8bc1e9.wgsl b/test/intrinsics/gen/fract/8bc1e9.wgsl
index 7c2e38b..ae41fa7 100644
--- a/test/intrinsics/gen/fract/8bc1e9.wgsl
+++ b/test/intrinsics/gen/fract/8bc1e9.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fract_8bc1e9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.hlsl b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.hlsl
index 5cf8141..3dcf051 100644
--- a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void fract_8bc1e9() {
float4 res = frac(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
fract_8bc1e9();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.msl b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.msl
index cd30c06..d4d52b2 100644
--- a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.msl
+++ b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void fract_8bc1e9() {
float4 res = fract(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
fract_8bc1e9();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.spvasm b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.spvasm
index bb69bbd..49901a7 100644
--- a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %fract_8bc1e9 "fract_8bc1e9"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%fract_8bc1e9 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Fract %12
- OpStore %res %9
+%fract_8bc1e9 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Fract %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %fract_8bc1e9
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %fract_8bc1e9
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %fract_8bc1e9
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %fract_8bc1e9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %fract_8bc1e9
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.wgsl b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.wgsl
index 5107174..84583e0 100644
--- a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fract_8bc1e9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fract/943cb1.wgsl b/test/intrinsics/gen/fract/943cb1.wgsl
index 754cd7d..8aa8d3c 100644
--- a/test/intrinsics/gen/fract/943cb1.wgsl
+++ b/test/intrinsics/gen/fract/943cb1.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fract_943cb1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fract/943cb1.wgsl.expected.hlsl b/test/intrinsics/gen/fract/943cb1.wgsl.expected.hlsl
index 4a9152d..413bae4 100644
--- a/test/intrinsics/gen/fract/943cb1.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/fract/943cb1.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void fract_943cb1() {
float2 res = frac(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
fract_943cb1();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/fract/943cb1.wgsl.expected.msl b/test/intrinsics/gen/fract/943cb1.wgsl.expected.msl
index 8df4530..1c89583 100644
--- a/test/intrinsics/gen/fract/943cb1.wgsl.expected.msl
+++ b/test/intrinsics/gen/fract/943cb1.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void fract_943cb1() {
float2 res = fract(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
fract_943cb1();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/fract/943cb1.wgsl.expected.spvasm b/test/intrinsics/gen/fract/943cb1.wgsl.expected.spvasm
index e1b7965..105eb76 100644
--- a/test/intrinsics/gen/fract/943cb1.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/fract/943cb1.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %fract_943cb1 "fract_943cb1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%fract_943cb1 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Fract %12
- OpStore %res %9
+%fract_943cb1 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Fract %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %fract_943cb1
+ %26 = OpFunctionCall %void %fract_943cb1
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %fract_943cb1
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %fract_943cb1
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %fract_943cb1
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %fract_943cb1
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/fract/943cb1.wgsl.expected.wgsl b/test/intrinsics/gen/fract/943cb1.wgsl.expected.wgsl
index 88db883..89412b0 100644
--- a/test/intrinsics/gen/fract/943cb1.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/fract/943cb1.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fract_943cb1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fract/a49758.wgsl b/test/intrinsics/gen/fract/a49758.wgsl
index d5f4528..dbbaebf 100644
--- a/test/intrinsics/gen/fract/a49758.wgsl
+++ b/test/intrinsics/gen/fract/a49758.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fract_a49758();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fract/a49758.wgsl.expected.hlsl b/test/intrinsics/gen/fract/a49758.wgsl.expected.hlsl
index 4f27c5f..e5f9476 100644
--- a/test/intrinsics/gen/fract/a49758.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/fract/a49758.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void fract_a49758() {
float3 res = frac(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
fract_a49758();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/fract/a49758.wgsl.expected.msl b/test/intrinsics/gen/fract/a49758.wgsl.expected.msl
index 6c302f2..400fc0a 100644
--- a/test/intrinsics/gen/fract/a49758.wgsl.expected.msl
+++ b/test/intrinsics/gen/fract/a49758.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void fract_a49758() {
float3 res = fract(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
fract_a49758();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/fract/a49758.wgsl.expected.spvasm b/test/intrinsics/gen/fract/a49758.wgsl.expected.spvasm
index ef18a35..48289e6 100644
--- a/test/intrinsics/gen/fract/a49758.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/fract/a49758.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %fract_a49758 "fract_a49758"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%fract_a49758 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Fract %12
- OpStore %res %9
+%fract_a49758 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Fract %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %fract_a49758
+ %26 = OpFunctionCall %void %fract_a49758
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %fract_a49758
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %fract_a49758
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %fract_a49758
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %fract_a49758
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/fract/a49758.wgsl.expected.wgsl b/test/intrinsics/gen/fract/a49758.wgsl.expected.wgsl
index f20dc80..3423d08 100644
--- a/test/intrinsics/gen/fract/a49758.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/fract/a49758.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fract_a49758();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fract/fa5c71.wgsl b/test/intrinsics/gen/fract/fa5c71.wgsl
index 26b513a..3b3c84f 100644
--- a/test/intrinsics/gen/fract/fa5c71.wgsl
+++ b/test/intrinsics/gen/fract/fa5c71.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fract_fa5c71();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.hlsl b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.hlsl
index 927ec31..97a0ec5 100644
--- a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void fract_fa5c71() {
float res = frac(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
fract_fa5c71();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.msl b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.msl
index 5f113c2..5d6f2fc 100644
--- a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.msl
+++ b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void fract_fa5c71() {
float res = fract(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
fract_fa5c71();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.spvasm b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.spvasm
index 5003c11..09d3f99 100644
--- a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %fract_fa5c71 "fract_fa5c71"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%fract_fa5c71 = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+%fract_fa5c71 = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Fract %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Fract %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %fract_fa5c71
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %fract_fa5c71
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %fract_fa5c71
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %fract_fa5c71
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %fract_fa5c71
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %fract_fa5c71
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.wgsl b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.wgsl
index c2bed7c..7b9f9e9 100644
--- a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fract_fa5c71();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/frexp/1d6b62.wgsl b/test/intrinsics/gen/frexp/1d6b62.wgsl
index 485a26d..c790bd0 100644
--- a/test/intrinsics/gen/frexp/1d6b62.wgsl
+++ b/test/intrinsics/gen/frexp/1d6b62.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
frexp_1d6b62();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.spvasm
index f697f59..3342c71 100644
--- a/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.spvasm
@@ -1,59 +1,75 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
- %16 = OpExtInstImport "GLSL.std.450"
+ %20 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %frexp_1d6b62 "frexp_1d6b62"
OpName %arg_1 "arg_1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %13 = OpConstantNull %v2int
+ %17 = OpConstantNull %v2int
%v2float = OpTypeVector %float 2
- %17 = OpConstantNull %v2float
+ %21 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%frexp_1d6b62 = OpFunction %void None %5
- %8 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_v2int Function %13
- %res = OpVariable %_ptr_Function_v2float Function %17
- %14 = OpExtInst %v2float %16 Frexp %17 %arg_1
- OpStore %res %14
+%frexp_1d6b62 = OpFunction %void None %9
+ %12 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2int Function %17
+ %res = OpVariable %_ptr_Function_v2float Function %21
+ %18 = OpExtInst %v2float %20 Frexp %21 %arg_1
+ OpStore %res %18
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %frexp_1d6b62
+ %32 = OpFunctionCall %void %frexp_1d6b62
+ %33 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %26 = OpLabel
- %27 = OpFunctionCall %void %frexp_1d6b62
+%fragment_main = OpFunction %void None %9
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %frexp_1d6b62
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %29 = OpLabel
- %30 = OpFunctionCall %void %frexp_1d6b62
+%compute_main = OpFunction %void None %9
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %frexp_1d6b62
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.wgsl
index 9222be8..bc2e1ab 100644
--- a/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.wgsl
@@ -4,8 +4,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
frexp_1d6b62();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/frexp/2507b2.wgsl b/test/intrinsics/gen/frexp/2507b2.wgsl
index 6e77b4a..2e1284c 100644
--- a/test/intrinsics/gen/frexp/2507b2.wgsl
+++ b/test/intrinsics/gen/frexp/2507b2.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
frexp_2507b2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/frexp/2507b2.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/2507b2.wgsl.expected.spvasm
index 9f3228f..b937ce8 100644
--- a/test/intrinsics/gen/frexp/2507b2.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/frexp/2507b2.wgsl.expected.spvasm
@@ -1,59 +1,73 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 38
; Schema: 0
OpCapability Shader
- %16 = OpExtInstImport "GLSL.std.450"
+ %19 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %frexp_2507b2 "frexp_2507b2"
OpName %arg_1 "arg_1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v4uint = OpTypeVector %uint 4
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %13 = OpConstantNull %v4uint
- %v4float = OpTypeVector %float 4
- %17 = OpConstantNull %v4float
+ %17 = OpConstantNull %v4uint
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%frexp_2507b2 = OpFunction %void None %5
- %8 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_v4uint Function %13
- %res = OpVariable %_ptr_Function_v4float Function %17
- %14 = OpExtInst %v4float %16 Frexp %17 %arg_1
- OpStore %res %14
+%frexp_2507b2 = OpFunction %void None %9
+ %12 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v4uint Function %17
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %18 = OpExtInst %v4float %19 Frexp %8 %arg_1
+ OpStore %res %18
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %22 = OpLabel
- OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %frexp_2507b2
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
%26 = OpLabel
- %27 = OpFunctionCall %void %frexp_2507b2
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %29 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
%30 = OpFunctionCall %void %frexp_2507b2
+ %31 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %frexp_2507b2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %frexp_2507b2
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/frexp/2507b2.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/2507b2.wgsl.expected.wgsl
index 436b452..1e09ae6 100644
--- a/test/intrinsics/gen/frexp/2507b2.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/frexp/2507b2.wgsl.expected.wgsl
@@ -4,8 +4,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
frexp_2507b2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/frexp/2a171c.wgsl b/test/intrinsics/gen/frexp/2a171c.wgsl
index d23094b..856dbda 100644
--- a/test/intrinsics/gen/frexp/2a171c.wgsl
+++ b/test/intrinsics/gen/frexp/2a171c.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
frexp_2a171c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/frexp/2a171c.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/2a171c.wgsl.expected.spvasm
index 3fa83d3..2369b9f 100644
--- a/test/intrinsics/gen/frexp/2a171c.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/frexp/2a171c.wgsl.expected.spvasm
@@ -1,59 +1,75 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
- %16 = OpExtInstImport "GLSL.std.450"
+ %20 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %frexp_2a171c "frexp_2a171c"
OpName %arg_1 "arg_1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v2uint = OpTypeVector %uint 2
%_ptr_Function_v2uint = OpTypePointer Function %v2uint
- %13 = OpConstantNull %v2uint
+ %17 = OpConstantNull %v2uint
%v2float = OpTypeVector %float 2
- %17 = OpConstantNull %v2float
+ %21 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%frexp_2a171c = OpFunction %void None %5
- %8 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_v2uint Function %13
- %res = OpVariable %_ptr_Function_v2float Function %17
- %14 = OpExtInst %v2float %16 Frexp %17 %arg_1
- OpStore %res %14
+%frexp_2a171c = OpFunction %void None %9
+ %12 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2uint Function %17
+ %res = OpVariable %_ptr_Function_v2float Function %21
+ %18 = OpExtInst %v2float %20 Frexp %21 %arg_1
+ OpStore %res %18
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %frexp_2a171c
+ %32 = OpFunctionCall %void %frexp_2a171c
+ %33 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %26 = OpLabel
- %27 = OpFunctionCall %void %frexp_2a171c
+%fragment_main = OpFunction %void None %9
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %frexp_2a171c
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %29 = OpLabel
- %30 = OpFunctionCall %void %frexp_2a171c
+%compute_main = OpFunction %void None %9
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %frexp_2a171c
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/frexp/2a171c.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/2a171c.wgsl.expected.wgsl
index e5bdf95..ffd3acd 100644
--- a/test/intrinsics/gen/frexp/2a171c.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/frexp/2a171c.wgsl.expected.wgsl
@@ -4,8 +4,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
frexp_2a171c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/frexp/34dd30.wgsl b/test/intrinsics/gen/frexp/34dd30.wgsl
index 848bd3f..50bc56c 100644
--- a/test/intrinsics/gen/frexp/34dd30.wgsl
+++ b/test/intrinsics/gen/frexp/34dd30.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
frexp_34dd30();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/frexp/34dd30.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/34dd30.wgsl.expected.spvasm
index 2e9b4d9..3dc8037 100644
--- a/test/intrinsics/gen/frexp/34dd30.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/frexp/34dd30.wgsl.expected.spvasm
@@ -1,56 +1,72 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
- %14 = OpExtInstImport "GLSL.std.450"
+ %18 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %frexp_34dd30 "frexp_34dd30"
OpName %arg_1 "arg_1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%_ptr_Function_uint = OpTypePointer Function %uint
- %12 = OpConstantNull %uint
+ %16 = OpConstantNull %uint
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%frexp_34dd30 = OpFunction %void None %5
- %8 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_uint Function %12
+ %23 = OpTypeFunction %void %v4float
+%frexp_34dd30 = OpFunction %void None %9
+ %12 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %16
%res = OpVariable %_ptr_Function_float Function %4
- %13 = OpExtInst %float %14 Frexp %float_1 %arg_1
- OpStore %res %13
+ %17 = OpExtInst %float %18 Frexp %float_1 %arg_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %20 = OpLabel
- OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %frexp_34dd30
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %frexp_34dd30
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
%26 = OpLabel
- %27 = OpFunctionCall %void %frexp_34dd30
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %29 = OpFunctionCall %void %frexp_34dd30
+ %30 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %frexp_34dd30
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %frexp_34dd30
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/frexp/34dd30.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/34dd30.wgsl.expected.wgsl
index c43e4c1..82331db 100644
--- a/test/intrinsics/gen/frexp/34dd30.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/frexp/34dd30.wgsl.expected.wgsl
@@ -4,8 +4,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
frexp_34dd30();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/frexp/4b73e3.wgsl b/test/intrinsics/gen/frexp/4b73e3.wgsl
index d4c5842..32a16bd 100644
--- a/test/intrinsics/gen/frexp/4b73e3.wgsl
+++ b/test/intrinsics/gen/frexp/4b73e3.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
frexp_4b73e3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.spvasm
index ab2f023..f3901b4 100644
--- a/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.spvasm
@@ -1,59 +1,73 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 38
; Schema: 0
OpCapability Shader
- %16 = OpExtInstImport "GLSL.std.450"
+ %19 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %frexp_4b73e3 "frexp_4b73e3"
OpName %arg_1 "arg_1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v4int = OpTypeVector %int 4
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %13 = OpConstantNull %v4int
- %v4float = OpTypeVector %float 4
- %17 = OpConstantNull %v4float
+ %17 = OpConstantNull %v4int
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%frexp_4b73e3 = OpFunction %void None %5
- %8 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_v4int Function %13
- %res = OpVariable %_ptr_Function_v4float Function %17
- %14 = OpExtInst %v4float %16 Frexp %17 %arg_1
- OpStore %res %14
+%frexp_4b73e3 = OpFunction %void None %9
+ %12 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v4int Function %17
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %18 = OpExtInst %v4float %19 Frexp %8 %arg_1
+ OpStore %res %18
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %22 = OpLabel
- OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %frexp_4b73e3
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
%26 = OpLabel
- %27 = OpFunctionCall %void %frexp_4b73e3
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %29 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
%30 = OpFunctionCall %void %frexp_4b73e3
+ %31 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %frexp_4b73e3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %frexp_4b73e3
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.wgsl
index 3672ae0..8726a64 100644
--- a/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.wgsl
@@ -4,8 +4,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
frexp_4b73e3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/frexp/79ed81.wgsl b/test/intrinsics/gen/frexp/79ed81.wgsl
index 2acbd4c..4debf1d 100644
--- a/test/intrinsics/gen/frexp/79ed81.wgsl
+++ b/test/intrinsics/gen/frexp/79ed81.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
frexp_79ed81();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/frexp/79ed81.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/79ed81.wgsl.expected.spvasm
index 2a7f736..be88edd 100644
--- a/test/intrinsics/gen/frexp/79ed81.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/frexp/79ed81.wgsl.expected.spvasm
@@ -1,59 +1,75 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
- %16 = OpExtInstImport "GLSL.std.450"
+ %20 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %frexp_79ed81 "frexp_79ed81"
OpName %arg_1 "arg_1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %13 = OpConstantNull %v3int
+ %17 = OpConstantNull %v3int
%v3float = OpTypeVector %float 3
- %17 = OpConstantNull %v3float
+ %21 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%frexp_79ed81 = OpFunction %void None %5
- %8 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_v3int Function %13
- %res = OpVariable %_ptr_Function_v3float Function %17
- %14 = OpExtInst %v3float %16 Frexp %17 %arg_1
- OpStore %res %14
+%frexp_79ed81 = OpFunction %void None %9
+ %12 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v3int Function %17
+ %res = OpVariable %_ptr_Function_v3float Function %21
+ %18 = OpExtInst %v3float %20 Frexp %21 %arg_1
+ OpStore %res %18
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %frexp_79ed81
+ %32 = OpFunctionCall %void %frexp_79ed81
+ %33 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %26 = OpLabel
- %27 = OpFunctionCall %void %frexp_79ed81
+%fragment_main = OpFunction %void None %9
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %frexp_79ed81
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %29 = OpLabel
- %30 = OpFunctionCall %void %frexp_79ed81
+%compute_main = OpFunction %void None %9
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %frexp_79ed81
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/frexp/79ed81.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/79ed81.wgsl.expected.wgsl
index 170e255..8c5eff8 100644
--- a/test/intrinsics/gen/frexp/79ed81.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/frexp/79ed81.wgsl.expected.wgsl
@@ -4,8 +4,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
frexp_79ed81();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/frexp/99b922.wgsl b/test/intrinsics/gen/frexp/99b922.wgsl
index 5d2cf6e..44f1976 100644
--- a/test/intrinsics/gen/frexp/99b922.wgsl
+++ b/test/intrinsics/gen/frexp/99b922.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
frexp_99b922();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/frexp/99b922.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/99b922.wgsl.expected.spvasm
index 03670ba..5b3d37c 100644
--- a/test/intrinsics/gen/frexp/99b922.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/frexp/99b922.wgsl.expected.spvasm
@@ -1,56 +1,72 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
- %14 = OpExtInstImport "GLSL.std.450"
+ %18 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %frexp_99b922 "frexp_99b922"
OpName %arg_1 "arg_1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %12 = OpConstantNull %int
+ %16 = OpConstantNull %int
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%frexp_99b922 = OpFunction %void None %5
- %8 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_int Function %12
+ %23 = OpTypeFunction %void %v4float
+%frexp_99b922 = OpFunction %void None %9
+ %12 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %16
%res = OpVariable %_ptr_Function_float Function %4
- %13 = OpExtInst %float %14 Frexp %float_1 %arg_1
- OpStore %res %13
+ %17 = OpExtInst %float %18 Frexp %float_1 %arg_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %20 = OpLabel
- OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %frexp_99b922
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %frexp_99b922
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
%26 = OpLabel
- %27 = OpFunctionCall %void %frexp_99b922
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %29 = OpFunctionCall %void %frexp_99b922
+ %30 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %frexp_99b922
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %frexp_99b922
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/frexp/99b922.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/99b922.wgsl.expected.wgsl
index e07d4c3..6f56b9e 100644
--- a/test/intrinsics/gen/frexp/99b922.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/frexp/99b922.wgsl.expected.wgsl
@@ -4,8 +4,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
frexp_99b922();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/frexp/cb41c5.wgsl b/test/intrinsics/gen/frexp/cb41c5.wgsl
index 298d24e..5bbb652 100644
--- a/test/intrinsics/gen/frexp/cb41c5.wgsl
+++ b/test/intrinsics/gen/frexp/cb41c5.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
frexp_cb41c5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.spvasm
index bec511a..f539a3c 100644
--- a/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.spvasm
@@ -1,59 +1,75 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
- %16 = OpExtInstImport "GLSL.std.450"
+ %20 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %frexp_cb41c5 "frexp_cb41c5"
OpName %arg_1 "arg_1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
%_ptr_Function_v3uint = OpTypePointer Function %v3uint
- %13 = OpConstantNull %v3uint
+ %17 = OpConstantNull %v3uint
%v3float = OpTypeVector %float 3
- %17 = OpConstantNull %v3float
+ %21 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%frexp_cb41c5 = OpFunction %void None %5
- %8 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_v3uint Function %13
- %res = OpVariable %_ptr_Function_v3float Function %17
- %14 = OpExtInst %v3float %16 Frexp %17 %arg_1
- OpStore %res %14
+%frexp_cb41c5 = OpFunction %void None %9
+ %12 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v3uint Function %17
+ %res = OpVariable %_ptr_Function_v3float Function %21
+ %18 = OpExtInst %v3float %20 Frexp %21 %arg_1
+ OpStore %res %18
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %frexp_cb41c5
+ %32 = OpFunctionCall %void %frexp_cb41c5
+ %33 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %26 = OpLabel
- %27 = OpFunctionCall %void %frexp_cb41c5
+%fragment_main = OpFunction %void None %9
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %frexp_cb41c5
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %29 = OpLabel
- %30 = OpFunctionCall %void %frexp_cb41c5
+%compute_main = OpFunction %void None %9
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %frexp_cb41c5
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.wgsl
index 7fcb8e0..24c63ba 100644
--- a/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.wgsl
@@ -4,8 +4,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
frexp_cb41c5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fwidth/5d1b39.wgsl b/test/intrinsics/gen/fwidth/5d1b39.wgsl
index 3a7a285..f004cf4 100644
--- a/test/intrinsics/gen/fwidth/5d1b39.wgsl
+++ b/test/intrinsics/gen/fwidth/5d1b39.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fwidth_5d1b39();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.hlsl b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.hlsl
index 1d700b1..9537c9b 100644
--- a/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void fwidth_5d1b39() {
float3 res = fwidth(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
fwidth_5d1b39();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.wgsl b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.wgsl
index bee6d3f..966c33a 100644
--- a/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fwidth_5d1b39();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fwidth/b83ebb.wgsl b/test/intrinsics/gen/fwidth/b83ebb.wgsl
index 9f657d1..96f3d2b 100644
--- a/test/intrinsics/gen/fwidth/b83ebb.wgsl
+++ b/test/intrinsics/gen/fwidth/b83ebb.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fwidth_b83ebb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.hlsl b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.hlsl
index db5d8aa..25357eb 100644
--- a/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void fwidth_b83ebb() {
float2 res = fwidth(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
fwidth_b83ebb();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.wgsl b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.wgsl
index 4618777..bffa899 100644
--- a/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fwidth_b83ebb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fwidth/d2ab9a.wgsl b/test/intrinsics/gen/fwidth/d2ab9a.wgsl
index 1110b54..18c912e 100644
--- a/test/intrinsics/gen/fwidth/d2ab9a.wgsl
+++ b/test/intrinsics/gen/fwidth/d2ab9a.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fwidth_d2ab9a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.hlsl b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.hlsl
index e963fc6..f72c106 100644
--- a/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void fwidth_d2ab9a() {
float4 res = fwidth(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
fwidth_d2ab9a();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.wgsl b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.wgsl
index 95ec91a..c8b11c6 100644
--- a/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fwidth_d2ab9a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fwidth/df38ef.wgsl b/test/intrinsics/gen/fwidth/df38ef.wgsl
index d830712..64490c3 100644
--- a/test/intrinsics/gen/fwidth/df38ef.wgsl
+++ b/test/intrinsics/gen/fwidth/df38ef.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fwidth_df38ef();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.hlsl b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.hlsl
index 4610453..aa1fd45 100644
--- a/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void fwidth_df38ef() {
float res = fwidth(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
fwidth_df38ef();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.wgsl b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.wgsl
index cf808fe..b19db99 100644
--- a/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fwidth_df38ef();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl
index eb1a5da..c9f50b7 100644
--- a/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl
+++ b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fwidthCoarse_159c8a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.hlsl
index 356be65..846633d 100644
--- a/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void fwidthCoarse_159c8a() {
float res = fwidth(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
fwidthCoarse_159c8a();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.wgsl
index 38b8696..abde6f8 100644
--- a/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fwidthCoarse_159c8a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl
index 05b4fcf..31bd377 100644
--- a/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl
+++ b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fwidthCoarse_1e59d9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.hlsl
index e3e1f18..fa99a24 100644
--- a/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void fwidthCoarse_1e59d9() {
float3 res = fwidth(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
fwidthCoarse_1e59d9();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.wgsl
index adb83b7..e55be28 100644
--- a/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fwidthCoarse_1e59d9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl
index 933322f..0c4fae0 100644
--- a/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl
+++ b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fwidthCoarse_4e4fc4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.hlsl
index ba1c141..89aad0f 100644
--- a/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void fwidthCoarse_4e4fc4() {
float4 res = fwidth(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
fwidthCoarse_4e4fc4();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.wgsl
index 245a06c..04e4b3a 100644
--- a/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fwidthCoarse_4e4fc4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl
index 928a912..a5492f6 100644
--- a/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl
+++ b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fwidthCoarse_e653f7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.hlsl
index dc9e721..a13ab5c 100644
--- a/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void fwidthCoarse_e653f7() {
float2 res = fwidth(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
fwidthCoarse_e653f7();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.wgsl
index c0568f9..123e26f 100644
--- a/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fwidthCoarse_e653f7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fwidthFine/523fdc.wgsl b/test/intrinsics/gen/fwidthFine/523fdc.wgsl
index 2db8dfb..284fa48 100644
--- a/test/intrinsics/gen/fwidthFine/523fdc.wgsl
+++ b/test/intrinsics/gen/fwidthFine/523fdc.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fwidthFine_523fdc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.hlsl
index a270d2d..4ad5e9f 100644
--- a/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void fwidthFine_523fdc() {
float3 res = fwidth(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
fwidthFine_523fdc();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.wgsl
index e7c73a9..28a6e6a 100644
--- a/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fwidthFine_523fdc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fwidthFine/68f4ef.wgsl b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl
index de6e3fe..6591e4a 100644
--- a/test/intrinsics/gen/fwidthFine/68f4ef.wgsl
+++ b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fwidthFine_68f4ef();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.hlsl
index 23406ee..b7788d5 100644
--- a/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void fwidthFine_68f4ef() {
float4 res = fwidth(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
fwidthFine_68f4ef();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.wgsl
index 9cc2625..467bdcc 100644
--- a/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fwidthFine_68f4ef();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fwidthFine/f1742d.wgsl b/test/intrinsics/gen/fwidthFine/f1742d.wgsl
index be30a23..13cfd38 100644
--- a/test/intrinsics/gen/fwidthFine/f1742d.wgsl
+++ b/test/intrinsics/gen/fwidthFine/f1742d.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fwidthFine_f1742d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.hlsl
index 774093a..3a62a95 100644
--- a/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void fwidthFine_f1742d() {
float res = fwidth(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
fwidthFine_f1742d();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.wgsl
index 93e9083..f085f7d 100644
--- a/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fwidthFine_f1742d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl
index 629a950..a2fcc4e 100644
--- a/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl
+++ b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fwidthFine_ff6aa0();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.hlsl
index f38c96a..4cd1a2f 100644
--- a/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void fwidthFine_ff6aa0() {
float2 res = fwidth(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
fwidthFine_ff6aa0();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.wgsl
index 4d0bcb6..578a12e 100644
--- a/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
fwidthFine_ff6aa0();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/inverseSqrt/84407e.wgsl b/test/intrinsics/gen/inverseSqrt/84407e.wgsl
index 070d48c..432e2f8 100644
--- a/test/intrinsics/gen/inverseSqrt/84407e.wgsl
+++ b/test/intrinsics/gen/inverseSqrt/84407e.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
inverseSqrt_84407e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.hlsl b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.hlsl
index 2a185e9..4c8f482 100644
--- a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void inverseSqrt_84407e() {
float res = rsqrt(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
inverseSqrt_84407e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.msl b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.msl
index 9e3ec22..0ff2cd0 100644
--- a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.msl
+++ b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void inverseSqrt_84407e() {
float res = rsqrt(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
inverseSqrt_84407e();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.spvasm b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.spvasm
index d00a8e2..33a4c98 100644
--- a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %inverseSqrt_84407e "inverseSqrt_84407e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%inverseSqrt_84407e = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+%inverseSqrt_84407e = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 InverseSqrt %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 InverseSqrt %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %inverseSqrt_84407e
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %inverseSqrt_84407e
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %inverseSqrt_84407e
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %inverseSqrt_84407e
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %inverseSqrt_84407e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %inverseSqrt_84407e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.wgsl b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.wgsl
index d1a2d35..fb37a94 100644
--- a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
inverseSqrt_84407e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl
index bb7bd2b..10d4b74 100644
--- a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl
+++ b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
inverseSqrt_8f2bd2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.hlsl b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.hlsl
index efa0978..747c9a5 100644
--- a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void inverseSqrt_8f2bd2() {
float2 res = rsqrt(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
inverseSqrt_8f2bd2();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.msl b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.msl
index 15325bc..beeb2cb 100644
--- a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.msl
+++ b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void inverseSqrt_8f2bd2() {
float2 res = rsqrt(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
inverseSqrt_8f2bd2();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.spvasm b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.spvasm
index 9f2fae1..2ec31e8 100644
--- a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %inverseSqrt_8f2bd2 "inverseSqrt_8f2bd2"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%inverseSqrt_8f2bd2 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 InverseSqrt %12
- OpStore %res %9
+%inverseSqrt_8f2bd2 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 InverseSqrt %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %inverseSqrt_8f2bd2
+ %26 = OpFunctionCall %void %inverseSqrt_8f2bd2
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %inverseSqrt_8f2bd2
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %inverseSqrt_8f2bd2
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %inverseSqrt_8f2bd2
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %inverseSqrt_8f2bd2
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.wgsl b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.wgsl
index 496ae23..f31778b 100644
--- a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
inverseSqrt_8f2bd2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl
index dda3627..14a84cb 100644
--- a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl
+++ b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
inverseSqrt_b197b1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.hlsl b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.hlsl
index 3f411b9..bf44bfe 100644
--- a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void inverseSqrt_b197b1() {
float3 res = rsqrt(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
inverseSqrt_b197b1();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.msl b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.msl
index 4fecada..da0d971 100644
--- a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.msl
+++ b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void inverseSqrt_b197b1() {
float3 res = rsqrt(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
inverseSqrt_b197b1();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.spvasm b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.spvasm
index 2d8c81c..beb3454 100644
--- a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %inverseSqrt_b197b1 "inverseSqrt_b197b1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%inverseSqrt_b197b1 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 InverseSqrt %12
- OpStore %res %9
+%inverseSqrt_b197b1 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 InverseSqrt %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %inverseSqrt_b197b1
+ %26 = OpFunctionCall %void %inverseSqrt_b197b1
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %inverseSqrt_b197b1
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %inverseSqrt_b197b1
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %inverseSqrt_b197b1
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %inverseSqrt_b197b1
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.wgsl b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.wgsl
index 0025c34..8481d34 100644
--- a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
inverseSqrt_b197b1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/inverseSqrt/c22347.wgsl b/test/intrinsics/gen/inverseSqrt/c22347.wgsl
index 35a6a14..0f57c7c 100644
--- a/test/intrinsics/gen/inverseSqrt/c22347.wgsl
+++ b/test/intrinsics/gen/inverseSqrt/c22347.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
inverseSqrt_c22347();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.hlsl b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.hlsl
index 28b66a7..b67ba97 100644
--- a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void inverseSqrt_c22347() {
float4 res = rsqrt(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
inverseSqrt_c22347();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.msl b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.msl
index a8f49da..07deeaa 100644
--- a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.msl
+++ b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void inverseSqrt_c22347() {
float4 res = rsqrt(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
inverseSqrt_c22347();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.spvasm b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.spvasm
index 55bfc48..8bcc297 100644
--- a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %inverseSqrt_c22347 "inverseSqrt_c22347"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%inverseSqrt_c22347 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 InverseSqrt %12
- OpStore %res %9
+%inverseSqrt_c22347 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 InverseSqrt %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %inverseSqrt_c22347
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %inverseSqrt_c22347
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %inverseSqrt_c22347
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %inverseSqrt_c22347
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %inverseSqrt_c22347
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.wgsl b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.wgsl
index 268014f..692ba58 100644
--- a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
inverseSqrt_c22347();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isFinite/34d32b.wgsl b/test/intrinsics/gen/isFinite/34d32b.wgsl
index f156daf..4d20d3a 100644
--- a/test/intrinsics/gen/isFinite/34d32b.wgsl
+++ b/test/intrinsics/gen/isFinite/34d32b.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isFinite_34d32b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.hlsl b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.hlsl
index e700d05..fd5747e 100644
--- a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void isFinite_34d32b() {
vector<bool, 2> res = isfinite(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
isFinite_34d32b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.msl b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.msl
index 5758537..be2ba66 100644
--- a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.msl
+++ b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void isFinite_34d32b() {
bool2 res = isfinite(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
isFinite_34d32b();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.spvasm b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.spvasm
index 12d3501..852e906 100644
--- a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.spvasm
@@ -1,58 +1,74 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %isFinite_34d32b "isFinite_34d32b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
%v2bool = OpTypeVector %bool 2
%v2float = OpTypeVector %float 2
- %13 = OpConstantNull %v2float
+ %17 = OpConstantNull %v2float
%_ptr_Function_v2bool = OpTypePointer Function %v2bool
- %19 = OpConstantNull %v2bool
+ %23 = OpConstantNull %v2bool
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%isFinite_34d32b = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2bool Function %19
- %14 = OpIsInf %v2bool %13
- %15 = OpIsNan %v2bool %13
- %16 = OpLogicalOr %v2bool %14 %15
- %9 = OpLogicalNot %v2bool %16
- OpStore %res %9
+%isFinite_34d32b = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2bool Function %23
+ %18 = OpIsInf %v2bool %17
+ %19 = OpIsNan %v2bool %17
+ %20 = OpLogicalOr %v2bool %18 %19
+ %13 = OpLogicalNot %v2bool %20
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %isFinite_34d32b
+ %31 = OpFunctionCall %void %isFinite_34d32b
+ %32 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %25 = OpLabel
- %26 = OpFunctionCall %void %isFinite_34d32b
+%fragment_main = OpFunction %void None %9
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %isFinite_34d32b
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %28 = OpLabel
- %29 = OpFunctionCall %void %isFinite_34d32b
+%compute_main = OpFunction %void None %9
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %isFinite_34d32b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.wgsl b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.wgsl
index a50f43c..35bad2a 100644
--- a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isFinite_34d32b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isFinite/426f9f.wgsl b/test/intrinsics/gen/isFinite/426f9f.wgsl
index 72f866b..19ae66e 100644
--- a/test/intrinsics/gen/isFinite/426f9f.wgsl
+++ b/test/intrinsics/gen/isFinite/426f9f.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isFinite_426f9f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.hlsl b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.hlsl
index 83b92bf..d46bad6 100644
--- a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void isFinite_426f9f() {
bool res = isfinite(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
isFinite_426f9f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.msl b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.msl
index 27e7955..fc6d588 100644
--- a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.msl
+++ b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void isFinite_426f9f() {
bool res = isfinite(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
isFinite_426f9f();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.spvasm b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.spvasm
index cca7605..4b54ee8 100644
--- a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.spvasm
@@ -1,55 +1,71 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 36
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %isFinite_426f9f "isFinite_426f9f"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
%float_1 = OpConstant %float 1
%_ptr_Function_bool = OpTypePointer Function %bool
- %17 = OpConstantNull %bool
-%isFinite_426f9f = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_bool Function %17
- %12 = OpIsInf %bool %float_1
- %13 = OpIsNan %bool %float_1
- %14 = OpLogicalOr %bool %12 %13
- %9 = OpLogicalNot %bool %14
- OpStore %res %9
+ %21 = OpConstantNull %bool
+ %22 = OpTypeFunction %void %v4float
+%isFinite_426f9f = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_bool Function %21
+ %16 = OpIsInf %bool %float_1
+ %17 = OpIsNan %bool %float_1
+ %18 = OpLogicalOr %bool %16 %17
+ %13 = OpLogicalNot %bool %18
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %19 = OpLabel
- OpStore %tint_pointsize %float_1
- %20 = OpFunctionCall %void %isFinite_426f9f
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %22 = OpLabel
- %23 = OpFunctionCall %void %isFinite_426f9f
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
%25 = OpLabel
- %26 = OpFunctionCall %void %isFinite_426f9f
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %27 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %28 = OpFunctionCall %void %isFinite_426f9f
+ %29 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %isFinite_426f9f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %isFinite_426f9f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.wgsl b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.wgsl
index 458d18f..7b583b2 100644
--- a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isFinite_426f9f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isFinite/8a23ad.wgsl b/test/intrinsics/gen/isFinite/8a23ad.wgsl
index 06f1693..9b34e32 100644
--- a/test/intrinsics/gen/isFinite/8a23ad.wgsl
+++ b/test/intrinsics/gen/isFinite/8a23ad.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isFinite_8a23ad();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.hlsl b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.hlsl
index b891553..010d015 100644
--- a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void isFinite_8a23ad() {
vector<bool, 3> res = isfinite(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
isFinite_8a23ad();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.msl b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.msl
index 3bfe1d3..9ecb4a4 100644
--- a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.msl
+++ b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void isFinite_8a23ad() {
bool3 res = isfinite(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
isFinite_8a23ad();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.spvasm b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.spvasm
index 45f72cf..1bfb11b 100644
--- a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.spvasm
@@ -1,58 +1,74 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %isFinite_8a23ad "isFinite_8a23ad"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
%v3bool = OpTypeVector %bool 3
%v3float = OpTypeVector %float 3
- %13 = OpConstantNull %v3float
+ %17 = OpConstantNull %v3float
%_ptr_Function_v3bool = OpTypePointer Function %v3bool
- %19 = OpConstantNull %v3bool
+ %23 = OpConstantNull %v3bool
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%isFinite_8a23ad = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3bool Function %19
- %14 = OpIsInf %v3bool %13
- %15 = OpIsNan %v3bool %13
- %16 = OpLogicalOr %v3bool %14 %15
- %9 = OpLogicalNot %v3bool %16
- OpStore %res %9
+%isFinite_8a23ad = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3bool Function %23
+ %18 = OpIsInf %v3bool %17
+ %19 = OpIsNan %v3bool %17
+ %20 = OpLogicalOr %v3bool %18 %19
+ %13 = OpLogicalNot %v3bool %20
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %isFinite_8a23ad
+ %31 = OpFunctionCall %void %isFinite_8a23ad
+ %32 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %25 = OpLabel
- %26 = OpFunctionCall %void %isFinite_8a23ad
+%fragment_main = OpFunction %void None %9
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %isFinite_8a23ad
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %28 = OpLabel
- %29 = OpFunctionCall %void %isFinite_8a23ad
+%compute_main = OpFunction %void None %9
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %isFinite_8a23ad
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.wgsl b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.wgsl
index 1cb9665..802869a 100644
--- a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isFinite_8a23ad();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isFinite/f31987.wgsl b/test/intrinsics/gen/isFinite/f31987.wgsl
index 9747c63..35c6b5e 100644
--- a/test/intrinsics/gen/isFinite/f31987.wgsl
+++ b/test/intrinsics/gen/isFinite/f31987.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isFinite_f31987();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.hlsl b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.hlsl
index 6e9a1af..ba30f1a 100644
--- a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void isFinite_f31987() {
vector<bool, 4> res = isfinite(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
isFinite_f31987();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.msl b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.msl
index f8184b3..0cd88d9 100644
--- a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.msl
+++ b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void isFinite_f31987() {
bool4 res = isfinite(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
isFinite_f31987();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.spvasm b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.spvasm
index 20008cb..5e80787 100644
--- a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.spvasm
@@ -1,58 +1,72 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 37
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %isFinite_f31987 "isFinite_f31987"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
%v4bool = OpTypeVector %bool 4
- %v4float = OpTypeVector %float 4
- %13 = OpConstantNull %v4float
%_ptr_Function_v4bool = OpTypePointer Function %v4bool
- %19 = OpConstantNull %v4bool
+ %21 = OpConstantNull %v4bool
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%isFinite_f31987 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4bool Function %19
- %14 = OpIsInf %v4bool %13
- %15 = OpIsNan %v4bool %13
- %16 = OpLogicalOr %v4bool %14 %15
- %9 = OpLogicalNot %v4bool %16
- OpStore %res %9
+%isFinite_f31987 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4bool Function %21
+ %16 = OpIsInf %v4bool %8
+ %17 = OpIsNan %v4bool %8
+ %18 = OpLogicalOr %v4bool %16 %17
+ %13 = OpLogicalNot %v4bool %18
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %21 = OpLabel
- OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %isFinite_f31987
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
%25 = OpLabel
- %26 = OpFunctionCall %void %isFinite_f31987
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %28 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %27 = OpLabel
+ OpStore %tint_pointsize %float_1
%29 = OpFunctionCall %void %isFinite_f31987
+ %30 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %isFinite_f31987
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %isFinite_f31987
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.wgsl b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.wgsl
index 63c77f5..65f538a 100644
--- a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isFinite_f31987();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isInf/666f2a.wgsl b/test/intrinsics/gen/isInf/666f2a.wgsl
index fb0708c..b0a4e24 100644
--- a/test/intrinsics/gen/isInf/666f2a.wgsl
+++ b/test/intrinsics/gen/isInf/666f2a.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isInf_666f2a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.hlsl b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.hlsl
index 7098626..c18d7bb 100644
--- a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void isInf_666f2a() {
vector<bool, 3> res = isinf(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
isInf_666f2a();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.msl b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.msl
index f2f6709..39d8aa9 100644
--- a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.msl
+++ b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void isInf_666f2a() {
bool3 res = isinf(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
isInf_666f2a();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.spvasm b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.spvasm
index b42d0f5..34a0c56 100644
--- a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.spvasm
@@ -1,55 +1,71 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 36
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %isInf_666f2a "isInf_666f2a"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
%v3bool = OpTypeVector %bool 3
%v3float = OpTypeVector %float 3
- %13 = OpConstantNull %v3float
+ %17 = OpConstantNull %v3float
%_ptr_Function_v3bool = OpTypePointer Function %v3bool
- %16 = OpConstantNull %v3bool
+ %20 = OpConstantNull %v3bool
+ %21 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%isInf_666f2a = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3bool Function %16
- %9 = OpIsInf %v3bool %13
- OpStore %res %9
+%isInf_666f2a = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3bool Function %20
+ %13 = OpIsInf %v3bool %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %18 = OpLabel
+%tint_symbol_2 = OpFunction %void None %21
+%tint_symbol = OpFunctionParameter %v4float
+ %24 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %26 = OpLabel
OpStore %tint_pointsize %float_1
- %20 = OpFunctionCall %void %isInf_666f2a
+ %28 = OpFunctionCall %void %isInf_666f2a
+ %29 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %22 = OpLabel
- %23 = OpFunctionCall %void %isInf_666f2a
+%fragment_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %isInf_666f2a
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %25 = OpLabel
- %26 = OpFunctionCall %void %isInf_666f2a
+%compute_main = OpFunction %void None %9
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %isInf_666f2a
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.wgsl b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.wgsl
index aaf35df..cf5f8bb 100644
--- a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isInf_666f2a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isInf/7bd98f.wgsl b/test/intrinsics/gen/isInf/7bd98f.wgsl
index a659856..c4d91f7 100644
--- a/test/intrinsics/gen/isInf/7bd98f.wgsl
+++ b/test/intrinsics/gen/isInf/7bd98f.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isInf_7bd98f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.hlsl b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.hlsl
index bb7d975..aa952bb 100644
--- a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void isInf_7bd98f() {
bool res = isinf(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
isInf_7bd98f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.msl b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.msl
index 8623d0e..6cec857 100644
--- a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.msl
+++ b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void isInf_7bd98f() {
bool res = isinf(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
isInf_7bd98f();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.spvasm b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.spvasm
index 361f0f8..f538f3a 100644
--- a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.spvasm
@@ -1,52 +1,68 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 24
+; Bound: 33
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %isInf_7bd98f "isInf_7bd98f"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
%float_1 = OpConstant %float 1
%_ptr_Function_bool = OpTypePointer Function %bool
- %14 = OpConstantNull %bool
-%isInf_7bd98f = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_bool Function %14
- %9 = OpIsInf %bool %float_1
- OpStore %res %9
+ %18 = OpConstantNull %bool
+ %19 = OpTypeFunction %void %v4float
+%isInf_7bd98f = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_bool Function %18
+ %13 = OpIsInf %bool %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %17 = OpFunctionCall %void %isInf_7bd98f
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %19 = OpLabel
- %20 = OpFunctionCall %void %isInf_7bd98f
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
%22 = OpLabel
- %23 = OpFunctionCall %void %isInf_7bd98f
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %isInf_7bd98f
+ %26 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %isInf_7bd98f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %isInf_7bd98f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.wgsl b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.wgsl
index 1fe501e..b9bb97e 100644
--- a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isInf_7bd98f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isInf/7e81b5.wgsl b/test/intrinsics/gen/isInf/7e81b5.wgsl
index 7462bd2..1af1d40 100644
--- a/test/intrinsics/gen/isInf/7e81b5.wgsl
+++ b/test/intrinsics/gen/isInf/7e81b5.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isInf_7e81b5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.hlsl b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.hlsl
index 00db4f3..c7019e2 100644
--- a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void isInf_7e81b5() {
vector<bool, 4> res = isinf(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
isInf_7e81b5();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.msl b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.msl
index 331e462..e8636d9 100644
--- a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.msl
+++ b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void isInf_7e81b5() {
bool4 res = isinf(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
isInf_7e81b5();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.spvasm b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.spvasm
index 8fc9a10..7b5ba04 100644
--- a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.spvasm
@@ -1,55 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %isInf_7e81b5 "isInf_7e81b5"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
%v4bool = OpTypeVector %bool 4
- %v4float = OpTypeVector %float 4
- %13 = OpConstantNull %v4float
%_ptr_Function_v4bool = OpTypePointer Function %v4bool
- %16 = OpConstantNull %v4bool
+ %18 = OpConstantNull %v4bool
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%isInf_7e81b5 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4bool Function %16
- %9 = OpIsInf %v4bool %13
- OpStore %res %9
+%isInf_7e81b5 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4bool Function %18
+ %13 = OpIsInf %v4bool %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %18 = OpLabel
- OpStore %tint_pointsize %float_1
- %20 = OpFunctionCall %void %isInf_7e81b5
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
%22 = OpLabel
- %23 = OpFunctionCall %void %isInf_7e81b5
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %25 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ OpStore %tint_pointsize %float_1
%26 = OpFunctionCall %void %isInf_7e81b5
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %isInf_7e81b5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %isInf_7e81b5
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.wgsl b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.wgsl
index 749e653..353e589 100644
--- a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isInf_7e81b5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isInf/a46d6f.wgsl b/test/intrinsics/gen/isInf/a46d6f.wgsl
index 336593b..d2ac8ea 100644
--- a/test/intrinsics/gen/isInf/a46d6f.wgsl
+++ b/test/intrinsics/gen/isInf/a46d6f.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isInf_a46d6f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.hlsl b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.hlsl
index dd76a70..93d5e9e 100644
--- a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void isInf_a46d6f() {
vector<bool, 2> res = isinf(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
isInf_a46d6f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.msl b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.msl
index 41925de..d423213 100644
--- a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.msl
+++ b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void isInf_a46d6f() {
bool2 res = isinf(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
isInf_a46d6f();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.spvasm b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.spvasm
index 5b3fe9b..20f293b 100644
--- a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.spvasm
@@ -1,55 +1,71 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 36
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %isInf_a46d6f "isInf_a46d6f"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
%v2bool = OpTypeVector %bool 2
%v2float = OpTypeVector %float 2
- %13 = OpConstantNull %v2float
+ %17 = OpConstantNull %v2float
%_ptr_Function_v2bool = OpTypePointer Function %v2bool
- %16 = OpConstantNull %v2bool
+ %20 = OpConstantNull %v2bool
+ %21 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%isInf_a46d6f = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2bool Function %16
- %9 = OpIsInf %v2bool %13
- OpStore %res %9
+%isInf_a46d6f = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2bool Function %20
+ %13 = OpIsInf %v2bool %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %18 = OpLabel
+%tint_symbol_2 = OpFunction %void None %21
+%tint_symbol = OpFunctionParameter %v4float
+ %24 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %26 = OpLabel
OpStore %tint_pointsize %float_1
- %20 = OpFunctionCall %void %isInf_a46d6f
+ %28 = OpFunctionCall %void %isInf_a46d6f
+ %29 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %22 = OpLabel
- %23 = OpFunctionCall %void %isInf_a46d6f
+%fragment_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %isInf_a46d6f
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %25 = OpLabel
- %26 = OpFunctionCall %void %isInf_a46d6f
+%compute_main = OpFunction %void None %9
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %isInf_a46d6f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.wgsl b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.wgsl
index 0166b73..1c04e2d 100644
--- a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isInf_a46d6f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isNan/1280ab.wgsl b/test/intrinsics/gen/isNan/1280ab.wgsl
index 5297e91..0375ee5 100644
--- a/test/intrinsics/gen/isNan/1280ab.wgsl
+++ b/test/intrinsics/gen/isNan/1280ab.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isNan_1280ab();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isNan/1280ab.wgsl.expected.msl b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.msl
index c19b61d..aa45bd0 100644
--- a/test/intrinsics/gen/isNan/1280ab.wgsl.expected.msl
+++ b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void isNan_1280ab() {
bool3 res = isnan(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
isNan_1280ab();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/isNan/1280ab.wgsl.expected.spvasm b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.spvasm
index f678b42..e8bec27 100644
--- a/test/intrinsics/gen/isNan/1280ab.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.spvasm
@@ -1,55 +1,71 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 36
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %isNan_1280ab "isNan_1280ab"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
%v3bool = OpTypeVector %bool 3
%v3float = OpTypeVector %float 3
- %13 = OpConstantNull %v3float
+ %17 = OpConstantNull %v3float
%_ptr_Function_v3bool = OpTypePointer Function %v3bool
- %16 = OpConstantNull %v3bool
+ %20 = OpConstantNull %v3bool
+ %21 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%isNan_1280ab = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3bool Function %16
- %9 = OpIsNan %v3bool %13
- OpStore %res %9
+%isNan_1280ab = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3bool Function %20
+ %13 = OpIsNan %v3bool %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %18 = OpLabel
+%tint_symbol_2 = OpFunction %void None %21
+%tint_symbol = OpFunctionParameter %v4float
+ %24 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %26 = OpLabel
OpStore %tint_pointsize %float_1
- %20 = OpFunctionCall %void %isNan_1280ab
+ %28 = OpFunctionCall %void %isNan_1280ab
+ %29 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %22 = OpLabel
- %23 = OpFunctionCall %void %isNan_1280ab
+%fragment_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %isNan_1280ab
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %25 = OpLabel
- %26 = OpFunctionCall %void %isNan_1280ab
+%compute_main = OpFunction %void None %9
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %isNan_1280ab
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/isNan/1280ab.wgsl.expected.wgsl b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.wgsl
index 4e728d7..9bb6fe2 100644
--- a/test/intrinsics/gen/isNan/1280ab.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isNan_1280ab();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isNan/4d280d.wgsl b/test/intrinsics/gen/isNan/4d280d.wgsl
index fb64518..5e6a83f 100644
--- a/test/intrinsics/gen/isNan/4d280d.wgsl
+++ b/test/intrinsics/gen/isNan/4d280d.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isNan_4d280d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isNan/4d280d.wgsl.expected.msl b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.msl
index 3b4b9e5..28fc710 100644
--- a/test/intrinsics/gen/isNan/4d280d.wgsl.expected.msl
+++ b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void isNan_4d280d() {
bool4 res = isnan(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
isNan_4d280d();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/isNan/4d280d.wgsl.expected.spvasm b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.spvasm
index 39e7edd..56ba241 100644
--- a/test/intrinsics/gen/isNan/4d280d.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.spvasm
@@ -1,55 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %isNan_4d280d "isNan_4d280d"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
%v4bool = OpTypeVector %bool 4
- %v4float = OpTypeVector %float 4
- %13 = OpConstantNull %v4float
%_ptr_Function_v4bool = OpTypePointer Function %v4bool
- %16 = OpConstantNull %v4bool
+ %18 = OpConstantNull %v4bool
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%isNan_4d280d = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4bool Function %16
- %9 = OpIsNan %v4bool %13
- OpStore %res %9
+%isNan_4d280d = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4bool Function %18
+ %13 = OpIsNan %v4bool %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %18 = OpLabel
- OpStore %tint_pointsize %float_1
- %20 = OpFunctionCall %void %isNan_4d280d
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
%22 = OpLabel
- %23 = OpFunctionCall %void %isNan_4d280d
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %25 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ OpStore %tint_pointsize %float_1
%26 = OpFunctionCall %void %isNan_4d280d
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %isNan_4d280d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %isNan_4d280d
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/isNan/4d280d.wgsl.expected.wgsl b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.wgsl
index f0acfc5..fe0a18a 100644
--- a/test/intrinsics/gen/isNan/4d280d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isNan_4d280d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isNan/67ecd3.wgsl b/test/intrinsics/gen/isNan/67ecd3.wgsl
index 030cd01..2d6d6a0 100644
--- a/test/intrinsics/gen/isNan/67ecd3.wgsl
+++ b/test/intrinsics/gen/isNan/67ecd3.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isNan_67ecd3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.msl b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.msl
index 66587ba..12439ba 100644
--- a/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.msl
+++ b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void isNan_67ecd3() {
bool2 res = isnan(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
isNan_67ecd3();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.spvasm b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.spvasm
index de78ebc..fe0be0d 100644
--- a/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.spvasm
@@ -1,55 +1,71 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 36
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %isNan_67ecd3 "isNan_67ecd3"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
%v2bool = OpTypeVector %bool 2
%v2float = OpTypeVector %float 2
- %13 = OpConstantNull %v2float
+ %17 = OpConstantNull %v2float
%_ptr_Function_v2bool = OpTypePointer Function %v2bool
- %16 = OpConstantNull %v2bool
+ %20 = OpConstantNull %v2bool
+ %21 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%isNan_67ecd3 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2bool Function %16
- %9 = OpIsNan %v2bool %13
- OpStore %res %9
+%isNan_67ecd3 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2bool Function %20
+ %13 = OpIsNan %v2bool %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %18 = OpLabel
+%tint_symbol_2 = OpFunction %void None %21
+%tint_symbol = OpFunctionParameter %v4float
+ %24 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %26 = OpLabel
OpStore %tint_pointsize %float_1
- %20 = OpFunctionCall %void %isNan_67ecd3
+ %28 = OpFunctionCall %void %isNan_67ecd3
+ %29 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %22 = OpLabel
- %23 = OpFunctionCall %void %isNan_67ecd3
+%fragment_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %isNan_67ecd3
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %25 = OpLabel
- %26 = OpFunctionCall %void %isNan_67ecd3
+%compute_main = OpFunction %void None %9
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %isNan_67ecd3
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.wgsl b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.wgsl
index dcdd0de..c4ae423 100644
--- a/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isNan_67ecd3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isNan/e4978e.wgsl b/test/intrinsics/gen/isNan/e4978e.wgsl
index ca06e23..de38f57 100644
--- a/test/intrinsics/gen/isNan/e4978e.wgsl
+++ b/test/intrinsics/gen/isNan/e4978e.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isNan_e4978e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.hlsl b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.hlsl
index cf183f7..688ff07 100644
--- a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void isNan_e4978e() {
bool res = isnan(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
isNan_e4978e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.msl b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.msl
index b308160..cad8c71 100644
--- a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.msl
+++ b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void isNan_e4978e() {
bool res = isnan(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
isNan_e4978e();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.spvasm b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.spvasm
index c8cf7ca..4d21c4d 100644
--- a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.spvasm
@@ -1,52 +1,68 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 24
+; Bound: 33
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %isNan_e4978e "isNan_e4978e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
%float_1 = OpConstant %float 1
%_ptr_Function_bool = OpTypePointer Function %bool
- %14 = OpConstantNull %bool
-%isNan_e4978e = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_bool Function %14
- %9 = OpIsNan %bool %float_1
- OpStore %res %9
+ %18 = OpConstantNull %bool
+ %19 = OpTypeFunction %void %v4float
+%isNan_e4978e = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_bool Function %18
+ %13 = OpIsNan %bool %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %17 = OpFunctionCall %void %isNan_e4978e
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %19 = OpLabel
- %20 = OpFunctionCall %void %isNan_e4978e
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
%22 = OpLabel
- %23 = OpFunctionCall %void %isNan_e4978e
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %25 = OpFunctionCall %void %isNan_e4978e
+ %26 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %isNan_e4978e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %isNan_e4978e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.wgsl b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.wgsl
index ecdc24f..25565a8 100644
--- a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isNan_e4978e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isNormal/863dcd.wgsl b/test/intrinsics/gen/isNormal/863dcd.wgsl
index 7098af1..3733474 100644
--- a/test/intrinsics/gen/isNormal/863dcd.wgsl
+++ b/test/intrinsics/gen/isNormal/863dcd.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isNormal_863dcd();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.msl b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.msl
index 864e4ef..67595de 100644
--- a/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.msl
+++ b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void isNormal_863dcd() {
bool4 res = isnormal(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
isNormal_863dcd();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.spvasm b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.spvasm
index 9d47ef5..ec938ef 100644
--- a/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.spvasm
@@ -1,67 +1,81 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
; Schema: 0
OpCapability Shader
- %14 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %isNormal_863dcd "isNormal_863dcd"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
%v4bool = OpTypeVector %bool 4
- %v4float = OpTypeVector %float 4
- %13 = OpConstantNull %v4float
%uint = OpTypeInt 32 0
%uint_133693440 = OpConstant %uint 133693440
%uint_524288 = OpConstant %uint 524288
%uint_133169152 = OpConstant %uint 133169152
%v4uint = OpTypeVector %uint 4
%_ptr_Function_v4bool = OpTypePointer Function %v4bool
- %28 = OpConstantNull %v4bool
+ %30 = OpConstantNull %v4bool
+ %31 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%isNormal_863dcd = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4bool Function %28
- %20 = OpCompositeConstruct %v4uint %uint_133693440 %uint_133693440 %uint_133693440 %uint_133693440
- %21 = OpCompositeConstruct %v4uint %uint_524288 %uint_524288 %uint_524288 %uint_524288
- %22 = OpCompositeConstruct %v4uint %uint_133169152 %uint_133169152 %uint_133169152 %uint_133169152
- %23 = OpBitcast %v4uint %13
- %24 = OpBitwiseAnd %v4uint %23 %20
- %25 = OpExtInst %v4uint %14 UClamp %24 %21 %22
- %9 = OpIEqual %v4bool %24 %25
- OpStore %res %9
+%isNormal_863dcd = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4bool Function %30
+ %22 = OpCompositeConstruct %v4uint %uint_133693440 %uint_133693440 %uint_133693440 %uint_133693440
+ %23 = OpCompositeConstruct %v4uint %uint_524288 %uint_524288 %uint_524288 %uint_524288
+ %24 = OpCompositeConstruct %v4uint %uint_133169152 %uint_133169152 %uint_133169152 %uint_133169152
+ %25 = OpBitcast %v4uint %8
+ %26 = OpBitwiseAnd %v4uint %25 %22
+ %27 = OpExtInst %v4uint %16 UClamp %26 %23 %24
+ %13 = OpIEqual %v4bool %26 %27
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %30 = OpLabel
- OpStore %tint_pointsize %float_1
- %32 = OpFunctionCall %void %isNormal_863dcd
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %31
+%tint_symbol = OpFunctionParameter %v4float
%34 = OpLabel
- %35 = OpFunctionCall %void %isNormal_863dcd
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %37 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %36 = OpLabel
+ OpStore %tint_pointsize %float_1
%38 = OpFunctionCall %void %isNormal_863dcd
+ %39 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %isNormal_863dcd
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %isNormal_863dcd
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.wgsl b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.wgsl
index f81cfef..d2a39bd 100644
--- a/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isNormal_863dcd();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isNormal/b00ab1.wgsl b/test/intrinsics/gen/isNormal/b00ab1.wgsl
index cb819a6..97556c1 100644
--- a/test/intrinsics/gen/isNormal/b00ab1.wgsl
+++ b/test/intrinsics/gen/isNormal/b00ab1.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isNormal_b00ab1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.msl b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.msl
index 8f1c9dd..898dd73 100644
--- a/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.msl
+++ b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void isNormal_b00ab1() {
bool2 res = isnormal(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
isNormal_b00ab1();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.spvasm b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.spvasm
index 392e627..0de7bf9 100644
--- a/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.spvasm
@@ -1,67 +1,83 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 48
; Schema: 0
OpCapability Shader
- %14 = OpExtInstImport "GLSL.std.450"
+ %18 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %isNormal_b00ab1 "isNormal_b00ab1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
%v2bool = OpTypeVector %bool 2
%v2float = OpTypeVector %float 2
- %13 = OpConstantNull %v2float
+ %17 = OpConstantNull %v2float
%uint = OpTypeInt 32 0
%uint_133693440 = OpConstant %uint 133693440
%uint_524288 = OpConstant %uint 524288
%uint_133169152 = OpConstant %uint 133169152
%v2uint = OpTypeVector %uint 2
%_ptr_Function_v2bool = OpTypePointer Function %v2bool
- %28 = OpConstantNull %v2bool
+ %32 = OpConstantNull %v2bool
+ %33 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%isNormal_b00ab1 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2bool Function %28
- %20 = OpCompositeConstruct %v2uint %uint_133693440 %uint_133693440
- %21 = OpCompositeConstruct %v2uint %uint_524288 %uint_524288
- %22 = OpCompositeConstruct %v2uint %uint_133169152 %uint_133169152
- %23 = OpBitcast %v2uint %13
- %24 = OpBitwiseAnd %v2uint %23 %20
- %25 = OpExtInst %v2uint %14 UClamp %24 %21 %22
- %9 = OpIEqual %v2bool %24 %25
- OpStore %res %9
+%isNormal_b00ab1 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2bool Function %32
+ %24 = OpCompositeConstruct %v2uint %uint_133693440 %uint_133693440
+ %25 = OpCompositeConstruct %v2uint %uint_524288 %uint_524288
+ %26 = OpCompositeConstruct %v2uint %uint_133169152 %uint_133169152
+ %27 = OpBitcast %v2uint %17
+ %28 = OpBitwiseAnd %v2uint %27 %24
+ %29 = OpExtInst %v2uint %18 UClamp %28 %25 %26
+ %13 = OpIEqual %v2bool %28 %29
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %30 = OpLabel
+%tint_symbol_2 = OpFunction %void None %33
+%tint_symbol = OpFunctionParameter %v4float
+ %36 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %38 = OpLabel
OpStore %tint_pointsize %float_1
- %32 = OpFunctionCall %void %isNormal_b00ab1
+ %40 = OpFunctionCall %void %isNormal_b00ab1
+ %41 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %34 = OpLabel
- %35 = OpFunctionCall %void %isNormal_b00ab1
+%fragment_main = OpFunction %void None %9
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %isNormal_b00ab1
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %37 = OpLabel
- %38 = OpFunctionCall %void %isNormal_b00ab1
+%compute_main = OpFunction %void None %9
+ %46 = OpLabel
+ %47 = OpFunctionCall %void %isNormal_b00ab1
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.wgsl b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.wgsl
index c14e06d..e1e5cb4 100644
--- a/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isNormal_b00ab1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isNormal/c286b7.wgsl b/test/intrinsics/gen/isNormal/c286b7.wgsl
index 50c11aa..3374630 100644
--- a/test/intrinsics/gen/isNormal/c286b7.wgsl
+++ b/test/intrinsics/gen/isNormal/c286b7.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isNormal_c286b7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.msl b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.msl
index 26fc3c4..e7bac05 100644
--- a/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.msl
+++ b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void isNormal_c286b7() {
bool3 res = isnormal(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
isNormal_c286b7();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.spvasm b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.spvasm
index 4ae8199..657c0d4 100644
--- a/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.spvasm
@@ -1,67 +1,83 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 48
; Schema: 0
OpCapability Shader
- %14 = OpExtInstImport "GLSL.std.450"
+ %18 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %isNormal_c286b7 "isNormal_c286b7"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
%v3bool = OpTypeVector %bool 3
%v3float = OpTypeVector %float 3
- %13 = OpConstantNull %v3float
+ %17 = OpConstantNull %v3float
%uint = OpTypeInt 32 0
%uint_133693440 = OpConstant %uint 133693440
%uint_524288 = OpConstant %uint 524288
%uint_133169152 = OpConstant %uint 133169152
%v3uint = OpTypeVector %uint 3
%_ptr_Function_v3bool = OpTypePointer Function %v3bool
- %28 = OpConstantNull %v3bool
+ %32 = OpConstantNull %v3bool
+ %33 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%isNormal_c286b7 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3bool Function %28
- %20 = OpCompositeConstruct %v3uint %uint_133693440 %uint_133693440 %uint_133693440
- %21 = OpCompositeConstruct %v3uint %uint_524288 %uint_524288 %uint_524288
- %22 = OpCompositeConstruct %v3uint %uint_133169152 %uint_133169152 %uint_133169152
- %23 = OpBitcast %v3uint %13
- %24 = OpBitwiseAnd %v3uint %23 %20
- %25 = OpExtInst %v3uint %14 UClamp %24 %21 %22
- %9 = OpIEqual %v3bool %24 %25
- OpStore %res %9
+%isNormal_c286b7 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3bool Function %32
+ %24 = OpCompositeConstruct %v3uint %uint_133693440 %uint_133693440 %uint_133693440
+ %25 = OpCompositeConstruct %v3uint %uint_524288 %uint_524288 %uint_524288
+ %26 = OpCompositeConstruct %v3uint %uint_133169152 %uint_133169152 %uint_133169152
+ %27 = OpBitcast %v3uint %17
+ %28 = OpBitwiseAnd %v3uint %27 %24
+ %29 = OpExtInst %v3uint %18 UClamp %28 %25 %26
+ %13 = OpIEqual %v3bool %28 %29
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %30 = OpLabel
+%tint_symbol_2 = OpFunction %void None %33
+%tint_symbol = OpFunctionParameter %v4float
+ %36 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %38 = OpLabel
OpStore %tint_pointsize %float_1
- %32 = OpFunctionCall %void %isNormal_c286b7
+ %40 = OpFunctionCall %void %isNormal_c286b7
+ %41 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %34 = OpLabel
- %35 = OpFunctionCall %void %isNormal_c286b7
+%fragment_main = OpFunction %void None %9
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %isNormal_c286b7
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %37 = OpLabel
- %38 = OpFunctionCall %void %isNormal_c286b7
+%compute_main = OpFunction %void None %9
+ %46 = OpLabel
+ %47 = OpFunctionCall %void %isNormal_c286b7
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.wgsl b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.wgsl
index e8b0e2b..5593263 100644
--- a/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isNormal_c286b7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isNormal/c6e880.wgsl b/test/intrinsics/gen/isNormal/c6e880.wgsl
index 9997d8c..0682a4f 100644
--- a/test/intrinsics/gen/isNormal/c6e880.wgsl
+++ b/test/intrinsics/gen/isNormal/c6e880.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isNormal_c6e880();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.msl b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.msl
index b8dda4e..2df6a24 100644
--- a/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.msl
+++ b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void isNormal_c6e880() {
bool res = isnormal(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
isNormal_c6e880();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.spvasm b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.spvasm
index 85f21bb..10c9497 100644
--- a/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.spvasm
@@ -1,29 +1,37 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %isNormal_c6e880 "isNormal_c6e880"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
%float_1 = OpConstant %float 1
%uint = OpTypeInt 32 0
@@ -31,30 +39,38 @@
%uint_524288 = OpConstant %uint 524288
%uint_133169152 = OpConstant %uint 133169152
%_ptr_Function_bool = OpTypePointer Function %bool
- %22 = OpConstantNull %bool
-%isNormal_c6e880 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_bool Function %22
- %17 = OpBitcast %uint %float_1
- %18 = OpBitwiseAnd %uint %17 %uint_133693440
- %19 = OpExtInst %uint %12 UClamp %18 %uint_524288 %uint_133169152
- %9 = OpIEqual %bool %18 %19
- OpStore %res %9
+ %26 = OpConstantNull %bool
+ %27 = OpTypeFunction %void %v4float
+%isNormal_c6e880 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_bool Function %26
+ %21 = OpBitcast %uint %float_1
+ %22 = OpBitwiseAnd %uint %21 %uint_133693440
+ %23 = OpExtInst %uint %16 UClamp %22 %uint_524288 %uint_133169152
+ %13 = OpIEqual %bool %22 %23
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %24 = OpLabel
- OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %isNormal_c6e880
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %27 = OpLabel
- %28 = OpFunctionCall %void %isNormal_c6e880
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %27
+%tint_symbol = OpFunctionParameter %v4float
%30 = OpLabel
- %31 = OpFunctionCall %void %isNormal_c6e880
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %32 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %33 = OpFunctionCall %void %isNormal_c6e880
+ %34 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %isNormal_c6e880
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %isNormal_c6e880
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.wgsl b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.wgsl
index 5218aec..8cef6c2 100644
--- a/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
isNormal_c6e880();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/ldexp/2cb32a.wgsl b/test/intrinsics/gen/ldexp/2cb32a.wgsl
index 46ca343..28840f0 100644
--- a/test/intrinsics/gen/ldexp/2cb32a.wgsl
+++ b/test/intrinsics/gen/ldexp/2cb32a.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
ldexp_2cb32a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.hlsl
index 60b2ca1..756a4aa 100644
--- a/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void ldexp_2cb32a() {
float3 res = ldexp(float3(0.0f, 0.0f, 0.0f), uint3(0u, 0u, 0u));
}
-void vertex_main() {
+tint_symbol vertex_main() {
ldexp_2cb32a();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.spvasm
index 7d726b1..7c0ec55 100644
--- a/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.spvasm
@@ -1,56 +1,72 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %ldexp_2cb32a "ldexp_2cb32a"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
- %15 = OpConstantNull %v3uint
+ %19 = OpConstantNull %v3uint
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%ldexp_2cb32a = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Ldexp %12 %15
- OpStore %res %9
+%ldexp_2cb32a = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Ldexp %16 %19
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %ldexp_2cb32a
+ %29 = OpFunctionCall %void %ldexp_2cb32a
+ %30 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %ldexp_2cb32a
+%fragment_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %ldexp_2cb32a
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %26 = OpLabel
- %27 = OpFunctionCall %void %ldexp_2cb32a
+%compute_main = OpFunction %void None %9
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %ldexp_2cb32a
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.wgsl
index 7a2d880..61a047c 100644
--- a/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
ldexp_2cb32a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/ldexp/4d6f6d.wgsl b/test/intrinsics/gen/ldexp/4d6f6d.wgsl
index 721a215..aa6f4bb 100644
--- a/test/intrinsics/gen/ldexp/4d6f6d.wgsl
+++ b/test/intrinsics/gen/ldexp/4d6f6d.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
ldexp_4d6f6d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.hlsl
index 34a11dc..6826179 100644
--- a/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void ldexp_4d6f6d() {
float4 res = ldexp(float4(0.0f, 0.0f, 0.0f, 0.0f), uint4(0u, 0u, 0u, 0u));
}
-void vertex_main() {
+tint_symbol vertex_main() {
ldexp_4d6f6d();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.spvasm
index 15284e6..63d2d74 100644
--- a/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.spvasm
@@ -1,56 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 35
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %ldexp_4d6f6d "ldexp_4d6f6d"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v4uint = OpTypeVector %uint 4
- %15 = OpConstantNull %v4uint
+ %17 = OpConstantNull %v4uint
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%ldexp_4d6f6d = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Ldexp %12 %15
- OpStore %res %9
+%ldexp_4d6f6d = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Ldexp %8 %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %19 = OpLabel
- OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %ldexp_4d6f6d
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
%23 = OpLabel
- %24 = OpFunctionCall %void %ldexp_4d6f6d
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %26 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
+ OpStore %tint_pointsize %float_1
%27 = OpFunctionCall %void %ldexp_4d6f6d
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %ldexp_4d6f6d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %ldexp_4d6f6d
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.wgsl
index 50dc307..e3a75a7 100644
--- a/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
ldexp_4d6f6d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/ldexp/7bc2fd.wgsl b/test/intrinsics/gen/ldexp/7bc2fd.wgsl
index f3de6a9..9d405fe 100644
--- a/test/intrinsics/gen/ldexp/7bc2fd.wgsl
+++ b/test/intrinsics/gen/ldexp/7bc2fd.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
ldexp_7bc2fd();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.hlsl
index b5ec607..4d473ca 100644
--- a/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void ldexp_7bc2fd() {
float2 res = ldexp(float2(0.0f, 0.0f), uint2(0u, 0u));
}
-void vertex_main() {
+tint_symbol vertex_main() {
ldexp_7bc2fd();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.spvasm
index e91a0d4..2c16517 100644
--- a/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.spvasm
@@ -1,56 +1,72 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %ldexp_7bc2fd "ldexp_7bc2fd"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%uint = OpTypeInt 32 0
%v2uint = OpTypeVector %uint 2
- %15 = OpConstantNull %v2uint
+ %19 = OpConstantNull %v2uint
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%ldexp_7bc2fd = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Ldexp %12 %15
- OpStore %res %9
+%ldexp_7bc2fd = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Ldexp %16 %19
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %ldexp_7bc2fd
+ %29 = OpFunctionCall %void %ldexp_7bc2fd
+ %30 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %ldexp_7bc2fd
+%fragment_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %ldexp_7bc2fd
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %26 = OpLabel
- %27 = OpFunctionCall %void %ldexp_7bc2fd
+%compute_main = OpFunction %void None %9
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %ldexp_7bc2fd
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.wgsl
index 3f6c48e..1b0fbfa 100644
--- a/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
ldexp_7bc2fd();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/ldexp/a31cdc.wgsl b/test/intrinsics/gen/ldexp/a31cdc.wgsl
index 54dd690..ba74142 100644
--- a/test/intrinsics/gen/ldexp/a31cdc.wgsl
+++ b/test/intrinsics/gen/ldexp/a31cdc.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
ldexp_a31cdc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.hlsl
index a099927..7ee93e5 100644
--- a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void ldexp_a31cdc() {
float3 res = ldexp(float3(0.0f, 0.0f, 0.0f), int3(0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
ldexp_a31cdc();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.msl b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.msl
index a535583..12ec936 100644
--- a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.msl
+++ b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void ldexp_a31cdc() {
float3 res = ldexp(float3(), int3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
ldexp_a31cdc();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.spvasm
index 07a38eb..0e0b939 100644
--- a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.spvasm
@@ -1,56 +1,72 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %ldexp_a31cdc "ldexp_a31cdc"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %15 = OpConstantNull %v3int
+ %19 = OpConstantNull %v3int
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%ldexp_a31cdc = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Ldexp %12 %15
- OpStore %res %9
+%ldexp_a31cdc = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Ldexp %16 %19
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %ldexp_a31cdc
+ %29 = OpFunctionCall %void %ldexp_a31cdc
+ %30 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %ldexp_a31cdc
+%fragment_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %ldexp_a31cdc
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %26 = OpLabel
- %27 = OpFunctionCall %void %ldexp_a31cdc
+%compute_main = OpFunction %void None %9
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %ldexp_a31cdc
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.wgsl
index 788cab2..7c995cc 100644
--- a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
ldexp_a31cdc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/ldexp/abd718.wgsl b/test/intrinsics/gen/ldexp/abd718.wgsl
index 7a5eef1..9459f7a 100644
--- a/test/intrinsics/gen/ldexp/abd718.wgsl
+++ b/test/intrinsics/gen/ldexp/abd718.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
ldexp_abd718();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.hlsl
index af7d67b..d5aaaa9 100644
--- a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void ldexp_abd718() {
float2 res = ldexp(float2(0.0f, 0.0f), int2(0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
ldexp_abd718();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.msl b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.msl
index 86338d3..2fa4009 100644
--- a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.msl
+++ b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void ldexp_abd718() {
float2 res = ldexp(float2(), int2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
ldexp_abd718();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.spvasm
index 5d84f62..64f614c 100644
--- a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.spvasm
@@ -1,56 +1,72 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %ldexp_abd718 "ldexp_abd718"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %15 = OpConstantNull %v2int
+ %19 = OpConstantNull %v2int
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%ldexp_abd718 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Ldexp %12 %15
- OpStore %res %9
+%ldexp_abd718 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Ldexp %16 %19
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %ldexp_abd718
+ %29 = OpFunctionCall %void %ldexp_abd718
+ %30 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %ldexp_abd718
+%fragment_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %ldexp_abd718
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %26 = OpLabel
- %27 = OpFunctionCall %void %ldexp_abd718
+%compute_main = OpFunction %void None %9
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %ldexp_abd718
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.wgsl
index 8d38ecd..b130fdc 100644
--- a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
ldexp_abd718();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/ldexp/cc9cde.wgsl b/test/intrinsics/gen/ldexp/cc9cde.wgsl
index 12d88ce..9ff2fdc 100644
--- a/test/intrinsics/gen/ldexp/cc9cde.wgsl
+++ b/test/intrinsics/gen/ldexp/cc9cde.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
ldexp_cc9cde();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.hlsl
index 8134010..a624dc7 100644
--- a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void ldexp_cc9cde() {
float4 res = ldexp(float4(0.0f, 0.0f, 0.0f, 0.0f), int4(0, 0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
ldexp_cc9cde();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.msl b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.msl
index 59232fd..c8a2dc9 100644
--- a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.msl
+++ b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void ldexp_cc9cde() {
float4 res = ldexp(float4(), int4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
ldexp_cc9cde();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.spvasm
index 085dc1a..9fabf44 100644
--- a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.spvasm
@@ -1,56 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 35
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %ldexp_cc9cde "ldexp_cc9cde"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v4int = OpTypeVector %int 4
- %15 = OpConstantNull %v4int
+ %17 = OpConstantNull %v4int
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%ldexp_cc9cde = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Ldexp %12 %15
- OpStore %res %9
+%ldexp_cc9cde = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Ldexp %8 %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %19 = OpLabel
- OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %ldexp_cc9cde
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
%23 = OpLabel
- %24 = OpFunctionCall %void %ldexp_cc9cde
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %26 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
+ OpStore %tint_pointsize %float_1
%27 = OpFunctionCall %void %ldexp_cc9cde
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %ldexp_cc9cde
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %ldexp_cc9cde
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.wgsl
index 5db48ce..8e51bc3 100644
--- a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
ldexp_cc9cde();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/ldexp/db8b49.wgsl b/test/intrinsics/gen/ldexp/db8b49.wgsl
index 97f4987..77b71bb 100644
--- a/test/intrinsics/gen/ldexp/db8b49.wgsl
+++ b/test/intrinsics/gen/ldexp/db8b49.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
ldexp_db8b49();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.hlsl
index db60414..4b5c054 100644
--- a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void ldexp_db8b49() {
float res = ldexp(1.0f, 1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
ldexp_db8b49();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.msl b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.msl
index 08368a3..cc7fbc1 100644
--- a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.msl
+++ b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void ldexp_db8b49() {
float res = ldexp(1.0f, 1);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
ldexp_db8b49();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.spvasm
index fd415e6..1295722 100644
--- a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %ldexp_db8b49 "ldexp_db8b49"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_Function_float = OpTypePointer Function %float
-%ldexp_db8b49 = OpFunction %void None %5
- %8 = OpLabel
+ %20 = OpTypeFunction %void %v4float
+%ldexp_db8b49 = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Ldexp %float_1 %int_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Ldexp %float_1 %int_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %ldexp_db8b49
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %ldexp_db8b49
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
%23 = OpLabel
- %24 = OpFunctionCall %void %ldexp_db8b49
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %26 = OpFunctionCall %void %ldexp_db8b49
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %ldexp_db8b49
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %ldexp_db8b49
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.wgsl
index cc84308..cc71fc3 100644
--- a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
ldexp_db8b49();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/ldexp/f54ff2.wgsl b/test/intrinsics/gen/ldexp/f54ff2.wgsl
index dfe420a..72fef93 100644
--- a/test/intrinsics/gen/ldexp/f54ff2.wgsl
+++ b/test/intrinsics/gen/ldexp/f54ff2.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
ldexp_f54ff2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.hlsl
index d674b8d..c20a999 100644
--- a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void ldexp_f54ff2() {
float res = ldexp(1.0f, 1u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
ldexp_f54ff2();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.msl b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.msl
index 4980cea..9cef87e 100644
--- a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.msl
+++ b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void ldexp_f54ff2() {
float res = ldexp(1.0f, 1u);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
ldexp_f54ff2();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.spvasm
index 6d449b0..221b818 100644
--- a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %ldexp_f54ff2 "ldexp_f54ff2"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%_ptr_Function_float = OpTypePointer Function %float
-%ldexp_f54ff2 = OpFunction %void None %5
- %8 = OpLabel
+ %20 = OpTypeFunction %void %v4float
+%ldexp_f54ff2 = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Ldexp %float_1 %uint_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Ldexp %float_1 %uint_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %ldexp_f54ff2
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %ldexp_f54ff2
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
%23 = OpLabel
- %24 = OpFunctionCall %void %ldexp_f54ff2
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %26 = OpFunctionCall %void %ldexp_f54ff2
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %ldexp_f54ff2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %ldexp_f54ff2
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.wgsl
index aea15a0..37e584c 100644
--- a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
ldexp_f54ff2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/length/056071.wgsl b/test/intrinsics/gen/length/056071.wgsl
index 61c6111..1684a87 100644
--- a/test/intrinsics/gen/length/056071.wgsl
+++ b/test/intrinsics/gen/length/056071.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
length_056071();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/length/056071.wgsl.expected.hlsl b/test/intrinsics/gen/length/056071.wgsl.expected.hlsl
index a3ffa2a..3c0448d 100644
--- a/test/intrinsics/gen/length/056071.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/length/056071.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void length_056071() {
float res = length(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
length_056071();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/length/056071.wgsl.expected.msl b/test/intrinsics/gen/length/056071.wgsl.expected.msl
index 5ea9ae9..bddb507 100644
--- a/test/intrinsics/gen/length/056071.wgsl.expected.msl
+++ b/test/intrinsics/gen/length/056071.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void length_056071() {
float res = length(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
length_056071();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/length/056071.wgsl.expected.spvasm b/test/intrinsics/gen/length/056071.wgsl.expected.spvasm
index 8fd8983..aa71be3 100644
--- a/test/intrinsics/gen/length/056071.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/length/056071.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %length_056071 "length_056071"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_float = OpTypePointer Function %float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%length_056071 = OpFunction %void None %5
- %8 = OpLabel
+%length_056071 = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Length %12
- OpStore %res %9
+ %13 = OpExtInst %float %14 Length %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %length_056071
+ %26 = OpFunctionCall %void %length_056071
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %length_056071
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %length_056071
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %length_056071
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %length_056071
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/length/056071.wgsl.expected.wgsl b/test/intrinsics/gen/length/056071.wgsl.expected.wgsl
index 76b3aa8..fdf20a4 100644
--- a/test/intrinsics/gen/length/056071.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/length/056071.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
length_056071();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/length/602a17.wgsl b/test/intrinsics/gen/length/602a17.wgsl
index 6f5d3b5..7db07ab 100644
--- a/test/intrinsics/gen/length/602a17.wgsl
+++ b/test/intrinsics/gen/length/602a17.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
length_602a17();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/length/602a17.wgsl.expected.hlsl b/test/intrinsics/gen/length/602a17.wgsl.expected.hlsl
index db461f8..c9fe718 100644
--- a/test/intrinsics/gen/length/602a17.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/length/602a17.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void length_602a17() {
float res = length(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
length_602a17();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/length/602a17.wgsl.expected.spvasm b/test/intrinsics/gen/length/602a17.wgsl.expected.spvasm
index 68516f0..aec0374 100644
--- a/test/intrinsics/gen/length/602a17.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/length/602a17.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %length_602a17 "length_602a17"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%length_602a17 = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+%length_602a17 = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Length %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Length %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %length_602a17
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %length_602a17
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %length_602a17
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %length_602a17
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %length_602a17
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %length_602a17
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/length/602a17.wgsl.expected.wgsl b/test/intrinsics/gen/length/602a17.wgsl.expected.wgsl
index 2b6b9e9..c277392 100644
--- a/test/intrinsics/gen/length/602a17.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/length/602a17.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
length_602a17();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/length/afde8b.wgsl b/test/intrinsics/gen/length/afde8b.wgsl
index fde4834..ea24ab2 100644
--- a/test/intrinsics/gen/length/afde8b.wgsl
+++ b/test/intrinsics/gen/length/afde8b.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
length_afde8b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/length/afde8b.wgsl.expected.hlsl b/test/intrinsics/gen/length/afde8b.wgsl.expected.hlsl
index 005dc5a..b0b2597 100644
--- a/test/intrinsics/gen/length/afde8b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/length/afde8b.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void length_afde8b() {
float res = length(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
length_afde8b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/length/afde8b.wgsl.expected.msl b/test/intrinsics/gen/length/afde8b.wgsl.expected.msl
index 56514b1..1902264 100644
--- a/test/intrinsics/gen/length/afde8b.wgsl.expected.msl
+++ b/test/intrinsics/gen/length/afde8b.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void length_afde8b() {
float res = length(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
length_afde8b();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/length/afde8b.wgsl.expected.spvasm b/test/intrinsics/gen/length/afde8b.wgsl.expected.spvasm
index 70f5d76..73d97a8 100644
--- a/test/intrinsics/gen/length/afde8b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/length/afde8b.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %length_afde8b "length_afde8b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_float = OpTypePointer Function %float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%length_afde8b = OpFunction %void None %5
- %8 = OpLabel
+%length_afde8b = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Length %12
- OpStore %res %9
+ %13 = OpExtInst %float %14 Length %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %length_afde8b
+ %26 = OpFunctionCall %void %length_afde8b
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %length_afde8b
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %length_afde8b
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %length_afde8b
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %length_afde8b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/length/afde8b.wgsl.expected.wgsl b/test/intrinsics/gen/length/afde8b.wgsl.expected.wgsl
index 052f0af..0630c3a 100644
--- a/test/intrinsics/gen/length/afde8b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/length/afde8b.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
length_afde8b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/length/becebf.wgsl b/test/intrinsics/gen/length/becebf.wgsl
index 447d82e..b3db3c5 100644
--- a/test/intrinsics/gen/length/becebf.wgsl
+++ b/test/intrinsics/gen/length/becebf.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
length_becebf();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/length/becebf.wgsl.expected.hlsl b/test/intrinsics/gen/length/becebf.wgsl.expected.hlsl
index a1c4197..c7daa53 100644
--- a/test/intrinsics/gen/length/becebf.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/length/becebf.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void length_becebf() {
float res = length(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
length_becebf();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/length/becebf.wgsl.expected.msl b/test/intrinsics/gen/length/becebf.wgsl.expected.msl
index a63f31a..9cd6341 100644
--- a/test/intrinsics/gen/length/becebf.wgsl.expected.msl
+++ b/test/intrinsics/gen/length/becebf.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void length_becebf() {
float res = length(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
length_becebf();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/length/becebf.wgsl.expected.spvasm b/test/intrinsics/gen/length/becebf.wgsl.expected.spvasm
index 48be6d3..4b20f99 100644
--- a/test/intrinsics/gen/length/becebf.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/length/becebf.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %length_becebf "length_becebf"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_float = OpTypePointer Function %float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%length_becebf = OpFunction %void None %5
- %8 = OpLabel
+%length_becebf = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Length %12
- OpStore %res %9
+ %13 = OpExtInst %float %14 Length %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %length_becebf
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %length_becebf
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %length_becebf
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %length_becebf
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %length_becebf
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/length/becebf.wgsl.expected.wgsl b/test/intrinsics/gen/length/becebf.wgsl.expected.wgsl
index c8a2c42..0abe272 100644
--- a/test/intrinsics/gen/length/becebf.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/length/becebf.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
length_becebf();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/log/3da25a.wgsl b/test/intrinsics/gen/log/3da25a.wgsl
index 07716b2..14a4ada 100644
--- a/test/intrinsics/gen/log/3da25a.wgsl
+++ b/test/intrinsics/gen/log/3da25a.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
log_3da25a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/log/3da25a.wgsl.expected.hlsl b/test/intrinsics/gen/log/3da25a.wgsl.expected.hlsl
index 7a247e3..d2ee1f4 100644
--- a/test/intrinsics/gen/log/3da25a.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/log/3da25a.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void log_3da25a() {
float4 res = log(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
log_3da25a();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/log/3da25a.wgsl.expected.msl b/test/intrinsics/gen/log/3da25a.wgsl.expected.msl
index ff81127..87551df 100644
--- a/test/intrinsics/gen/log/3da25a.wgsl.expected.msl
+++ b/test/intrinsics/gen/log/3da25a.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void log_3da25a() {
float4 res = log(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
log_3da25a();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/log/3da25a.wgsl.expected.spvasm b/test/intrinsics/gen/log/3da25a.wgsl.expected.spvasm
index 3d66145..de8964a 100644
--- a/test/intrinsics/gen/log/3da25a.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/log/3da25a.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %log_3da25a "log_3da25a"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %log_3da25a = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Log %12
- OpStore %res %9
+ %log_3da25a = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Log %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %log_3da25a
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %log_3da25a
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %log_3da25a
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %log_3da25a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %log_3da25a
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/log/3da25a.wgsl.expected.wgsl b/test/intrinsics/gen/log/3da25a.wgsl.expected.wgsl
index 452e71c..c143d5e 100644
--- a/test/intrinsics/gen/log/3da25a.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/log/3da25a.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
log_3da25a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/log/7114a6.wgsl b/test/intrinsics/gen/log/7114a6.wgsl
index bac8f95..242a19a 100644
--- a/test/intrinsics/gen/log/7114a6.wgsl
+++ b/test/intrinsics/gen/log/7114a6.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
log_7114a6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/log/7114a6.wgsl.expected.hlsl b/test/intrinsics/gen/log/7114a6.wgsl.expected.hlsl
index e1f96d2..81658bb 100644
--- a/test/intrinsics/gen/log/7114a6.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/log/7114a6.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void log_7114a6() {
float res = log(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
log_7114a6();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/log/7114a6.wgsl.expected.msl b/test/intrinsics/gen/log/7114a6.wgsl.expected.msl
index e052391..ca21705 100644
--- a/test/intrinsics/gen/log/7114a6.wgsl.expected.msl
+++ b/test/intrinsics/gen/log/7114a6.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void log_7114a6() {
float res = log(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
log_7114a6();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/log/7114a6.wgsl.expected.spvasm b/test/intrinsics/gen/log/7114a6.wgsl.expected.spvasm
index fd0a41c..2069403 100644
--- a/test/intrinsics/gen/log/7114a6.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/log/7114a6.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %log_7114a6 "log_7114a6"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
- %log_7114a6 = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+ %log_7114a6 = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Log %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Log %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %log_7114a6
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %log_7114a6
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %log_7114a6
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %log_7114a6
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %log_7114a6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %log_7114a6
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/log/7114a6.wgsl.expected.wgsl b/test/intrinsics/gen/log/7114a6.wgsl.expected.wgsl
index 9887a63..fd87d03 100644
--- a/test/intrinsics/gen/log/7114a6.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/log/7114a6.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
log_7114a6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/log/b2ce28.wgsl b/test/intrinsics/gen/log/b2ce28.wgsl
index 540615d..2dd933c 100644
--- a/test/intrinsics/gen/log/b2ce28.wgsl
+++ b/test/intrinsics/gen/log/b2ce28.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
log_b2ce28();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/log/b2ce28.wgsl.expected.hlsl b/test/intrinsics/gen/log/b2ce28.wgsl.expected.hlsl
index 0e6d75d..63b63dd 100644
--- a/test/intrinsics/gen/log/b2ce28.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/log/b2ce28.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void log_b2ce28() {
float2 res = log(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
log_b2ce28();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/log/b2ce28.wgsl.expected.msl b/test/intrinsics/gen/log/b2ce28.wgsl.expected.msl
index 69f048a..43777d4 100644
--- a/test/intrinsics/gen/log/b2ce28.wgsl.expected.msl
+++ b/test/intrinsics/gen/log/b2ce28.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void log_b2ce28() {
float2 res = log(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
log_b2ce28();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/log/b2ce28.wgsl.expected.spvasm b/test/intrinsics/gen/log/b2ce28.wgsl.expected.spvasm
index 3615a64..94e3fda 100644
--- a/test/intrinsics/gen/log/b2ce28.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/log/b2ce28.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %log_b2ce28 "log_b2ce28"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %log_b2ce28 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Log %12
- OpStore %res %9
+ %log_b2ce28 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Log %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %log_b2ce28
+ %26 = OpFunctionCall %void %log_b2ce28
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %log_b2ce28
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %log_b2ce28
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %log_b2ce28
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %log_b2ce28
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/log/b2ce28.wgsl.expected.wgsl b/test/intrinsics/gen/log/b2ce28.wgsl.expected.wgsl
index 3e98760..0eb2862 100644
--- a/test/intrinsics/gen/log/b2ce28.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/log/b2ce28.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
log_b2ce28();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/log/f4c570.wgsl b/test/intrinsics/gen/log/f4c570.wgsl
index 70a5b35..fe34013 100644
--- a/test/intrinsics/gen/log/f4c570.wgsl
+++ b/test/intrinsics/gen/log/f4c570.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
log_f4c570();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/log/f4c570.wgsl.expected.hlsl b/test/intrinsics/gen/log/f4c570.wgsl.expected.hlsl
index 92b5439..fd8c5ab 100644
--- a/test/intrinsics/gen/log/f4c570.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/log/f4c570.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void log_f4c570() {
float3 res = log(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
log_f4c570();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/log/f4c570.wgsl.expected.msl b/test/intrinsics/gen/log/f4c570.wgsl.expected.msl
index e1b3061..6344246 100644
--- a/test/intrinsics/gen/log/f4c570.wgsl.expected.msl
+++ b/test/intrinsics/gen/log/f4c570.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void log_f4c570() {
float3 res = log(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
log_f4c570();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/log/f4c570.wgsl.expected.spvasm b/test/intrinsics/gen/log/f4c570.wgsl.expected.spvasm
index 367cee2..69b5d67 100644
--- a/test/intrinsics/gen/log/f4c570.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/log/f4c570.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %log_f4c570 "log_f4c570"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %log_f4c570 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Log %12
- OpStore %res %9
+ %log_f4c570 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Log %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %log_f4c570
+ %26 = OpFunctionCall %void %log_f4c570
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %log_f4c570
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %log_f4c570
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %log_f4c570
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %log_f4c570
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/log/f4c570.wgsl.expected.wgsl b/test/intrinsics/gen/log/f4c570.wgsl.expected.wgsl
index 57a2f17..7b61578 100644
--- a/test/intrinsics/gen/log/f4c570.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/log/f4c570.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
log_f4c570();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/log2/4036ed.wgsl b/test/intrinsics/gen/log2/4036ed.wgsl
index 12a5124..4a16c52 100644
--- a/test/intrinsics/gen/log2/4036ed.wgsl
+++ b/test/intrinsics/gen/log2/4036ed.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
log2_4036ed();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/log2/4036ed.wgsl.expected.hlsl b/test/intrinsics/gen/log2/4036ed.wgsl.expected.hlsl
index 64d6c00..8cf1e31 100644
--- a/test/intrinsics/gen/log2/4036ed.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/log2/4036ed.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void log2_4036ed() {
float res = log2(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
log2_4036ed();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/log2/4036ed.wgsl.expected.msl b/test/intrinsics/gen/log2/4036ed.wgsl.expected.msl
index 30658f2..49dc07a 100644
--- a/test/intrinsics/gen/log2/4036ed.wgsl.expected.msl
+++ b/test/intrinsics/gen/log2/4036ed.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void log2_4036ed() {
float res = log2(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
log2_4036ed();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/log2/4036ed.wgsl.expected.spvasm b/test/intrinsics/gen/log2/4036ed.wgsl.expected.spvasm
index 25873c2..79365bf 100644
--- a/test/intrinsics/gen/log2/4036ed.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/log2/4036ed.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %log2_4036ed "log2_4036ed"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%log2_4036ed = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+%log2_4036ed = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Log2 %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Log2 %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %log2_4036ed
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %log2_4036ed
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %log2_4036ed
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %log2_4036ed
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %log2_4036ed
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %log2_4036ed
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/log2/4036ed.wgsl.expected.wgsl b/test/intrinsics/gen/log2/4036ed.wgsl.expected.wgsl
index c188875..6e2a761 100644
--- a/test/intrinsics/gen/log2/4036ed.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/log2/4036ed.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
log2_4036ed();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/log2/902988.wgsl b/test/intrinsics/gen/log2/902988.wgsl
index 37fa435..fb66cde 100644
--- a/test/intrinsics/gen/log2/902988.wgsl
+++ b/test/intrinsics/gen/log2/902988.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
log2_902988();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/log2/902988.wgsl.expected.hlsl b/test/intrinsics/gen/log2/902988.wgsl.expected.hlsl
index cf1503f..36b4440 100644
--- a/test/intrinsics/gen/log2/902988.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/log2/902988.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void log2_902988() {
float4 res = log2(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
log2_902988();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/log2/902988.wgsl.expected.msl b/test/intrinsics/gen/log2/902988.wgsl.expected.msl
index 4a9bd89..d7828e6 100644
--- a/test/intrinsics/gen/log2/902988.wgsl.expected.msl
+++ b/test/intrinsics/gen/log2/902988.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void log2_902988() {
float4 res = log2(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
log2_902988();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/log2/902988.wgsl.expected.spvasm b/test/intrinsics/gen/log2/902988.wgsl.expected.spvasm
index bab1daa..094a885 100644
--- a/test/intrinsics/gen/log2/902988.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/log2/902988.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %log2_902988 "log2_902988"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%log2_902988 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Log2 %12
- OpStore %res %9
+%log2_902988 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Log2 %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %log2_902988
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %log2_902988
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %log2_902988
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %log2_902988
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %log2_902988
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/log2/902988.wgsl.expected.wgsl b/test/intrinsics/gen/log2/902988.wgsl.expected.wgsl
index 9f4b264..290a85e 100644
--- a/test/intrinsics/gen/log2/902988.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/log2/902988.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
log2_902988();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/log2/adb233.wgsl b/test/intrinsics/gen/log2/adb233.wgsl
index 54b7dc3..e3e72b5 100644
--- a/test/intrinsics/gen/log2/adb233.wgsl
+++ b/test/intrinsics/gen/log2/adb233.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
log2_adb233();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/log2/adb233.wgsl.expected.hlsl b/test/intrinsics/gen/log2/adb233.wgsl.expected.hlsl
index d78b713..d12c23f 100644
--- a/test/intrinsics/gen/log2/adb233.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/log2/adb233.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void log2_adb233() {
float3 res = log2(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
log2_adb233();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/log2/adb233.wgsl.expected.msl b/test/intrinsics/gen/log2/adb233.wgsl.expected.msl
index 8e122aa..ee68aab 100644
--- a/test/intrinsics/gen/log2/adb233.wgsl.expected.msl
+++ b/test/intrinsics/gen/log2/adb233.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void log2_adb233() {
float3 res = log2(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
log2_adb233();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/log2/adb233.wgsl.expected.spvasm b/test/intrinsics/gen/log2/adb233.wgsl.expected.spvasm
index 60d3c54..166e27f 100644
--- a/test/intrinsics/gen/log2/adb233.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/log2/adb233.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %log2_adb233 "log2_adb233"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%log2_adb233 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Log2 %12
- OpStore %res %9
+%log2_adb233 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Log2 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %log2_adb233
+ %26 = OpFunctionCall %void %log2_adb233
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %log2_adb233
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %log2_adb233
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %log2_adb233
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %log2_adb233
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/log2/adb233.wgsl.expected.wgsl b/test/intrinsics/gen/log2/adb233.wgsl.expected.wgsl
index 1b6e0ca5..aaac332 100644
--- a/test/intrinsics/gen/log2/adb233.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/log2/adb233.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
log2_adb233();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/log2/aea659.wgsl b/test/intrinsics/gen/log2/aea659.wgsl
index b9d25e4..6b6d5f4 100644
--- a/test/intrinsics/gen/log2/aea659.wgsl
+++ b/test/intrinsics/gen/log2/aea659.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
log2_aea659();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/log2/aea659.wgsl.expected.hlsl b/test/intrinsics/gen/log2/aea659.wgsl.expected.hlsl
index d4bf6ed..c14b45a 100644
--- a/test/intrinsics/gen/log2/aea659.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/log2/aea659.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void log2_aea659() {
float2 res = log2(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
log2_aea659();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/log2/aea659.wgsl.expected.msl b/test/intrinsics/gen/log2/aea659.wgsl.expected.msl
index fa4ade2..4e44b11 100644
--- a/test/intrinsics/gen/log2/aea659.wgsl.expected.msl
+++ b/test/intrinsics/gen/log2/aea659.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void log2_aea659() {
float2 res = log2(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
log2_aea659();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/log2/aea659.wgsl.expected.spvasm b/test/intrinsics/gen/log2/aea659.wgsl.expected.spvasm
index ac0c815..7e17b05 100644
--- a/test/intrinsics/gen/log2/aea659.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/log2/aea659.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %log2_aea659 "log2_aea659"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%log2_aea659 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Log2 %12
- OpStore %res %9
+%log2_aea659 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Log2 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %log2_aea659
+ %26 = OpFunctionCall %void %log2_aea659
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %log2_aea659
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %log2_aea659
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %log2_aea659
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %log2_aea659
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/log2/aea659.wgsl.expected.wgsl b/test/intrinsics/gen/log2/aea659.wgsl.expected.wgsl
index f21cead..05a7f5f 100644
--- a/test/intrinsics/gen/log2/aea659.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/log2/aea659.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
log2_aea659();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/max/0c0aae.wgsl b/test/intrinsics/gen/max/0c0aae.wgsl
index e68b502..36e2239 100644
--- a/test/intrinsics/gen/max/0c0aae.wgsl
+++ b/test/intrinsics/gen/max/0c0aae.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
max_0c0aae();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/max/0c0aae.wgsl.expected.hlsl b/test/intrinsics/gen/max/0c0aae.wgsl.expected.hlsl
index 9190770..e4b23d4 100644
--- a/test/intrinsics/gen/max/0c0aae.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/max/0c0aae.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void max_0c0aae() {
uint res = max(1u, 1u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
max_0c0aae();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/max/0c0aae.wgsl.expected.msl b/test/intrinsics/gen/max/0c0aae.wgsl.expected.msl
index c70f546..9ebf54a 100644
--- a/test/intrinsics/gen/max/0c0aae.wgsl.expected.msl
+++ b/test/intrinsics/gen/max/0c0aae.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void max_0c0aae() {
uint res = max(1u, 1u);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
max_0c0aae();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/max/0c0aae.wgsl.expected.spvasm b/test/intrinsics/gen/max/0c0aae.wgsl.expected.spvasm
index 16889df..cc586bb 100644
--- a/test/intrinsics/gen/max/0c0aae.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/max/0c0aae.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %max_0c0aae "max_0c0aae"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%_ptr_Function_uint = OpTypePointer Function %uint
- %15 = OpConstantNull %uint
+ %19 = OpConstantNull %uint
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %max_0c0aae = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_uint Function %15
- %9 = OpExtInst %uint %11 UMax %uint_1 %uint_1
- OpStore %res %9
+ %max_0c0aae = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %19
+ %13 = OpExtInst %uint %15 UMax %uint_1 %uint_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %max_0c0aae
+ %27 = OpFunctionCall %void %max_0c0aae
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %max_0c0aae
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %max_0c0aae
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %max_0c0aae
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %max_0c0aae
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/max/0c0aae.wgsl.expected.wgsl b/test/intrinsics/gen/max/0c0aae.wgsl.expected.wgsl
index 911ceb0..5ef8934 100644
--- a/test/intrinsics/gen/max/0c0aae.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/max/0c0aae.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
max_0c0aae();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/max/25eafe.wgsl b/test/intrinsics/gen/max/25eafe.wgsl
index 1662e9f..6674302 100644
--- a/test/intrinsics/gen/max/25eafe.wgsl
+++ b/test/intrinsics/gen/max/25eafe.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
max_25eafe();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/max/25eafe.wgsl.expected.hlsl b/test/intrinsics/gen/max/25eafe.wgsl.expected.hlsl
index fbd6119..21ad0f5 100644
--- a/test/intrinsics/gen/max/25eafe.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/max/25eafe.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void max_25eafe() {
int3 res = max(int3(0, 0, 0), int3(0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
max_25eafe();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/max/25eafe.wgsl.expected.msl b/test/intrinsics/gen/max/25eafe.wgsl.expected.msl
index 42f0ea3..b8eca1d 100644
--- a/test/intrinsics/gen/max/25eafe.wgsl.expected.msl
+++ b/test/intrinsics/gen/max/25eafe.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void max_25eafe() {
int3 res = max(int3(), int3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
max_25eafe();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/max/25eafe.wgsl.expected.spvasm b/test/intrinsics/gen/max/25eafe.wgsl.expected.spvasm
index 2e5b431..9c17396 100644
--- a/test/intrinsics/gen/max/25eafe.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/max/25eafe.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %max_25eafe "max_25eafe"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %13 = OpConstantNull %v3int
+ %17 = OpConstantNull %v3int
%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %max_25eafe = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %13
- %9 = OpExtInst %v3int %12 SMax %13 %13
- OpStore %res %9
+ %max_25eafe = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %17
+ %13 = OpExtInst %v3int %16 SMax %17 %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %max_25eafe
+ %27 = OpFunctionCall %void %max_25eafe
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %max_25eafe
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %max_25eafe
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %max_25eafe
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %max_25eafe
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/max/25eafe.wgsl.expected.wgsl b/test/intrinsics/gen/max/25eafe.wgsl.expected.wgsl
index 7f7ed46..bc18138 100644
--- a/test/intrinsics/gen/max/25eafe.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/max/25eafe.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
max_25eafe();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/max/320815.wgsl b/test/intrinsics/gen/max/320815.wgsl
index 0e5a426..6c14e5b 100644
--- a/test/intrinsics/gen/max/320815.wgsl
+++ b/test/intrinsics/gen/max/320815.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
max_320815();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/max/320815.wgsl.expected.hlsl b/test/intrinsics/gen/max/320815.wgsl.expected.hlsl
index 454bb3a..d4abc9e 100644
--- a/test/intrinsics/gen/max/320815.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/max/320815.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void max_320815() {
uint2 res = max(uint2(0u, 0u), uint2(0u, 0u));
}
-void vertex_main() {
+tint_symbol vertex_main() {
max_320815();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/max/320815.wgsl.expected.msl b/test/intrinsics/gen/max/320815.wgsl.expected.msl
index 4f151c1..9ecdcb9 100644
--- a/test/intrinsics/gen/max/320815.wgsl.expected.msl
+++ b/test/intrinsics/gen/max/320815.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void max_320815() {
uint2 res = max(uint2(), uint2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
max_320815();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/max/320815.wgsl.expected.spvasm b/test/intrinsics/gen/max/320815.wgsl.expected.spvasm
index aaac67e..24307bd 100644
--- a/test/intrinsics/gen/max/320815.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/max/320815.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %max_320815 "max_320815"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v2uint = OpTypeVector %uint 2
- %13 = OpConstantNull %v2uint
+ %17 = OpConstantNull %v2uint
%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %max_320815 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2uint Function %13
- %9 = OpExtInst %v2uint %12 UMax %13 %13
- OpStore %res %9
+ %max_320815 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %17
+ %13 = OpExtInst %v2uint %16 UMax %17 %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %max_320815
+ %27 = OpFunctionCall %void %max_320815
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %max_320815
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %max_320815
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %max_320815
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %max_320815
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/max/320815.wgsl.expected.wgsl b/test/intrinsics/gen/max/320815.wgsl.expected.wgsl
index f99eb40..c845ac3 100644
--- a/test/intrinsics/gen/max/320815.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/max/320815.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
max_320815();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/max/44a39d.wgsl b/test/intrinsics/gen/max/44a39d.wgsl
index 1767a3d..ba199cc 100644
--- a/test/intrinsics/gen/max/44a39d.wgsl
+++ b/test/intrinsics/gen/max/44a39d.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
max_44a39d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/max/44a39d.wgsl.expected.hlsl b/test/intrinsics/gen/max/44a39d.wgsl.expected.hlsl
index 5b3fdc3..d093206 100644
--- a/test/intrinsics/gen/max/44a39d.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/max/44a39d.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void max_44a39d() {
float res = max(1.0f, 1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
max_44a39d();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/max/44a39d.wgsl.expected.msl b/test/intrinsics/gen/max/44a39d.wgsl.expected.msl
index 4dc7f9c..ba3fcf1 100644
--- a/test/intrinsics/gen/max/44a39d.wgsl.expected.msl
+++ b/test/intrinsics/gen/max/44a39d.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void max_44a39d() {
float res = fmax(1.0f, 1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
max_44a39d();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/max/44a39d.wgsl.expected.spvasm b/test/intrinsics/gen/max/44a39d.wgsl.expected.spvasm
index 19bb7a4..b2775c6 100644
--- a/test/intrinsics/gen/max/44a39d.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/max/44a39d.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %max_44a39d "max_44a39d"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
- %max_44a39d = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+ %max_44a39d = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 NMax %float_1 %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 NMax %float_1 %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %max_44a39d
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %max_44a39d
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %max_44a39d
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %max_44a39d
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %max_44a39d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %max_44a39d
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/max/44a39d.wgsl.expected.wgsl b/test/intrinsics/gen/max/44a39d.wgsl.expected.wgsl
index d520c06..6958016 100644
--- a/test/intrinsics/gen/max/44a39d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/max/44a39d.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
max_44a39d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/max/453e04.wgsl b/test/intrinsics/gen/max/453e04.wgsl
index 1ed4d30..15807d4 100644
--- a/test/intrinsics/gen/max/453e04.wgsl
+++ b/test/intrinsics/gen/max/453e04.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
max_453e04();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/max/453e04.wgsl.expected.hlsl b/test/intrinsics/gen/max/453e04.wgsl.expected.hlsl
index 1500fa2..d89a97b 100644
--- a/test/intrinsics/gen/max/453e04.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/max/453e04.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void max_453e04() {
uint4 res = max(uint4(0u, 0u, 0u, 0u), uint4(0u, 0u, 0u, 0u));
}
-void vertex_main() {
+tint_symbol vertex_main() {
max_453e04();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/max/453e04.wgsl.expected.msl b/test/intrinsics/gen/max/453e04.wgsl.expected.msl
index 9704013..d8b12c6 100644
--- a/test/intrinsics/gen/max/453e04.wgsl.expected.msl
+++ b/test/intrinsics/gen/max/453e04.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void max_453e04() {
uint4 res = max(uint4(), uint4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
max_453e04();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/max/453e04.wgsl.expected.spvasm b/test/intrinsics/gen/max/453e04.wgsl.expected.spvasm
index c043630..942578b 100644
--- a/test/intrinsics/gen/max/453e04.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/max/453e04.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %max_453e04 "max_453e04"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v4uint = OpTypeVector %uint 4
- %13 = OpConstantNull %v4uint
+ %17 = OpConstantNull %v4uint
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %max_453e04 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %13
- %9 = OpExtInst %v4uint %12 UMax %13 %13
- OpStore %res %9
+ %max_453e04 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %17
+ %13 = OpExtInst %v4uint %16 UMax %17 %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %max_453e04
+ %27 = OpFunctionCall %void %max_453e04
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %max_453e04
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %max_453e04
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %max_453e04
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %max_453e04
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/max/453e04.wgsl.expected.wgsl b/test/intrinsics/gen/max/453e04.wgsl.expected.wgsl
index 37ad8eb..5549a7d 100644
--- a/test/intrinsics/gen/max/453e04.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/max/453e04.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
max_453e04();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/max/462050.wgsl b/test/intrinsics/gen/max/462050.wgsl
index 1e694e8..8f5be92 100644
--- a/test/intrinsics/gen/max/462050.wgsl
+++ b/test/intrinsics/gen/max/462050.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
max_462050();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/max/462050.wgsl.expected.hlsl b/test/intrinsics/gen/max/462050.wgsl.expected.hlsl
index cab3796..3e0d5d4 100644
--- a/test/intrinsics/gen/max/462050.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/max/462050.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void max_462050() {
float2 res = max(float2(0.0f, 0.0f), float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
max_462050();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/max/462050.wgsl.expected.msl b/test/intrinsics/gen/max/462050.wgsl.expected.msl
index 073d8df..ef47fd2 100644
--- a/test/intrinsics/gen/max/462050.wgsl.expected.msl
+++ b/test/intrinsics/gen/max/462050.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void max_462050() {
float2 res = fmax(float2(), float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
max_462050();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/max/462050.wgsl.expected.spvasm b/test/intrinsics/gen/max/462050.wgsl.expected.spvasm
index 02f6779..6a3f595 100644
--- a/test/intrinsics/gen/max/462050.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/max/462050.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %max_462050 "max_462050"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %max_462050 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 NMax %12 %12
- OpStore %res %9
+ %max_462050 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 NMax %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %max_462050
+ %26 = OpFunctionCall %void %max_462050
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %max_462050
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %max_462050
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %max_462050
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %max_462050
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/max/462050.wgsl.expected.wgsl b/test/intrinsics/gen/max/462050.wgsl.expected.wgsl
index 07aa216..6edc8a5 100644
--- a/test/intrinsics/gen/max/462050.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/max/462050.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
max_462050();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/max/4883ac.wgsl b/test/intrinsics/gen/max/4883ac.wgsl
index e8da7d2..1cf8125 100644
--- a/test/intrinsics/gen/max/4883ac.wgsl
+++ b/test/intrinsics/gen/max/4883ac.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
max_4883ac();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/max/4883ac.wgsl.expected.hlsl b/test/intrinsics/gen/max/4883ac.wgsl.expected.hlsl
index d14a43d..4020fd7 100644
--- a/test/intrinsics/gen/max/4883ac.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/max/4883ac.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void max_4883ac() {
float3 res = max(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
max_4883ac();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/max/4883ac.wgsl.expected.msl b/test/intrinsics/gen/max/4883ac.wgsl.expected.msl
index 05f7616..fc31548 100644
--- a/test/intrinsics/gen/max/4883ac.wgsl.expected.msl
+++ b/test/intrinsics/gen/max/4883ac.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void max_4883ac() {
float3 res = fmax(float3(), float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
max_4883ac();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/max/4883ac.wgsl.expected.spvasm b/test/intrinsics/gen/max/4883ac.wgsl.expected.spvasm
index 9af3925..497672a 100644
--- a/test/intrinsics/gen/max/4883ac.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/max/4883ac.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %max_4883ac "max_4883ac"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %max_4883ac = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 NMax %12 %12
- OpStore %res %9
+ %max_4883ac = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 NMax %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %max_4883ac
+ %26 = OpFunctionCall %void %max_4883ac
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %max_4883ac
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %max_4883ac
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %max_4883ac
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %max_4883ac
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/max/4883ac.wgsl.expected.wgsl b/test/intrinsics/gen/max/4883ac.wgsl.expected.wgsl
index a066ad5..93c3a20 100644
--- a/test/intrinsics/gen/max/4883ac.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/max/4883ac.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
max_4883ac();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/max/85e6bc.wgsl b/test/intrinsics/gen/max/85e6bc.wgsl
index a915f0d..116c261 100644
--- a/test/intrinsics/gen/max/85e6bc.wgsl
+++ b/test/intrinsics/gen/max/85e6bc.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
max_85e6bc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/max/85e6bc.wgsl.expected.hlsl b/test/intrinsics/gen/max/85e6bc.wgsl.expected.hlsl
index 17f9ed7..237e7ef 100644
--- a/test/intrinsics/gen/max/85e6bc.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/max/85e6bc.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void max_85e6bc() {
int4 res = max(int4(0, 0, 0, 0), int4(0, 0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
max_85e6bc();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/max/85e6bc.wgsl.expected.msl b/test/intrinsics/gen/max/85e6bc.wgsl.expected.msl
index 67c75e7..8606e9a 100644
--- a/test/intrinsics/gen/max/85e6bc.wgsl.expected.msl
+++ b/test/intrinsics/gen/max/85e6bc.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void max_85e6bc() {
int4 res = max(int4(), int4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
max_85e6bc();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/max/85e6bc.wgsl.expected.spvasm b/test/intrinsics/gen/max/85e6bc.wgsl.expected.spvasm
index b3dd4ca..2bd843e 100644
--- a/test/intrinsics/gen/max/85e6bc.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/max/85e6bc.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %max_85e6bc "max_85e6bc"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v4int = OpTypeVector %int 4
- %13 = OpConstantNull %v4int
+ %17 = OpConstantNull %v4int
%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %max_85e6bc = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %13
- %9 = OpExtInst %v4int %12 SMax %13 %13
- OpStore %res %9
+ %max_85e6bc = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %17
+ %13 = OpExtInst %v4int %16 SMax %17 %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %max_85e6bc
+ %27 = OpFunctionCall %void %max_85e6bc
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %max_85e6bc
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %max_85e6bc
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %max_85e6bc
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %max_85e6bc
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/max/85e6bc.wgsl.expected.wgsl b/test/intrinsics/gen/max/85e6bc.wgsl.expected.wgsl
index 2055bb6..ed6e7f4 100644
--- a/test/intrinsics/gen/max/85e6bc.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/max/85e6bc.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
max_85e6bc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/max/a93419.wgsl b/test/intrinsics/gen/max/a93419.wgsl
index 1856337..e9c3692 100644
--- a/test/intrinsics/gen/max/a93419.wgsl
+++ b/test/intrinsics/gen/max/a93419.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
max_a93419();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/max/a93419.wgsl.expected.hlsl b/test/intrinsics/gen/max/a93419.wgsl.expected.hlsl
index 3701fa2..92950d1 100644
--- a/test/intrinsics/gen/max/a93419.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/max/a93419.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void max_a93419() {
float4 res = max(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
max_a93419();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/max/a93419.wgsl.expected.msl b/test/intrinsics/gen/max/a93419.wgsl.expected.msl
index abe3fc6..056c4b8 100644
--- a/test/intrinsics/gen/max/a93419.wgsl.expected.msl
+++ b/test/intrinsics/gen/max/a93419.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void max_a93419() {
float4 res = fmax(float4(), float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
max_a93419();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/max/a93419.wgsl.expected.spvasm b/test/intrinsics/gen/max/a93419.wgsl.expected.spvasm
index c65a59f..affcf74 100644
--- a/test/intrinsics/gen/max/a93419.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/max/a93419.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %max_a93419 "max_a93419"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %max_a93419 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 NMax %12 %12
- OpStore %res %9
+ %max_a93419 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 NMax %8 %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %max_a93419
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %max_a93419
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %max_a93419
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %max_a93419
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %max_a93419
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/max/a93419.wgsl.expected.wgsl b/test/intrinsics/gen/max/a93419.wgsl.expected.wgsl
index a278e21..8124cbf 100644
--- a/test/intrinsics/gen/max/a93419.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/max/a93419.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
max_a93419();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/max/b1b73a.wgsl b/test/intrinsics/gen/max/b1b73a.wgsl
index 2cbe7db..18a0315 100644
--- a/test/intrinsics/gen/max/b1b73a.wgsl
+++ b/test/intrinsics/gen/max/b1b73a.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
max_b1b73a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/max/b1b73a.wgsl.expected.hlsl b/test/intrinsics/gen/max/b1b73a.wgsl.expected.hlsl
index 7dca442..ab2d462 100644
--- a/test/intrinsics/gen/max/b1b73a.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/max/b1b73a.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void max_b1b73a() {
uint3 res = max(uint3(0u, 0u, 0u), uint3(0u, 0u, 0u));
}
-void vertex_main() {
+tint_symbol vertex_main() {
max_b1b73a();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/max/b1b73a.wgsl.expected.msl b/test/intrinsics/gen/max/b1b73a.wgsl.expected.msl
index 979f9d5..3dfa68c 100644
--- a/test/intrinsics/gen/max/b1b73a.wgsl.expected.msl
+++ b/test/intrinsics/gen/max/b1b73a.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void max_b1b73a() {
uint3 res = max(uint3(), uint3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
max_b1b73a();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/max/b1b73a.wgsl.expected.spvasm b/test/intrinsics/gen/max/b1b73a.wgsl.expected.spvasm
index 4296bae..54cf5c4 100644
--- a/test/intrinsics/gen/max/b1b73a.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/max/b1b73a.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %max_b1b73a "max_b1b73a"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
- %13 = OpConstantNull %v3uint
+ %17 = OpConstantNull %v3uint
%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %max_b1b73a = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3uint Function %13
- %9 = OpExtInst %v3uint %12 UMax %13 %13
- OpStore %res %9
+ %max_b1b73a = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %17
+ %13 = OpExtInst %v3uint %16 UMax %17 %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %max_b1b73a
+ %27 = OpFunctionCall %void %max_b1b73a
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %max_b1b73a
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %max_b1b73a
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %max_b1b73a
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %max_b1b73a
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/max/b1b73a.wgsl.expected.wgsl b/test/intrinsics/gen/max/b1b73a.wgsl.expected.wgsl
index ff4689f..d7a467d 100644
--- a/test/intrinsics/gen/max/b1b73a.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/max/b1b73a.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
max_b1b73a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/max/ce7c30.wgsl b/test/intrinsics/gen/max/ce7c30.wgsl
index 6f44a08..8a20376 100644
--- a/test/intrinsics/gen/max/ce7c30.wgsl
+++ b/test/intrinsics/gen/max/ce7c30.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
max_ce7c30();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/max/ce7c30.wgsl.expected.hlsl b/test/intrinsics/gen/max/ce7c30.wgsl.expected.hlsl
index 581614a..7892ab4 100644
--- a/test/intrinsics/gen/max/ce7c30.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/max/ce7c30.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void max_ce7c30() {
int res = max(1, 1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
max_ce7c30();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/max/ce7c30.wgsl.expected.msl b/test/intrinsics/gen/max/ce7c30.wgsl.expected.msl
index 125162c..4f300ff 100644
--- a/test/intrinsics/gen/max/ce7c30.wgsl.expected.msl
+++ b/test/intrinsics/gen/max/ce7c30.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void max_ce7c30() {
int res = max(1, 1);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
max_ce7c30();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/max/ce7c30.wgsl.expected.spvasm b/test/intrinsics/gen/max/ce7c30.wgsl.expected.spvasm
index 83b18b4..068d7d2 100644
--- a/test/intrinsics/gen/max/ce7c30.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/max/ce7c30.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %max_ce7c30 "max_ce7c30"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_Function_int = OpTypePointer Function %int
- %15 = OpConstantNull %int
+ %19 = OpConstantNull %int
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %max_ce7c30 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %15
- %9 = OpExtInst %int %11 SMax %int_1 %int_1
- OpStore %res %9
+ %max_ce7c30 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %13 = OpExtInst %int %15 SMax %int_1 %int_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %max_ce7c30
+ %27 = OpFunctionCall %void %max_ce7c30
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %max_ce7c30
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %max_ce7c30
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %max_ce7c30
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %max_ce7c30
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/max/ce7c30.wgsl.expected.wgsl b/test/intrinsics/gen/max/ce7c30.wgsl.expected.wgsl
index c682b34..61ad5bf 100644
--- a/test/intrinsics/gen/max/ce7c30.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/max/ce7c30.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
max_ce7c30();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/max/e8192f.wgsl b/test/intrinsics/gen/max/e8192f.wgsl
index 2609dcb..f093110 100644
--- a/test/intrinsics/gen/max/e8192f.wgsl
+++ b/test/intrinsics/gen/max/e8192f.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
max_e8192f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/max/e8192f.wgsl.expected.hlsl b/test/intrinsics/gen/max/e8192f.wgsl.expected.hlsl
index cda8e83..8209b73 100644
--- a/test/intrinsics/gen/max/e8192f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/max/e8192f.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void max_e8192f() {
int2 res = max(int2(0, 0), int2(0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
max_e8192f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/max/e8192f.wgsl.expected.msl b/test/intrinsics/gen/max/e8192f.wgsl.expected.msl
index c6165c3..e35eb46 100644
--- a/test/intrinsics/gen/max/e8192f.wgsl.expected.msl
+++ b/test/intrinsics/gen/max/e8192f.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void max_e8192f() {
int2 res = max(int2(), int2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
max_e8192f();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/max/e8192f.wgsl.expected.spvasm b/test/intrinsics/gen/max/e8192f.wgsl.expected.spvasm
index 676cac1..d417a92 100644
--- a/test/intrinsics/gen/max/e8192f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/max/e8192f.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %max_e8192f "max_e8192f"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %13 = OpConstantNull %v2int
+ %17 = OpConstantNull %v2int
%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %max_e8192f = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %13
- %9 = OpExtInst %v2int %12 SMax %13 %13
- OpStore %res %9
+ %max_e8192f = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %17
+ %13 = OpExtInst %v2int %16 SMax %17 %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %max_e8192f
+ %27 = OpFunctionCall %void %max_e8192f
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %max_e8192f
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %max_e8192f
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %max_e8192f
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %max_e8192f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/max/e8192f.wgsl.expected.wgsl b/test/intrinsics/gen/max/e8192f.wgsl.expected.wgsl
index b5720fb..c552473 100644
--- a/test/intrinsics/gen/max/e8192f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/max/e8192f.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
max_e8192f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/min/03c7e3.wgsl b/test/intrinsics/gen/min/03c7e3.wgsl
index 9b0727f..5ebc08b 100644
--- a/test/intrinsics/gen/min/03c7e3.wgsl
+++ b/test/intrinsics/gen/min/03c7e3.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
min_03c7e3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/min/03c7e3.wgsl.expected.hlsl b/test/intrinsics/gen/min/03c7e3.wgsl.expected.hlsl
index c4e4bbb..1873732 100644
--- a/test/intrinsics/gen/min/03c7e3.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/min/03c7e3.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void min_03c7e3() {
int2 res = min(int2(0, 0), int2(0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
min_03c7e3();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/min/03c7e3.wgsl.expected.msl b/test/intrinsics/gen/min/03c7e3.wgsl.expected.msl
index ba68209..7ae789a 100644
--- a/test/intrinsics/gen/min/03c7e3.wgsl.expected.msl
+++ b/test/intrinsics/gen/min/03c7e3.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void min_03c7e3() {
int2 res = min(int2(), int2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
min_03c7e3();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/min/03c7e3.wgsl.expected.spvasm b/test/intrinsics/gen/min/03c7e3.wgsl.expected.spvasm
index a2d7d52..a303e59 100644
--- a/test/intrinsics/gen/min/03c7e3.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/min/03c7e3.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %min_03c7e3 "min_03c7e3"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %13 = OpConstantNull %v2int
+ %17 = OpConstantNull %v2int
%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %min_03c7e3 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %13
- %9 = OpExtInst %v2int %12 SMin %13 %13
- OpStore %res %9
+ %min_03c7e3 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %17
+ %13 = OpExtInst %v2int %16 SMin %17 %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %min_03c7e3
+ %27 = OpFunctionCall %void %min_03c7e3
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %min_03c7e3
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %min_03c7e3
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %min_03c7e3
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %min_03c7e3
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/min/03c7e3.wgsl.expected.wgsl b/test/intrinsics/gen/min/03c7e3.wgsl.expected.wgsl
index 2098c20..945b9f1 100644
--- a/test/intrinsics/gen/min/03c7e3.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/min/03c7e3.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
min_03c7e3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/min/0dc614.wgsl b/test/intrinsics/gen/min/0dc614.wgsl
index 7f33995..ad1e63d 100644
--- a/test/intrinsics/gen/min/0dc614.wgsl
+++ b/test/intrinsics/gen/min/0dc614.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
min_0dc614();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/min/0dc614.wgsl.expected.hlsl b/test/intrinsics/gen/min/0dc614.wgsl.expected.hlsl
index 2916bb5..e3d5176 100644
--- a/test/intrinsics/gen/min/0dc614.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/min/0dc614.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void min_0dc614() {
uint4 res = min(uint4(0u, 0u, 0u, 0u), uint4(0u, 0u, 0u, 0u));
}
-void vertex_main() {
+tint_symbol vertex_main() {
min_0dc614();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/min/0dc614.wgsl.expected.msl b/test/intrinsics/gen/min/0dc614.wgsl.expected.msl
index 0baef43..c50267d 100644
--- a/test/intrinsics/gen/min/0dc614.wgsl.expected.msl
+++ b/test/intrinsics/gen/min/0dc614.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void min_0dc614() {
uint4 res = min(uint4(), uint4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
min_0dc614();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/min/0dc614.wgsl.expected.spvasm b/test/intrinsics/gen/min/0dc614.wgsl.expected.spvasm
index 52ba04e..eebe29b 100644
--- a/test/intrinsics/gen/min/0dc614.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/min/0dc614.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %min_0dc614 "min_0dc614"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v4uint = OpTypeVector %uint 4
- %13 = OpConstantNull %v4uint
+ %17 = OpConstantNull %v4uint
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %min_0dc614 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %13
- %9 = OpExtInst %v4uint %12 UMin %13 %13
- OpStore %res %9
+ %min_0dc614 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %17
+ %13 = OpExtInst %v4uint %16 UMin %17 %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %min_0dc614
+ %27 = OpFunctionCall %void %min_0dc614
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %min_0dc614
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %min_0dc614
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %min_0dc614
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %min_0dc614
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/min/0dc614.wgsl.expected.wgsl b/test/intrinsics/gen/min/0dc614.wgsl.expected.wgsl
index 5c1965c..c20ebc1 100644
--- a/test/intrinsics/gen/min/0dc614.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/min/0dc614.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
min_0dc614();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/min/3941e1.wgsl b/test/intrinsics/gen/min/3941e1.wgsl
index 4e74104..886dabf 100644
--- a/test/intrinsics/gen/min/3941e1.wgsl
+++ b/test/intrinsics/gen/min/3941e1.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
min_3941e1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/min/3941e1.wgsl.expected.hlsl b/test/intrinsics/gen/min/3941e1.wgsl.expected.hlsl
index f21aacf..ca5c4aa 100644
--- a/test/intrinsics/gen/min/3941e1.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/min/3941e1.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void min_3941e1() {
int4 res = min(int4(0, 0, 0, 0), int4(0, 0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
min_3941e1();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/min/3941e1.wgsl.expected.msl b/test/intrinsics/gen/min/3941e1.wgsl.expected.msl
index 25c94c3..d7b4550 100644
--- a/test/intrinsics/gen/min/3941e1.wgsl.expected.msl
+++ b/test/intrinsics/gen/min/3941e1.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void min_3941e1() {
int4 res = min(int4(), int4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
min_3941e1();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/min/3941e1.wgsl.expected.spvasm b/test/intrinsics/gen/min/3941e1.wgsl.expected.spvasm
index 1b3f0f3..eacea37 100644
--- a/test/intrinsics/gen/min/3941e1.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/min/3941e1.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %min_3941e1 "min_3941e1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v4int = OpTypeVector %int 4
- %13 = OpConstantNull %v4int
+ %17 = OpConstantNull %v4int
%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %min_3941e1 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %13
- %9 = OpExtInst %v4int %12 SMin %13 %13
- OpStore %res %9
+ %min_3941e1 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %17
+ %13 = OpExtInst %v4int %16 SMin %17 %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %min_3941e1
+ %27 = OpFunctionCall %void %min_3941e1
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %min_3941e1
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %min_3941e1
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %min_3941e1
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %min_3941e1
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/min/3941e1.wgsl.expected.wgsl b/test/intrinsics/gen/min/3941e1.wgsl.expected.wgsl
index cd5ed89..4d46b41 100644
--- a/test/intrinsics/gen/min/3941e1.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/min/3941e1.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
min_3941e1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/min/46c5d3.wgsl b/test/intrinsics/gen/min/46c5d3.wgsl
index b1603fb..f873305 100644
--- a/test/intrinsics/gen/min/46c5d3.wgsl
+++ b/test/intrinsics/gen/min/46c5d3.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
min_46c5d3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/min/46c5d3.wgsl.expected.hlsl b/test/intrinsics/gen/min/46c5d3.wgsl.expected.hlsl
index fda2c28..7b463e1 100644
--- a/test/intrinsics/gen/min/46c5d3.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/min/46c5d3.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void min_46c5d3() {
uint res = min(1u, 1u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
min_46c5d3();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/min/46c5d3.wgsl.expected.msl b/test/intrinsics/gen/min/46c5d3.wgsl.expected.msl
index 9d2021e..60276ce 100644
--- a/test/intrinsics/gen/min/46c5d3.wgsl.expected.msl
+++ b/test/intrinsics/gen/min/46c5d3.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void min_46c5d3() {
uint res = min(1u, 1u);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
min_46c5d3();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/min/46c5d3.wgsl.expected.spvasm b/test/intrinsics/gen/min/46c5d3.wgsl.expected.spvasm
index 093c7c8..7a14bf5 100644
--- a/test/intrinsics/gen/min/46c5d3.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/min/46c5d3.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %min_46c5d3 "min_46c5d3"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%_ptr_Function_uint = OpTypePointer Function %uint
- %15 = OpConstantNull %uint
+ %19 = OpConstantNull %uint
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %min_46c5d3 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_uint Function %15
- %9 = OpExtInst %uint %11 UMin %uint_1 %uint_1
- OpStore %res %9
+ %min_46c5d3 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %19
+ %13 = OpExtInst %uint %15 UMin %uint_1 %uint_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %min_46c5d3
+ %27 = OpFunctionCall %void %min_46c5d3
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %min_46c5d3
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %min_46c5d3
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %min_46c5d3
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %min_46c5d3
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/min/46c5d3.wgsl.expected.wgsl b/test/intrinsics/gen/min/46c5d3.wgsl.expected.wgsl
index 4792db1..cd7f63a 100644
--- a/test/intrinsics/gen/min/46c5d3.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/min/46c5d3.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
min_46c5d3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/min/82b28f.wgsl b/test/intrinsics/gen/min/82b28f.wgsl
index 3dc216d..2e67e77 100644
--- a/test/intrinsics/gen/min/82b28f.wgsl
+++ b/test/intrinsics/gen/min/82b28f.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
min_82b28f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/min/82b28f.wgsl.expected.hlsl b/test/intrinsics/gen/min/82b28f.wgsl.expected.hlsl
index 96cdb72..7e4e2eb 100644
--- a/test/intrinsics/gen/min/82b28f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/min/82b28f.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void min_82b28f() {
uint2 res = min(uint2(0u, 0u), uint2(0u, 0u));
}
-void vertex_main() {
+tint_symbol vertex_main() {
min_82b28f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/min/82b28f.wgsl.expected.msl b/test/intrinsics/gen/min/82b28f.wgsl.expected.msl
index c79d466..7bd80b5b 100644
--- a/test/intrinsics/gen/min/82b28f.wgsl.expected.msl
+++ b/test/intrinsics/gen/min/82b28f.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void min_82b28f() {
uint2 res = min(uint2(), uint2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
min_82b28f();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/min/82b28f.wgsl.expected.spvasm b/test/intrinsics/gen/min/82b28f.wgsl.expected.spvasm
index 869b476..bd2f708 100644
--- a/test/intrinsics/gen/min/82b28f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/min/82b28f.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %min_82b28f "min_82b28f"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v2uint = OpTypeVector %uint 2
- %13 = OpConstantNull %v2uint
+ %17 = OpConstantNull %v2uint
%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %min_82b28f = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2uint Function %13
- %9 = OpExtInst %v2uint %12 UMin %13 %13
- OpStore %res %9
+ %min_82b28f = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %17
+ %13 = OpExtInst %v2uint %16 UMin %17 %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %min_82b28f
+ %27 = OpFunctionCall %void %min_82b28f
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %min_82b28f
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %min_82b28f
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %min_82b28f
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %min_82b28f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/min/82b28f.wgsl.expected.wgsl b/test/intrinsics/gen/min/82b28f.wgsl.expected.wgsl
index cd3d2a7..c9daf74 100644
--- a/test/intrinsics/gen/min/82b28f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/min/82b28f.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
min_82b28f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/min/93cfc4.wgsl b/test/intrinsics/gen/min/93cfc4.wgsl
index af0896c..937bfd5 100644
--- a/test/intrinsics/gen/min/93cfc4.wgsl
+++ b/test/intrinsics/gen/min/93cfc4.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
min_93cfc4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/min/93cfc4.wgsl.expected.hlsl b/test/intrinsics/gen/min/93cfc4.wgsl.expected.hlsl
index c3d2e41..fdb17d1 100644
--- a/test/intrinsics/gen/min/93cfc4.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/min/93cfc4.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void min_93cfc4() {
float3 res = min(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
min_93cfc4();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/min/93cfc4.wgsl.expected.msl b/test/intrinsics/gen/min/93cfc4.wgsl.expected.msl
index 2333a21..97dc1ce 100644
--- a/test/intrinsics/gen/min/93cfc4.wgsl.expected.msl
+++ b/test/intrinsics/gen/min/93cfc4.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void min_93cfc4() {
float3 res = fmin(float3(), float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
min_93cfc4();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/min/93cfc4.wgsl.expected.spvasm b/test/intrinsics/gen/min/93cfc4.wgsl.expected.spvasm
index c4c3db9..a2b6713 100644
--- a/test/intrinsics/gen/min/93cfc4.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/min/93cfc4.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %min_93cfc4 "min_93cfc4"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %min_93cfc4 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 NMin %12 %12
- OpStore %res %9
+ %min_93cfc4 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 NMin %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %min_93cfc4
+ %26 = OpFunctionCall %void %min_93cfc4
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %min_93cfc4
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %min_93cfc4
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %min_93cfc4
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %min_93cfc4
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/min/93cfc4.wgsl.expected.wgsl b/test/intrinsics/gen/min/93cfc4.wgsl.expected.wgsl
index a285e0d..fba1d8c 100644
--- a/test/intrinsics/gen/min/93cfc4.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/min/93cfc4.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
min_93cfc4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/min/a45171.wgsl b/test/intrinsics/gen/min/a45171.wgsl
index 5c70dba..c473ff7 100644
--- a/test/intrinsics/gen/min/a45171.wgsl
+++ b/test/intrinsics/gen/min/a45171.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
min_a45171();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/min/a45171.wgsl.expected.hlsl b/test/intrinsics/gen/min/a45171.wgsl.expected.hlsl
index 7c4503e..6e28f6b 100644
--- a/test/intrinsics/gen/min/a45171.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/min/a45171.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void min_a45171() {
int3 res = min(int3(0, 0, 0), int3(0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
min_a45171();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/min/a45171.wgsl.expected.msl b/test/intrinsics/gen/min/a45171.wgsl.expected.msl
index 9b4cdd6c..42a9bf7 100644
--- a/test/intrinsics/gen/min/a45171.wgsl.expected.msl
+++ b/test/intrinsics/gen/min/a45171.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void min_a45171() {
int3 res = min(int3(), int3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
min_a45171();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/min/a45171.wgsl.expected.spvasm b/test/intrinsics/gen/min/a45171.wgsl.expected.spvasm
index 9b0d611..8f7b2f2 100644
--- a/test/intrinsics/gen/min/a45171.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/min/a45171.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %min_a45171 "min_a45171"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %13 = OpConstantNull %v3int
+ %17 = OpConstantNull %v3int
%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %min_a45171 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %13
- %9 = OpExtInst %v3int %12 SMin %13 %13
- OpStore %res %9
+ %min_a45171 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %17
+ %13 = OpExtInst %v3int %16 SMin %17 %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %min_a45171
+ %27 = OpFunctionCall %void %min_a45171
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %min_a45171
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %min_a45171
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %min_a45171
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %min_a45171
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/min/a45171.wgsl.expected.wgsl b/test/intrinsics/gen/min/a45171.wgsl.expected.wgsl
index 4d10949..43b43ae 100644
--- a/test/intrinsics/gen/min/a45171.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/min/a45171.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
min_a45171();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/min/aa28ad.wgsl b/test/intrinsics/gen/min/aa28ad.wgsl
index 78ab786..0263ac0 100644
--- a/test/intrinsics/gen/min/aa28ad.wgsl
+++ b/test/intrinsics/gen/min/aa28ad.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
min_aa28ad();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/min/aa28ad.wgsl.expected.hlsl b/test/intrinsics/gen/min/aa28ad.wgsl.expected.hlsl
index adffe08..6338bf2 100644
--- a/test/intrinsics/gen/min/aa28ad.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/min/aa28ad.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void min_aa28ad() {
float2 res = min(float2(0.0f, 0.0f), float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
min_aa28ad();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/min/aa28ad.wgsl.expected.msl b/test/intrinsics/gen/min/aa28ad.wgsl.expected.msl
index e3235d3..7959144 100644
--- a/test/intrinsics/gen/min/aa28ad.wgsl.expected.msl
+++ b/test/intrinsics/gen/min/aa28ad.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void min_aa28ad() {
float2 res = fmin(float2(), float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
min_aa28ad();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/min/aa28ad.wgsl.expected.spvasm b/test/intrinsics/gen/min/aa28ad.wgsl.expected.spvasm
index e37dabc..a45fdff 100644
--- a/test/intrinsics/gen/min/aa28ad.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/min/aa28ad.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %min_aa28ad "min_aa28ad"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %min_aa28ad = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 NMin %12 %12
- OpStore %res %9
+ %min_aa28ad = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 NMin %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %min_aa28ad
+ %26 = OpFunctionCall %void %min_aa28ad
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %min_aa28ad
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %min_aa28ad
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %min_aa28ad
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %min_aa28ad
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/min/aa28ad.wgsl.expected.wgsl b/test/intrinsics/gen/min/aa28ad.wgsl.expected.wgsl
index ea0d321..b545fa6 100644
--- a/test/intrinsics/gen/min/aa28ad.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/min/aa28ad.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
min_aa28ad();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/min/af326d.wgsl b/test/intrinsics/gen/min/af326d.wgsl
index 421360a..c9104fd 100644
--- a/test/intrinsics/gen/min/af326d.wgsl
+++ b/test/intrinsics/gen/min/af326d.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
min_af326d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/min/af326d.wgsl.expected.hlsl b/test/intrinsics/gen/min/af326d.wgsl.expected.hlsl
index fd8e65a..5abdab5 100644
--- a/test/intrinsics/gen/min/af326d.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/min/af326d.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void min_af326d() {
float res = min(1.0f, 1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
min_af326d();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/min/af326d.wgsl.expected.msl b/test/intrinsics/gen/min/af326d.wgsl.expected.msl
index 9e219a3..d0e009b 100644
--- a/test/intrinsics/gen/min/af326d.wgsl.expected.msl
+++ b/test/intrinsics/gen/min/af326d.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void min_af326d() {
float res = fmin(1.0f, 1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
min_af326d();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/min/af326d.wgsl.expected.spvasm b/test/intrinsics/gen/min/af326d.wgsl.expected.spvasm
index a7c01c3..f56cffe 100644
--- a/test/intrinsics/gen/min/af326d.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/min/af326d.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %min_af326d "min_af326d"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
- %min_af326d = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+ %min_af326d = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 NMin %float_1 %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 NMin %float_1 %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %min_af326d
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %min_af326d
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %min_af326d
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %min_af326d
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %min_af326d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %min_af326d
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/min/af326d.wgsl.expected.wgsl b/test/intrinsics/gen/min/af326d.wgsl.expected.wgsl
index 6e1515d..3af8613 100644
--- a/test/intrinsics/gen/min/af326d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/min/af326d.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
min_af326d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/min/c70bb7.wgsl b/test/intrinsics/gen/min/c70bb7.wgsl
index 6daef6c..0510558 100644
--- a/test/intrinsics/gen/min/c70bb7.wgsl
+++ b/test/intrinsics/gen/min/c70bb7.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
min_c70bb7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/min/c70bb7.wgsl.expected.hlsl b/test/intrinsics/gen/min/c70bb7.wgsl.expected.hlsl
index 0d4d6a6..a7f58af 100644
--- a/test/intrinsics/gen/min/c70bb7.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/min/c70bb7.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void min_c70bb7() {
uint3 res = min(uint3(0u, 0u, 0u), uint3(0u, 0u, 0u));
}
-void vertex_main() {
+tint_symbol vertex_main() {
min_c70bb7();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/min/c70bb7.wgsl.expected.msl b/test/intrinsics/gen/min/c70bb7.wgsl.expected.msl
index d49a6bc..09c6b44 100644
--- a/test/intrinsics/gen/min/c70bb7.wgsl.expected.msl
+++ b/test/intrinsics/gen/min/c70bb7.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void min_c70bb7() {
uint3 res = min(uint3(), uint3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
min_c70bb7();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/min/c70bb7.wgsl.expected.spvasm b/test/intrinsics/gen/min/c70bb7.wgsl.expected.spvasm
index c5b03ab..df2e8f1 100644
--- a/test/intrinsics/gen/min/c70bb7.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/min/c70bb7.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %min_c70bb7 "min_c70bb7"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
- %13 = OpConstantNull %v3uint
+ %17 = OpConstantNull %v3uint
%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %min_c70bb7 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3uint Function %13
- %9 = OpExtInst %v3uint %12 UMin %13 %13
- OpStore %res %9
+ %min_c70bb7 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %17
+ %13 = OpExtInst %v3uint %16 UMin %17 %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %min_c70bb7
+ %27 = OpFunctionCall %void %min_c70bb7
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %min_c70bb7
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %min_c70bb7
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %min_c70bb7
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %min_c70bb7
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/min/c70bb7.wgsl.expected.wgsl b/test/intrinsics/gen/min/c70bb7.wgsl.expected.wgsl
index 3d86d95..b9679de 100644
--- a/test/intrinsics/gen/min/c70bb7.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/min/c70bb7.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
min_c70bb7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/min/c73147.wgsl b/test/intrinsics/gen/min/c73147.wgsl
index 09dd3c4..9ebc8fd 100644
--- a/test/intrinsics/gen/min/c73147.wgsl
+++ b/test/intrinsics/gen/min/c73147.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
min_c73147();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/min/c73147.wgsl.expected.hlsl b/test/intrinsics/gen/min/c73147.wgsl.expected.hlsl
index 3f6819a..1fddfd9 100644
--- a/test/intrinsics/gen/min/c73147.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/min/c73147.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void min_c73147() {
int res = min(1, 1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
min_c73147();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/min/c73147.wgsl.expected.msl b/test/intrinsics/gen/min/c73147.wgsl.expected.msl
index 9ee44ee..7ec0d47 100644
--- a/test/intrinsics/gen/min/c73147.wgsl.expected.msl
+++ b/test/intrinsics/gen/min/c73147.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void min_c73147() {
int res = min(1, 1);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
min_c73147();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/min/c73147.wgsl.expected.spvasm b/test/intrinsics/gen/min/c73147.wgsl.expected.spvasm
index 687c902..85c0cb7 100644
--- a/test/intrinsics/gen/min/c73147.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/min/c73147.wgsl.expected.spvasm
@@ -1,54 +1,70 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 26
+; Bound: 35
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %min_c73147 "min_c73147"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_Function_int = OpTypePointer Function %int
- %15 = OpConstantNull %int
+ %19 = OpConstantNull %int
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %min_c73147 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %15
- %9 = OpExtInst %int %11 SMin %int_1 %int_1
- OpStore %res %9
+ %min_c73147 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %19
+ %13 = OpExtInst %int %15 SMin %int_1 %int_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
+ %23 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
OpStore %tint_pointsize %float_1
- %19 = OpFunctionCall %void %min_c73147
+ %27 = OpFunctionCall %void %min_c73147
+ %28 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %21 = OpLabel
- %22 = OpFunctionCall %void %min_c73147
+%fragment_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %min_c73147
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %24 = OpLabel
- %25 = OpFunctionCall %void %min_c73147
+%compute_main = OpFunction %void None %9
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %min_c73147
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/min/c73147.wgsl.expected.wgsl b/test/intrinsics/gen/min/c73147.wgsl.expected.wgsl
index 59a2cfc..6221b97 100644
--- a/test/intrinsics/gen/min/c73147.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/min/c73147.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
min_c73147();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/min/c76fa6.wgsl b/test/intrinsics/gen/min/c76fa6.wgsl
index 86b14be..6872263 100644
--- a/test/intrinsics/gen/min/c76fa6.wgsl
+++ b/test/intrinsics/gen/min/c76fa6.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
min_c76fa6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/min/c76fa6.wgsl.expected.hlsl b/test/intrinsics/gen/min/c76fa6.wgsl.expected.hlsl
index 55d25a7..72c91f1 100644
--- a/test/intrinsics/gen/min/c76fa6.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/min/c76fa6.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void min_c76fa6() {
float4 res = min(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
min_c76fa6();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/min/c76fa6.wgsl.expected.msl b/test/intrinsics/gen/min/c76fa6.wgsl.expected.msl
index 85a723e..015d645 100644
--- a/test/intrinsics/gen/min/c76fa6.wgsl.expected.msl
+++ b/test/intrinsics/gen/min/c76fa6.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void min_c76fa6() {
float4 res = fmin(float4(), float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
min_c76fa6();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/min/c76fa6.wgsl.expected.spvasm b/test/intrinsics/gen/min/c76fa6.wgsl.expected.spvasm
index f8e63d7..c537c48 100644
--- a/test/intrinsics/gen/min/c76fa6.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/min/c76fa6.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %min_c76fa6 "min_c76fa6"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %min_c76fa6 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 NMin %12 %12
- OpStore %res %9
+ %min_c76fa6 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 NMin %8 %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %min_c76fa6
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %min_c76fa6
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %min_c76fa6
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %min_c76fa6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %min_c76fa6
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/min/c76fa6.wgsl.expected.wgsl b/test/intrinsics/gen/min/c76fa6.wgsl.expected.wgsl
index b9c81fd..d56585a 100644
--- a/test/intrinsics/gen/min/c76fa6.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/min/c76fa6.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
min_c76fa6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/mix/0c8c33.wgsl b/test/intrinsics/gen/mix/0c8c33.wgsl
index 497f81a..1e3da74 100644
--- a/test/intrinsics/gen/mix/0c8c33.wgsl
+++ b/test/intrinsics/gen/mix/0c8c33.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
mix_0c8c33();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.hlsl b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.hlsl
index b520655..eae9172 100644
--- a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void mix_0c8c33() {
float3 res = lerp(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
mix_0c8c33();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.msl b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.msl
index a9ba57e..6cc23a6 100644
--- a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.msl
+++ b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void mix_0c8c33() {
float3 res = mix(float3(), float3(), float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
mix_0c8c33();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.spvasm b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.spvasm
index 7ebdd25..431e74b 100644
--- a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %mix_0c8c33 "mix_0c8c33"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %mix_0c8c33 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 FMix %12 %12 %12
- OpStore %res %9
+ %mix_0c8c33 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 FMix %16 %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %mix_0c8c33
+ %26 = OpFunctionCall %void %mix_0c8c33
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %mix_0c8c33
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %mix_0c8c33
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %mix_0c8c33
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %mix_0c8c33
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.wgsl b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.wgsl
index cbcde05..9041bad 100644
--- a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
mix_0c8c33();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/mix/4f0b5e.wgsl b/test/intrinsics/gen/mix/4f0b5e.wgsl
index ff54cd2..97269b2 100644
--- a/test/intrinsics/gen/mix/4f0b5e.wgsl
+++ b/test/intrinsics/gen/mix/4f0b5e.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
mix_4f0b5e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.hlsl b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.hlsl
index 0e0d6cf..f26b24f 100644
--- a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void mix_4f0b5e() {
float res = lerp(1.0f, 1.0f, 1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
mix_4f0b5e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.msl b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.msl
index 2ed9515..9e549fa 100644
--- a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.msl
+++ b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void mix_4f0b5e() {
float res = mix(1.0f, 1.0f, 1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
mix_4f0b5e();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.spvasm b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.spvasm
index a35bde5..60937ee 100644
--- a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %mix_4f0b5e "mix_4f0b5e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
- %mix_4f0b5e = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+ %mix_4f0b5e = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 FMix %float_1 %float_1 %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 FMix %float_1 %float_1 %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %mix_4f0b5e
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %mix_4f0b5e
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %mix_4f0b5e
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %mix_4f0b5e
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %mix_4f0b5e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %mix_4f0b5e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.wgsl b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.wgsl
index 847669d..3b31571 100644
--- a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
mix_4f0b5e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/mix/6f8adc.wgsl b/test/intrinsics/gen/mix/6f8adc.wgsl
index b38477c..50f54b7 100644
--- a/test/intrinsics/gen/mix/6f8adc.wgsl
+++ b/test/intrinsics/gen/mix/6f8adc.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
mix_6f8adc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.hlsl b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.hlsl
index dd8fa59..c9d077b 100644
--- a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void mix_6f8adc() {
float2 res = lerp(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
mix_6f8adc();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.msl b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.msl
index 6e65e03..34ac943 100644
--- a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.msl
+++ b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void mix_6f8adc() {
float2 res = mix(float2(), float2(), float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
mix_6f8adc();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.spvasm b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.spvasm
index ea47804..7d6f639 100644
--- a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %mix_6f8adc "mix_6f8adc"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %mix_6f8adc = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 FMix %12 %12 %12
- OpStore %res %9
+ %mix_6f8adc = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 FMix %16 %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %mix_6f8adc
+ %26 = OpFunctionCall %void %mix_6f8adc
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %mix_6f8adc
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %mix_6f8adc
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %mix_6f8adc
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %mix_6f8adc
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.wgsl b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.wgsl
index 7a2ae66..2ee8dd2 100644
--- a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
mix_6f8adc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/mix/c37ede.wgsl b/test/intrinsics/gen/mix/c37ede.wgsl
index 083fa4d..c8a16a9 100644
--- a/test/intrinsics/gen/mix/c37ede.wgsl
+++ b/test/intrinsics/gen/mix/c37ede.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
mix_c37ede();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/mix/c37ede.wgsl.expected.hlsl b/test/intrinsics/gen/mix/c37ede.wgsl.expected.hlsl
index e66be23..d0bd679 100644
--- a/test/intrinsics/gen/mix/c37ede.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/mix/c37ede.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void mix_c37ede() {
float4 res = lerp(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
mix_c37ede();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/mix/c37ede.wgsl.expected.msl b/test/intrinsics/gen/mix/c37ede.wgsl.expected.msl
index 2da352e..246ff75 100644
--- a/test/intrinsics/gen/mix/c37ede.wgsl.expected.msl
+++ b/test/intrinsics/gen/mix/c37ede.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void mix_c37ede() {
float4 res = mix(float4(), float4(), float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
mix_c37ede();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/mix/c37ede.wgsl.expected.spvasm b/test/intrinsics/gen/mix/c37ede.wgsl.expected.spvasm
index 4277d14..7aa03fc 100644
--- a/test/intrinsics/gen/mix/c37ede.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/mix/c37ede.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %mix_c37ede "mix_c37ede"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %mix_c37ede = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 FMix %12 %12 %12
- OpStore %res %9
+ %mix_c37ede = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 FMix %8 %8 %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %mix_c37ede
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %mix_c37ede
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %mix_c37ede
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %mix_c37ede
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %mix_c37ede
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/mix/c37ede.wgsl.expected.wgsl b/test/intrinsics/gen/mix/c37ede.wgsl.expected.wgsl
index 72a921b..2c82fee 100644
--- a/test/intrinsics/gen/mix/c37ede.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/mix/c37ede.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
mix_c37ede();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/modf/8d6261.wgsl b/test/intrinsics/gen/modf/8d6261.wgsl
index fbc453d..ac17fa6 100644
--- a/test/intrinsics/gen/modf/8d6261.wgsl
+++ b/test/intrinsics/gen/modf/8d6261.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
modf_8d6261();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/modf/8d6261.wgsl.expected.spvasm b/test/intrinsics/gen/modf/8d6261.wgsl.expected.spvasm
index ca34c91..4835826 100644
--- a/test/intrinsics/gen/modf/8d6261.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/modf/8d6261.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %12 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %modf_8d6261 "modf_8d6261"
OpName %arg_1 "arg_1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%_ptr_Function_float = OpTypePointer Function %float
%float_1 = OpConstant %float 1
-%modf_8d6261 = OpFunction %void None %5
- %8 = OpLabel
+ %20 = OpTypeFunction %void %v4float
+%modf_8d6261 = OpFunction %void None %9
+ %12 = OpLabel
%arg_1 = OpVariable %_ptr_Function_float Function %4
%res = OpVariable %_ptr_Function_float Function %4
- %11 = OpExtInst %float %12 Modf %float_1 %arg_1
- OpStore %res %11
+ %15 = OpExtInst %float %16 Modf %float_1 %arg_1
+ OpStore %res %15
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %17 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %modf_8d6261
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %modf_8d6261
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
%23 = OpLabel
- %24 = OpFunctionCall %void %modf_8d6261
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %25 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %26 = OpFunctionCall %void %modf_8d6261
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %modf_8d6261
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %modf_8d6261
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/modf/8d6261.wgsl.expected.wgsl b/test/intrinsics/gen/modf/8d6261.wgsl.expected.wgsl
index 2afc9f9..e23dd0c 100644
--- a/test/intrinsics/gen/modf/8d6261.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/modf/8d6261.wgsl.expected.wgsl
@@ -4,8 +4,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
modf_8d6261();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/modf/c82e3f.wgsl b/test/intrinsics/gen/modf/c82e3f.wgsl
index c8fa7a7..bc0651d 100644
--- a/test/intrinsics/gen/modf/c82e3f.wgsl
+++ b/test/intrinsics/gen/modf/c82e3f.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
modf_c82e3f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/modf/c82e3f.wgsl.expected.spvasm b/test/intrinsics/gen/modf/c82e3f.wgsl.expected.spvasm
index e32d405..962fba0 100644
--- a/test/intrinsics/gen/modf/c82e3f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/modf/c82e3f.wgsl.expected.spvasm
@@ -1,55 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 34
; Schema: 0
OpCapability Shader
- %14 = OpExtInstImport "GLSL.std.450"
+ %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %modf_c82e3f "modf_c82e3f"
OpName %arg_1 "arg_1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %12 = OpConstantNull %v4float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%modf_c82e3f = OpFunction %void None %5
- %8 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_v4float Function %12
- %res = OpVariable %_ptr_Function_v4float Function %12
- %13 = OpExtInst %v4float %14 Modf %12 %arg_1
- OpStore %res %13
+%modf_c82e3f = OpFunction %void None %9
+ %12 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v4float Function %8
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %15 = OpExtInst %v4float %16 Modf %8 %arg_1
+ OpStore %res %15
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %18 = OpLabel
- OpStore %tint_pointsize %float_1
- %20 = OpFunctionCall %void %modf_c82e3f
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
%22 = OpLabel
- %23 = OpFunctionCall %void %modf_c82e3f
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %25 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ OpStore %tint_pointsize %float_1
%26 = OpFunctionCall %void %modf_c82e3f
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %modf_c82e3f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %modf_c82e3f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/modf/c82e3f.wgsl.expected.wgsl b/test/intrinsics/gen/modf/c82e3f.wgsl.expected.wgsl
index 17caaf0..60bcecd 100644
--- a/test/intrinsics/gen/modf/c82e3f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/modf/c82e3f.wgsl.expected.wgsl
@@ -4,8 +4,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
modf_c82e3f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/modf/d62477.wgsl b/test/intrinsics/gen/modf/d62477.wgsl
index a96fefe..694148e 100644
--- a/test/intrinsics/gen/modf/d62477.wgsl
+++ b/test/intrinsics/gen/modf/d62477.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
modf_d62477();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/modf/d62477.wgsl.expected.spvasm b/test/intrinsics/gen/modf/d62477.wgsl.expected.spvasm
index 6f536e1..cef08e6 100644
--- a/test/intrinsics/gen/modf/d62477.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/modf/d62477.wgsl.expected.spvasm
@@ -1,55 +1,71 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 36
; Schema: 0
OpCapability Shader
- %14 = OpExtInstImport "GLSL.std.450"
+ %18 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %modf_d62477 "modf_d62477"
OpName %arg_1 "arg_1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
%_ptr_Function_v2float = OpTypePointer Function %v2float
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
+ %21 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%modf_d62477 = OpFunction %void None %5
- %8 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_v2float Function %12
- %res = OpVariable %_ptr_Function_v2float Function %12
- %13 = OpExtInst %v2float %14 Modf %12 %arg_1
- OpStore %res %13
+%modf_d62477 = OpFunction %void None %9
+ %12 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v2float Function %16
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %17 = OpExtInst %v2float %18 Modf %16 %arg_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %18 = OpLabel
+%tint_symbol_2 = OpFunction %void None %21
+%tint_symbol = OpFunctionParameter %v4float
+ %24 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %26 = OpLabel
OpStore %tint_pointsize %float_1
- %20 = OpFunctionCall %void %modf_d62477
+ %28 = OpFunctionCall %void %modf_d62477
+ %29 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %22 = OpLabel
- %23 = OpFunctionCall %void %modf_d62477
+%fragment_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %modf_d62477
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %25 = OpLabel
- %26 = OpFunctionCall %void %modf_d62477
+%compute_main = OpFunction %void None %9
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %modf_d62477
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/modf/d62477.wgsl.expected.wgsl b/test/intrinsics/gen/modf/d62477.wgsl.expected.wgsl
index 0dd0dff..5bd5b42 100644
--- a/test/intrinsics/gen/modf/d62477.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/modf/d62477.wgsl.expected.wgsl
@@ -4,8 +4,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
modf_d62477();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/modf/f9f98c.wgsl b/test/intrinsics/gen/modf/f9f98c.wgsl
index 2127285..4b7d03b 100644
--- a/test/intrinsics/gen/modf/f9f98c.wgsl
+++ b/test/intrinsics/gen/modf/f9f98c.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
modf_f9f98c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/modf/f9f98c.wgsl.expected.spvasm b/test/intrinsics/gen/modf/f9f98c.wgsl.expected.spvasm
index 44dfbf8..b62c50a 100644
--- a/test/intrinsics/gen/modf/f9f98c.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/modf/f9f98c.wgsl.expected.spvasm
@@ -1,55 +1,71 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 36
; Schema: 0
OpCapability Shader
- %14 = OpExtInstImport "GLSL.std.450"
+ %18 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %modf_f9f98c "modf_f9f98c"
OpName %arg_1 "arg_1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
%_ptr_Function_v3float = OpTypePointer Function %v3float
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
+ %21 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%modf_f9f98c = OpFunction %void None %5
- %8 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_v3float Function %12
- %res = OpVariable %_ptr_Function_v3float Function %12
- %13 = OpExtInst %v3float %14 Modf %12 %arg_1
- OpStore %res %13
+%modf_f9f98c = OpFunction %void None %9
+ %12 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_v3float Function %16
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %17 = OpExtInst %v3float %18 Modf %16 %arg_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %18 = OpLabel
+%tint_symbol_2 = OpFunction %void None %21
+%tint_symbol = OpFunctionParameter %v4float
+ %24 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %26 = OpLabel
OpStore %tint_pointsize %float_1
- %20 = OpFunctionCall %void %modf_f9f98c
+ %28 = OpFunctionCall %void %modf_f9f98c
+ %29 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %22 = OpLabel
- %23 = OpFunctionCall %void %modf_f9f98c
+%fragment_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %modf_f9f98c
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %25 = OpLabel
- %26 = OpFunctionCall %void %modf_f9f98c
+%compute_main = OpFunction %void None %9
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %modf_f9f98c
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/modf/f9f98c.wgsl.expected.wgsl b/test/intrinsics/gen/modf/f9f98c.wgsl.expected.wgsl
index 31d6412..432b127 100644
--- a/test/intrinsics/gen/modf/f9f98c.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/modf/f9f98c.wgsl.expected.wgsl
@@ -4,8 +4,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
modf_f9f98c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/normalize/64d8c0.wgsl b/test/intrinsics/gen/normalize/64d8c0.wgsl
index 5cc7274..56ebb03 100644
--- a/test/intrinsics/gen/normalize/64d8c0.wgsl
+++ b/test/intrinsics/gen/normalize/64d8c0.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
normalize_64d8c0();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.hlsl b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.hlsl
index c3c93d9..a078829 100644
--- a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void normalize_64d8c0() {
float3 res = normalize(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
normalize_64d8c0();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.msl b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.msl
index 63a1895..39c6462 100644
--- a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.msl
+++ b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void normalize_64d8c0() {
float3 res = normalize(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
normalize_64d8c0();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.spvasm b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.spvasm
index c3c10f9..311fe46 100644
--- a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %normalize_64d8c0 "normalize_64d8c0"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%normalize_64d8c0 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Normalize %12
- OpStore %res %9
+%normalize_64d8c0 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Normalize %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %normalize_64d8c0
+ %26 = OpFunctionCall %void %normalize_64d8c0
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %normalize_64d8c0
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %normalize_64d8c0
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %normalize_64d8c0
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %normalize_64d8c0
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.wgsl b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.wgsl
index 3949845..cf51163 100644
--- a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
normalize_64d8c0();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/normalize/9a0aab.wgsl b/test/intrinsics/gen/normalize/9a0aab.wgsl
index 2640499..347d43b 100644
--- a/test/intrinsics/gen/normalize/9a0aab.wgsl
+++ b/test/intrinsics/gen/normalize/9a0aab.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
normalize_9a0aab();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.hlsl b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.hlsl
index 064c758..b03bff5 100644
--- a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void normalize_9a0aab() {
float4 res = normalize(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
normalize_9a0aab();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.msl b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.msl
index 84dc468..2dc22f3 100644
--- a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.msl
+++ b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void normalize_9a0aab() {
float4 res = normalize(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
normalize_9a0aab();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.spvasm b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.spvasm
index a261175..9a06b7e 100644
--- a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %normalize_9a0aab "normalize_9a0aab"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%normalize_9a0aab = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Normalize %12
- OpStore %res %9
+%normalize_9a0aab = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Normalize %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %normalize_9a0aab
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %normalize_9a0aab
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %normalize_9a0aab
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %normalize_9a0aab
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %normalize_9a0aab
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.wgsl b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.wgsl
index 979531f..d88f83a 100644
--- a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
normalize_9a0aab();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/normalize/fc2ef1.wgsl b/test/intrinsics/gen/normalize/fc2ef1.wgsl
index 498bd96..aae33f1 100644
--- a/test/intrinsics/gen/normalize/fc2ef1.wgsl
+++ b/test/intrinsics/gen/normalize/fc2ef1.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
normalize_fc2ef1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.hlsl b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.hlsl
index aba2121..03f2379 100644
--- a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void normalize_fc2ef1() {
float2 res = normalize(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
normalize_fc2ef1();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.msl b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.msl
index 6fb8128..7e5afe0 100644
--- a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.msl
+++ b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void normalize_fc2ef1() {
float2 res = normalize(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
normalize_fc2ef1();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.spvasm b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.spvasm
index 99cc6bd..98db250 100644
--- a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %normalize_fc2ef1 "normalize_fc2ef1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%normalize_fc2ef1 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Normalize %12
- OpStore %res %9
+%normalize_fc2ef1 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Normalize %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %normalize_fc2ef1
+ %26 = OpFunctionCall %void %normalize_fc2ef1
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %normalize_fc2ef1
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %normalize_fc2ef1
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %normalize_fc2ef1
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %normalize_fc2ef1
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.wgsl b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.wgsl
index 8c35391..a291914 100644
--- a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
normalize_fc2ef1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl
index 8765662..eaa8929 100644
--- a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl
+++ b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
pack2x16float_0e97b3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.hlsl b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.hlsl
index c942222..b641eea 100644
--- a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.hlsl
@@ -1,11 +1,16 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void pack2x16float_0e97b3() {
uint2 tint_tmp = f32tof16(float2(0.0f, 0.0f));
uint res = (tint_tmp.x | tint_tmp.y << 16);
}
-void vertex_main() {
+tint_symbol vertex_main() {
pack2x16float_0e97b3();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.msl b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.msl
index 04b790d..05f90db 100644
--- a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.msl
+++ b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void pack2x16float_0e97b3() {
uint res = as_type<uint>(half2(float2()));
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
pack2x16float_0e97b3();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.spvasm b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.spvasm
index c8eac8b..4ee8e50 100644
--- a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.spvasm
@@ -1,55 +1,71 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 36
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %pack2x16float_0e97b3 "pack2x16float_0e97b3"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v2float = OpTypeVector %float 2
- %13 = OpConstantNull %v2float
+ %17 = OpConstantNull %v2float
%_ptr_Function_uint = OpTypePointer Function %uint
- %16 = OpConstantNull %uint
+ %20 = OpConstantNull %uint
+ %21 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%pack2x16float_0e97b3 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_uint Function %16
- %9 = OpExtInst %uint %11 PackHalf2x16 %13
- OpStore %res %9
+%pack2x16float_0e97b3 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %20
+ %13 = OpExtInst %uint %15 PackHalf2x16 %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %18 = OpLabel
+%tint_symbol_2 = OpFunction %void None %21
+%tint_symbol = OpFunctionParameter %v4float
+ %24 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %26 = OpLabel
OpStore %tint_pointsize %float_1
- %20 = OpFunctionCall %void %pack2x16float_0e97b3
+ %28 = OpFunctionCall %void %pack2x16float_0e97b3
+ %29 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %22 = OpLabel
- %23 = OpFunctionCall %void %pack2x16float_0e97b3
+%fragment_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %pack2x16float_0e97b3
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %25 = OpLabel
- %26 = OpFunctionCall %void %pack2x16float_0e97b3
+%compute_main = OpFunction %void None %9
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %pack2x16float_0e97b3
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.wgsl b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.wgsl
index d4d2b137..f866c86 100644
--- a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
pack2x16float_0e97b3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl
index 1ce08a3..692e9bf 100644
--- a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl
+++ b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
pack2x16snorm_6c169b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.hlsl b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.hlsl
index f8db4b3..9b38965 100644
--- a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.hlsl
@@ -1,11 +1,16 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void pack2x16snorm_6c169b() {
int2 tint_tmp = int2(round(clamp(float2(0.0f, 0.0f), -1.0, 1.0) * 32767.0)) & 0xffff;
uint res = asuint(tint_tmp.x | tint_tmp.y << 16);
}
-void vertex_main() {
+tint_symbol vertex_main() {
pack2x16snorm_6c169b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.msl b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.msl
index 744c4b4..7e91e3b 100644
--- a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.msl
+++ b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void pack2x16snorm_6c169b() {
uint res = pack_float_to_snorm2x16(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
pack2x16snorm_6c169b();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.spvasm b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.spvasm
index 73ea23a..b877da4 100644
--- a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.spvasm
@@ -1,55 +1,71 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 36
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %pack2x16snorm_6c169b "pack2x16snorm_6c169b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v2float = OpTypeVector %float 2
- %13 = OpConstantNull %v2float
+ %17 = OpConstantNull %v2float
%_ptr_Function_uint = OpTypePointer Function %uint
- %16 = OpConstantNull %uint
+ %20 = OpConstantNull %uint
+ %21 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%pack2x16snorm_6c169b = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_uint Function %16
- %9 = OpExtInst %uint %11 PackSnorm2x16 %13
- OpStore %res %9
+%pack2x16snorm_6c169b = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %20
+ %13 = OpExtInst %uint %15 PackSnorm2x16 %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %18 = OpLabel
+%tint_symbol_2 = OpFunction %void None %21
+%tint_symbol = OpFunctionParameter %v4float
+ %24 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %26 = OpLabel
OpStore %tint_pointsize %float_1
- %20 = OpFunctionCall %void %pack2x16snorm_6c169b
+ %28 = OpFunctionCall %void %pack2x16snorm_6c169b
+ %29 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %22 = OpLabel
- %23 = OpFunctionCall %void %pack2x16snorm_6c169b
+%fragment_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %pack2x16snorm_6c169b
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %25 = OpLabel
- %26 = OpFunctionCall %void %pack2x16snorm_6c169b
+%compute_main = OpFunction %void None %9
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %pack2x16snorm_6c169b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.wgsl b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.wgsl
index 33b7961..e693486 100644
--- a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
pack2x16snorm_6c169b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl
index 7e28d98..3afaeed 100644
--- a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl
+++ b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
pack2x16unorm_0f08e4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.hlsl b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.hlsl
index 4893f30..e7d59a9 100644
--- a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.hlsl
@@ -1,11 +1,16 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void pack2x16unorm_0f08e4() {
uint2 tint_tmp = uint2(round(clamp(float2(0.0f, 0.0f), 0.0, 1.0) * 65535.0));
uint res = (tint_tmp.x | tint_tmp.y << 16);
}
-void vertex_main() {
+tint_symbol vertex_main() {
pack2x16unorm_0f08e4();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.msl b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.msl
index 4032c7a..5f507aa 100644
--- a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.msl
+++ b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void pack2x16unorm_0f08e4() {
uint res = pack_float_to_unorm2x16(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
pack2x16unorm_0f08e4();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.spvasm b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.spvasm
index bdd07e7..448a04a 100644
--- a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.spvasm
@@ -1,55 +1,71 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 36
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %pack2x16unorm_0f08e4 "pack2x16unorm_0f08e4"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v2float = OpTypeVector %float 2
- %13 = OpConstantNull %v2float
+ %17 = OpConstantNull %v2float
%_ptr_Function_uint = OpTypePointer Function %uint
- %16 = OpConstantNull %uint
+ %20 = OpConstantNull %uint
+ %21 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%pack2x16unorm_0f08e4 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_uint Function %16
- %9 = OpExtInst %uint %11 PackUnorm2x16 %13
- OpStore %res %9
+%pack2x16unorm_0f08e4 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %20
+ %13 = OpExtInst %uint %15 PackUnorm2x16 %17
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %18 = OpLabel
+%tint_symbol_2 = OpFunction %void None %21
+%tint_symbol = OpFunctionParameter %v4float
+ %24 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %26 = OpLabel
OpStore %tint_pointsize %float_1
- %20 = OpFunctionCall %void %pack2x16unorm_0f08e4
+ %28 = OpFunctionCall %void %pack2x16unorm_0f08e4
+ %29 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %22 = OpLabel
- %23 = OpFunctionCall %void %pack2x16unorm_0f08e4
+%fragment_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %pack2x16unorm_0f08e4
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %25 = OpLabel
- %26 = OpFunctionCall %void %pack2x16unorm_0f08e4
+%compute_main = OpFunction %void None %9
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %pack2x16unorm_0f08e4
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.wgsl b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.wgsl
index 50a1f43..5022289 100644
--- a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
pack2x16unorm_0f08e4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl
index 926a674..10b7803 100644
--- a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl
+++ b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
pack4x8snorm_4d22e7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.hlsl b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.hlsl
index fdb571f..b2ac524 100644
--- a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.hlsl
@@ -1,11 +1,16 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void pack4x8snorm_4d22e7() {
int4 tint_tmp = int4(round(clamp(float4(0.0f, 0.0f, 0.0f, 0.0f), -1.0, 1.0) * 127.0)) & 0xff;
uint res = asuint(tint_tmp.x | tint_tmp.y << 8 | tint_tmp.z << 16 | tint_tmp.w << 24);
}
-void vertex_main() {
+tint_symbol vertex_main() {
pack4x8snorm_4d22e7();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.msl b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.msl
index 29469ce..f4311c9 100644
--- a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.msl
+++ b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void pack4x8snorm_4d22e7() {
uint res = pack_float_to_snorm4x8(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
pack4x8snorm_4d22e7();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.spvasm b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.spvasm
index 14c3fed..2455ddf 100644
--- a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.spvasm
@@ -1,55 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %pack4x8snorm_4d22e7 "pack4x8snorm_4d22e7"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
- %uint = OpTypeInt 32 0
%v4float = OpTypeVector %float 4
- %13 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
%_ptr_Function_uint = OpTypePointer Function %uint
- %16 = OpConstantNull %uint
+ %18 = OpConstantNull %uint
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%pack4x8snorm_4d22e7 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_uint Function %16
- %9 = OpExtInst %uint %11 PackSnorm4x8 %13
- OpStore %res %9
+%pack4x8snorm_4d22e7 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %18
+ %13 = OpExtInst %uint %15 PackSnorm4x8 %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %18 = OpLabel
- OpStore %tint_pointsize %float_1
- %20 = OpFunctionCall %void %pack4x8snorm_4d22e7
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
%22 = OpLabel
- %23 = OpFunctionCall %void %pack4x8snorm_4d22e7
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %25 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ OpStore %tint_pointsize %float_1
%26 = OpFunctionCall %void %pack4x8snorm_4d22e7
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %pack4x8snorm_4d22e7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %pack4x8snorm_4d22e7
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.wgsl b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.wgsl
index f004930..11c9f64 100644
--- a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
pack4x8snorm_4d22e7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl
index 7d24875..12bf088 100644
--- a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl
+++ b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
pack4x8unorm_95c456();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.hlsl b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.hlsl
index d28797e..1dc64d0 100644
--- a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.hlsl
@@ -1,11 +1,16 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void pack4x8unorm_95c456() {
uint4 tint_tmp = uint4(round(clamp(float4(0.0f, 0.0f, 0.0f, 0.0f), 0.0, 1.0) * 255.0));
uint res = (tint_tmp.x | tint_tmp.y << 8 | tint_tmp.z << 16 | tint_tmp.w << 24);
}
-void vertex_main() {
+tint_symbol vertex_main() {
pack4x8unorm_95c456();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.msl b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.msl
index 0871406..6edb56f 100644
--- a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.msl
+++ b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void pack4x8unorm_95c456() {
uint res = pack_float_to_unorm4x8(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
pack4x8unorm_95c456();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.spvasm b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.spvasm
index 2dd4c33..88f6962 100644
--- a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.spvasm
@@ -1,55 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %pack4x8unorm_95c456 "pack4x8unorm_95c456"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
- %uint = OpTypeInt 32 0
%v4float = OpTypeVector %float 4
- %13 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
%_ptr_Function_uint = OpTypePointer Function %uint
- %16 = OpConstantNull %uint
+ %18 = OpConstantNull %uint
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%pack4x8unorm_95c456 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_uint Function %16
- %9 = OpExtInst %uint %11 PackUnorm4x8 %13
- OpStore %res %9
+%pack4x8unorm_95c456 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %18
+ %13 = OpExtInst %uint %15 PackUnorm4x8 %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %18 = OpLabel
- OpStore %tint_pointsize %float_1
- %20 = OpFunctionCall %void %pack4x8unorm_95c456
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
%22 = OpLabel
- %23 = OpFunctionCall %void %pack4x8unorm_95c456
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %25 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ OpStore %tint_pointsize %float_1
%26 = OpFunctionCall %void %pack4x8unorm_95c456
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %pack4x8unorm_95c456
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %pack4x8unorm_95c456
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.wgsl b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.wgsl
index 1b296f9..278de47 100644
--- a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
pack4x8unorm_95c456();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/pow/04a908.wgsl b/test/intrinsics/gen/pow/04a908.wgsl
index c91e6cf..0ee93c1 100644
--- a/test/intrinsics/gen/pow/04a908.wgsl
+++ b/test/intrinsics/gen/pow/04a908.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
pow_04a908();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/pow/04a908.wgsl.expected.hlsl b/test/intrinsics/gen/pow/04a908.wgsl.expected.hlsl
index ad54235..15e1d54 100644
--- a/test/intrinsics/gen/pow/04a908.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/pow/04a908.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void pow_04a908() {
float4 res = pow(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
pow_04a908();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/pow/04a908.wgsl.expected.msl b/test/intrinsics/gen/pow/04a908.wgsl.expected.msl
index 228e56f..73909be 100644
--- a/test/intrinsics/gen/pow/04a908.wgsl.expected.msl
+++ b/test/intrinsics/gen/pow/04a908.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void pow_04a908() {
float4 res = pow(float4(), float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
pow_04a908();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/pow/04a908.wgsl.expected.spvasm b/test/intrinsics/gen/pow/04a908.wgsl.expected.spvasm
index ac67719..387d9cb 100644
--- a/test/intrinsics/gen/pow/04a908.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/pow/04a908.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %pow_04a908 "pow_04a908"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %pow_04a908 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Pow %12 %12
- OpStore %res %9
+ %pow_04a908 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Pow %8 %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %pow_04a908
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %pow_04a908
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %pow_04a908
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %pow_04a908
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %pow_04a908
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/pow/04a908.wgsl.expected.wgsl b/test/intrinsics/gen/pow/04a908.wgsl.expected.wgsl
index cbbf4b7..22ebe8a 100644
--- a/test/intrinsics/gen/pow/04a908.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/pow/04a908.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
pow_04a908();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/pow/46e029.wgsl b/test/intrinsics/gen/pow/46e029.wgsl
index b373967..a9c96f1 100644
--- a/test/intrinsics/gen/pow/46e029.wgsl
+++ b/test/intrinsics/gen/pow/46e029.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
pow_46e029();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/pow/46e029.wgsl.expected.hlsl b/test/intrinsics/gen/pow/46e029.wgsl.expected.hlsl
index 193aaea..94d3343 100644
--- a/test/intrinsics/gen/pow/46e029.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/pow/46e029.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void pow_46e029() {
float res = pow(1.0f, 1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
pow_46e029();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/pow/46e029.wgsl.expected.msl b/test/intrinsics/gen/pow/46e029.wgsl.expected.msl
index 22cdf1f..d1bd4b9 100644
--- a/test/intrinsics/gen/pow/46e029.wgsl.expected.msl
+++ b/test/intrinsics/gen/pow/46e029.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void pow_46e029() {
float res = pow(1.0f, 1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
pow_46e029();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/pow/46e029.wgsl.expected.spvasm b/test/intrinsics/gen/pow/46e029.wgsl.expected.spvasm
index 030a77e..8eadbb0 100644
--- a/test/intrinsics/gen/pow/46e029.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/pow/46e029.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %pow_46e029 "pow_46e029"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
- %pow_46e029 = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+ %pow_46e029 = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Pow %float_1 %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Pow %float_1 %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %pow_46e029
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %pow_46e029
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %pow_46e029
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %pow_46e029
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %pow_46e029
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %pow_46e029
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/pow/46e029.wgsl.expected.wgsl b/test/intrinsics/gen/pow/46e029.wgsl.expected.wgsl
index 6aae69e..0630887 100644
--- a/test/intrinsics/gen/pow/46e029.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/pow/46e029.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
pow_46e029();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/pow/4a46c9.wgsl b/test/intrinsics/gen/pow/4a46c9.wgsl
index cf1801d..eedeae0 100644
--- a/test/intrinsics/gen/pow/4a46c9.wgsl
+++ b/test/intrinsics/gen/pow/4a46c9.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
pow_4a46c9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.hlsl b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.hlsl
index 4b79a21..647b0db 100644
--- a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void pow_4a46c9() {
float3 res = pow(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
pow_4a46c9();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.msl b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.msl
index e518b16..6765ee7 100644
--- a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.msl
+++ b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void pow_4a46c9() {
float3 res = pow(float3(), float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
pow_4a46c9();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.spvasm b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.spvasm
index 3ba1ee0..d15b172 100644
--- a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %pow_4a46c9 "pow_4a46c9"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %pow_4a46c9 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Pow %12 %12
- OpStore %res %9
+ %pow_4a46c9 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Pow %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %pow_4a46c9
+ %26 = OpFunctionCall %void %pow_4a46c9
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %pow_4a46c9
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %pow_4a46c9
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %pow_4a46c9
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %pow_4a46c9
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.wgsl b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.wgsl
index c789baa..b02d7fc 100644
--- a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
pow_4a46c9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/pow/e60ea5.wgsl b/test/intrinsics/gen/pow/e60ea5.wgsl
index ad3bb6c..fb93bfb 100644
--- a/test/intrinsics/gen/pow/e60ea5.wgsl
+++ b/test/intrinsics/gen/pow/e60ea5.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
pow_e60ea5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.hlsl b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.hlsl
index b03968b..c9faab8 100644
--- a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void pow_e60ea5() {
float2 res = pow(float2(0.0f, 0.0f), float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
pow_e60ea5();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.msl b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.msl
index d957e76..7e1c6f7 100644
--- a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.msl
+++ b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void pow_e60ea5() {
float2 res = pow(float2(), float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
pow_e60ea5();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.spvasm b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.spvasm
index 8aeb680..27bfedb 100644
--- a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %pow_e60ea5 "pow_e60ea5"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %pow_e60ea5 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Pow %12 %12
- OpStore %res %9
+ %pow_e60ea5 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Pow %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %pow_e60ea5
+ %26 = OpFunctionCall %void %pow_e60ea5
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %pow_e60ea5
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %pow_e60ea5
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %pow_e60ea5
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %pow_e60ea5
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.wgsl b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.wgsl
index d8c2cb6..88837a1 100644
--- a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
pow_e60ea5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/reflect/05357e.wgsl b/test/intrinsics/gen/reflect/05357e.wgsl
index 79795c5..662463d 100644
--- a/test/intrinsics/gen/reflect/05357e.wgsl
+++ b/test/intrinsics/gen/reflect/05357e.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
reflect_05357e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/reflect/05357e.wgsl.expected.hlsl b/test/intrinsics/gen/reflect/05357e.wgsl.expected.hlsl
index 8b788a2..fed17cd 100644
--- a/test/intrinsics/gen/reflect/05357e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/reflect/05357e.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void reflect_05357e() {
float4 res = reflect(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
reflect_05357e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/reflect/05357e.wgsl.expected.msl b/test/intrinsics/gen/reflect/05357e.wgsl.expected.msl
index 2254230..10fb0cb 100644
--- a/test/intrinsics/gen/reflect/05357e.wgsl.expected.msl
+++ b/test/intrinsics/gen/reflect/05357e.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void reflect_05357e() {
float4 res = reflect(float4(), float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
reflect_05357e();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/reflect/05357e.wgsl.expected.spvasm b/test/intrinsics/gen/reflect/05357e.wgsl.expected.spvasm
index 5326fc6..e73594a 100644
--- a/test/intrinsics/gen/reflect/05357e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/reflect/05357e.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %reflect_05357e "reflect_05357e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%reflect_05357e = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Reflect %12 %12
- OpStore %res %9
+%reflect_05357e = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Reflect %8 %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %reflect_05357e
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %reflect_05357e
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %reflect_05357e
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %reflect_05357e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %reflect_05357e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/reflect/05357e.wgsl.expected.wgsl b/test/intrinsics/gen/reflect/05357e.wgsl.expected.wgsl
index 5795848..e02b51b 100644
--- a/test/intrinsics/gen/reflect/05357e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/reflect/05357e.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
reflect_05357e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/reflect/b61e10.wgsl b/test/intrinsics/gen/reflect/b61e10.wgsl
index ce35141..108d1dcb 100644
--- a/test/intrinsics/gen/reflect/b61e10.wgsl
+++ b/test/intrinsics/gen/reflect/b61e10.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
reflect_b61e10();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.hlsl b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.hlsl
index 57643e7..a80f406 100644
--- a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void reflect_b61e10() {
float2 res = reflect(float2(0.0f, 0.0f), float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
reflect_b61e10();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.msl b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.msl
index a810e76..e8c412a 100644
--- a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.msl
+++ b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void reflect_b61e10() {
float2 res = reflect(float2(), float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
reflect_b61e10();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.spvasm b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.spvasm
index 9e75c23..bb16320 100644
--- a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %reflect_b61e10 "reflect_b61e10"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%reflect_b61e10 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Reflect %12 %12
- OpStore %res %9
+%reflect_b61e10 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Reflect %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %reflect_b61e10
+ %26 = OpFunctionCall %void %reflect_b61e10
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %reflect_b61e10
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %reflect_b61e10
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %reflect_b61e10
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %reflect_b61e10
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.wgsl b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.wgsl
index 69cebff..20bcaf2 100644
--- a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
reflect_b61e10();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/reflect/f47fdb.wgsl b/test/intrinsics/gen/reflect/f47fdb.wgsl
index 81ce08e..9709528 100644
--- a/test/intrinsics/gen/reflect/f47fdb.wgsl
+++ b/test/intrinsics/gen/reflect/f47fdb.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
reflect_f47fdb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.hlsl b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.hlsl
index f48fec2..39eac48 100644
--- a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void reflect_f47fdb() {
float3 res = reflect(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
reflect_f47fdb();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.msl b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.msl
index d710cf2..c0b9c40 100644
--- a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.msl
+++ b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void reflect_f47fdb() {
float3 res = reflect(float3(), float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
reflect_f47fdb();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.spvasm b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.spvasm
index 6b71c48..845c705 100644
--- a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %reflect_f47fdb "reflect_f47fdb"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%reflect_f47fdb = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Reflect %12 %12
- OpStore %res %9
+%reflect_f47fdb = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Reflect %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %reflect_f47fdb
+ %26 = OpFunctionCall %void %reflect_f47fdb
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %reflect_f47fdb
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %reflect_f47fdb
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %reflect_f47fdb
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %reflect_f47fdb
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.wgsl b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.wgsl
index 68fdf25..7d2dbb4 100644
--- a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
reflect_f47fdb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/reflect/feae90.wgsl b/test/intrinsics/gen/reflect/feae90.wgsl
index cd1ef9f..c1c4fb7 100644
--- a/test/intrinsics/gen/reflect/feae90.wgsl
+++ b/test/intrinsics/gen/reflect/feae90.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
reflect_feae90();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/reflect/feae90.wgsl.expected.hlsl b/test/intrinsics/gen/reflect/feae90.wgsl.expected.hlsl
index 9be6d7b..1e134b1 100644
--- a/test/intrinsics/gen/reflect/feae90.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/reflect/feae90.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void reflect_feae90() {
float res = reflect(1.0f, 1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
reflect_feae90();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/reflect/feae90.wgsl.expected.spvasm b/test/intrinsics/gen/reflect/feae90.wgsl.expected.spvasm
index f8f0680..3ea067f 100644
--- a/test/intrinsics/gen/reflect/feae90.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/reflect/feae90.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %reflect_feae90 "reflect_feae90"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%reflect_feae90 = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+%reflect_feae90 = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Reflect %float_1 %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Reflect %float_1 %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %reflect_feae90
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %reflect_feae90
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %reflect_feae90
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %reflect_feae90
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %reflect_feae90
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %reflect_feae90
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/reflect/feae90.wgsl.expected.wgsl b/test/intrinsics/gen/reflect/feae90.wgsl.expected.wgsl
index 7b3a23b..939a130 100644
--- a/test/intrinsics/gen/reflect/feae90.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/reflect/feae90.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
reflect_feae90();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/reverseBits/222177.wgsl b/test/intrinsics/gen/reverseBits/222177.wgsl
index 01dc289..febc201 100644
--- a/test/intrinsics/gen/reverseBits/222177.wgsl
+++ b/test/intrinsics/gen/reverseBits/222177.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
reverseBits_222177();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.hlsl
index f4c8e99..251d14d 100644
--- a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void reverseBits_222177() {
int2 res = reversebits(int2(0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
reverseBits_222177();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.msl
index e4cc0b3..210f3b3 100644
--- a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.msl
+++ b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void reverseBits_222177() {
int2 res = reverse_bits(int2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
reverseBits_222177();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.spvasm
index f180cb1..7a72b2c 100644
--- a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %reverseBits_222177 "reverseBits_222177"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %12 = OpConstantNull %v2int
+ %16 = OpConstantNull %v2int
%_ptr_Function_v2int = OpTypePointer Function %v2int
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%reverseBits_222177 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %12
- %9 = OpBitReverse %v2int %12
- OpStore %res %9
+%reverseBits_222177 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %16
+ %13 = OpBitReverse %v2int %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %reverseBits_222177
+ %26 = OpFunctionCall %void %reverseBits_222177
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %reverseBits_222177
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %reverseBits_222177
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %reverseBits_222177
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %reverseBits_222177
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.wgsl
index bf364aa..60cbc40 100644
--- a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
reverseBits_222177();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/reverseBits/35fea9.wgsl b/test/intrinsics/gen/reverseBits/35fea9.wgsl
index 4a85781..f2cdb14 100644
--- a/test/intrinsics/gen/reverseBits/35fea9.wgsl
+++ b/test/intrinsics/gen/reverseBits/35fea9.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
reverseBits_35fea9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.hlsl
index da3cf17..b826d6a 100644
--- a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void reverseBits_35fea9() {
uint4 res = reversebits(uint4(0u, 0u, 0u, 0u));
}
-void vertex_main() {
+tint_symbol vertex_main() {
reverseBits_35fea9();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.msl
index 7aea816..2d0b471 100644
--- a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.msl
+++ b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void reverseBits_35fea9() {
uint4 res = reverse_bits(uint4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
reverseBits_35fea9();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.spvasm
index 114d8da..107b474 100644
--- a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %reverseBits_35fea9 "reverseBits_35fea9"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v4uint = OpTypeVector %uint 4
- %12 = OpConstantNull %v4uint
+ %16 = OpConstantNull %v4uint
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%reverseBits_35fea9 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %12
- %9 = OpBitReverse %v4uint %12
- OpStore %res %9
+%reverseBits_35fea9 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %16
+ %13 = OpBitReverse %v4uint %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %reverseBits_35fea9
+ %26 = OpFunctionCall %void %reverseBits_35fea9
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %reverseBits_35fea9
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %reverseBits_35fea9
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %reverseBits_35fea9
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %reverseBits_35fea9
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.wgsl
index 850bc8f..39ecfee 100644
--- a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
reverseBits_35fea9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl
index ecb8851..fd1888f 100644
--- a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl
+++ b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
reverseBits_4dbd6f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.hlsl
index 3d0d9f8..708d2a0 100644
--- a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void reverseBits_4dbd6f() {
int4 res = reversebits(int4(0, 0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
reverseBits_4dbd6f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.msl
index f73e0c6..5dde8a3 100644
--- a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.msl
+++ b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void reverseBits_4dbd6f() {
int4 res = reverse_bits(int4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
reverseBits_4dbd6f();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.spvasm
index 35d075f..040a433 100644
--- a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %reverseBits_4dbd6f "reverseBits_4dbd6f"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v4int = OpTypeVector %int 4
- %12 = OpConstantNull %v4int
+ %16 = OpConstantNull %v4int
%_ptr_Function_v4int = OpTypePointer Function %v4int
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%reverseBits_4dbd6f = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %12
- %9 = OpBitReverse %v4int %12
- OpStore %res %9
+%reverseBits_4dbd6f = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %16
+ %13 = OpBitReverse %v4int %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %reverseBits_4dbd6f
+ %26 = OpFunctionCall %void %reverseBits_4dbd6f
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %reverseBits_4dbd6f
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %reverseBits_4dbd6f
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %reverseBits_4dbd6f
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %reverseBits_4dbd6f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.wgsl
index 282a3c5..ecd9852 100644
--- a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
reverseBits_4dbd6f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/reverseBits/7c4269.wgsl b/test/intrinsics/gen/reverseBits/7c4269.wgsl
index 3528f06..396ed41 100644
--- a/test/intrinsics/gen/reverseBits/7c4269.wgsl
+++ b/test/intrinsics/gen/reverseBits/7c4269.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
reverseBits_7c4269();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.hlsl
index 871fbfc..9694820 100644
--- a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void reverseBits_7c4269() {
int res = reversebits(1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
reverseBits_7c4269();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.msl
index 07d3509..5621f10 100644
--- a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.msl
+++ b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void reverseBits_7c4269() {
int res = reverse_bits(1);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
reverseBits_7c4269();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.spvasm
index c7b168a..9201251 100644
--- a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %reverseBits_7c4269 "reverseBits_7c4269"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_Function_int = OpTypePointer Function %int
- %14 = OpConstantNull %int
+ %18 = OpConstantNull %int
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%reverseBits_7c4269 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %14
- %9 = OpBitReverse %int %int_1
- OpStore %res %9
+%reverseBits_7c4269 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %18
+ %13 = OpBitReverse %int %int_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %reverseBits_7c4269
+ %26 = OpFunctionCall %void %reverseBits_7c4269
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %reverseBits_7c4269
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %reverseBits_7c4269
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %reverseBits_7c4269
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %reverseBits_7c4269
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.wgsl
index 3571b73..aeaf905 100644
--- a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
reverseBits_7c4269();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl
index 960cb70..20efbd5 100644
--- a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl
+++ b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
reverseBits_a6ccd4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.hlsl
index 8a15354..78ed8c2 100644
--- a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void reverseBits_a6ccd4() {
uint3 res = reversebits(uint3(0u, 0u, 0u));
}
-void vertex_main() {
+tint_symbol vertex_main() {
reverseBits_a6ccd4();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.msl
index 73b5497..0158aed 100644
--- a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.msl
+++ b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void reverseBits_a6ccd4() {
uint3 res = reverse_bits(uint3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
reverseBits_a6ccd4();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.spvasm
index 51617d4..11dbeb9 100644
--- a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %reverseBits_a6ccd4 "reverseBits_a6ccd4"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v3uint = OpTypeVector %uint 3
- %12 = OpConstantNull %v3uint
+ %16 = OpConstantNull %v3uint
%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%reverseBits_a6ccd4 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3uint Function %12
- %9 = OpBitReverse %v3uint %12
- OpStore %res %9
+%reverseBits_a6ccd4 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %16
+ %13 = OpBitReverse %v3uint %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %reverseBits_a6ccd4
+ %26 = OpFunctionCall %void %reverseBits_a6ccd4
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %reverseBits_a6ccd4
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %reverseBits_a6ccd4
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %reverseBits_a6ccd4
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %reverseBits_a6ccd4
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.wgsl
index 118301b..8ca19a3 100644
--- a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
reverseBits_a6ccd4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/reverseBits/c21bc1.wgsl b/test/intrinsics/gen/reverseBits/c21bc1.wgsl
index aab692d..6235a86 100644
--- a/test/intrinsics/gen/reverseBits/c21bc1.wgsl
+++ b/test/intrinsics/gen/reverseBits/c21bc1.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
reverseBits_c21bc1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.hlsl
index fcf618a..e3e9170 100644
--- a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void reverseBits_c21bc1() {
int3 res = reversebits(int3(0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
reverseBits_c21bc1();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.msl
index 45aa86e..b8623bc 100644
--- a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.msl
+++ b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void reverseBits_c21bc1() {
int3 res = reverse_bits(int3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
reverseBits_c21bc1();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.spvasm
index 1f24721..d1e61d6 100644
--- a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %reverseBits_c21bc1 "reverseBits_c21bc1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %12 = OpConstantNull %v3int
+ %16 = OpConstantNull %v3int
%_ptr_Function_v3int = OpTypePointer Function %v3int
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%reverseBits_c21bc1 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %12
- %9 = OpBitReverse %v3int %12
- OpStore %res %9
+%reverseBits_c21bc1 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %16
+ %13 = OpBitReverse %v3int %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %reverseBits_c21bc1
+ %26 = OpFunctionCall %void %reverseBits_c21bc1
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %reverseBits_c21bc1
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %reverseBits_c21bc1
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %reverseBits_c21bc1
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %reverseBits_c21bc1
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.wgsl
index adb06da..0f3f42b 100644
--- a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
reverseBits_c21bc1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl
index 238cba0..575fbc7 100644
--- a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl
+++ b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
reverseBits_e1f4c1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.hlsl
index faf8a49..58a73ee 100644
--- a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void reverseBits_e1f4c1() {
uint2 res = reversebits(uint2(0u, 0u));
}
-void vertex_main() {
+tint_symbol vertex_main() {
reverseBits_e1f4c1();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.msl
index 7c2a685..ba544b7 100644
--- a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.msl
+++ b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void reverseBits_e1f4c1() {
uint2 res = reverse_bits(uint2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
reverseBits_e1f4c1();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.spvasm
index 35a6db0..d6b4d88 100644
--- a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %reverseBits_e1f4c1 "reverseBits_e1f4c1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%v2uint = OpTypeVector %uint 2
- %12 = OpConstantNull %v2uint
+ %16 = OpConstantNull %v2uint
%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%reverseBits_e1f4c1 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2uint Function %12
- %9 = OpBitReverse %v2uint %12
- OpStore %res %9
+%reverseBits_e1f4c1 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %16
+ %13 = OpBitReverse %v2uint %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %reverseBits_e1f4c1
+ %26 = OpFunctionCall %void %reverseBits_e1f4c1
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %reverseBits_e1f4c1
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %reverseBits_e1f4c1
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %reverseBits_e1f4c1
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %reverseBits_e1f4c1
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.wgsl
index 7676c94..eef4ade 100644
--- a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
reverseBits_e1f4c1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/reverseBits/e31adf.wgsl b/test/intrinsics/gen/reverseBits/e31adf.wgsl
index 6f8855d..cf4776a 100644
--- a/test/intrinsics/gen/reverseBits/e31adf.wgsl
+++ b/test/intrinsics/gen/reverseBits/e31adf.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
reverseBits_e31adf();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.hlsl
index 245c726..5d35bfc 100644
--- a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void reverseBits_e31adf() {
uint res = reversebits(1u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
reverseBits_e31adf();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.msl
index eb2b65c..bc9b4af 100644
--- a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.msl
+++ b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void reverseBits_e31adf() {
uint res = reverse_bits(1u);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
reverseBits_e31adf();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.spvasm
index d9e3f25..d40e31b 100644
--- a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %reverseBits_e31adf "reverseBits_e31adf"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%_ptr_Function_uint = OpTypePointer Function %uint
- %14 = OpConstantNull %uint
+ %18 = OpConstantNull %uint
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%reverseBits_e31adf = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_uint Function %14
- %9 = OpBitReverse %uint %uint_1
- OpStore %res %9
+%reverseBits_e31adf = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %18
+ %13 = OpBitReverse %uint %uint_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %reverseBits_e31adf
+ %26 = OpFunctionCall %void %reverseBits_e31adf
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %reverseBits_e31adf
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %reverseBits_e31adf
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %reverseBits_e31adf
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %reverseBits_e31adf
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.wgsl
index c3a3a48..8c4a086 100644
--- a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
reverseBits_e31adf();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/round/106c0b.wgsl b/test/intrinsics/gen/round/106c0b.wgsl
index d8b36ba..cbaee80 100644
--- a/test/intrinsics/gen/round/106c0b.wgsl
+++ b/test/intrinsics/gen/round/106c0b.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
round_106c0b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/round/106c0b.wgsl.expected.hlsl b/test/intrinsics/gen/round/106c0b.wgsl.expected.hlsl
index 1d5a479..c75d2ca 100644
--- a/test/intrinsics/gen/round/106c0b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/round/106c0b.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void round_106c0b() {
float4 res = round(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
round_106c0b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/round/106c0b.wgsl.expected.msl b/test/intrinsics/gen/round/106c0b.wgsl.expected.msl
index 460fcfa..2ae782a 100644
--- a/test/intrinsics/gen/round/106c0b.wgsl.expected.msl
+++ b/test/intrinsics/gen/round/106c0b.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void round_106c0b() {
float4 res = rint(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
round_106c0b();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/round/106c0b.wgsl.expected.spvasm b/test/intrinsics/gen/round/106c0b.wgsl.expected.spvasm
index 1a45662..2227569 100644
--- a/test/intrinsics/gen/round/106c0b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/round/106c0b.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %round_106c0b "round_106c0b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%round_106c0b = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 RoundEven %12
- OpStore %res %9
+%round_106c0b = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 RoundEven %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %round_106c0b
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %round_106c0b
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %round_106c0b
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %round_106c0b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %round_106c0b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/round/106c0b.wgsl.expected.wgsl b/test/intrinsics/gen/round/106c0b.wgsl.expected.wgsl
index 454fbb1..e505c11 100644
--- a/test/intrinsics/gen/round/106c0b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/round/106c0b.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
round_106c0b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/round/1c7897.wgsl b/test/intrinsics/gen/round/1c7897.wgsl
index 48f1a1f..8ff54e0 100644
--- a/test/intrinsics/gen/round/1c7897.wgsl
+++ b/test/intrinsics/gen/round/1c7897.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
round_1c7897();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/round/1c7897.wgsl.expected.hlsl b/test/intrinsics/gen/round/1c7897.wgsl.expected.hlsl
index ca4d1b8..4c4bb18 100644
--- a/test/intrinsics/gen/round/1c7897.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/round/1c7897.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void round_1c7897() {
float3 res = round(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
round_1c7897();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/round/1c7897.wgsl.expected.msl b/test/intrinsics/gen/round/1c7897.wgsl.expected.msl
index 567828b..608a2fe 100644
--- a/test/intrinsics/gen/round/1c7897.wgsl.expected.msl
+++ b/test/intrinsics/gen/round/1c7897.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void round_1c7897() {
float3 res = rint(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
round_1c7897();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/round/1c7897.wgsl.expected.spvasm b/test/intrinsics/gen/round/1c7897.wgsl.expected.spvasm
index 81b1781..6228f41 100644
--- a/test/intrinsics/gen/round/1c7897.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/round/1c7897.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %round_1c7897 "round_1c7897"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%round_1c7897 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 RoundEven %12
- OpStore %res %9
+%round_1c7897 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 RoundEven %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %round_1c7897
+ %26 = OpFunctionCall %void %round_1c7897
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %round_1c7897
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %round_1c7897
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %round_1c7897
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %round_1c7897
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/round/1c7897.wgsl.expected.wgsl b/test/intrinsics/gen/round/1c7897.wgsl.expected.wgsl
index ab42e01..3691eda 100644
--- a/test/intrinsics/gen/round/1c7897.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/round/1c7897.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
round_1c7897();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/round/52c84d.wgsl b/test/intrinsics/gen/round/52c84d.wgsl
index 189a1d5..2b6e373 100644
--- a/test/intrinsics/gen/round/52c84d.wgsl
+++ b/test/intrinsics/gen/round/52c84d.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
round_52c84d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/round/52c84d.wgsl.expected.hlsl b/test/intrinsics/gen/round/52c84d.wgsl.expected.hlsl
index 948707e..6aa14eb 100644
--- a/test/intrinsics/gen/round/52c84d.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/round/52c84d.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void round_52c84d() {
float2 res = round(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
round_52c84d();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/round/52c84d.wgsl.expected.msl b/test/intrinsics/gen/round/52c84d.wgsl.expected.msl
index 8b8b6d6..b9fc56f 100644
--- a/test/intrinsics/gen/round/52c84d.wgsl.expected.msl
+++ b/test/intrinsics/gen/round/52c84d.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void round_52c84d() {
float2 res = rint(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
round_52c84d();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/round/52c84d.wgsl.expected.spvasm b/test/intrinsics/gen/round/52c84d.wgsl.expected.spvasm
index d3a9a9a..e8ef366 100644
--- a/test/intrinsics/gen/round/52c84d.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/round/52c84d.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %round_52c84d "round_52c84d"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%round_52c84d = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 RoundEven %12
- OpStore %res %9
+%round_52c84d = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 RoundEven %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %round_52c84d
+ %26 = OpFunctionCall %void %round_52c84d
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %round_52c84d
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %round_52c84d
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %round_52c84d
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %round_52c84d
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/round/52c84d.wgsl.expected.wgsl b/test/intrinsics/gen/round/52c84d.wgsl.expected.wgsl
index 9243a33..89febac 100644
--- a/test/intrinsics/gen/round/52c84d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/round/52c84d.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
round_52c84d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/round/9edc38.wgsl b/test/intrinsics/gen/round/9edc38.wgsl
index 549a6b7..1d6d64d 100644
--- a/test/intrinsics/gen/round/9edc38.wgsl
+++ b/test/intrinsics/gen/round/9edc38.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
round_9edc38();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/round/9edc38.wgsl.expected.hlsl b/test/intrinsics/gen/round/9edc38.wgsl.expected.hlsl
index 1cebde8..874ac81 100644
--- a/test/intrinsics/gen/round/9edc38.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/round/9edc38.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void round_9edc38() {
float res = round(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
round_9edc38();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/round/9edc38.wgsl.expected.msl b/test/intrinsics/gen/round/9edc38.wgsl.expected.msl
index bf4f2ab..0361b22 100644
--- a/test/intrinsics/gen/round/9edc38.wgsl.expected.msl
+++ b/test/intrinsics/gen/round/9edc38.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void round_9edc38() {
float res = rint(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
round_9edc38();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/round/9edc38.wgsl.expected.spvasm b/test/intrinsics/gen/round/9edc38.wgsl.expected.spvasm
index 8d34914..977d0ac 100644
--- a/test/intrinsics/gen/round/9edc38.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/round/9edc38.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %round_9edc38 "round_9edc38"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%round_9edc38 = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+%round_9edc38 = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 RoundEven %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 RoundEven %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %round_9edc38
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %round_9edc38
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %round_9edc38
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %round_9edc38
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %round_9edc38
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %round_9edc38
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/round/9edc38.wgsl.expected.wgsl b/test/intrinsics/gen/round/9edc38.wgsl.expected.wgsl
index fcb59dc..993bb50 100644
--- a/test/intrinsics/gen/round/9edc38.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/round/9edc38.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
round_9edc38();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/00b848.wgsl b/test/intrinsics/gen/select/00b848.wgsl
index 61e3913..c88c350 100644
--- a/test/intrinsics/gen/select/00b848.wgsl
+++ b/test/intrinsics/gen/select/00b848.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_00b848();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/00b848.wgsl.expected.msl b/test/intrinsics/gen/select/00b848.wgsl.expected.msl
index 426deef..2b431a8 100644
--- a/test/intrinsics/gen/select/00b848.wgsl.expected.msl
+++ b/test/intrinsics/gen/select/00b848.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void select_00b848() {
int2 res = select(int2(), int2(), bool2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
select_00b848();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/select/00b848.wgsl.expected.wgsl b/test/intrinsics/gen/select/00b848.wgsl.expected.wgsl
index afae377..90876ef 100644
--- a/test/intrinsics/gen/select/00b848.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/select/00b848.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_00b848();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/01e2cd.wgsl b/test/intrinsics/gen/select/01e2cd.wgsl
index 79c24e4..d3811f2 100644
--- a/test/intrinsics/gen/select/01e2cd.wgsl
+++ b/test/intrinsics/gen/select/01e2cd.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_01e2cd();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/01e2cd.wgsl.expected.msl b/test/intrinsics/gen/select/01e2cd.wgsl.expected.msl
index 652bb8b..9f29574 100644
--- a/test/intrinsics/gen/select/01e2cd.wgsl.expected.msl
+++ b/test/intrinsics/gen/select/01e2cd.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void select_01e2cd() {
int3 res = select(int3(), int3(), bool3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
select_01e2cd();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/select/01e2cd.wgsl.expected.wgsl b/test/intrinsics/gen/select/01e2cd.wgsl.expected.wgsl
index 8cc641b..a69ac5e 100644
--- a/test/intrinsics/gen/select/01e2cd.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/select/01e2cd.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_01e2cd();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/1e960b.wgsl b/test/intrinsics/gen/select/1e960b.wgsl
index 94fc946..71309eb 100644
--- a/test/intrinsics/gen/select/1e960b.wgsl
+++ b/test/intrinsics/gen/select/1e960b.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_1e960b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/1e960b.wgsl.expected.msl b/test/intrinsics/gen/select/1e960b.wgsl.expected.msl
index 7b9cc56..172ac62 100644
--- a/test/intrinsics/gen/select/1e960b.wgsl.expected.msl
+++ b/test/intrinsics/gen/select/1e960b.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void select_1e960b() {
uint2 res = select(uint2(), uint2(), bool2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
select_1e960b();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/select/1e960b.wgsl.expected.wgsl b/test/intrinsics/gen/select/1e960b.wgsl.expected.wgsl
index bbf9f1c..bb6cbb3 100644
--- a/test/intrinsics/gen/select/1e960b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/select/1e960b.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_1e960b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/266aff.wgsl b/test/intrinsics/gen/select/266aff.wgsl
index 6ad4aeb..88c7d50 100644
--- a/test/intrinsics/gen/select/266aff.wgsl
+++ b/test/intrinsics/gen/select/266aff.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_266aff();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/266aff.wgsl.expected.msl b/test/intrinsics/gen/select/266aff.wgsl.expected.msl
index 9e2b612..347ac27 100644
--- a/test/intrinsics/gen/select/266aff.wgsl.expected.msl
+++ b/test/intrinsics/gen/select/266aff.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void select_266aff() {
float2 res = select(float2(), float2(), bool2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
select_266aff();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/select/266aff.wgsl.expected.wgsl b/test/intrinsics/gen/select/266aff.wgsl.expected.wgsl
index 2b269b7..9c53851 100644
--- a/test/intrinsics/gen/select/266aff.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/select/266aff.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_266aff();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/28a27e.wgsl b/test/intrinsics/gen/select/28a27e.wgsl
index 1eb6bba..68520c1 100644
--- a/test/intrinsics/gen/select/28a27e.wgsl
+++ b/test/intrinsics/gen/select/28a27e.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_28a27e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/28a27e.wgsl.expected.msl b/test/intrinsics/gen/select/28a27e.wgsl.expected.msl
index 2e6f617..667c9a1 100644
--- a/test/intrinsics/gen/select/28a27e.wgsl.expected.msl
+++ b/test/intrinsics/gen/select/28a27e.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void select_28a27e() {
uint3 res = select(uint3(), uint3(), bool3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
select_28a27e();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/select/28a27e.wgsl.expected.wgsl b/test/intrinsics/gen/select/28a27e.wgsl.expected.wgsl
index fc8858f..037afbc 100644
--- a/test/intrinsics/gen/select/28a27e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/select/28a27e.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_28a27e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/416e14.wgsl b/test/intrinsics/gen/select/416e14.wgsl
index 0dd6b76..44f2070 100644
--- a/test/intrinsics/gen/select/416e14.wgsl
+++ b/test/intrinsics/gen/select/416e14.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_416e14();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/416e14.wgsl.expected.msl b/test/intrinsics/gen/select/416e14.wgsl.expected.msl
index 376f282..85cd25a 100644
--- a/test/intrinsics/gen/select/416e14.wgsl.expected.msl
+++ b/test/intrinsics/gen/select/416e14.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void select_416e14() {
float res = select(1.0f, 1.0f, bool());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
select_416e14();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/select/416e14.wgsl.expected.wgsl b/test/intrinsics/gen/select/416e14.wgsl.expected.wgsl
index d44749c..90abb36 100644
--- a/test/intrinsics/gen/select/416e14.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/select/416e14.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_416e14();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/80a9a9.wgsl b/test/intrinsics/gen/select/80a9a9.wgsl
index 089c979..6aafb93 100644
--- a/test/intrinsics/gen/select/80a9a9.wgsl
+++ b/test/intrinsics/gen/select/80a9a9.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_80a9a9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/80a9a9.wgsl.expected.msl b/test/intrinsics/gen/select/80a9a9.wgsl.expected.msl
index 0263844..3aff43f 100644
--- a/test/intrinsics/gen/select/80a9a9.wgsl.expected.msl
+++ b/test/intrinsics/gen/select/80a9a9.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void select_80a9a9() {
bool3 res = select(bool3(), bool3(), bool3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
select_80a9a9();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/select/80a9a9.wgsl.expected.spvasm b/test/intrinsics/gen/select/80a9a9.wgsl.expected.spvasm
index 34b464e..71bf522 100644
--- a/test/intrinsics/gen/select/80a9a9.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/select/80a9a9.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %select_80a9a9 "select_80a9a9"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
%v3bool = OpTypeVector %bool 3
- %12 = OpConstantNull %v3bool
+ %16 = OpConstantNull %v3bool
%_ptr_Function_v3bool = OpTypePointer Function %v3bool
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%select_80a9a9 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3bool Function %12
- %9 = OpSelect %v3bool %12 %12 %12
- OpStore %res %9
+%select_80a9a9 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3bool Function %16
+ %13 = OpSelect %v3bool %16 %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %select_80a9a9
+ %26 = OpFunctionCall %void %select_80a9a9
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %select_80a9a9
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %select_80a9a9
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %select_80a9a9
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %select_80a9a9
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/select/80a9a9.wgsl.expected.wgsl b/test/intrinsics/gen/select/80a9a9.wgsl.expected.wgsl
index 52d6efe..a5fb47d 100644
--- a/test/intrinsics/gen/select/80a9a9.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/select/80a9a9.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_80a9a9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/99f883.wgsl b/test/intrinsics/gen/select/99f883.wgsl
index 7c078a0..a03ed53 100644
--- a/test/intrinsics/gen/select/99f883.wgsl
+++ b/test/intrinsics/gen/select/99f883.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_99f883();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/99f883.wgsl.expected.msl b/test/intrinsics/gen/select/99f883.wgsl.expected.msl
index 8332072..45e38cf 100644
--- a/test/intrinsics/gen/select/99f883.wgsl.expected.msl
+++ b/test/intrinsics/gen/select/99f883.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void select_99f883() {
uint res = select(1u, 1u, bool());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
select_99f883();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/select/99f883.wgsl.expected.wgsl b/test/intrinsics/gen/select/99f883.wgsl.expected.wgsl
index 6dd41c7..7ede94b 100644
--- a/test/intrinsics/gen/select/99f883.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/select/99f883.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_99f883();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/a2860e.wgsl b/test/intrinsics/gen/select/a2860e.wgsl
index 1df8bf5..4f9458b 100644
--- a/test/intrinsics/gen/select/a2860e.wgsl
+++ b/test/intrinsics/gen/select/a2860e.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_a2860e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/a2860e.wgsl.expected.msl b/test/intrinsics/gen/select/a2860e.wgsl.expected.msl
index aacb8ce..d57b00a 100644
--- a/test/intrinsics/gen/select/a2860e.wgsl.expected.msl
+++ b/test/intrinsics/gen/select/a2860e.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void select_a2860e() {
int4 res = select(int4(), int4(), bool4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
select_a2860e();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/select/a2860e.wgsl.expected.wgsl b/test/intrinsics/gen/select/a2860e.wgsl.expected.wgsl
index e7cb1ea..3c163ae 100644
--- a/test/intrinsics/gen/select/a2860e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/select/a2860e.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_a2860e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/bb8aae.wgsl b/test/intrinsics/gen/select/bb8aae.wgsl
index 8806956..cc508ba 100644
--- a/test/intrinsics/gen/select/bb8aae.wgsl
+++ b/test/intrinsics/gen/select/bb8aae.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_bb8aae();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/bb8aae.wgsl.expected.msl b/test/intrinsics/gen/select/bb8aae.wgsl.expected.msl
index a2418f5..0ac6179 100644
--- a/test/intrinsics/gen/select/bb8aae.wgsl.expected.msl
+++ b/test/intrinsics/gen/select/bb8aae.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void select_bb8aae() {
float4 res = select(float4(), float4(), bool4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
select_bb8aae();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/select/bb8aae.wgsl.expected.wgsl b/test/intrinsics/gen/select/bb8aae.wgsl.expected.wgsl
index 85e05cf..019fd04 100644
--- a/test/intrinsics/gen/select/bb8aae.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/select/bb8aae.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_bb8aae();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/c31f9e.wgsl b/test/intrinsics/gen/select/c31f9e.wgsl
index d721803..dccafd5 100644
--- a/test/intrinsics/gen/select/c31f9e.wgsl
+++ b/test/intrinsics/gen/select/c31f9e.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_c31f9e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/c31f9e.wgsl.expected.msl b/test/intrinsics/gen/select/c31f9e.wgsl.expected.msl
index 6719974..21695bd 100644
--- a/test/intrinsics/gen/select/c31f9e.wgsl.expected.msl
+++ b/test/intrinsics/gen/select/c31f9e.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void select_c31f9e() {
bool res = select(bool(), bool(), bool());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
select_c31f9e();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/select/c31f9e.wgsl.expected.spvasm b/test/intrinsics/gen/select/c31f9e.wgsl.expected.spvasm
index c0961e9..b056d08 100644
--- a/test/intrinsics/gen/select/c31f9e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/select/c31f9e.wgsl.expected.spvasm
@@ -1,52 +1,68 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 24
+; Bound: 33
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %select_c31f9e "select_c31f9e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
- %11 = OpConstantNull %bool
+ %15 = OpConstantNull %bool
%_ptr_Function_bool = OpTypePointer Function %bool
+ %18 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%select_c31f9e = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_bool Function %11
- %9 = OpSelect %bool %11 %11 %11
- OpStore %res %9
+%select_c31f9e = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_bool Function %15
+ %13 = OpSelect %bool %15 %15 %15
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
+ %21 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
OpStore %tint_pointsize %float_1
- %17 = OpFunctionCall %void %select_c31f9e
+ %25 = OpFunctionCall %void %select_c31f9e
+ %26 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %19 = OpLabel
- %20 = OpFunctionCall %void %select_c31f9e
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %select_c31f9e
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %22 = OpLabel
- %23 = OpFunctionCall %void %select_c31f9e
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %select_c31f9e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/select/c31f9e.wgsl.expected.wgsl b/test/intrinsics/gen/select/c31f9e.wgsl.expected.wgsl
index 7ffd827..6b93e42 100644
--- a/test/intrinsics/gen/select/c31f9e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/select/c31f9e.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_c31f9e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/c4a4ef.wgsl b/test/intrinsics/gen/select/c4a4ef.wgsl
index 254b37b..3c2a08b 100644
--- a/test/intrinsics/gen/select/c4a4ef.wgsl
+++ b/test/intrinsics/gen/select/c4a4ef.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_c4a4ef();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/c4a4ef.wgsl.expected.msl b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.msl
index 65a42ac..eb6e007 100644
--- a/test/intrinsics/gen/select/c4a4ef.wgsl.expected.msl
+++ b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void select_c4a4ef() {
uint4 res = select(uint4(), uint4(), bool4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
select_c4a4ef();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/select/c4a4ef.wgsl.expected.wgsl b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.wgsl
index 4338ad6..68d6006 100644
--- a/test/intrinsics/gen/select/c4a4ef.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_c4a4ef();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/cb9301.wgsl b/test/intrinsics/gen/select/cb9301.wgsl
index 968cf2c..ab78579 100644
--- a/test/intrinsics/gen/select/cb9301.wgsl
+++ b/test/intrinsics/gen/select/cb9301.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_cb9301();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/cb9301.wgsl.expected.msl b/test/intrinsics/gen/select/cb9301.wgsl.expected.msl
index ffdbe51..846a79f 100644
--- a/test/intrinsics/gen/select/cb9301.wgsl.expected.msl
+++ b/test/intrinsics/gen/select/cb9301.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void select_cb9301() {
bool2 res = select(bool2(), bool2(), bool2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
select_cb9301();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/select/cb9301.wgsl.expected.spvasm b/test/intrinsics/gen/select/cb9301.wgsl.expected.spvasm
index cd00a77..ab807b3 100644
--- a/test/intrinsics/gen/select/cb9301.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/select/cb9301.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %select_cb9301 "select_cb9301"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
%v2bool = OpTypeVector %bool 2
- %12 = OpConstantNull %v2bool
+ %16 = OpConstantNull %v2bool
%_ptr_Function_v2bool = OpTypePointer Function %v2bool
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%select_cb9301 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2bool Function %12
- %9 = OpSelect %v2bool %12 %12 %12
- OpStore %res %9
+%select_cb9301 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2bool Function %16
+ %13 = OpSelect %v2bool %16 %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %select_cb9301
+ %26 = OpFunctionCall %void %select_cb9301
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %select_cb9301
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %select_cb9301
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %select_cb9301
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %select_cb9301
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/select/cb9301.wgsl.expected.wgsl b/test/intrinsics/gen/select/cb9301.wgsl.expected.wgsl
index 5d7c05e..20cc0fa 100644
--- a/test/intrinsics/gen/select/cb9301.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/select/cb9301.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_cb9301();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/e3e028.wgsl b/test/intrinsics/gen/select/e3e028.wgsl
index 9b613b0..5bec050 100644
--- a/test/intrinsics/gen/select/e3e028.wgsl
+++ b/test/intrinsics/gen/select/e3e028.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_e3e028();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/e3e028.wgsl.expected.msl b/test/intrinsics/gen/select/e3e028.wgsl.expected.msl
index 67d331c..a1f57f6 100644
--- a/test/intrinsics/gen/select/e3e028.wgsl.expected.msl
+++ b/test/intrinsics/gen/select/e3e028.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void select_e3e028() {
bool4 res = select(bool4(), bool4(), bool4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
select_e3e028();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/select/e3e028.wgsl.expected.spvasm b/test/intrinsics/gen/select/e3e028.wgsl.expected.spvasm
index 9a327a1..27ca8f9 100644
--- a/test/intrinsics/gen/select/e3e028.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/select/e3e028.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %select_e3e028 "select_e3e028"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%bool = OpTypeBool
%v4bool = OpTypeVector %bool 4
- %12 = OpConstantNull %v4bool
+ %16 = OpConstantNull %v4bool
%_ptr_Function_v4bool = OpTypePointer Function %v4bool
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%select_e3e028 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4bool Function %12
- %9 = OpSelect %v4bool %12 %12 %12
- OpStore %res %9
+%select_e3e028 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4bool Function %16
+ %13 = OpSelect %v4bool %16 %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %select_e3e028
+ %26 = OpFunctionCall %void %select_e3e028
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %select_e3e028
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %select_e3e028
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %select_e3e028
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %select_e3e028
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/select/e3e028.wgsl.expected.wgsl b/test/intrinsics/gen/select/e3e028.wgsl.expected.wgsl
index edf186d..e059b31 100644
--- a/test/intrinsics/gen/select/e3e028.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/select/e3e028.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_e3e028();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/ebfea2.wgsl b/test/intrinsics/gen/select/ebfea2.wgsl
index 994a427..2e2d1cd 100644
--- a/test/intrinsics/gen/select/ebfea2.wgsl
+++ b/test/intrinsics/gen/select/ebfea2.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_ebfea2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/ebfea2.wgsl.expected.msl b/test/intrinsics/gen/select/ebfea2.wgsl.expected.msl
index c1a1253..81db84c 100644
--- a/test/intrinsics/gen/select/ebfea2.wgsl.expected.msl
+++ b/test/intrinsics/gen/select/ebfea2.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void select_ebfea2() {
float3 res = select(float3(), float3(), bool3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
select_ebfea2();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/select/ebfea2.wgsl.expected.wgsl b/test/intrinsics/gen/select/ebfea2.wgsl.expected.wgsl
index 15cda7c..e710fc8 100644
--- a/test/intrinsics/gen/select/ebfea2.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/select/ebfea2.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_ebfea2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/ed8a15.wgsl b/test/intrinsics/gen/select/ed8a15.wgsl
index 7b83f92..353f6b7 100644
--- a/test/intrinsics/gen/select/ed8a15.wgsl
+++ b/test/intrinsics/gen/select/ed8a15.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_ed8a15();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/select/ed8a15.wgsl.expected.msl b/test/intrinsics/gen/select/ed8a15.wgsl.expected.msl
index 18b9b3a..2c84ce4 100644
--- a/test/intrinsics/gen/select/ed8a15.wgsl.expected.msl
+++ b/test/intrinsics/gen/select/ed8a15.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void select_ed8a15() {
int res = select(1, 1, bool());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
select_ed8a15();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/select/ed8a15.wgsl.expected.wgsl b/test/intrinsics/gen/select/ed8a15.wgsl.expected.wgsl
index a569ef0..47a6c61 100644
--- a/test/intrinsics/gen/select/ed8a15.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/select/ed8a15.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
select_ed8a15();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sign/159665.wgsl b/test/intrinsics/gen/sign/159665.wgsl
index 49eb85b..068f4e3 100644
--- a/test/intrinsics/gen/sign/159665.wgsl
+++ b/test/intrinsics/gen/sign/159665.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sign_159665();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sign/159665.wgsl.expected.hlsl b/test/intrinsics/gen/sign/159665.wgsl.expected.hlsl
index 822f73c..99d593a 100644
--- a/test/intrinsics/gen/sign/159665.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/sign/159665.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void sign_159665() {
float3 res = sign(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
sign_159665();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/sign/159665.wgsl.expected.msl b/test/intrinsics/gen/sign/159665.wgsl.expected.msl
index 143c028..9a0fcb0 100644
--- a/test/intrinsics/gen/sign/159665.wgsl.expected.msl
+++ b/test/intrinsics/gen/sign/159665.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void sign_159665() {
float3 res = sign(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
sign_159665();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/sign/159665.wgsl.expected.spvasm b/test/intrinsics/gen/sign/159665.wgsl.expected.spvasm
index a14e870..b202170 100644
--- a/test/intrinsics/gen/sign/159665.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/sign/159665.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %sign_159665 "sign_159665"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%sign_159665 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 FSign %12
- OpStore %res %9
+%sign_159665 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 FSign %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %sign_159665
+ %26 = OpFunctionCall %void %sign_159665
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %sign_159665
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %sign_159665
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %sign_159665
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %sign_159665
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/sign/159665.wgsl.expected.wgsl b/test/intrinsics/gen/sign/159665.wgsl.expected.wgsl
index 2f7b9a9..a162049 100644
--- a/test/intrinsics/gen/sign/159665.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/sign/159665.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sign_159665();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sign/b8f634.wgsl b/test/intrinsics/gen/sign/b8f634.wgsl
index 85ed595..5b90dfd 100644
--- a/test/intrinsics/gen/sign/b8f634.wgsl
+++ b/test/intrinsics/gen/sign/b8f634.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sign_b8f634();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sign/b8f634.wgsl.expected.hlsl b/test/intrinsics/gen/sign/b8f634.wgsl.expected.hlsl
index d8c0428..6c50bbe 100644
--- a/test/intrinsics/gen/sign/b8f634.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/sign/b8f634.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void sign_b8f634() {
float4 res = sign(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
sign_b8f634();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/sign/b8f634.wgsl.expected.msl b/test/intrinsics/gen/sign/b8f634.wgsl.expected.msl
index d26088d..b13803a 100644
--- a/test/intrinsics/gen/sign/b8f634.wgsl.expected.msl
+++ b/test/intrinsics/gen/sign/b8f634.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void sign_b8f634() {
float4 res = sign(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
sign_b8f634();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/sign/b8f634.wgsl.expected.spvasm b/test/intrinsics/gen/sign/b8f634.wgsl.expected.spvasm
index 2a2d428..dc20942 100644
--- a/test/intrinsics/gen/sign/b8f634.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/sign/b8f634.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %sign_b8f634 "sign_b8f634"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%sign_b8f634 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 FSign %12
- OpStore %res %9
+%sign_b8f634 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 FSign %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %sign_b8f634
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %sign_b8f634
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %sign_b8f634
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %sign_b8f634
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %sign_b8f634
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/sign/b8f634.wgsl.expected.wgsl b/test/intrinsics/gen/sign/b8f634.wgsl.expected.wgsl
index 4e8e484..8b33b23 100644
--- a/test/intrinsics/gen/sign/b8f634.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/sign/b8f634.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sign_b8f634();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sign/d065d8.wgsl b/test/intrinsics/gen/sign/d065d8.wgsl
index 75254a8..3ce533f 100644
--- a/test/intrinsics/gen/sign/d065d8.wgsl
+++ b/test/intrinsics/gen/sign/d065d8.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sign_d065d8();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sign/d065d8.wgsl.expected.hlsl b/test/intrinsics/gen/sign/d065d8.wgsl.expected.hlsl
index 491b380..5734893 100644
--- a/test/intrinsics/gen/sign/d065d8.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/sign/d065d8.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void sign_d065d8() {
float2 res = sign(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
sign_d065d8();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/sign/d065d8.wgsl.expected.msl b/test/intrinsics/gen/sign/d065d8.wgsl.expected.msl
index abacffb..dc48e61 100644
--- a/test/intrinsics/gen/sign/d065d8.wgsl.expected.msl
+++ b/test/intrinsics/gen/sign/d065d8.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void sign_d065d8() {
float2 res = sign(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
sign_d065d8();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/sign/d065d8.wgsl.expected.spvasm b/test/intrinsics/gen/sign/d065d8.wgsl.expected.spvasm
index f532736..224618c 100644
--- a/test/intrinsics/gen/sign/d065d8.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/sign/d065d8.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %sign_d065d8 "sign_d065d8"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%sign_d065d8 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 FSign %12
- OpStore %res %9
+%sign_d065d8 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 FSign %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %sign_d065d8
+ %26 = OpFunctionCall %void %sign_d065d8
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %sign_d065d8
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %sign_d065d8
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %sign_d065d8
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %sign_d065d8
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/sign/d065d8.wgsl.expected.wgsl b/test/intrinsics/gen/sign/d065d8.wgsl.expected.wgsl
index 9079c7f..40b0c8d 100644
--- a/test/intrinsics/gen/sign/d065d8.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/sign/d065d8.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sign_d065d8();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sign/dd790e.wgsl b/test/intrinsics/gen/sign/dd790e.wgsl
index 762bdfe..52f58d0 100644
--- a/test/intrinsics/gen/sign/dd790e.wgsl
+++ b/test/intrinsics/gen/sign/dd790e.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sign_dd790e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sign/dd790e.wgsl.expected.hlsl b/test/intrinsics/gen/sign/dd790e.wgsl.expected.hlsl
index 52f319c..693c167 100644
--- a/test/intrinsics/gen/sign/dd790e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/sign/dd790e.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void sign_dd790e() {
float res = sign(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
sign_dd790e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/sign/dd790e.wgsl.expected.msl b/test/intrinsics/gen/sign/dd790e.wgsl.expected.msl
index a4d2552..b77013a 100644
--- a/test/intrinsics/gen/sign/dd790e.wgsl.expected.msl
+++ b/test/intrinsics/gen/sign/dd790e.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void sign_dd790e() {
float res = sign(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
sign_dd790e();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/sign/dd790e.wgsl.expected.spvasm b/test/intrinsics/gen/sign/dd790e.wgsl.expected.spvasm
index 5403ccb..bb97f04 100644
--- a/test/intrinsics/gen/sign/dd790e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/sign/dd790e.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %sign_dd790e "sign_dd790e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%sign_dd790e = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+%sign_dd790e = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 FSign %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 FSign %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %sign_dd790e
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %sign_dd790e
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %sign_dd790e
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %sign_dd790e
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %sign_dd790e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %sign_dd790e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/sign/dd790e.wgsl.expected.wgsl b/test/intrinsics/gen/sign/dd790e.wgsl.expected.wgsl
index 4ec9d23..c3f369c 100644
--- a/test/intrinsics/gen/sign/dd790e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/sign/dd790e.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sign_dd790e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sin/01f241.wgsl b/test/intrinsics/gen/sin/01f241.wgsl
index b53e8b8..f739a2c 100644
--- a/test/intrinsics/gen/sin/01f241.wgsl
+++ b/test/intrinsics/gen/sin/01f241.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sin_01f241();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sin/01f241.wgsl.expected.hlsl b/test/intrinsics/gen/sin/01f241.wgsl.expected.hlsl
index 05afedd..57f4db0 100644
--- a/test/intrinsics/gen/sin/01f241.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/sin/01f241.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void sin_01f241() {
float3 res = sin(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
sin_01f241();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/sin/01f241.wgsl.expected.msl b/test/intrinsics/gen/sin/01f241.wgsl.expected.msl
index 22ef886..72d06c0 100644
--- a/test/intrinsics/gen/sin/01f241.wgsl.expected.msl
+++ b/test/intrinsics/gen/sin/01f241.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void sin_01f241() {
float3 res = sin(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
sin_01f241();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/sin/01f241.wgsl.expected.spvasm b/test/intrinsics/gen/sin/01f241.wgsl.expected.spvasm
index e03940b..e459aea 100644
--- a/test/intrinsics/gen/sin/01f241.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/sin/01f241.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %sin_01f241 "sin_01f241"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %sin_01f241 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Sin %12
- OpStore %res %9
+ %sin_01f241 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Sin %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %sin_01f241
+ %26 = OpFunctionCall %void %sin_01f241
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %sin_01f241
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %sin_01f241
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %sin_01f241
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %sin_01f241
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/sin/01f241.wgsl.expected.wgsl b/test/intrinsics/gen/sin/01f241.wgsl.expected.wgsl
index 4717bb5..a127214 100644
--- a/test/intrinsics/gen/sin/01f241.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/sin/01f241.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sin_01f241();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sin/4e3979.wgsl b/test/intrinsics/gen/sin/4e3979.wgsl
index c0282bc..8a09738 100644
--- a/test/intrinsics/gen/sin/4e3979.wgsl
+++ b/test/intrinsics/gen/sin/4e3979.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sin_4e3979();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sin/4e3979.wgsl.expected.hlsl b/test/intrinsics/gen/sin/4e3979.wgsl.expected.hlsl
index 6ef2c93..a39a10f 100644
--- a/test/intrinsics/gen/sin/4e3979.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/sin/4e3979.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void sin_4e3979() {
float4 res = sin(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
sin_4e3979();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/sin/4e3979.wgsl.expected.msl b/test/intrinsics/gen/sin/4e3979.wgsl.expected.msl
index 331a368..8490349 100644
--- a/test/intrinsics/gen/sin/4e3979.wgsl.expected.msl
+++ b/test/intrinsics/gen/sin/4e3979.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void sin_4e3979() {
float4 res = sin(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
sin_4e3979();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/sin/4e3979.wgsl.expected.spvasm b/test/intrinsics/gen/sin/4e3979.wgsl.expected.spvasm
index af59f4a..6c33ea5 100644
--- a/test/intrinsics/gen/sin/4e3979.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/sin/4e3979.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %sin_4e3979 "sin_4e3979"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %sin_4e3979 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Sin %12
- OpStore %res %9
+ %sin_4e3979 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Sin %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %sin_4e3979
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %sin_4e3979
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %sin_4e3979
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %sin_4e3979
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %sin_4e3979
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/sin/4e3979.wgsl.expected.wgsl b/test/intrinsics/gen/sin/4e3979.wgsl.expected.wgsl
index ae9d145..3c78781 100644
--- a/test/intrinsics/gen/sin/4e3979.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/sin/4e3979.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sin_4e3979();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sin/b78c91.wgsl b/test/intrinsics/gen/sin/b78c91.wgsl
index 35cd7d9..99d472f 100644
--- a/test/intrinsics/gen/sin/b78c91.wgsl
+++ b/test/intrinsics/gen/sin/b78c91.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sin_b78c91();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sin/b78c91.wgsl.expected.hlsl b/test/intrinsics/gen/sin/b78c91.wgsl.expected.hlsl
index e3c066a..8714c25 100644
--- a/test/intrinsics/gen/sin/b78c91.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/sin/b78c91.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void sin_b78c91() {
float res = sin(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
sin_b78c91();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/sin/b78c91.wgsl.expected.msl b/test/intrinsics/gen/sin/b78c91.wgsl.expected.msl
index ddada4c..b356483 100644
--- a/test/intrinsics/gen/sin/b78c91.wgsl.expected.msl
+++ b/test/intrinsics/gen/sin/b78c91.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void sin_b78c91() {
float res = sin(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
sin_b78c91();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/sin/b78c91.wgsl.expected.spvasm b/test/intrinsics/gen/sin/b78c91.wgsl.expected.spvasm
index b1ba48d..45895ad 100644
--- a/test/intrinsics/gen/sin/b78c91.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/sin/b78c91.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %sin_b78c91 "sin_b78c91"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
- %sin_b78c91 = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+ %sin_b78c91 = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Sin %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Sin %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %sin_b78c91
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %sin_b78c91
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %sin_b78c91
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %sin_b78c91
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %sin_b78c91
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %sin_b78c91
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/sin/b78c91.wgsl.expected.wgsl b/test/intrinsics/gen/sin/b78c91.wgsl.expected.wgsl
index de3a1f3..4b444a4 100644
--- a/test/intrinsics/gen/sin/b78c91.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/sin/b78c91.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sin_b78c91();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sin/fc8bc4.wgsl b/test/intrinsics/gen/sin/fc8bc4.wgsl
index ea5e900..b4314b7 100644
--- a/test/intrinsics/gen/sin/fc8bc4.wgsl
+++ b/test/intrinsics/gen/sin/fc8bc4.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sin_fc8bc4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.hlsl b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.hlsl
index e24e20e..9b910da 100644
--- a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void sin_fc8bc4() {
float2 res = sin(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
sin_fc8bc4();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.msl b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.msl
index 0dbeea8..e66435a 100644
--- a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.msl
+++ b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void sin_fc8bc4() {
float2 res = sin(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
sin_fc8bc4();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.spvasm b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.spvasm
index d9a58ad..1897305 100644
--- a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %sin_fc8bc4 "sin_fc8bc4"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %sin_fc8bc4 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Sin %12
- OpStore %res %9
+ %sin_fc8bc4 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Sin %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %sin_fc8bc4
+ %26 = OpFunctionCall %void %sin_fc8bc4
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %sin_fc8bc4
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %sin_fc8bc4
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %sin_fc8bc4
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %sin_fc8bc4
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.wgsl b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.wgsl
index 35ad28e..26fd4da 100644
--- a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sin_fc8bc4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sinh/445e33.wgsl b/test/intrinsics/gen/sinh/445e33.wgsl
index 0a62c81..15ad5f7 100644
--- a/test/intrinsics/gen/sinh/445e33.wgsl
+++ b/test/intrinsics/gen/sinh/445e33.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sinh_445e33();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sinh/445e33.wgsl.expected.hlsl b/test/intrinsics/gen/sinh/445e33.wgsl.expected.hlsl
index b8cb85b..f274918 100644
--- a/test/intrinsics/gen/sinh/445e33.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/sinh/445e33.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void sinh_445e33() {
float4 res = sinh(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
sinh_445e33();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/sinh/445e33.wgsl.expected.msl b/test/intrinsics/gen/sinh/445e33.wgsl.expected.msl
index 0f89471..aa95482 100644
--- a/test/intrinsics/gen/sinh/445e33.wgsl.expected.msl
+++ b/test/intrinsics/gen/sinh/445e33.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void sinh_445e33() {
float4 res = sinh(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
sinh_445e33();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/sinh/445e33.wgsl.expected.spvasm b/test/intrinsics/gen/sinh/445e33.wgsl.expected.spvasm
index 734a54b..71e5771 100644
--- a/test/intrinsics/gen/sinh/445e33.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/sinh/445e33.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %sinh_445e33 "sinh_445e33"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%sinh_445e33 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Sinh %12
- OpStore %res %9
+%sinh_445e33 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Sinh %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %sinh_445e33
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %sinh_445e33
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %sinh_445e33
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %sinh_445e33
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %sinh_445e33
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/sinh/445e33.wgsl.expected.wgsl b/test/intrinsics/gen/sinh/445e33.wgsl.expected.wgsl
index ad790a5..8c279d0 100644
--- a/test/intrinsics/gen/sinh/445e33.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/sinh/445e33.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sinh_445e33();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sinh/7bb598.wgsl b/test/intrinsics/gen/sinh/7bb598.wgsl
index b38208c..4f810d6 100644
--- a/test/intrinsics/gen/sinh/7bb598.wgsl
+++ b/test/intrinsics/gen/sinh/7bb598.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sinh_7bb598();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.hlsl b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.hlsl
index 181c064..3edf894 100644
--- a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void sinh_7bb598() {
float res = sinh(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
sinh_7bb598();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.msl b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.msl
index d14c1fb..e6c5990 100644
--- a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.msl
+++ b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void sinh_7bb598() {
float res = sinh(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
sinh_7bb598();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.spvasm b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.spvasm
index 481720d..997d3ff 100644
--- a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %sinh_7bb598 "sinh_7bb598"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%sinh_7bb598 = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+%sinh_7bb598 = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Sinh %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Sinh %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %sinh_7bb598
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %sinh_7bb598
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %sinh_7bb598
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %sinh_7bb598
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %sinh_7bb598
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %sinh_7bb598
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.wgsl b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.wgsl
index ae2a45f..28ff0c4 100644
--- a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sinh_7bb598();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sinh/b9860e.wgsl b/test/intrinsics/gen/sinh/b9860e.wgsl
index 5f596f2..217163e 100644
--- a/test/intrinsics/gen/sinh/b9860e.wgsl
+++ b/test/intrinsics/gen/sinh/b9860e.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sinh_b9860e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.hlsl b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.hlsl
index 4c2cd68..1a6c8b6 100644
--- a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void sinh_b9860e() {
float2 res = sinh(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
sinh_b9860e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.msl b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.msl
index 3f6dc50..5bc5bc4 100644
--- a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.msl
+++ b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void sinh_b9860e() {
float2 res = sinh(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
sinh_b9860e();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.spvasm b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.spvasm
index 82b4486..bba9adb 100644
--- a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %sinh_b9860e "sinh_b9860e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%sinh_b9860e = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Sinh %12
- OpStore %res %9
+%sinh_b9860e = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Sinh %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %sinh_b9860e
+ %26 = OpFunctionCall %void %sinh_b9860e
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %sinh_b9860e
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %sinh_b9860e
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %sinh_b9860e
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %sinh_b9860e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.wgsl b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.wgsl
index 20bc6e3..5e58b9e 100644
--- a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sinh_b9860e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sinh/c9a5eb.wgsl b/test/intrinsics/gen/sinh/c9a5eb.wgsl
index 0f60e63..af91887 100644
--- a/test/intrinsics/gen/sinh/c9a5eb.wgsl
+++ b/test/intrinsics/gen/sinh/c9a5eb.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sinh_c9a5eb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.hlsl b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.hlsl
index b18f22e..0446183 100644
--- a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void sinh_c9a5eb() {
float3 res = sinh(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
sinh_c9a5eb();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.msl b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.msl
index 91ba6f6..05558c7 100644
--- a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.msl
+++ b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void sinh_c9a5eb() {
float3 res = sinh(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
sinh_c9a5eb();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.spvasm b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.spvasm
index 480ba1c..f923d9f 100644
--- a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %sinh_c9a5eb "sinh_c9a5eb"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%sinh_c9a5eb = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Sinh %12
- OpStore %res %9
+%sinh_c9a5eb = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Sinh %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %sinh_c9a5eb
+ %26 = OpFunctionCall %void %sinh_c9a5eb
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %sinh_c9a5eb
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %sinh_c9a5eb
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %sinh_c9a5eb
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %sinh_c9a5eb
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.wgsl b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.wgsl
index 7056b19..ce80f1c 100644
--- a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sinh_c9a5eb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/smoothStep/5f615b.wgsl b/test/intrinsics/gen/smoothStep/5f615b.wgsl
index c71fcf0..63da6fd 100644
--- a/test/intrinsics/gen/smoothStep/5f615b.wgsl
+++ b/test/intrinsics/gen/smoothStep/5f615b.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
smoothStep_5f615b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.hlsl b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.hlsl
index 49c6c61..4fe969c 100644
--- a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void smoothStep_5f615b() {
float4 res = smoothstep(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
smoothStep_5f615b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.msl b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.msl
index 3f21ed3..22a3ab7 100644
--- a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.msl
+++ b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void smoothStep_5f615b() {
float4 res = smoothstep(float4(), float4(), float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
smoothStep_5f615b();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.spvasm b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.spvasm
index f2e6112..f20b707 100644
--- a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %smoothStep_5f615b "smoothStep_5f615b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%smoothStep_5f615b = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 SmoothStep %12 %12 %12
- OpStore %res %9
+%smoothStep_5f615b = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 SmoothStep %8 %8 %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %smoothStep_5f615b
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %smoothStep_5f615b
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %smoothStep_5f615b
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %smoothStep_5f615b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %smoothStep_5f615b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.wgsl b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.wgsl
index 26e95e4..7e139d1 100644
--- a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
smoothStep_5f615b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/smoothStep/658be3.wgsl b/test/intrinsics/gen/smoothStep/658be3.wgsl
index c66c45f..a068e20 100644
--- a/test/intrinsics/gen/smoothStep/658be3.wgsl
+++ b/test/intrinsics/gen/smoothStep/658be3.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
smoothStep_658be3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.hlsl b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.hlsl
index 80b9c81..a33cea4 100644
--- a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void smoothStep_658be3() {
float3 res = smoothstep(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
smoothStep_658be3();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.msl b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.msl
index dc7e7a4..42d4a3a 100644
--- a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.msl
+++ b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void smoothStep_658be3() {
float3 res = smoothstep(float3(), float3(), float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
smoothStep_658be3();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.spvasm b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.spvasm
index 8278797..b6a904e 100644
--- a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %smoothStep_658be3 "smoothStep_658be3"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%smoothStep_658be3 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 SmoothStep %12 %12 %12
- OpStore %res %9
+%smoothStep_658be3 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 SmoothStep %16 %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %smoothStep_658be3
+ %26 = OpFunctionCall %void %smoothStep_658be3
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %smoothStep_658be3
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %smoothStep_658be3
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %smoothStep_658be3
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %smoothStep_658be3
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.wgsl b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.wgsl
index 5a6bd89..1b22410 100644
--- a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
smoothStep_658be3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/smoothStep/c11eef.wgsl b/test/intrinsics/gen/smoothStep/c11eef.wgsl
index 1f531a2..b8eab7b 100644
--- a/test/intrinsics/gen/smoothStep/c11eef.wgsl
+++ b/test/intrinsics/gen/smoothStep/c11eef.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
smoothStep_c11eef();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.hlsl b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.hlsl
index bda9151..a4e9542 100644
--- a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void smoothStep_c11eef() {
float2 res = smoothstep(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
smoothStep_c11eef();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.msl b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.msl
index 3f3315d..7788c35 100644
--- a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.msl
+++ b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void smoothStep_c11eef() {
float2 res = smoothstep(float2(), float2(), float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
smoothStep_c11eef();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.spvasm b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.spvasm
index 4d21a96..f393adc 100644
--- a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %smoothStep_c11eef "smoothStep_c11eef"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%smoothStep_c11eef = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 SmoothStep %12 %12 %12
- OpStore %res %9
+%smoothStep_c11eef = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 SmoothStep %16 %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %smoothStep_c11eef
+ %26 = OpFunctionCall %void %smoothStep_c11eef
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %smoothStep_c11eef
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %smoothStep_c11eef
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %smoothStep_c11eef
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %smoothStep_c11eef
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.wgsl b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.wgsl
index 147b9fd..d2bc420 100644
--- a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
smoothStep_c11eef();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl
index e67b070..a1709a6 100644
--- a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl
+++ b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
smoothStep_cb0bfb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.hlsl b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.hlsl
index 7f9a93d..02c8d1e 100644
--- a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void smoothStep_cb0bfb() {
float res = smoothstep(1.0f, 1.0f, 1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
smoothStep_cb0bfb();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.msl b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.msl
index 9e0b99a..f963d98 100644
--- a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.msl
+++ b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void smoothStep_cb0bfb() {
float res = smoothstep(1.0f, 1.0f, 1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
smoothStep_cb0bfb();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.spvasm b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.spvasm
index e991a8c..a19270a 100644
--- a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %smoothStep_cb0bfb "smoothStep_cb0bfb"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%smoothStep_cb0bfb = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+%smoothStep_cb0bfb = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 SmoothStep %float_1 %float_1 %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 SmoothStep %float_1 %float_1 %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %smoothStep_cb0bfb
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %smoothStep_cb0bfb
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %smoothStep_cb0bfb
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %smoothStep_cb0bfb
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %smoothStep_cb0bfb
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %smoothStep_cb0bfb
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.wgsl b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.wgsl
index 7ecfe0c..907a327 100644
--- a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
smoothStep_cb0bfb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sqrt/20c74e.wgsl b/test/intrinsics/gen/sqrt/20c74e.wgsl
index 7a74f52..6295d0b 100644
--- a/test/intrinsics/gen/sqrt/20c74e.wgsl
+++ b/test/intrinsics/gen/sqrt/20c74e.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sqrt_20c74e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.hlsl b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.hlsl
index d9fdd42..b6b6c4b 100644
--- a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void sqrt_20c74e() {
float res = sqrt(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
sqrt_20c74e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.msl b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.msl
index 591cff9..ebe9cc5 100644
--- a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.msl
+++ b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void sqrt_20c74e() {
float res = sqrt(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
sqrt_20c74e();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.spvasm b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.spvasm
index fefbb94..7e26f2b 100644
--- a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %sqrt_20c74e "sqrt_20c74e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%sqrt_20c74e = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+%sqrt_20c74e = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Sqrt %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Sqrt %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %sqrt_20c74e
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %sqrt_20c74e
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %sqrt_20c74e
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %sqrt_20c74e
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %sqrt_20c74e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %sqrt_20c74e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.wgsl b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.wgsl
index 4aeac64..cfb4ca1 100644
--- a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sqrt_20c74e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sqrt/8c7024.wgsl b/test/intrinsics/gen/sqrt/8c7024.wgsl
index 9286ae3..d7d7005 100644
--- a/test/intrinsics/gen/sqrt/8c7024.wgsl
+++ b/test/intrinsics/gen/sqrt/8c7024.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sqrt_8c7024();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.hlsl b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.hlsl
index 2e82392..f6ac0f0 100644
--- a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void sqrt_8c7024() {
float2 res = sqrt(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
sqrt_8c7024();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.msl b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.msl
index b2852ff..c6e76d0 100644
--- a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.msl
+++ b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void sqrt_8c7024() {
float2 res = sqrt(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
sqrt_8c7024();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.spvasm b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.spvasm
index ba243fc..fd48614 100644
--- a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %sqrt_8c7024 "sqrt_8c7024"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%sqrt_8c7024 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Sqrt %12
- OpStore %res %9
+%sqrt_8c7024 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Sqrt %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %sqrt_8c7024
+ %26 = OpFunctionCall %void %sqrt_8c7024
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %sqrt_8c7024
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %sqrt_8c7024
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %sqrt_8c7024
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %sqrt_8c7024
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.wgsl b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.wgsl
index 6b97f1e..04e9892 100644
--- a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sqrt_8c7024();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sqrt/aa0d7a.wgsl b/test/intrinsics/gen/sqrt/aa0d7a.wgsl
index d559779..a67ebc6 100644
--- a/test/intrinsics/gen/sqrt/aa0d7a.wgsl
+++ b/test/intrinsics/gen/sqrt/aa0d7a.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sqrt_aa0d7a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.hlsl b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.hlsl
index bc21867..9ba1434 100644
--- a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void sqrt_aa0d7a() {
float4 res = sqrt(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
sqrt_aa0d7a();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.msl b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.msl
index 9dbff0e..7de1194 100644
--- a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.msl
+++ b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void sqrt_aa0d7a() {
float4 res = sqrt(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
sqrt_aa0d7a();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.spvasm b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.spvasm
index 0a422cc..c944fbf 100644
--- a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %sqrt_aa0d7a "sqrt_aa0d7a"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%sqrt_aa0d7a = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Sqrt %12
- OpStore %res %9
+%sqrt_aa0d7a = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Sqrt %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %sqrt_aa0d7a
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %sqrt_aa0d7a
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %sqrt_aa0d7a
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %sqrt_aa0d7a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %sqrt_aa0d7a
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.wgsl b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.wgsl
index 3785674..ef205f6 100644
--- a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sqrt_aa0d7a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sqrt/f8c59a.wgsl b/test/intrinsics/gen/sqrt/f8c59a.wgsl
index ab11967..6f0ecd3 100644
--- a/test/intrinsics/gen/sqrt/f8c59a.wgsl
+++ b/test/intrinsics/gen/sqrt/f8c59a.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sqrt_f8c59a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.hlsl b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.hlsl
index 1dd2bc3..9ccbfea 100644
--- a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void sqrt_f8c59a() {
float3 res = sqrt(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
sqrt_f8c59a();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.msl b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.msl
index 9cb74e6..a0281f7 100644
--- a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.msl
+++ b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void sqrt_f8c59a() {
float3 res = sqrt(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
sqrt_f8c59a();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.spvasm b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.spvasm
index c29897a..5d8c11c 100644
--- a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %sqrt_f8c59a "sqrt_f8c59a"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%sqrt_f8c59a = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Sqrt %12
- OpStore %res %9
+%sqrt_f8c59a = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Sqrt %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %sqrt_f8c59a
+ %26 = OpFunctionCall %void %sqrt_f8c59a
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %sqrt_f8c59a
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %sqrt_f8c59a
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %sqrt_f8c59a
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %sqrt_f8c59a
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.wgsl b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.wgsl
index 3a3adbe..a0f24c2 100644
--- a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
sqrt_f8c59a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/step/0b073b.wgsl b/test/intrinsics/gen/step/0b073b.wgsl
index 8efda60..059d84d 100644
--- a/test/intrinsics/gen/step/0b073b.wgsl
+++ b/test/intrinsics/gen/step/0b073b.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
step_0b073b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/step/0b073b.wgsl.expected.hlsl b/test/intrinsics/gen/step/0b073b.wgsl.expected.hlsl
index 4aa8a03..3eff0d8 100644
--- a/test/intrinsics/gen/step/0b073b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/step/0b073b.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void step_0b073b() {
float res = step(1.0f, 1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
step_0b073b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/step/0b073b.wgsl.expected.msl b/test/intrinsics/gen/step/0b073b.wgsl.expected.msl
index 379623d..0a76b20 100644
--- a/test/intrinsics/gen/step/0b073b.wgsl.expected.msl
+++ b/test/intrinsics/gen/step/0b073b.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void step_0b073b() {
float res = step(1.0f, 1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
step_0b073b();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/step/0b073b.wgsl.expected.spvasm b/test/intrinsics/gen/step/0b073b.wgsl.expected.spvasm
index 733e788..43ffb2f 100644
--- a/test/intrinsics/gen/step/0b073b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/step/0b073b.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %step_0b073b "step_0b073b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%step_0b073b = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+%step_0b073b = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Step %float_1 %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Step %float_1 %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %step_0b073b
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %step_0b073b
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %step_0b073b
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %step_0b073b
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %step_0b073b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %step_0b073b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/step/0b073b.wgsl.expected.wgsl b/test/intrinsics/gen/step/0b073b.wgsl.expected.wgsl
index c75b485..e9ce7e8 100644
--- a/test/intrinsics/gen/step/0b073b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/step/0b073b.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
step_0b073b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/step/19accd.wgsl b/test/intrinsics/gen/step/19accd.wgsl
index faebe4e..ab41384 100644
--- a/test/intrinsics/gen/step/19accd.wgsl
+++ b/test/intrinsics/gen/step/19accd.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
step_19accd();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/step/19accd.wgsl.expected.hlsl b/test/intrinsics/gen/step/19accd.wgsl.expected.hlsl
index 7dd6205..c2bd85b 100644
--- a/test/intrinsics/gen/step/19accd.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/step/19accd.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void step_19accd() {
float2 res = step(float2(0.0f, 0.0f), float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
step_19accd();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/step/19accd.wgsl.expected.msl b/test/intrinsics/gen/step/19accd.wgsl.expected.msl
index 781b56a..a26cee5 100644
--- a/test/intrinsics/gen/step/19accd.wgsl.expected.msl
+++ b/test/intrinsics/gen/step/19accd.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void step_19accd() {
float2 res = step(float2(), float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
step_19accd();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/step/19accd.wgsl.expected.spvasm b/test/intrinsics/gen/step/19accd.wgsl.expected.spvasm
index 93706b0..2ff36a6 100644
--- a/test/intrinsics/gen/step/19accd.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/step/19accd.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %step_19accd "step_19accd"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%step_19accd = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Step %12 %12
- OpStore %res %9
+%step_19accd = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Step %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %step_19accd
+ %26 = OpFunctionCall %void %step_19accd
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %step_19accd
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %step_19accd
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %step_19accd
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %step_19accd
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/step/19accd.wgsl.expected.wgsl b/test/intrinsics/gen/step/19accd.wgsl.expected.wgsl
index e45f4ee..a6c1328 100644
--- a/test/intrinsics/gen/step/19accd.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/step/19accd.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
step_19accd();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/step/334303.wgsl b/test/intrinsics/gen/step/334303.wgsl
index e692357..00d7b58 100644
--- a/test/intrinsics/gen/step/334303.wgsl
+++ b/test/intrinsics/gen/step/334303.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
step_334303();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/step/334303.wgsl.expected.hlsl b/test/intrinsics/gen/step/334303.wgsl.expected.hlsl
index ee296d2..9e76fdc 100644
--- a/test/intrinsics/gen/step/334303.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/step/334303.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void step_334303() {
float3 res = step(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
step_334303();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/step/334303.wgsl.expected.msl b/test/intrinsics/gen/step/334303.wgsl.expected.msl
index cc53896..8594bfc 100644
--- a/test/intrinsics/gen/step/334303.wgsl.expected.msl
+++ b/test/intrinsics/gen/step/334303.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void step_334303() {
float3 res = step(float3(), float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
step_334303();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/step/334303.wgsl.expected.spvasm b/test/intrinsics/gen/step/334303.wgsl.expected.spvasm
index 6d91105..67f95b8 100644
--- a/test/intrinsics/gen/step/334303.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/step/334303.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %step_334303 "step_334303"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%step_334303 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Step %12 %12
- OpStore %res %9
+%step_334303 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Step %16 %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %step_334303
+ %26 = OpFunctionCall %void %step_334303
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %step_334303
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %step_334303
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %step_334303
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %step_334303
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/step/334303.wgsl.expected.wgsl b/test/intrinsics/gen/step/334303.wgsl.expected.wgsl
index d14ad04..0eb6d5a 100644
--- a/test/intrinsics/gen/step/334303.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/step/334303.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
step_334303();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/step/e2b337.wgsl b/test/intrinsics/gen/step/e2b337.wgsl
index 8e11a80..d10ceb5 100644
--- a/test/intrinsics/gen/step/e2b337.wgsl
+++ b/test/intrinsics/gen/step/e2b337.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
step_e2b337();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/step/e2b337.wgsl.expected.hlsl b/test/intrinsics/gen/step/e2b337.wgsl.expected.hlsl
index 27f9644..8faf236 100644
--- a/test/intrinsics/gen/step/e2b337.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/step/e2b337.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void step_e2b337() {
float4 res = step(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
step_e2b337();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/step/e2b337.wgsl.expected.msl b/test/intrinsics/gen/step/e2b337.wgsl.expected.msl
index a59fbfe..d35db64 100644
--- a/test/intrinsics/gen/step/e2b337.wgsl.expected.msl
+++ b/test/intrinsics/gen/step/e2b337.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void step_e2b337() {
float4 res = step(float4(), float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
step_e2b337();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/step/e2b337.wgsl.expected.spvasm b/test/intrinsics/gen/step/e2b337.wgsl.expected.spvasm
index 5221bea..96519e6 100644
--- a/test/intrinsics/gen/step/e2b337.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/step/e2b337.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %step_e2b337 "step_e2b337"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%step_e2b337 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Step %12 %12
- OpStore %res %9
+%step_e2b337 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Step %8 %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %step_e2b337
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %step_e2b337
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %step_e2b337
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %step_e2b337
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %step_e2b337
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/step/e2b337.wgsl.expected.wgsl b/test/intrinsics/gen/step/e2b337.wgsl.expected.wgsl
index 2309dbf..28f85f4 100644
--- a/test/intrinsics/gen/step/e2b337.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/step/e2b337.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
step_e2b337();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/tan/244e2a.wgsl b/test/intrinsics/gen/tan/244e2a.wgsl
index 7bb14bf..bbf346f 100644
--- a/test/intrinsics/gen/tan/244e2a.wgsl
+++ b/test/intrinsics/gen/tan/244e2a.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
tan_244e2a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/tan/244e2a.wgsl.expected.hlsl b/test/intrinsics/gen/tan/244e2a.wgsl.expected.hlsl
index 5044add..747de61 100644
--- a/test/intrinsics/gen/tan/244e2a.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/tan/244e2a.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void tan_244e2a() {
float4 res = tan(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
tan_244e2a();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/tan/244e2a.wgsl.expected.msl b/test/intrinsics/gen/tan/244e2a.wgsl.expected.msl
index 1f3a31d..71c4d77 100644
--- a/test/intrinsics/gen/tan/244e2a.wgsl.expected.msl
+++ b/test/intrinsics/gen/tan/244e2a.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void tan_244e2a() {
float4 res = tan(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
tan_244e2a();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/tan/244e2a.wgsl.expected.spvasm b/test/intrinsics/gen/tan/244e2a.wgsl.expected.spvasm
index 4ad2729..15f6527 100644
--- a/test/intrinsics/gen/tan/244e2a.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/tan/244e2a.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %tan_244e2a "tan_244e2a"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %tan_244e2a = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Tan %12
- OpStore %res %9
+ %tan_244e2a = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Tan %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %tan_244e2a
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %tan_244e2a
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %tan_244e2a
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %tan_244e2a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %tan_244e2a
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/tan/244e2a.wgsl.expected.wgsl b/test/intrinsics/gen/tan/244e2a.wgsl.expected.wgsl
index 56c1b2d..6dbb764 100644
--- a/test/intrinsics/gen/tan/244e2a.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/tan/244e2a.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
tan_244e2a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/tan/2f030e.wgsl b/test/intrinsics/gen/tan/2f030e.wgsl
index f0e4258..adcab68 100644
--- a/test/intrinsics/gen/tan/2f030e.wgsl
+++ b/test/intrinsics/gen/tan/2f030e.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
tan_2f030e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/tan/2f030e.wgsl.expected.hlsl b/test/intrinsics/gen/tan/2f030e.wgsl.expected.hlsl
index b647df2..3b74399 100644
--- a/test/intrinsics/gen/tan/2f030e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/tan/2f030e.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void tan_2f030e() {
float res = tan(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
tan_2f030e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/tan/2f030e.wgsl.expected.msl b/test/intrinsics/gen/tan/2f030e.wgsl.expected.msl
index 19a8b8f..10fd660 100644
--- a/test/intrinsics/gen/tan/2f030e.wgsl.expected.msl
+++ b/test/intrinsics/gen/tan/2f030e.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void tan_2f030e() {
float res = tan(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
tan_2f030e();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/tan/2f030e.wgsl.expected.spvasm b/test/intrinsics/gen/tan/2f030e.wgsl.expected.spvasm
index ba5b2ce..53e31dd 100644
--- a/test/intrinsics/gen/tan/2f030e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/tan/2f030e.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %tan_2f030e "tan_2f030e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
- %tan_2f030e = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+ %tan_2f030e = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Tan %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Tan %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %tan_2f030e
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %tan_2f030e
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %tan_2f030e
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %tan_2f030e
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %tan_2f030e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %tan_2f030e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/tan/2f030e.wgsl.expected.wgsl b/test/intrinsics/gen/tan/2f030e.wgsl.expected.wgsl
index da88b0d..9a63aba 100644
--- a/test/intrinsics/gen/tan/2f030e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/tan/2f030e.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
tan_2f030e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/tan/7ea104.wgsl b/test/intrinsics/gen/tan/7ea104.wgsl
index c01ac62..e9e56f8 100644
--- a/test/intrinsics/gen/tan/7ea104.wgsl
+++ b/test/intrinsics/gen/tan/7ea104.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
tan_7ea104();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/tan/7ea104.wgsl.expected.hlsl b/test/intrinsics/gen/tan/7ea104.wgsl.expected.hlsl
index f31a310..31def87 100644
--- a/test/intrinsics/gen/tan/7ea104.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/tan/7ea104.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void tan_7ea104() {
float3 res = tan(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
tan_7ea104();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/tan/7ea104.wgsl.expected.msl b/test/intrinsics/gen/tan/7ea104.wgsl.expected.msl
index 17676af..f4ef836 100644
--- a/test/intrinsics/gen/tan/7ea104.wgsl.expected.msl
+++ b/test/intrinsics/gen/tan/7ea104.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void tan_7ea104() {
float3 res = tan(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
tan_7ea104();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/tan/7ea104.wgsl.expected.spvasm b/test/intrinsics/gen/tan/7ea104.wgsl.expected.spvasm
index 226a7b0..a776589 100644
--- a/test/intrinsics/gen/tan/7ea104.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/tan/7ea104.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %tan_7ea104 "tan_7ea104"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %tan_7ea104 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Tan %12
- OpStore %res %9
+ %tan_7ea104 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Tan %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %tan_7ea104
+ %26 = OpFunctionCall %void %tan_7ea104
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %tan_7ea104
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %tan_7ea104
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %tan_7ea104
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %tan_7ea104
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/tan/7ea104.wgsl.expected.wgsl b/test/intrinsics/gen/tan/7ea104.wgsl.expected.wgsl
index 4e6f0f5..da186c5 100644
--- a/test/intrinsics/gen/tan/7ea104.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/tan/7ea104.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
tan_7ea104();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/tan/8ce3e9.wgsl b/test/intrinsics/gen/tan/8ce3e9.wgsl
index b62fa47..22dec19 100644
--- a/test/intrinsics/gen/tan/8ce3e9.wgsl
+++ b/test/intrinsics/gen/tan/8ce3e9.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
tan_8ce3e9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.hlsl b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.hlsl
index ab79f9a..be458f9 100644
--- a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void tan_8ce3e9() {
float2 res = tan(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
tan_8ce3e9();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.msl b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.msl
index bad2f53..89bfdfe 100644
--- a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.msl
+++ b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void tan_8ce3e9() {
float2 res = tan(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
tan_8ce3e9();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.spvasm b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.spvasm
index d02318d..50360e3 100644
--- a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %tan_8ce3e9 "tan_8ce3e9"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
- %tan_8ce3e9 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Tan %12
- OpStore %res %9
+ %tan_8ce3e9 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Tan %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %tan_8ce3e9
+ %26 = OpFunctionCall %void %tan_8ce3e9
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %tan_8ce3e9
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %tan_8ce3e9
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %tan_8ce3e9
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %tan_8ce3e9
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.wgsl b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.wgsl
index b7b3c29..b215d9e 100644
--- a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
tan_8ce3e9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/tanh/5663c5.wgsl b/test/intrinsics/gen/tanh/5663c5.wgsl
index 58def07..5f373d0 100644
--- a/test/intrinsics/gen/tanh/5663c5.wgsl
+++ b/test/intrinsics/gen/tanh/5663c5.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
tanh_5663c5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.hlsl b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.hlsl
index 6a10df24..6579c41 100644
--- a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void tanh_5663c5() {
float4 res = tanh(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
tanh_5663c5();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.msl b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.msl
index 326f847..421d1a1 100644
--- a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.msl
+++ b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void tanh_5663c5() {
float4 res = tanh(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
tanh_5663c5();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.spvasm b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.spvasm
index 6484100..bdf846a 100644
--- a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %tanh_5663c5 "tanh_5663c5"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%tanh_5663c5 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Tanh %12
- OpStore %res %9
+%tanh_5663c5 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Tanh %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %tanh_5663c5
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %tanh_5663c5
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %tanh_5663c5
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %tanh_5663c5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %tanh_5663c5
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.wgsl b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.wgsl
index 017fdaa..4869033 100644
--- a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
tanh_5663c5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/tanh/5724b3.wgsl b/test/intrinsics/gen/tanh/5724b3.wgsl
index e832a46..a62cb77 100644
--- a/test/intrinsics/gen/tanh/5724b3.wgsl
+++ b/test/intrinsics/gen/tanh/5724b3.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
tanh_5724b3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.hlsl b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.hlsl
index 09ee1c5..950b4b9 100644
--- a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void tanh_5724b3() {
float2 res = tanh(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
tanh_5724b3();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.msl b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.msl
index d87dbf7..90440da 100644
--- a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.msl
+++ b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void tanh_5724b3() {
float2 res = tanh(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
tanh_5724b3();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.spvasm b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.spvasm
index 573f7ef..62ff765 100644
--- a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %tanh_5724b3 "tanh_5724b3"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%tanh_5724b3 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Tanh %12
- OpStore %res %9
+%tanh_5724b3 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Tanh %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %tanh_5724b3
+ %26 = OpFunctionCall %void %tanh_5724b3
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %tanh_5724b3
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %tanh_5724b3
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %tanh_5724b3
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %tanh_5724b3
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.wgsl b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.wgsl
index 64efc2b..dd9f0f0 100644
--- a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
tanh_5724b3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/tanh/9f9fb9.wgsl b/test/intrinsics/gen/tanh/9f9fb9.wgsl
index 5461f60..0de6764 100644
--- a/test/intrinsics/gen/tanh/9f9fb9.wgsl
+++ b/test/intrinsics/gen/tanh/9f9fb9.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
tanh_9f9fb9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.hlsl b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.hlsl
index 981877b..c37aa5f 100644
--- a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void tanh_9f9fb9() {
float3 res = tanh(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
tanh_9f9fb9();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.msl b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.msl
index 2eac415c..9e0039b 100644
--- a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.msl
+++ b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void tanh_9f9fb9() {
float3 res = tanh(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
tanh_9f9fb9();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.spvasm b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.spvasm
index 3f448b6..9c4b25d 100644
--- a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %tanh_9f9fb9 "tanh_9f9fb9"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%tanh_9f9fb9 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Tanh %12
- OpStore %res %9
+%tanh_9f9fb9 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Tanh %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %tanh_9f9fb9
+ %26 = OpFunctionCall %void %tanh_9f9fb9
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %tanh_9f9fb9
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %tanh_9f9fb9
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %tanh_9f9fb9
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %tanh_9f9fb9
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.wgsl b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.wgsl
index ff29472..2851c58 100644
--- a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
tanh_9f9fb9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/tanh/c15fdb.wgsl b/test/intrinsics/gen/tanh/c15fdb.wgsl
index 55d3294..dbc6f8c 100644
--- a/test/intrinsics/gen/tanh/c15fdb.wgsl
+++ b/test/intrinsics/gen/tanh/c15fdb.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
tanh_c15fdb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.hlsl b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.hlsl
index 8638935..ec2388c 100644
--- a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void tanh_c15fdb() {
float res = tanh(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
tanh_c15fdb();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.msl b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.msl
index ca7aebe..31287f6 100644
--- a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.msl
+++ b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void tanh_c15fdb() {
float res = tanh(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
tanh_c15fdb();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.spvasm b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.spvasm
index 250c6b2..a233a16 100644
--- a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %tanh_c15fdb "tanh_c15fdb"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%tanh_c15fdb = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+%tanh_c15fdb = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Tanh %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Tanh %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %tanh_c15fdb
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %tanh_c15fdb
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %tanh_c15fdb
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %tanh_c15fdb
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %tanh_c15fdb
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %tanh_c15fdb
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.wgsl b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.wgsl
index ecd8766..10ee65c 100644
--- a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
tanh_c15fdb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/002b2a.wgsl b/test/intrinsics/gen/textureDimensions/002b2a.wgsl
index 718b2a9..c23bb53 100644
--- a/test/intrinsics/gen/textureDimensions/002b2a.wgsl
+++ b/test/intrinsics/gen/textureDimensions/002b2a.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_002b2a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.hlsl
index d83530e..edcde32 100644
--- a/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<float4> arg_0 : register(t0, space1);
void textureDimensions_002b2a() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_002b2a();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.spvasm
index 2dc45cf..e30b842 100644
--- a/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.spvasm
@@ -1,27 +1,31 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_002b2a "textureDimensions_002b2a"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %float 1D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%_ptr_Function_int = OpTypePointer Function %int
- %18 = OpConstantNull %int
+ %22 = OpConstantNull %int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_002b2a = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %18
- %14 = OpLoad %7 %arg_0
- %12 = OpImageQuerySizeLod %int %14 %int_0
- OpStore %res %12
+%textureDimensions_002b2a = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %22
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySizeLod %int %18 %int_0
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_002b2a
+ %30 = OpFunctionCall %void %textureDimensions_002b2a
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_002b2a
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_002b2a
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_002b2a
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_002b2a
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.wgsl
index 20d2b0f..1cb02b3 100644
--- a/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_002b2a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/012b82.wgsl b/test/intrinsics/gen/textureDimensions/012b82.wgsl
index 69ae40d..1e3a598 100644
--- a/test/intrinsics/gen/textureDimensions/012b82.wgsl
+++ b/test/intrinsics/gen/textureDimensions/012b82.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_012b82();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.hlsl
index a192aa3..378682f 100644
--- a/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<int4> arg_0 : register(u0, space1);
void textureDimensions_012b82() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_012b82();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.spvasm
index c8b4b79..0cc033b 100644
--- a/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_012b82 "textureDimensions_012b82"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %int 2D 0 1 0 2 R32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %20 = OpConstantNull %v2int
+ %24 = OpConstantNull %v2int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_012b82 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %13 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %13
+%textureDimensions_012b82 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %17 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_012b82
+ %32 = OpFunctionCall %void %textureDimensions_012b82
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_012b82
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_012b82
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_012b82
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_012b82
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.wgsl
index 7a5470d..8aa6f10 100644
--- a/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_012b82();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/08753d.wgsl b/test/intrinsics/gen/textureDimensions/08753d.wgsl
index ba9471b..dc402e2 100644
--- a/test/intrinsics/gen/textureDimensions/08753d.wgsl
+++ b/test/intrinsics/gen/textureDimensions/08753d.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_08753d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.hlsl
index e414fdb..4f438e3 100644
--- a/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<int4> arg_0 : register(u0, space1);
void textureDimensions_08753d() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_08753d();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.spvasm
index 9ab3e11..7844189 100644
--- a/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_08753d "textureDimensions_08753d"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,32 +35,44 @@
%7 = OpTypeImage %int 1D 0 0 0 2 Rgba16i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_08753d = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %int %14
- OpStore %res %13
+%textureDimensions_08753d = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %int %18
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureDimensions_08753d
+ %29 = OpFunctionCall %void %textureDimensions_08753d
+ %30 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureDimensions_08753d
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_08753d
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_08753d
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_08753d
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.wgsl
index dde9010..0c06897 100644
--- a/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_08753d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/08a62e.wgsl b/test/intrinsics/gen/textureDimensions/08a62e.wgsl
index 6cf4810..2f808b4 100644
--- a/test/intrinsics/gen/textureDimensions/08a62e.wgsl
+++ b/test/intrinsics/gen/textureDimensions/08a62e.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_08a62e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.hlsl
index daea9af..ce1b111 100644
--- a/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<int4> arg_0 : register(t0, space1);
void textureDimensions_08a62e() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_08a62e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.spvasm
index 0eca5b3..30cf3a5 100644
--- a/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_08a62e "textureDimensions_08a62e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,32 +35,44 @@
%7 = OpTypeImage %int 1D 0 0 0 2 Rgba32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_08a62e = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %int %14
- OpStore %res %13
+%textureDimensions_08a62e = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %int %18
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureDimensions_08a62e
+ %29 = OpFunctionCall %void %textureDimensions_08a62e
+ %30 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureDimensions_08a62e
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_08a62e
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_08a62e
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_08a62e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.wgsl
index fad47a1..6b9d4eb 100644
--- a/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_08a62e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl
index 2e4dc90..0bf88f3 100644
--- a/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl
+++ b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_0a5fcf();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.hlsl
index d269b48..2142950 100644
--- a/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
void textureDimensions_0a5fcf() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_0a5fcf();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.spvasm
index 7f18747..78cdeab 100644
--- a/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_0a5fcf "textureDimensions_0a5fcf"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %20 = OpConstantNull %v2int
+ %24 = OpConstantNull %v2int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_0a5fcf = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %12 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %12
+%textureDimensions_0a5fcf = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %16 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_0a5fcf
+ %32 = OpFunctionCall %void %textureDimensions_0a5fcf
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_0a5fcf
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_0a5fcf
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_0a5fcf
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_0a5fcf
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.wgsl
index 14574cf..8025f25 100644
--- a/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_0a5fcf();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/0bab57.wgsl b/test/intrinsics/gen/textureDimensions/0bab57.wgsl
index c74f80f..d192af2 100644
--- a/test/intrinsics/gen/textureDimensions/0bab57.wgsl
+++ b/test/intrinsics/gen/textureDimensions/0bab57.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_0bab57();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.hlsl
index 74e27fc..d14bed1 100644
--- a/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<int4> arg_0 : register(t0, space1);
void textureDimensions_0bab57() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_0bab57();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.spvasm
index d0652c2..5122a7a 100644
--- a/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_0bab57 "textureDimensions_0bab57"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %int 3D 0 0 0 2 Rgba16i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_0bab57 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v3int %15
- OpStore %res %13
+%textureDimensions_0bab57 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v3int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_0bab57
+ %30 = OpFunctionCall %void %textureDimensions_0bab57
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_0bab57
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_0bab57
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_0bab57
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_0bab57
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.wgsl
index 3ba0ffc..2a1cdc2 100644
--- a/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_0bab57();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/0c4772.wgsl b/test/intrinsics/gen/textureDimensions/0c4772.wgsl
index d880eba..899abde 100644
--- a/test/intrinsics/gen/textureDimensions/0c4772.wgsl
+++ b/test/intrinsics/gen/textureDimensions/0c4772.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_0c4772();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.hlsl
index 6aa502f..faf837d 100644
--- a/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<float4> arg_0 : register(u0, space1);
void textureDimensions_0c4772() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_0c4772();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.spvasm
index 3c1c1c0..a84a2c9 100644
--- a/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_0c4772 "textureDimensions_0c4772"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %float 3D 0 0 0 2 Rgba16f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_0c4772 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %18
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %v3int %15
- OpStore %res %12
+%textureDimensions_0c4772 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %22
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v3int %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_0c4772
+ %30 = OpFunctionCall %void %textureDimensions_0c4772
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_0c4772
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_0c4772
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_0c4772
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_0c4772
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.wgsl
index 8721c37..1b29dc5 100644
--- a/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_0c4772();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/0cce40.wgsl b/test/intrinsics/gen/textureDimensions/0cce40.wgsl
index 8e54db4..4b7c350 100644
--- a/test/intrinsics/gen/textureDimensions/0cce40.wgsl
+++ b/test/intrinsics/gen/textureDimensions/0cce40.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_0cce40();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.hlsl
index 7b1dcc7..c6df8d0 100644
--- a/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<int4> arg_0 : register(u0, space1);
void textureDimensions_0cce40() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_0cce40();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.spvasm
index 98ecb89..a86327e 100644
--- a/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_0cce40 "textureDimensions_0cce40"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,32 +35,44 @@
%7 = OpTypeImage %int 1D 0 0 0 2 R32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_0cce40 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %int %14
- OpStore %res %13
+%textureDimensions_0cce40 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %int %18
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureDimensions_0cce40
+ %29 = OpFunctionCall %void %textureDimensions_0cce40
+ %30 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureDimensions_0cce40
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_0cce40
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_0cce40
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_0cce40
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.wgsl
index fd78266..e1b4227 100644
--- a/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_0cce40();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl
index 4b75932..26cb0ec 100644
--- a/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl
+++ b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_0cf2ff();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.hlsl
index 738b5be..b056688 100644
--- a/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<uint4> arg_0 : register(u0, space1);
void textureDimensions_0cf2ff() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_0cf2ff();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.spvasm
index 40c7109..9a0a27b 100644
--- a/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_0cf2ff "textureDimensions_0cf2ff"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %uint 2D 0 0 0 2 Rgba16ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %19 = OpConstantNull %v2int
+ %23 = OpConstantNull %v2int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_0cf2ff = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %19
- %16 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v2int %16
- OpStore %res %13
+%textureDimensions_0cf2ff = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %23
+ %20 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v2int %20
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_0cf2ff
+ %31 = OpFunctionCall %void %textureDimensions_0cf2ff
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_0cf2ff
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_0cf2ff
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_0cf2ff
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_0cf2ff
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.wgsl
index 21b0006..0dcd6ab 100644
--- a/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_0cf2ff();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl
index 0946237..5aca3e2 100644
--- a/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl
+++ b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_0d8b7e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.hlsl
index 06bf872..4688a7e 100644
--- a/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<uint4> arg_0 : register(u0, space1);
void textureDimensions_0d8b7e() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_0d8b7e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.spvasm
index e8b582b..81c70b0 100644
--- a/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_0d8b7e "textureDimensions_0d8b7e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,36 +34,48 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 R32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %21 = OpConstantNull %v2int
+ %25 = OpConstantNull %v2int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_0d8b7e = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %21
- %18 = OpLoad %7 %arg_0
- %16 = OpImageQuerySize %v3int %18
- %13 = OpVectorShuffle %v2int %16 %16 0 1
- OpStore %res %13
+%textureDimensions_0d8b7e = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %25
+ %22 = OpLoad %7 %arg_0
+ %20 = OpImageQuerySize %v3int %22
+ %17 = OpVectorShuffle %v2int %20 %20 0 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureDimensions_0d8b7e
+ %33 = OpFunctionCall %void %textureDimensions_0d8b7e
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_0d8b7e
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_0d8b7e
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_0d8b7e
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_0d8b7e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.wgsl
index c0c36bf..a756817 100644
--- a/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_0d8b7e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/0e32ee.wgsl b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl
index a242d8e..4c93c0e 100644
--- a/test/intrinsics/gen/textureDimensions/0e32ee.wgsl
+++ b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_0e32ee();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.hlsl
index 7146aa7..29e863d 100644
--- a/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<uint4> arg_0 : register(u0, space1);
void textureDimensions_0e32ee() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_0e32ee();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.spvasm
index c53b4b1..74a4736 100644
--- a/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_0e32ee "textureDimensions_0e32ee"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %uint 3D 0 0 0 2 Rgba16ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %19 = OpConstantNull %v3int
+ %23 = OpConstantNull %v3int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_0e32ee = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %19
- %16 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v3int %16
- OpStore %res %13
+%textureDimensions_0e32ee = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %23
+ %20 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v3int %20
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_0e32ee
+ %31 = OpFunctionCall %void %textureDimensions_0e32ee
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_0e32ee
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_0e32ee
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_0e32ee
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_0e32ee
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.wgsl
index b32e2ea..d22f78e 100644
--- a/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_0e32ee();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/0f3c50.wgsl b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl
index a2a7a52..a83e365 100644
--- a/test/intrinsics/gen/textureDimensions/0f3c50.wgsl
+++ b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_0f3c50();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.hlsl
index abf7390..9421283 100644
--- a/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<int4> arg_0 : register(t0, space1);
void textureDimensions_0f3c50() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_0f3c50();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.spvasm
index 0091be2..34cbe26 100644
--- a/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_0f3c50 "textureDimensions_0f3c50"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %int 2D 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %21 = OpConstantNull %v2int
+ %25 = OpConstantNull %v2int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_0f3c50 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %21
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySizeLod %v3int %17 %int_0
- %13 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %13
+%textureDimensions_0f3c50 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %25
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySizeLod %v3int %21 %int_0
+ %17 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureDimensions_0f3c50
+ %33 = OpFunctionCall %void %textureDimensions_0f3c50
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_0f3c50
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_0f3c50
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_0f3c50
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_0f3c50
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.wgsl
index ce1a4f3..b83a934 100644
--- a/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_0f3c50();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/1147d6.wgsl b/test/intrinsics/gen/textureDimensions/1147d6.wgsl
index a460387..bdbed6d 100644
--- a/test/intrinsics/gen/textureDimensions/1147d6.wgsl
+++ b/test/intrinsics/gen/textureDimensions/1147d6.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_1147d6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.hlsl
index b1318e5..7d82574 100644
--- a/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<int4> arg_0 : register(t0, space1);
void textureDimensions_1147d6() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_1147d6();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.spvasm
index 7c586a9..ca44195 100644
--- a/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_1147d6 "textureDimensions_1147d6"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %20 = OpConstantNull %v2int
+ %24 = OpConstantNull %v2int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_1147d6 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %13 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %13
+%textureDimensions_1147d6 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %17 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_1147d6
+ %32 = OpFunctionCall %void %textureDimensions_1147d6
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_1147d6
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_1147d6
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_1147d6
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_1147d6
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.wgsl
index d510726..46318ce 100644
--- a/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_1147d6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/1191a5.wgsl b/test/intrinsics/gen/textureDimensions/1191a5.wgsl
index b846121..de1197d 100644
--- a/test/intrinsics/gen/textureDimensions/1191a5.wgsl
+++ b/test/intrinsics/gen/textureDimensions/1191a5.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_1191a5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.hlsl
index 561d7d4..b07629e 100644
--- a/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<uint4> arg_0 : register(t0, space1);
void textureDimensions_1191a5() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_1191a5();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.spvasm
index c94df74..90f0304 100644
--- a/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_1191a5 "textureDimensions_1191a5"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,47 @@
%7 = OpTypeImage %uint 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%int_0 = OpConstant %int 0
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %20 = OpConstantNull %v2int
+ %24 = OpConstantNull %v2int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_1191a5 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %20
- %16 = OpLoad %7 %arg_0
- %13 = OpImageQuerySizeLod %v2int %16 %int_0
- OpStore %res %13
+%textureDimensions_1191a5 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %24
+ %20 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySizeLod %v2int %20 %int_0
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_1191a5
+ %32 = OpFunctionCall %void %textureDimensions_1191a5
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_1191a5
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_1191a5
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_1191a5
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_1191a5
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.wgsl
index d17c8a9..a90f6c5 100644
--- a/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_1191a5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/12c9bb.wgsl b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl
index e99292b..a96b814 100644
--- a/test/intrinsics/gen/textureDimensions/12c9bb.wgsl
+++ b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_12c9bb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.hlsl
index e2fbea5..fbcb7c7 100644
--- a/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D arg_0 : register(t0, space1);
void textureDimensions_12c9bb() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_12c9bb();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.spvasm
index ff69832..599497a 100644
--- a/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_12c9bb "textureDimensions_12c9bb"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,35 +32,47 @@
%7 = OpTypeImage %float 2D 1 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%int_1 = OpConstant %int 1
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %19 = OpConstantNull %v2int
+ %23 = OpConstantNull %v2int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_12c9bb = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %19
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySizeLod %v2int %15 %int_1
- OpStore %res %12
+%textureDimensions_12c9bb = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %23
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySizeLod %v2int %19 %int_1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_12c9bb
+ %31 = OpFunctionCall %void %textureDimensions_12c9bb
+ %32 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_12c9bb
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_12c9bb
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_12c9bb
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_12c9bb
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.wgsl
index a9e20d6..c912411 100644
--- a/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_12c9bb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/147998.wgsl b/test/intrinsics/gen/textureDimensions/147998.wgsl
index f0dbaf2..15d37f6 100644
--- a/test/intrinsics/gen/textureDimensions/147998.wgsl
+++ b/test/intrinsics/gen/textureDimensions/147998.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_147998();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.hlsl
index eff5508..ccf858b 100644
--- a/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<float4> arg_0 : register(u0, space1);
void textureDimensions_147998() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_147998();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.spvasm
index 2295a19..83e696c 100644
--- a/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_147998 "textureDimensions_147998"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %float 2D 0 0 0 2 Rg32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_147998 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %18
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %v2int %15
- OpStore %res %12
+%textureDimensions_147998 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v2int %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_147998
+ %30 = OpFunctionCall %void %textureDimensions_147998
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_147998
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_147998
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_147998
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_147998
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.wgsl
index cc32bc4..f519203 100644
--- a/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_147998();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/16036c.wgsl b/test/intrinsics/gen/textureDimensions/16036c.wgsl
index 55224db..87b951f 100644
--- a/test/intrinsics/gen/textureDimensions/16036c.wgsl
+++ b/test/intrinsics/gen/textureDimensions/16036c.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_16036c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.hlsl
index f358c2a..2b718eb 100644
--- a/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<int4> arg_0 : register(u0, space1);
void textureDimensions_16036c() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_16036c();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.spvasm
index 8498e15..f00ebb9 100644
--- a/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_16036c "textureDimensions_16036c"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %20 = OpConstantNull %v2int
+ %24 = OpConstantNull %v2int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_16036c = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %13 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %13
+%textureDimensions_16036c = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %17 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_16036c
+ %32 = OpFunctionCall %void %textureDimensions_16036c
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_16036c
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_16036c
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_16036c
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_16036c
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.wgsl
index 3972668..6b679ac 100644
--- a/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_16036c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/168fcc.wgsl b/test/intrinsics/gen/textureDimensions/168fcc.wgsl
index ae55f61..8134688 100644
--- a/test/intrinsics/gen/textureDimensions/168fcc.wgsl
+++ b/test/intrinsics/gen/textureDimensions/168fcc.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_168fcc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.hlsl
index 45811ef..f1b9dff 100644
--- a/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<float4> arg_0 : register(t0, space1);
void textureDimensions_168fcc() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_168fcc();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.spvasm
index b9b2a43..e1c7c11 100644
--- a/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_168fcc "textureDimensions_168fcc"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %float 2D 0 0 0 2 Rgba8
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_168fcc = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %18
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %v2int %15
- OpStore %res %12
+%textureDimensions_168fcc = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v2int %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_168fcc
+ %30 = OpFunctionCall %void %textureDimensions_168fcc
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_168fcc
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_168fcc
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_168fcc
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_168fcc
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.wgsl
index 50cebb3..b66918a 100644
--- a/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_168fcc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/183b3e.wgsl b/test/intrinsics/gen/textureDimensions/183b3e.wgsl
index 9579b95..ec5dc3d 100644
--- a/test/intrinsics/gen/textureDimensions/183b3e.wgsl
+++ b/test/intrinsics/gen/textureDimensions/183b3e.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_183b3e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.hlsl
index 764248c..0aee4e9 100644
--- a/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCubeArray<uint4> arg_0 : register(t0, space1);
void textureDimensions_183b3e() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp.xyy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_183b3e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.spvasm
index 3a6eb22..cd4d25b 100644
--- a/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.spvasm
@@ -1,27 +1,31 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability SampledCubeArray
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_183b3e "textureDimensions_183b3e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,36 +34,48 @@
%7 = OpTypeImage %uint Cube 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %21 = OpConstantNull %v3int
+ %25 = OpConstantNull %v3int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_183b3e = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %21
- %17 = OpLoad %7 %arg_0
- %16 = OpImageQuerySizeLod %v3int %17 %int_0
- %13 = OpVectorShuffle %v3int %16 %16 0 1 1
- OpStore %res %13
+%textureDimensions_183b3e = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %25
+ %21 = OpLoad %7 %arg_0
+ %20 = OpImageQuerySizeLod %v3int %21 %int_0
+ %17 = OpVectorShuffle %v3int %20 %20 0 1 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureDimensions_183b3e
+ %33 = OpFunctionCall %void %textureDimensions_183b3e
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_183b3e
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_183b3e
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_183b3e
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_183b3e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.wgsl
index d2bc85f..e42d888 100644
--- a/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_183b3e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/18bd57.wgsl b/test/intrinsics/gen/textureDimensions/18bd57.wgsl
index d458253..187a607 100644
--- a/test/intrinsics/gen/textureDimensions/18bd57.wgsl
+++ b/test/intrinsics/gen/textureDimensions/18bd57.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_18bd57();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.hlsl
index 14127ef..343ba45 100644
--- a/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<uint4> arg_0 : register(t0, space1);
void textureDimensions_18bd57() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_18bd57();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.spvasm
index 70b169b..c0c23cb 100644
--- a/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_18bd57 "textureDimensions_18bd57"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,36 +35,48 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %21 = OpConstantNull %v2int
+ %25 = OpConstantNull %v2int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_18bd57 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %21
- %18 = OpLoad %7 %arg_0
- %16 = OpImageQuerySize %v3int %18
- %13 = OpVectorShuffle %v2int %16 %16 0 1
- OpStore %res %13
+%textureDimensions_18bd57 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %25
+ %22 = OpLoad %7 %arg_0
+ %20 = OpImageQuerySize %v3int %22
+ %17 = OpVectorShuffle %v2int %20 %20 0 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureDimensions_18bd57
+ %33 = OpFunctionCall %void %textureDimensions_18bd57
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_18bd57
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_18bd57
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_18bd57
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_18bd57
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.wgsl
index 01698c5..6eb56a5 100644
--- a/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_18bd57();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/19bffc.wgsl b/test/intrinsics/gen/textureDimensions/19bffc.wgsl
index 21137dc..9d460dd 100644
--- a/test/intrinsics/gen/textureDimensions/19bffc.wgsl
+++ b/test/intrinsics/gen/textureDimensions/19bffc.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_19bffc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.hlsl
index dbcc08d..abf1f04 100644
--- a/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<int4> arg_0 : register(t0, space1);
void textureDimensions_19bffc() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_19bffc();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.spvasm
index 5d81c19..8157657 100644
--- a/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_19bffc "textureDimensions_19bffc"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,33 +35,45 @@
%7 = OpTypeImage %int 3D 0 0 0 2 Rg32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_19bffc = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v3int %15
- OpStore %res %13
+%textureDimensions_19bffc = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v3int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_19bffc
+ %30 = OpFunctionCall %void %textureDimensions_19bffc
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_19bffc
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_19bffc
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_19bffc
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_19bffc
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.wgsl
index e0135b0..b484dbe 100644
--- a/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_19bffc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/1a58e7.wgsl b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl
index 30f31ea..3f45fde 100644
--- a/test/intrinsics/gen/textureDimensions/1a58e7.wgsl
+++ b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_1a58e7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.hlsl
index 565d342..7e5c2b4 100644
--- a/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
void textureDimensions_1a58e7() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_1a58e7();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.spvasm
index 504d710..53bda8e 100644
--- a/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_1a58e7 "textureDimensions_1a58e7"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rgba8
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %20 = OpConstantNull %v2int
+ %24 = OpConstantNull %v2int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_1a58e7 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %12 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %12
+%textureDimensions_1a58e7 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %16 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_1a58e7
+ %32 = OpFunctionCall %void %textureDimensions_1a58e7
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_1a58e7
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_1a58e7
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_1a58e7
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_1a58e7
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.wgsl
index 2706764..d8ec022 100644
--- a/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_1a58e7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/1aa199.wgsl b/test/intrinsics/gen/textureDimensions/1aa199.wgsl
index b39067c..b4337f5 100644
--- a/test/intrinsics/gen/textureDimensions/1aa199.wgsl
+++ b/test/intrinsics/gen/textureDimensions/1aa199.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_1aa199();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.hlsl
index bd8d2e1..1c77f9f 100644
--- a/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<int4> arg_0 : register(t0, space1);
void textureDimensions_1aa199() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_1aa199();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.spvasm
index 682bb78..721e60a 100644
--- a/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_1aa199 "textureDimensions_1aa199"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %20 = OpConstantNull %v2int
+ %24 = OpConstantNull %v2int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_1aa199 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %13 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %13
+%textureDimensions_1aa199 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %17 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_1aa199
+ %32 = OpFunctionCall %void %textureDimensions_1aa199
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_1aa199
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_1aa199
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_1aa199
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_1aa199
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.wgsl
index e04a103..07dcdb5 100644
--- a/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_1aa199();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/1b71f0.wgsl b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl
index 396abe2..b14ab12 100644
--- a/test/intrinsics/gen/textureDimensions/1b71f0.wgsl
+++ b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_1b71f0();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.hlsl
index af31554..c57db86 100644
--- a/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<int4> arg_0 : register(u0, space1);
void textureDimensions_1b71f0() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_1b71f0();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.spvasm
index 1a854e4..1bd6793 100644
--- a/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_1b71f0 "textureDimensions_1b71f0"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %int 3D 0 0 0 2 Rgba16i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_1b71f0 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v3int %15
- OpStore %res %13
+%textureDimensions_1b71f0 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v3int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_1b71f0
+ %30 = OpFunctionCall %void %textureDimensions_1b71f0
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_1b71f0
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_1b71f0
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_1b71f0
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_1b71f0
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.wgsl
index e9f02be..d2d1fde 100644
--- a/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_1b71f0();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/1d6c26.wgsl b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl
index 29be560..eef5ba3 100644
--- a/test/intrinsics/gen/textureDimensions/1d6c26.wgsl
+++ b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_1d6c26();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.hlsl
index a496442..f9e2114 100644
--- a/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<float4> arg_0 : register(u0, space1);
void textureDimensions_1d6c26() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_1d6c26();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.spvasm
index 91f238a..211100f 100644
--- a/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_1d6c26 "textureDimensions_1d6c26"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rgba8
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %20 = OpConstantNull %v2int
+ %24 = OpConstantNull %v2int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_1d6c26 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %12 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %12
+%textureDimensions_1d6c26 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %16 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_1d6c26
+ %32 = OpFunctionCall %void %textureDimensions_1d6c26
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_1d6c26
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_1d6c26
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_1d6c26
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_1d6c26
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.wgsl
index fa33009..7ab9a37 100644
--- a/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_1d6c26();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/1e189c.wgsl b/test/intrinsics/gen/textureDimensions/1e189c.wgsl
index 2234eda..1180906 100644
--- a/test/intrinsics/gen/textureDimensions/1e189c.wgsl
+++ b/test/intrinsics/gen/textureDimensions/1e189c.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_1e189c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.hlsl
index be9b5ff..f8ba104 100644
--- a/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<int4> arg_0 : register(t0, space1);
void textureDimensions_1e189c() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_1e189c();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.spvasm
index eb6508a..1445365 100644
--- a/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_1e189c "textureDimensions_1e189c"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %int 3D 0 0 0 2 R32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_1e189c = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v3int %15
- OpStore %res %13
+%textureDimensions_1e189c = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v3int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_1e189c
+ %30 = OpFunctionCall %void %textureDimensions_1e189c
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_1e189c
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_1e189c
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_1e189c
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_1e189c
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.wgsl
index 7959299..4e8b5f6 100644
--- a/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_1e189c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/1e9e39.wgsl b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl
index e109c3c..5d2b2cb 100644
--- a/test/intrinsics/gen/textureDimensions/1e9e39.wgsl
+++ b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_1e9e39();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.hlsl
index a77efc4..d4dcf6a 100644
--- a/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<float4> arg_0 : register(u0, space1);
void textureDimensions_1e9e39() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_1e9e39();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.spvasm
index 33b2772..8deedb3 100644
--- a/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_1e9e39 "textureDimensions_1e9e39"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %float 1D 0 0 0 2 Rgba16f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_1e9e39 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %int %14
- OpStore %res %12
+%textureDimensions_1e9e39 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %int %18
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureDimensions_1e9e39
+ %29 = OpFunctionCall %void %textureDimensions_1e9e39
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureDimensions_1e9e39
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_1e9e39
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_1e9e39
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_1e9e39
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.wgsl
index 7aee504..7cd094b 100644
--- a/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_1e9e39();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl
index a1468f4..9b5dd98 100644
--- a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl
+++ b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_1ebd6a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.hlsl
index 8cd7608..6787aab 100644
--- a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCube<uint4> arg_0 : register(t0, space1);
void textureDimensions_1ebd6a() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp.xyy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_1ebd6a();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.spvasm
index dd9af14..78971ba 100644
--- a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 42
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_1ebd6a "textureDimensions_1ebd6a"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,37 +33,49 @@
%7 = OpTypeImage %uint Cube 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%v2int = OpTypeVector %int 2
%int_0 = OpConstant %int 0
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %22 = OpConstantNull %v3int
+ %26 = OpConstantNull %v3int
+ %27 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_1ebd6a = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %22
- %18 = OpLoad %7 %arg_0
- %16 = OpImageQuerySizeLod %v2int %18 %int_0
- %13 = OpVectorShuffle %v3int %16 %16 0 1 1
- OpStore %res %13
+%textureDimensions_1ebd6a = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %26
+ %22 = OpLoad %7 %arg_0
+ %20 = OpImageQuerySizeLod %v2int %22 %int_0
+ %17 = OpVectorShuffle %v3int %20 %20 0 1 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %24 = OpLabel
+%tint_symbol_2 = OpFunction %void None %27
+%tint_symbol = OpFunctionParameter %v4float
+ %30 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
OpStore %tint_pointsize %float_1
- %26 = OpFunctionCall %void %textureDimensions_1ebd6a
+ %34 = OpFunctionCall %void %textureDimensions_1ebd6a
+ %35 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_1ebd6a
+%fragment_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_1ebd6a
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_1ebd6a
+%compute_main = OpFunction %void None %13
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureDimensions_1ebd6a
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.wgsl
index da5ca1c..87878e8 100644
--- a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_1ebd6a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/1f20c5.wgsl b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl
index 333146a..b5d6911 100644
--- a/test/intrinsics/gen/textureDimensions/1f20c5.wgsl
+++ b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_1f20c5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.hlsl
index bc07afa..5246f41 100644
--- a/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<uint4> arg_0 : register(t0, space1);
void textureDimensions_1f20c5() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_1f20c5();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.spvasm
index c7c82c8..bee122d 100644
--- a/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 42
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_1f20c5 "textureDimensions_1f20c5"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,37 +33,49 @@
%7 = OpTypeImage %uint 2D 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
+ %26 = OpConstantNull %v2int
+ %27 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_1f20c5 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %18 = OpLoad %7 %arg_0
- %16 = OpImageQuerySizeLod %v3int %18 %int_0
- %13 = OpVectorShuffle %v2int %16 %16 0 1
- OpStore %res %13
+%textureDimensions_1f20c5 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %26
+ %22 = OpLoad %7 %arg_0
+ %20 = OpImageQuerySizeLod %v3int %22 %int_0
+ %17 = OpVectorShuffle %v2int %20 %20 0 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %24 = OpLabel
+%tint_symbol_2 = OpFunction %void None %27
+%tint_symbol = OpFunctionParameter %v4float
+ %30 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
OpStore %tint_pointsize %float_1
- %26 = OpFunctionCall %void %textureDimensions_1f20c5
+ %34 = OpFunctionCall %void %textureDimensions_1f20c5
+ %35 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_1f20c5
+%fragment_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_1f20c5
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_1f20c5
+%compute_main = OpFunction %void None %13
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureDimensions_1f20c5
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.wgsl
index dce90c1..0d580f7 100644
--- a/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_1f20c5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/214b7b.wgsl b/test/intrinsics/gen/textureDimensions/214b7b.wgsl
index 053eab1..1eff7e2 100644
--- a/test/intrinsics/gen/textureDimensions/214b7b.wgsl
+++ b/test/intrinsics/gen/textureDimensions/214b7b.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_214b7b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.hlsl
index e3c3205..422b814 100644
--- a/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<float4> arg_0 : register(t0, space1);
void textureDimensions_214b7b() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_214b7b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.spvasm
index 19b3b6d..6179d33 100644
--- a/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.spvasm
@@ -1,22 +1,25 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_214b7b "textureDimensions_214b7b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -24,6 +27,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,33 +35,45 @@
%7 = OpTypeImage %float 1D 0 0 0 2 Rg32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_214b7b = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %int %14
- OpStore %res %12
+%textureDimensions_214b7b = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %int %18
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureDimensions_214b7b
+ %29 = OpFunctionCall %void %textureDimensions_214b7b
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureDimensions_214b7b
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_214b7b
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_214b7b
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_214b7b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.wgsl
index 5a63062..b885786 100644
--- a/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_214b7b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/214dd4.wgsl b/test/intrinsics/gen/textureDimensions/214dd4.wgsl
index 042c0ed..c7f6354 100644
--- a/test/intrinsics/gen/textureDimensions/214dd4.wgsl
+++ b/test/intrinsics/gen/textureDimensions/214dd4.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_214dd4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.hlsl
index 9a51609..75222f5 100644
--- a/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<int4> arg_0 : register(u0, space1);
void textureDimensions_214dd4() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_214dd4();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.spvasm
index 3db1b54..9b8ac32 100644
--- a/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_214dd4 "textureDimensions_214dd4"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %int 3D 0 0 0 2 Rgba8i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_214dd4 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v3int %15
- OpStore %res %13
+%textureDimensions_214dd4 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v3int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_214dd4
+ %30 = OpFunctionCall %void %textureDimensions_214dd4
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_214dd4
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_214dd4
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_214dd4
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_214dd4
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.wgsl
index de7e3bb..760b456 100644
--- a/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_214dd4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/267788.wgsl b/test/intrinsics/gen/textureDimensions/267788.wgsl
index 83b5d07..88df32e 100644
--- a/test/intrinsics/gen/textureDimensions/267788.wgsl
+++ b/test/intrinsics/gen/textureDimensions/267788.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_267788();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.hlsl
index aa6b355..be0ec88 100644
--- a/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<uint4> arg_0 : register(t0, space1);
void textureDimensions_267788() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_267788();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.spvasm
index d0154aa..4b3cbc2 100644
--- a/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 42
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_267788 "textureDimensions_267788"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,37 +33,49 @@
%7 = OpTypeImage %uint 2D 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%int_1 = OpConstant %int 1
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
+ %26 = OpConstantNull %v2int
+ %27 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_267788 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %18 = OpLoad %7 %arg_0
- %16 = OpImageQuerySizeLod %v3int %18 %int_1
- %13 = OpVectorShuffle %v2int %16 %16 0 1
- OpStore %res %13
+%textureDimensions_267788 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %26
+ %22 = OpLoad %7 %arg_0
+ %20 = OpImageQuerySizeLod %v3int %22 %int_1
+ %17 = OpVectorShuffle %v2int %20 %20 0 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %24 = OpLabel
+%tint_symbol_2 = OpFunction %void None %27
+%tint_symbol = OpFunctionParameter %v4float
+ %30 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
OpStore %tint_pointsize %float_1
- %26 = OpFunctionCall %void %textureDimensions_267788
+ %34 = OpFunctionCall %void %textureDimensions_267788
+ %35 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_267788
+%fragment_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_267788
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_267788
+%compute_main = OpFunction %void None %13
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureDimensions_267788
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.wgsl
index 177cdb2..87bd669 100644
--- a/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_267788();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/26bdfa.wgsl b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl
index 445a6d2..9988127 100644
--- a/test/intrinsics/gen/textureDimensions/26bdfa.wgsl
+++ b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_26bdfa();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.hlsl
index f6e82ab..2b9a1f7 100644
--- a/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<float4> arg_0 : register(t0, space1);
void textureDimensions_26bdfa() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp.xyz;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_26bdfa();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.spvasm
index 80e6028..c851fa4 100644
--- a/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_26bdfa "textureDimensions_26bdfa"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,35 +32,47 @@
%7 = OpTypeImage %float 3D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_1 = OpConstant %int 1
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %19 = OpConstantNull %v3int
+ %23 = OpConstantNull %v3int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_26bdfa = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %19
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySizeLod %v3int %15 %int_1
- OpStore %res %12
+%textureDimensions_26bdfa = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %23
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySizeLod %v3int %19 %int_1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_26bdfa
+ %31 = OpFunctionCall %void %textureDimensions_26bdfa
+ %32 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_26bdfa
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_26bdfa
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_26bdfa
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_26bdfa
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.wgsl
index 10d89c3..6c92d3f 100644
--- a/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_26bdfa();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/26ef6c.wgsl b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl
index e197ab2..ceb229c 100644
--- a/test/intrinsics/gen/textureDimensions/26ef6c.wgsl
+++ b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_26ef6c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.hlsl
index 9e11e83..61a8a42 100644
--- a/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<uint4> arg_0 : register(u0, space1);
void textureDimensions_26ef6c() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_26ef6c();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.spvasm
index 26609c2..a02bdc1 100644
--- a/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_26ef6c "textureDimensions_26ef6c"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,36 +34,48 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %21 = OpConstantNull %v2int
+ %25 = OpConstantNull %v2int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_26ef6c = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %21
- %18 = OpLoad %7 %arg_0
- %16 = OpImageQuerySize %v3int %18
- %13 = OpVectorShuffle %v2int %16 %16 0 1
- OpStore %res %13
+%textureDimensions_26ef6c = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %25
+ %22 = OpLoad %7 %arg_0
+ %20 = OpImageQuerySize %v3int %22
+ %17 = OpVectorShuffle %v2int %20 %20 0 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureDimensions_26ef6c
+ %33 = OpFunctionCall %void %textureDimensions_26ef6c
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_26ef6c
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_26ef6c
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_26ef6c
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_26ef6c
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.wgsl
index ccf7e79..83295f3 100644
--- a/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_26ef6c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/2ad087.wgsl b/test/intrinsics/gen/textureDimensions/2ad087.wgsl
index e10201e..7bc99f6 100644
--- a/test/intrinsics/gen/textureDimensions/2ad087.wgsl
+++ b/test/intrinsics/gen/textureDimensions/2ad087.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_2ad087();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.hlsl
index 82c4e11..e9602c3 100644
--- a/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<int4> arg_0 : register(u0, space1);
void textureDimensions_2ad087() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_2ad087();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.spvasm
index 74f5e24a..d4c7fd8 100644
--- a/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_2ad087 "textureDimensions_2ad087"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %int 2D 0 0 0 2 Rgba16i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_2ad087 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v2int %15
- OpStore %res %13
+%textureDimensions_2ad087 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v2int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_2ad087
+ %30 = OpFunctionCall %void %textureDimensions_2ad087
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_2ad087
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_2ad087
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_2ad087
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_2ad087
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.wgsl
index 095ee44..c9e1f16 100644
--- a/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_2ad087();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/2d32ae.wgsl b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl
index 8a96df2..bb78393 100644
--- a/test/intrinsics/gen/textureDimensions/2d32ae.wgsl
+++ b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_2d32ae();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.hlsl
index 83d3b36..e7f0854 100644
--- a/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<uint4> arg_0 : register(t0, space1);
void textureDimensions_2d32ae() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_2d32ae();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.spvasm
index 96c6b4c..43bf92d 100644
--- a/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_2d32ae "textureDimensions_2d32ae"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %uint 3D 0 0 0 2 Rgba32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %19 = OpConstantNull %v3int
+ %23 = OpConstantNull %v3int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_2d32ae = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %19
- %16 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v3int %16
- OpStore %res %13
+%textureDimensions_2d32ae = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %23
+ %20 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v3int %20
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_2d32ae
+ %31 = OpFunctionCall %void %textureDimensions_2d32ae
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_2d32ae
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_2d32ae
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_2d32ae
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_2d32ae
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.wgsl
index 61b01c9..8ad08a8 100644
--- a/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_2d32ae();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/2e0662.wgsl b/test/intrinsics/gen/textureDimensions/2e0662.wgsl
index fc5760d..7688adb 100644
--- a/test/intrinsics/gen/textureDimensions/2e0662.wgsl
+++ b/test/intrinsics/gen/textureDimensions/2e0662.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_2e0662();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.hlsl
index 30d3b53..014e321 100644
--- a/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<float4> arg_0 : register(t0, space1);
void textureDimensions_2e0662() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_2e0662();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.spvasm
index 8b365da..c28f836 100644
--- a/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_2e0662 "textureDimensions_2e0662"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %float 2D 0 0 0 2 Rgba8Snorm
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_2e0662 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %18
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %v2int %15
- OpStore %res %12
+%textureDimensions_2e0662 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v2int %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_2e0662
+ %30 = OpFunctionCall %void %textureDimensions_2e0662
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_2e0662
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_2e0662
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_2e0662
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_2e0662
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.wgsl
index 39f4bbd..6ce2d76 100644
--- a/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_2e0662();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/2efa05.wgsl b/test/intrinsics/gen/textureDimensions/2efa05.wgsl
index 88c2c9f..fa584db 100644
--- a/test/intrinsics/gen/textureDimensions/2efa05.wgsl
+++ b/test/intrinsics/gen/textureDimensions/2efa05.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_2efa05();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.hlsl
index 5175bdd..a3c3f0e 100644
--- a/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<uint4> arg_0 : register(t0, space1);
void textureDimensions_2efa05() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp.xyz;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_2efa05();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.spvasm
index ecba548..6ed8b5b 100644
--- a/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_2efa05 "textureDimensions_2efa05"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,47 @@
%7 = OpTypeImage %uint 3D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_1 = OpConstant %int 1
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %20 = OpConstantNull %v3int
+ %24 = OpConstantNull %v3int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_2efa05 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %20
- %16 = OpLoad %7 %arg_0
- %13 = OpImageQuerySizeLod %v3int %16 %int_1
- OpStore %res %13
+%textureDimensions_2efa05 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %24
+ %20 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySizeLod %v3int %20 %int_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_2efa05
+ %32 = OpFunctionCall %void %textureDimensions_2efa05
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_2efa05
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_2efa05
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_2efa05
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_2efa05
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.wgsl
index 02c2e5a..3b902cc 100644
--- a/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_2efa05();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/2f289f.wgsl b/test/intrinsics/gen/textureDimensions/2f289f.wgsl
index cc718aa..bb7115b 100644
--- a/test/intrinsics/gen/textureDimensions/2f289f.wgsl
+++ b/test/intrinsics/gen/textureDimensions/2f289f.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_2f289f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.hlsl
index ee4cc4c..72b6b64 100644
--- a/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<int4> arg_0 : register(u0, space1);
void textureDimensions_2f289f() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_2f289f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.spvasm
index 4d2be75..ffe6d7e 100644
--- a/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_2f289f "textureDimensions_2f289f"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %int 3D 0 0 0 2 R32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_2f289f = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v3int %15
- OpStore %res %13
+%textureDimensions_2f289f = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v3int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_2f289f
+ %30 = OpFunctionCall %void %textureDimensions_2f289f
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_2f289f
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_2f289f
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_2f289f
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_2f289f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.wgsl
index cb95ece..64ae074 100644
--- a/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_2f289f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl
index dfa4db2..d1e868c 100644
--- a/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl
+++ b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_2fe1cc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.hlsl
index a2d49c8..54c9ce3 100644
--- a/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<float4> arg_0 : register(t0, space1);
void textureDimensions_2fe1cc() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_2fe1cc();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.spvasm
index 76ece0d..0af8187 100644
--- a/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_2fe1cc "textureDimensions_2fe1cc"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,35 +32,47 @@
%7 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%int_1 = OpConstant %int 1
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %19 = OpConstantNull %v2int
+ %23 = OpConstantNull %v2int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_2fe1cc = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %19
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySizeLod %v2int %15 %int_1
- OpStore %res %12
+%textureDimensions_2fe1cc = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %23
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySizeLod %v2int %19 %int_1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_2fe1cc
+ %31 = OpFunctionCall %void %textureDimensions_2fe1cc
+ %32 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_2fe1cc
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_2fe1cc
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_2fe1cc
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_2fe1cc
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.wgsl
index 215ce6a..d27758b 100644
--- a/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_2fe1cc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/318ecc.wgsl b/test/intrinsics/gen/textureDimensions/318ecc.wgsl
index 29b4ad5..cc8ae79 100644
--- a/test/intrinsics/gen/textureDimensions/318ecc.wgsl
+++ b/test/intrinsics/gen/textureDimensions/318ecc.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_318ecc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.hlsl
index ad7854d..4976ca7 100644
--- a/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<uint4> arg_0 : register(u0, space1);
void textureDimensions_318ecc() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_318ecc();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.spvasm
index 9cd91c9..17a4e27 100644
--- a/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_318ecc "textureDimensions_318ecc"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,33 +35,45 @@
%7 = OpTypeImage %uint 1D 0 0 0 2 Rgba16ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %18 = OpConstantNull %int
+ %22 = OpConstantNull %int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_318ecc = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %int %15
- OpStore %res %13
+%textureDimensions_318ecc = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_318ecc
+ %30 = OpFunctionCall %void %textureDimensions_318ecc
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_318ecc
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_318ecc
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_318ecc
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_318ecc
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.wgsl
index 4332a63..1c8d987 100644
--- a/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_318ecc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/340d06.wgsl b/test/intrinsics/gen/textureDimensions/340d06.wgsl
index 7d8e7ba..5b40190 100644
--- a/test/intrinsics/gen/textureDimensions/340d06.wgsl
+++ b/test/intrinsics/gen/textureDimensions/340d06.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_340d06();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.hlsl
index 341d62a..700259c 100644
--- a/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<uint4> arg_0 : register(u0, space1);
void textureDimensions_340d06() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_340d06();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.spvasm
index 5ededab..f666315 100644
--- a/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_340d06 "textureDimensions_340d06"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %uint 3D 0 0 0 2 R32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %19 = OpConstantNull %v3int
+ %23 = OpConstantNull %v3int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_340d06 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %19
- %16 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v3int %16
- OpStore %res %13
+%textureDimensions_340d06 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %23
+ %20 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v3int %20
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_340d06
+ %31 = OpFunctionCall %void %textureDimensions_340d06
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_340d06
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_340d06
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_340d06
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_340d06
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.wgsl
index aca58ad..b2d0826 100644
--- a/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_340d06();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/398e30.wgsl b/test/intrinsics/gen/textureDimensions/398e30.wgsl
index a6f3ad9..71bb78f 100644
--- a/test/intrinsics/gen/textureDimensions/398e30.wgsl
+++ b/test/intrinsics/gen/textureDimensions/398e30.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_398e30();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.hlsl
index 43f9e21..7db71a8 100644
--- a/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<uint4> arg_0 : register(u0, space1);
void textureDimensions_398e30() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_398e30();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.spvasm
index d2c4d31..88fb12c 100644
--- a/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_398e30 "textureDimensions_398e30"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,36 +34,48 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %21 = OpConstantNull %v2int
+ %25 = OpConstantNull %v2int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_398e30 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %21
- %18 = OpLoad %7 %arg_0
- %16 = OpImageQuerySize %v3int %18
- %13 = OpVectorShuffle %v2int %16 %16 0 1
- OpStore %res %13
+%textureDimensions_398e30 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %25
+ %22 = OpLoad %7 %arg_0
+ %20 = OpImageQuerySize %v3int %22
+ %17 = OpVectorShuffle %v2int %20 %20 0 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureDimensions_398e30
+ %33 = OpFunctionCall %void %textureDimensions_398e30
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_398e30
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_398e30
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_398e30
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_398e30
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.wgsl
index 50376ff..5d0bac4 100644
--- a/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_398e30();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/39a600.wgsl b/test/intrinsics/gen/textureDimensions/39a600.wgsl
index a06623f..ccb385e 100644
--- a/test/intrinsics/gen/textureDimensions/39a600.wgsl
+++ b/test/intrinsics/gen/textureDimensions/39a600.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_39a600();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.hlsl
index bb63468..630e3fc 100644
--- a/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<int4> arg_0 : register(t0, space1);
void textureDimensions_39a600() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_39a600();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.spvasm
index b5f190c..c364050 100644
--- a/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_39a600 "textureDimensions_39a600"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %int 2D 0 1 0 2 R32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %20 = OpConstantNull %v2int
+ %24 = OpConstantNull %v2int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_39a600 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %13 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %13
+%textureDimensions_39a600 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %17 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_39a600
+ %32 = OpFunctionCall %void %textureDimensions_39a600
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_39a600
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_39a600
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_39a600
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_39a600
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.wgsl
index 5915c37..ea6c5b2 100644
--- a/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_39a600();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/3a94ea.wgsl b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl
index ad3a697..9e93d06 100644
--- a/test/intrinsics/gen/textureDimensions/3a94ea.wgsl
+++ b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_3a94ea();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.hlsl
index 984a409..3b41938 100644
--- a/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<uint4> arg_0 : register(u0, space1);
void textureDimensions_3a94ea() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_3a94ea();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.spvasm
index e1132c3..36d52b7 100644
--- a/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_3a94ea "textureDimensions_3a94ea"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,34 +35,46 @@
%7 = OpTypeImage %uint 2D 0 0 0 2 Rg32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %19 = OpConstantNull %v2int
+ %23 = OpConstantNull %v2int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_3a94ea = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %19
- %16 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v2int %16
- OpStore %res %13
+%textureDimensions_3a94ea = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %23
+ %20 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v2int %20
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_3a94ea
+ %31 = OpFunctionCall %void %textureDimensions_3a94ea
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_3a94ea
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_3a94ea
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_3a94ea
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_3a94ea
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.wgsl
index f1acdc1..f369f54 100644
--- a/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_3a94ea();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/3aca08.wgsl b/test/intrinsics/gen/textureDimensions/3aca08.wgsl
index e9735ce..e6f1753 100644
--- a/test/intrinsics/gen/textureDimensions/3aca08.wgsl
+++ b/test/intrinsics/gen/textureDimensions/3aca08.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_3aca08();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.hlsl
index 5a88e3b..9584a88 100644
--- a/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<float4> arg_0 : register(u0, space1);
void textureDimensions_3aca08() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_3aca08();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.spvasm
index a191b3e..5cd7281 100644
--- a/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_3aca08 "textureDimensions_3aca08"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %float 1D 0 0 0 2 Rgba32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_3aca08 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %int %14
- OpStore %res %12
+%textureDimensions_3aca08 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %int %18
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureDimensions_3aca08
+ %29 = OpFunctionCall %void %textureDimensions_3aca08
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureDimensions_3aca08
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_3aca08
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_3aca08
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_3aca08
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.wgsl
index 2c8cb95..fbb8bf8 100644
--- a/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_3aca08();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl
index 30d77c0..99b92ef 100644
--- a/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl
+++ b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_3c5ad8();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.hlsl
index 15ccdf1..a3b9ba6 100644
--- a/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<int4> arg_0 : register(u0, space1);
void textureDimensions_3c5ad8() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_3c5ad8();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.spvasm
index 90d93e5..c6cb7d8 100644
--- a/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_3c5ad8 "textureDimensions_3c5ad8"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %int 2D 0 0 0 2 Rgba8i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_3c5ad8 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v2int %15
- OpStore %res %13
+%textureDimensions_3c5ad8 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v2int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_3c5ad8
+ %30 = OpFunctionCall %void %textureDimensions_3c5ad8
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_3c5ad8
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_3c5ad8
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_3c5ad8
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_3c5ad8
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.wgsl
index ea66097..5f25817 100644
--- a/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_3c5ad8();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/3d5817.wgsl b/test/intrinsics/gen/textureDimensions/3d5817.wgsl
index f09f6f3..b20a3a4 100644
--- a/test/intrinsics/gen/textureDimensions/3d5817.wgsl
+++ b/test/intrinsics/gen/textureDimensions/3d5817.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_3d5817();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.hlsl
index 28ac7bf..d54a083 100644
--- a/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<uint4> arg_0 : register(t0, space1);
void textureDimensions_3d5817() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_3d5817();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.spvasm
index f33f81e..e617ef6 100644
--- a/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_3d5817 "textureDimensions_3d5817"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,33 +35,45 @@
%7 = OpTypeImage %uint 1D 0 0 0 2 Rgba16ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %18 = OpConstantNull %int
+ %22 = OpConstantNull %int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_3d5817 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %int %15
- OpStore %res %13
+%textureDimensions_3d5817 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_3d5817
+ %30 = OpFunctionCall %void %textureDimensions_3d5817
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_3d5817
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_3d5817
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_3d5817
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_3d5817
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.wgsl
index 21e8ab0..981b928 100644
--- a/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_3d5817();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/3e0403.wgsl b/test/intrinsics/gen/textureDimensions/3e0403.wgsl
index ab806b3..381f3fc 100644
--- a/test/intrinsics/gen/textureDimensions/3e0403.wgsl
+++ b/test/intrinsics/gen/textureDimensions/3e0403.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_3e0403();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.hlsl
index bdad7cf..6f38405 100644
--- a/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCubeArray<float4> arg_0 : register(t0, space1);
void textureDimensions_3e0403() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp.xyy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_3e0403();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.spvasm
index 41e422d..70fa473 100644
--- a/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.spvasm
@@ -1,27 +1,31 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability SampledCubeArray
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_3e0403 "textureDimensions_3e0403"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %float Cube 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %20 = OpConstantNull %v3int
+ %24 = OpConstantNull %v3int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_3e0403 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %20
- %16 = OpLoad %7 %arg_0
- %15 = OpImageQuerySizeLod %v3int %16 %int_0
- %12 = OpVectorShuffle %v3int %15 %15 0 1 1
- OpStore %res %12
+%textureDimensions_3e0403 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %24
+ %20 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySizeLod %v3int %20 %int_0
+ %16 = OpVectorShuffle %v3int %19 %19 0 1 1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_3e0403
+ %32 = OpFunctionCall %void %textureDimensions_3e0403
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_3e0403
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_3e0403
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_3e0403
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_3e0403
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.wgsl
index 769dcc4..a9a3da0 100644
--- a/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_3e0403();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/3e626d.wgsl b/test/intrinsics/gen/textureDimensions/3e626d.wgsl
index 14d0b63..e9eac68 100644
--- a/test/intrinsics/gen/textureDimensions/3e626d.wgsl
+++ b/test/intrinsics/gen/textureDimensions/3e626d.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_3e626d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.hlsl
index a279501..d71ed54 100644
--- a/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCubeArray arg_0 : register(t0, space1);
void textureDimensions_3e626d() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp.xyy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_3e626d();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.spvasm
index 056eb24..b8f6b67 100644
--- a/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.spvasm
@@ -1,27 +1,31 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability SampledCubeArray
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_3e626d "textureDimensions_3e626d"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %float Cube 1 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_1 = OpConstant %int 1
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %20 = OpConstantNull %v3int
+ %24 = OpConstantNull %v3int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_3e626d = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %20
- %16 = OpLoad %7 %arg_0
- %15 = OpImageQuerySizeLod %v3int %16 %int_1
- %12 = OpVectorShuffle %v3int %15 %15 0 1 1
- OpStore %res %12
+%textureDimensions_3e626d = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %24
+ %20 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySizeLod %v3int %20 %int_1
+ %16 = OpVectorShuffle %v3int %19 %19 0 1 1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_3e626d
+ %32 = OpFunctionCall %void %textureDimensions_3e626d
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_3e626d
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_3e626d
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_3e626d
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_3e626d
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.wgsl
index 1fb3dbd..cbe958c 100644
--- a/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_3e626d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/40bc10.wgsl b/test/intrinsics/gen/textureDimensions/40bc10.wgsl
index f8f4dd4..fcef286 100644
--- a/test/intrinsics/gen/textureDimensions/40bc10.wgsl
+++ b/test/intrinsics/gen/textureDimensions/40bc10.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_40bc10();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.hlsl
index 5a4ba74..8a30fc1 100644
--- a/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<uint4> arg_0 : register(t0, space1);
void textureDimensions_40bc10() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_40bc10();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.spvasm
index 228f0b5..2d5abf4 100644
--- a/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_40bc10 "textureDimensions_40bc10"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,33 +35,45 @@
%7 = OpTypeImage %uint 1D 0 0 0 2 Rgba8ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %18 = OpConstantNull %int
+ %22 = OpConstantNull %int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_40bc10 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %int %15
- OpStore %res %13
+%textureDimensions_40bc10 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_40bc10
+ %30 = OpFunctionCall %void %textureDimensions_40bc10
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_40bc10
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_40bc10
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_40bc10
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_40bc10
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.wgsl
index 0727714..22ba5ee 100644
--- a/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_40bc10();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/423f99.wgsl b/test/intrinsics/gen/textureDimensions/423f99.wgsl
index f451b22..7eff83a 100644
--- a/test/intrinsics/gen/textureDimensions/423f99.wgsl
+++ b/test/intrinsics/gen/textureDimensions/423f99.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_423f99();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.hlsl
index 2896dcc..17a6923 100644
--- a/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<int4> arg_0 : register(t0, space1);
void textureDimensions_423f99() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_423f99();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.spvasm
index 75aeca4..b6a2c25 100644
--- a/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.spvasm
@@ -1,27 +1,31 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_423f99 "textureDimensions_423f99"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %int 1D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int_0 = OpConstant %int 0
%_ptr_Function_int = OpTypePointer Function %int
- %18 = OpConstantNull %int
+ %22 = OpConstantNull %int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_423f99 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %18
- %14 = OpLoad %7 %arg_0
- %13 = OpImageQuerySizeLod %int %14 %int_0
- OpStore %res %13
+%textureDimensions_423f99 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %22
+ %18 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySizeLod %int %18 %int_0
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_423f99
+ %30 = OpFunctionCall %void %textureDimensions_423f99
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_423f99
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_423f99
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_423f99
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_423f99
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.wgsl
index 1b008ff..54fca49 100644
--- a/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_423f99();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/4267ee.wgsl b/test/intrinsics/gen/textureDimensions/4267ee.wgsl
index 1d1c2ef..565b180 100644
--- a/test/intrinsics/gen/textureDimensions/4267ee.wgsl
+++ b/test/intrinsics/gen/textureDimensions/4267ee.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_4267ee();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.hlsl
index aef602d..ff9767f 100644
--- a/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<float4> arg_0 : register(u0, space1);
void textureDimensions_4267ee() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_4267ee();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.spvasm
index 5e24b4e..e5b6e92 100644
--- a/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_4267ee "textureDimensions_4267ee"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %float 2D 0 0 0 2 Rgba32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_4267ee = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %18
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %v2int %15
- OpStore %res %12
+%textureDimensions_4267ee = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v2int %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_4267ee
+ %30 = OpFunctionCall %void %textureDimensions_4267ee
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_4267ee
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_4267ee
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_4267ee
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_4267ee
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.wgsl
index 05b48af..f548fe4 100644
--- a/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_4267ee();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/42d4e6.wgsl b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl
index d2454e4..a5c2e7d 100644
--- a/test/intrinsics/gen/textureDimensions/42d4e6.wgsl
+++ b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_42d4e6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.hlsl
index 6fc1b1a..80fa6e9 100644
--- a/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<float4> arg_0 : register(u0, space1);
void textureDimensions_42d4e6() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_42d4e6();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.spvasm
index 1291134..572fcb0 100644
--- a/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_42d4e6 "textureDimensions_42d4e6"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %float 1D 0 0 0 2 Rgba8
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_42d4e6 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %int %14
- OpStore %res %12
+%textureDimensions_42d4e6 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %int %18
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureDimensions_42d4e6
+ %29 = OpFunctionCall %void %textureDimensions_42d4e6
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureDimensions_42d4e6
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_42d4e6
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_42d4e6
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_42d4e6
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.wgsl
index 92708fb..d218c7b 100644
--- a/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_42d4e6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/441392.wgsl b/test/intrinsics/gen/textureDimensions/441392.wgsl
index 937d79b..f1bb4e6 100644
--- a/test/intrinsics/gen/textureDimensions/441392.wgsl
+++ b/test/intrinsics/gen/textureDimensions/441392.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_441392();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.hlsl
index 67d2344..2b0e416 100644
--- a/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<uint4> arg_0 : register(t0, space1);
void textureDimensions_441392() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_441392();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.spvasm
index fb56b4f..1fb6b0f 100644
--- a/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.spvasm
@@ -1,22 +1,25 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_441392 "textureDimensions_441392"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -24,6 +27,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -32,33 +36,45 @@
%7 = OpTypeImage %uint 1D 0 0 0 2 Rg32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %18 = OpConstantNull %int
+ %22 = OpConstantNull %int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_441392 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %int %15
- OpStore %res %13
+%textureDimensions_441392 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_441392
+ %30 = OpFunctionCall %void %textureDimensions_441392
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_441392
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_441392
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_441392
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_441392
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.wgsl
index 432e612..19693a9 100644
--- a/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_441392();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/48cb89.wgsl b/test/intrinsics/gen/textureDimensions/48cb89.wgsl
index 60991cd..2ef0482 100644
--- a/test/intrinsics/gen/textureDimensions/48cb89.wgsl
+++ b/test/intrinsics/gen/textureDimensions/48cb89.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_48cb89();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.hlsl
index 9f45377..6cdc61b 100644
--- a/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<float4> arg_0 : register(u0, space1);
void textureDimensions_48cb89() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_48cb89();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.spvasm
index c149ebe..bcca1a0 100644
--- a/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_48cb89 "textureDimensions_48cb89"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %float 2D 0 0 0 2 Rgba16f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_48cb89 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %18
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %v2int %15
- OpStore %res %12
+%textureDimensions_48cb89 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v2int %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_48cb89
+ %30 = OpFunctionCall %void %textureDimensions_48cb89
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_48cb89
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_48cb89
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_48cb89
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_48cb89
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.wgsl
index aaa4c33..5fc20b1 100644
--- a/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_48cb89();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/48cbb2.wgsl b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl
index 38ecb4d..3dd5ca7 100644
--- a/test/intrinsics/gen/textureDimensions/48cbb2.wgsl
+++ b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_48cbb2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.hlsl
index 979d34f6..6862ef8 100644
--- a/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
void textureDimensions_48cbb2() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_48cbb2();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.spvasm
index 54fe427..3aaea4e 100644
--- a/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_48cbb2 "textureDimensions_48cbb2"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,36 +34,48 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rg32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %20 = OpConstantNull %v2int
+ %24 = OpConstantNull %v2int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_48cbb2 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %12 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %12
+%textureDimensions_48cbb2 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %16 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_48cbb2
+ %32 = OpFunctionCall %void %textureDimensions_48cbb2
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_48cbb2
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_48cbb2
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_48cbb2
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_48cbb2
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.wgsl
index 180ebcf..c987541 100644
--- a/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_48cbb2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/48f360.wgsl b/test/intrinsics/gen/textureDimensions/48f360.wgsl
index 9e24a9e..971c339 100644
--- a/test/intrinsics/gen/textureDimensions/48f360.wgsl
+++ b/test/intrinsics/gen/textureDimensions/48f360.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_48f360();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.hlsl
index 9fbc6c7..91c03e9 100644
--- a/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<int4> arg_0 : register(t0, space1);
void textureDimensions_48f360() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_48f360();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.spvasm
index b86a2ec..48c69ba 100644
--- a/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_48f360 "textureDimensions_48f360"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,33 +35,45 @@
%7 = OpTypeImage %int 2D 0 0 0 2 Rg32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_48f360 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v2int %15
- OpStore %res %13
+%textureDimensions_48f360 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v2int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_48f360
+ %30 = OpFunctionCall %void %textureDimensions_48f360
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_48f360
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_48f360
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_48f360
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_48f360
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.wgsl
index 3fa6ac8..25c40cd 100644
--- a/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_48f360();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/49d274.wgsl b/test/intrinsics/gen/textureDimensions/49d274.wgsl
index 25adf50..e0cef32 100644
--- a/test/intrinsics/gen/textureDimensions/49d274.wgsl
+++ b/test/intrinsics/gen/textureDimensions/49d274.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_49d274();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.hlsl
index 1523867..dd20f99 100644
--- a/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<int4> arg_0 : register(u0, space1);
void textureDimensions_49d274() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_49d274();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.spvasm
index 099c090..94abc18 100644
--- a/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_49d274 "textureDimensions_49d274"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,35 +35,47 @@
%7 = OpTypeImage %int 2D 0 1 0 2 Rg32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %20 = OpConstantNull %v2int
+ %24 = OpConstantNull %v2int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_49d274 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %13 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %13
+%textureDimensions_49d274 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %17 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_49d274
+ %32 = OpFunctionCall %void %textureDimensions_49d274
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_49d274
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_49d274
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_49d274
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_49d274
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.wgsl
index 3a08ece..2308b26 100644
--- a/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_49d274();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/4df9a8.wgsl b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl
index fe40ade..8e8a9c7 100644
--- a/test/intrinsics/gen/textureDimensions/4df9a8.wgsl
+++ b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_4df9a8();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.hlsl
index 1203833..86ee9db 100644
--- a/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<uint4> arg_0 : register(u0, space1);
void textureDimensions_4df9a8() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_4df9a8();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.spvasm
index 2aa1708..91dc89d 100644
--- a/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.spvasm
@@ -1,22 +1,25 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_4df9a8 "textureDimensions_4df9a8"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -24,6 +27,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -32,33 +36,45 @@
%7 = OpTypeImage %uint 1D 0 0 0 2 Rg32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %18 = OpConstantNull %int
+ %22 = OpConstantNull %int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_4df9a8 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %int %15
- OpStore %res %13
+%textureDimensions_4df9a8 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_4df9a8
+ %30 = OpFunctionCall %void %textureDimensions_4df9a8
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_4df9a8
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_4df9a8
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_4df9a8
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_4df9a8
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.wgsl
index 7c597ef..f29f9ac 100644
--- a/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_4df9a8();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/55b23e.wgsl b/test/intrinsics/gen/textureDimensions/55b23e.wgsl
index 3d070db..094f049 100644
--- a/test/intrinsics/gen/textureDimensions/55b23e.wgsl
+++ b/test/intrinsics/gen/textureDimensions/55b23e.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_55b23e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.hlsl
index b595443..85b4ecf 100644
--- a/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<float4> arg_0 : register(u0, space1);
void textureDimensions_55b23e() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_55b23e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.spvasm
index 4899a5f..e1da323 100644
--- a/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.spvasm
@@ -1,22 +1,25 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_55b23e "textureDimensions_55b23e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -24,6 +27,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,33 +35,45 @@
%7 = OpTypeImage %float 1D 0 0 0 2 Rg32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_55b23e = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %int %14
- OpStore %res %12
+%textureDimensions_55b23e = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %int %18
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureDimensions_55b23e
+ %29 = OpFunctionCall %void %textureDimensions_55b23e
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureDimensions_55b23e
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_55b23e
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_55b23e
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_55b23e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.wgsl
index bb617fa..fecc1a3 100644
--- a/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_55b23e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/56ccfa.wgsl b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl
index 479a5c5..1c14f27 100644
--- a/test/intrinsics/gen/textureDimensions/56ccfa.wgsl
+++ b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_56ccfa();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.hlsl
index f6855fe..e90beec 100644
--- a/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<float4> arg_0 : register(t0, space1);
void textureDimensions_56ccfa() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_56ccfa();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.spvasm
index 0cc05de..2316a22 100644
--- a/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_56ccfa "textureDimensions_56ccfa"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %float 3D 0 0 0 2 Rgba16f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_56ccfa = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %18
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %v3int %15
- OpStore %res %12
+%textureDimensions_56ccfa = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %22
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v3int %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_56ccfa
+ %30 = OpFunctionCall %void %textureDimensions_56ccfa
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_56ccfa
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_56ccfa
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_56ccfa
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_56ccfa
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.wgsl
index caa5fca..4523c91 100644
--- a/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_56ccfa();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/579629.wgsl b/test/intrinsics/gen/textureDimensions/579629.wgsl
index 19fb810..f4192e5 100644
--- a/test/intrinsics/gen/textureDimensions/579629.wgsl
+++ b/test/intrinsics/gen/textureDimensions/579629.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_579629();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.hlsl
index 797af6b..a45f676 100644
--- a/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DMS<uint4> arg_0 : register(t0, space1);
void textureDimensions_579629() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_579629();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.spvasm
index 7de9341..0974546 100644
--- a/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_579629 "textureDimensions_579629"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %uint 2D 0 0 1 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %19 = OpConstantNull %v2int
+ %23 = OpConstantNull %v2int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_579629 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %19
- %16 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v2int %16
- OpStore %res %13
+%textureDimensions_579629 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %23
+ %20 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v2int %20
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_579629
+ %31 = OpFunctionCall %void %textureDimensions_579629
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_579629
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_579629
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_579629
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_579629
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.wgsl
index 2b6608f..3ee34a3 100644
--- a/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_579629();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/57da0b.wgsl b/test/intrinsics/gen/textureDimensions/57da0b.wgsl
index 7f4e08f..df96e95 100644
--- a/test/intrinsics/gen/textureDimensions/57da0b.wgsl
+++ b/test/intrinsics/gen/textureDimensions/57da0b.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_57da0b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.hlsl
index 3c8852b..f28db4a 100644
--- a/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<uint4> arg_0 : register(u0, space1);
void textureDimensions_57da0b() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_57da0b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.spvasm
index b619011..cec2ed3 100644
--- a/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_57da0b "textureDimensions_57da0b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,33 +35,45 @@
%7 = OpTypeImage %uint 1D 0 0 0 2 R32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %18 = OpConstantNull %int
+ %22 = OpConstantNull %int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_57da0b = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %int %15
- OpStore %res %13
+%textureDimensions_57da0b = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_57da0b
+ %30 = OpFunctionCall %void %textureDimensions_57da0b
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_57da0b
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_57da0b
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_57da0b
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_57da0b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.wgsl
index c28634f..485e888 100644
--- a/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_57da0b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/57e7b3.wgsl b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl
index 6b07538..e0f6c01 100644
--- a/test/intrinsics/gen/textureDimensions/57e7b3.wgsl
+++ b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_57e7b3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.hlsl
index bf491cb..649a074 100644
--- a/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<float4> arg_0 : register(t0, space1);
void textureDimensions_57e7b3() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_57e7b3();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.spvasm
index 501de7b..7e8fb3d 100644
--- a/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_57e7b3 "textureDimensions_57e7b3"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %float 3D 0 0 0 2 Rgba8Snorm
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_57e7b3 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %18
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %v3int %15
- OpStore %res %12
+%textureDimensions_57e7b3 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %22
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v3int %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_57e7b3
+ %30 = OpFunctionCall %void %textureDimensions_57e7b3
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_57e7b3
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_57e7b3
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_57e7b3
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_57e7b3
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.wgsl
index 2de1c5d..ef8e7a8 100644
--- a/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_57e7b3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/58a515.wgsl b/test/intrinsics/gen/textureDimensions/58a515.wgsl
index abe400b..d5c72b4 100644
--- a/test/intrinsics/gen/textureDimensions/58a515.wgsl
+++ b/test/intrinsics/gen/textureDimensions/58a515.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_58a515();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.hlsl
index dde543e..fd0bbea 100644
--- a/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<float4> arg_0 : register(u0, space1);
void textureDimensions_58a515() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_58a515();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.spvasm
index c0f19b4..85bea61 100644
--- a/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_58a515 "textureDimensions_58a515"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %20 = OpConstantNull %v2int
+ %24 = OpConstantNull %v2int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_58a515 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %12 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %12
+%textureDimensions_58a515 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %16 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_58a515
+ %32 = OpFunctionCall %void %textureDimensions_58a515
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_58a515
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_58a515
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_58a515
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_58a515
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.wgsl
index c909b43..238dcba 100644
--- a/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_58a515();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/5985f3.wgsl b/test/intrinsics/gen/textureDimensions/5985f3.wgsl
index 2b87708..88623f3 100644
--- a/test/intrinsics/gen/textureDimensions/5985f3.wgsl
+++ b/test/intrinsics/gen/textureDimensions/5985f3.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_5985f3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.hlsl
index 9bd1140..c6847f1 100644
--- a/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<int4> arg_0 : register(u0, space1);
void textureDimensions_5985f3() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_5985f3();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.spvasm
index fa73029..7f559e8 100644
--- a/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_5985f3 "textureDimensions_5985f3"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %20 = OpConstantNull %v2int
+ %24 = OpConstantNull %v2int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_5985f3 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %13 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %13
+%textureDimensions_5985f3 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %17 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_5985f3
+ %32 = OpFunctionCall %void %textureDimensions_5985f3
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_5985f3
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_5985f3
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_5985f3
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_5985f3
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.wgsl
index 28e8229..f8e2f8b 100644
--- a/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_5985f3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/5caa5e.wgsl b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl
index c907865..edfe960 100644
--- a/test/intrinsics/gen/textureDimensions/5caa5e.wgsl
+++ b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_5caa5e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.hlsl
index d250720..f4f6e3b 100644
--- a/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<uint4> arg_0 : register(u0, space1);
void textureDimensions_5caa5e() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_5caa5e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.spvasm
index 4890fee..9d43ef9 100644
--- a/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_5caa5e "textureDimensions_5caa5e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,33 +35,45 @@
%7 = OpTypeImage %uint 1D 0 0 0 2 Rgba32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %18 = OpConstantNull %int
+ %22 = OpConstantNull %int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_5caa5e = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %int %15
- OpStore %res %13
+%textureDimensions_5caa5e = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_5caa5e
+ %30 = OpFunctionCall %void %textureDimensions_5caa5e
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_5caa5e
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_5caa5e
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_5caa5e
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_5caa5e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.wgsl
index f1dfd35..23e4b36 100644
--- a/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_5caa5e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/5e295d.wgsl b/test/intrinsics/gen/textureDimensions/5e295d.wgsl
index be0e8ed..2bc018d 100644
--- a/test/intrinsics/gen/textureDimensions/5e295d.wgsl
+++ b/test/intrinsics/gen/textureDimensions/5e295d.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_5e295d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.hlsl
index 3123bda..e538f63 100644
--- a/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<uint4> arg_0 : register(u0, space1);
void textureDimensions_5e295d() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_5e295d();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.spvasm
index bb02735..c761434 100644
--- a/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_5e295d "textureDimensions_5e295d"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,36 +34,48 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %21 = OpConstantNull %v2int
+ %25 = OpConstantNull %v2int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_5e295d = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %21
- %18 = OpLoad %7 %arg_0
- %16 = OpImageQuerySize %v3int %18
- %13 = OpVectorShuffle %v2int %16 %16 0 1
- OpStore %res %13
+%textureDimensions_5e295d = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %25
+ %22 = OpLoad %7 %arg_0
+ %20 = OpImageQuerySize %v3int %22
+ %17 = OpVectorShuffle %v2int %20 %20 0 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureDimensions_5e295d
+ %33 = OpFunctionCall %void %textureDimensions_5e295d
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_5e295d
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_5e295d
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_5e295d
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_5e295d
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.wgsl
index 493103b..a5193f0 100644
--- a/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_5e295d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl
index 839f64a..7adf90e 100644
--- a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl
+++ b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_5ec4e1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.hlsl
index 4aa8f3e..5f11e27 100644
--- a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCube<uint4> arg_0 : register(t0, space1);
void textureDimensions_5ec4e1() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp.xyy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_5ec4e1();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.spvasm
index 2e4dbd2..354e77c 100644
--- a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 42
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_5ec4e1 "textureDimensions_5ec4e1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,37 +33,49 @@
%7 = OpTypeImage %uint Cube 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%v2int = OpTypeVector %int 2
%int_1 = OpConstant %int 1
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %22 = OpConstantNull %v3int
+ %26 = OpConstantNull %v3int
+ %27 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_5ec4e1 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %22
- %18 = OpLoad %7 %arg_0
- %16 = OpImageQuerySizeLod %v2int %18 %int_1
- %13 = OpVectorShuffle %v3int %16 %16 0 1 1
- OpStore %res %13
+%textureDimensions_5ec4e1 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %26
+ %22 = OpLoad %7 %arg_0
+ %20 = OpImageQuerySizeLod %v2int %22 %int_1
+ %17 = OpVectorShuffle %v3int %20 %20 0 1 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %24 = OpLabel
+%tint_symbol_2 = OpFunction %void None %27
+%tint_symbol = OpFunctionParameter %v4float
+ %30 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
OpStore %tint_pointsize %float_1
- %26 = OpFunctionCall %void %textureDimensions_5ec4e1
+ %34 = OpFunctionCall %void %textureDimensions_5ec4e1
+ %35 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_5ec4e1
+%fragment_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_5ec4e1
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_5ec4e1
+%compute_main = OpFunction %void None %13
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureDimensions_5ec4e1
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.wgsl
index b0aa472..e6ed80b 100644
--- a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_5ec4e1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/60bf54.wgsl b/test/intrinsics/gen/textureDimensions/60bf54.wgsl
index 5a1f3c4..72fae60 100644
--- a/test/intrinsics/gen/textureDimensions/60bf54.wgsl
+++ b/test/intrinsics/gen/textureDimensions/60bf54.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_60bf54();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.hlsl
index 34334ee..5038d47 100644
--- a/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<int4> arg_0 : register(u0, space1);
void textureDimensions_60bf54() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_60bf54();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.spvasm
index 8980759..fa2f410 100644
--- a/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_60bf54 "textureDimensions_60bf54"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,33 +35,45 @@
%7 = OpTypeImage %int 3D 0 0 0 2 Rg32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_60bf54 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v3int %15
- OpStore %res %13
+%textureDimensions_60bf54 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v3int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_60bf54
+ %30 = OpFunctionCall %void %textureDimensions_60bf54
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_60bf54
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_60bf54
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_60bf54
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_60bf54
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.wgsl
index f2dd194..54326c9 100644
--- a/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_60bf54();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/63f3cf.wgsl b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl
index 1a87d61..c0b0f26 100644
--- a/test/intrinsics/gen/textureDimensions/63f3cf.wgsl
+++ b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_63f3cf();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.hlsl
index fcfed00..a9de7f8 100644
--- a/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<float4> arg_0 : register(u0, space1);
void textureDimensions_63f3cf() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_63f3cf();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.spvasm
index 35ab54b..a4f9900 100644
--- a/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_63f3cf "textureDimensions_63f3cf"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %float 3D 0 0 0 2 Rg32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_63f3cf = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %18
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %v3int %15
- OpStore %res %12
+%textureDimensions_63f3cf = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %22
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v3int %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_63f3cf
+ %30 = OpFunctionCall %void %textureDimensions_63f3cf
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_63f3cf
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_63f3cf
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_63f3cf
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_63f3cf
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.wgsl
index b408be4..c77564f 100644
--- a/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_63f3cf();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/66dc4e.wgsl b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl
index 6fe3476..70bf9c2 100644
--- a/test/intrinsics/gen/textureDimensions/66dc4e.wgsl
+++ b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_66dc4e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.hlsl
index 0c86dc6..476c3f6 100644
--- a/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
void textureDimensions_66dc4e() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_66dc4e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.spvasm
index 63ab7f6..c47f34c 100644
--- a/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_66dc4e "textureDimensions_66dc4e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %20 = OpConstantNull %v2int
+ %24 = OpConstantNull %v2int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_66dc4e = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %12 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %12
+%textureDimensions_66dc4e = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %16 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_66dc4e
+ %32 = OpFunctionCall %void %textureDimensions_66dc4e
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_66dc4e
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_66dc4e
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_66dc4e
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_66dc4e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.wgsl
index 35b621a..8d5e3b5 100644
--- a/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_66dc4e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/670d90.wgsl b/test/intrinsics/gen/textureDimensions/670d90.wgsl
index 1893db1..a6bb16b 100644
--- a/test/intrinsics/gen/textureDimensions/670d90.wgsl
+++ b/test/intrinsics/gen/textureDimensions/670d90.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_670d90();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.hlsl
index 8da3ae1..0c7b7ce 100644
--- a/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<float4> arg_0 : register(t0, space1);
void textureDimensions_670d90() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_670d90();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.spvasm
index 09d9df8..acd52e6 100644
--- a/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_670d90 "textureDimensions_670d90"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %float 3D 0 0 0 2 Rg32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_670d90 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %18
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %v3int %15
- OpStore %res %12
+%textureDimensions_670d90 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %22
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v3int %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_670d90
+ %30 = OpFunctionCall %void %textureDimensions_670d90
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_670d90
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_670d90
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_670d90
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_670d90
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.wgsl
index 553906b..3f6a780 100644
--- a/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_670d90();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/68105c.wgsl b/test/intrinsics/gen/textureDimensions/68105c.wgsl
index 47040f3..ef0a866 100644
--- a/test/intrinsics/gen/textureDimensions/68105c.wgsl
+++ b/test/intrinsics/gen/textureDimensions/68105c.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_68105c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.hlsl
index 01c571d..47d4573 100644
--- a/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<uint4> arg_0 : register(u0, space1);
void textureDimensions_68105c() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_68105c();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.spvasm
index 2f3a801..3c80ade 100644
--- a/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_68105c "textureDimensions_68105c"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %uint 2D 0 0 0 2 Rgba32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %19 = OpConstantNull %v2int
+ %23 = OpConstantNull %v2int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_68105c = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %19
- %16 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v2int %16
- OpStore %res %13
+%textureDimensions_68105c = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %23
+ %20 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v2int %20
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_68105c
+ %31 = OpFunctionCall %void %textureDimensions_68105c
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_68105c
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_68105c
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_68105c
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_68105c
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.wgsl
index 979666e..dba95a2 100644
--- a/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_68105c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/6adac6.wgsl b/test/intrinsics/gen/textureDimensions/6adac6.wgsl
index 8ed6e68..55e1ef2 100644
--- a/test/intrinsics/gen/textureDimensions/6adac6.wgsl
+++ b/test/intrinsics/gen/textureDimensions/6adac6.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_6adac6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.hlsl
index 8e90341..4e00737 100644
--- a/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<int4> arg_0 : register(u0, space1);
void textureDimensions_6adac6() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_6adac6();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.spvasm
index 0030afd..322fa31 100644
--- a/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_6adac6 "textureDimensions_6adac6"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,32 +35,44 @@
%7 = OpTypeImage %int 1D 0 0 0 2 Rgba32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_6adac6 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %int %14
- OpStore %res %13
+%textureDimensions_6adac6 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %int %18
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureDimensions_6adac6
+ %29 = OpFunctionCall %void %textureDimensions_6adac6
+ %30 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureDimensions_6adac6
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_6adac6
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_6adac6
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_6adac6
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.wgsl
index ef544c7..2cf5d09 100644
--- a/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_6adac6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/6c08ab.wgsl b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl
index 6560c31..ba0e139 100644
--- a/test/intrinsics/gen/textureDimensions/6c08ab.wgsl
+++ b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_6c08ab();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.hlsl
index a4b0f25..f8e730c 100644
--- a/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<float4> arg_0 : register(t0, space1);
void textureDimensions_6c08ab() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_6c08ab();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.spvasm
index 4f28d72..9b6e762 100644
--- a/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_6c08ab "textureDimensions_6c08ab"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %float 1D 0 0 0 2 Rgba32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_6c08ab = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %int %14
- OpStore %res %12
+%textureDimensions_6c08ab = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %int %18
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureDimensions_6c08ab
+ %29 = OpFunctionCall %void %textureDimensions_6c08ab
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureDimensions_6c08ab
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_6c08ab
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_6c08ab
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_6c08ab
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.wgsl
index a43bd5d..739dd84 100644
--- a/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_6c08ab();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/6e2d12.wgsl b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl
index 5f143a0..2ae6f77 100644
--- a/test/intrinsics/gen/textureDimensions/6e2d12.wgsl
+++ b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_6e2d12();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.hlsl
index 68c8298..9d87135d 100644
--- a/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<int4> arg_0 : register(t0, space1);
void textureDimensions_6e2d12() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_6e2d12();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.spvasm
index 3be8eef..f2af0b5 100644
--- a/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_6e2d12 "textureDimensions_6e2d12"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,32 +35,44 @@
%7 = OpTypeImage %int 1D 0 0 0 2 Rgba8i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_6e2d12 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %int %14
- OpStore %res %13
+%textureDimensions_6e2d12 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %int %18
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureDimensions_6e2d12
+ %29 = OpFunctionCall %void %textureDimensions_6e2d12
+ %30 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureDimensions_6e2d12
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_6e2d12
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_6e2d12
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_6e2d12
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.wgsl
index c1496a7..10b273b 100644
--- a/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_6e2d12();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl
index a8f2f38..0ddda4f 100644
--- a/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl
+++ b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_6ec1b4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.hlsl
index f32020e..7bba929 100644
--- a/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<uint4> arg_0 : register(t0, space1);
void textureDimensions_6ec1b4() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_6ec1b4();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.spvasm
index 69bfc00..d9b8ac9 100644
--- a/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_6ec1b4 "textureDimensions_6ec1b4"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,47 @@
%7 = OpTypeImage %uint 3D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %20 = OpConstantNull %v3int
+ %24 = OpConstantNull %v3int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_6ec1b4 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %20
- %16 = OpLoad %7 %arg_0
- %13 = OpImageQuerySizeLod %v3int %16 %int_0
- OpStore %res %13
+%textureDimensions_6ec1b4 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %24
+ %20 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySizeLod %v3int %20 %int_0
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_6ec1b4
+ %32 = OpFunctionCall %void %textureDimensions_6ec1b4
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_6ec1b4
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_6ec1b4
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_6ec1b4
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_6ec1b4
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.wgsl
index 543e010..e89a7d1 100644
--- a/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_6ec1b4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/6f0d79.wgsl b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl
index 81d1dd7..59681b2 100644
--- a/test/intrinsics/gen/textureDimensions/6f0d79.wgsl
+++ b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_6f0d79();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.hlsl
index f64072d..060565b 100644
--- a/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<float4> arg_0 : register(u0, space1);
void textureDimensions_6f0d79() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_6f0d79();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.spvasm
index 207ca7b..c82c664 100644
--- a/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_6f0d79 "textureDimensions_6f0d79"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %20 = OpConstantNull %v2int
+ %24 = OpConstantNull %v2int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_6f0d79 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %12 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %12
+%textureDimensions_6f0d79 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %16 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_6f0d79
+ %32 = OpFunctionCall %void %textureDimensions_6f0d79
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_6f0d79
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_6f0d79
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_6f0d79
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_6f0d79
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.wgsl
index 77931a9..624277c 100644
--- a/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_6f0d79();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/702c53.wgsl b/test/intrinsics/gen/textureDimensions/702c53.wgsl
index ab009e8..b0b6dbb 100644
--- a/test/intrinsics/gen/textureDimensions/702c53.wgsl
+++ b/test/intrinsics/gen/textureDimensions/702c53.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_702c53();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.hlsl
index 3900595..c322459 100644
--- a/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<float4> arg_0 : register(u0, space1);
void textureDimensions_702c53() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_702c53();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.spvasm
index 2054bf8..d1d4436 100644
--- a/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_702c53 "textureDimensions_702c53"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %float 2D 0 0 0 2 Rgba8
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_702c53 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %18
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %v2int %15
- OpStore %res %12
+%textureDimensions_702c53 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v2int %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_702c53
+ %30 = OpFunctionCall %void %textureDimensions_702c53
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_702c53
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_702c53
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_702c53
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_702c53
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.wgsl
index 79bc870..c303a34 100644
--- a/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_702c53();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/70e26a.wgsl b/test/intrinsics/gen/textureDimensions/70e26a.wgsl
index c513572..ae6e85a 100644
--- a/test/intrinsics/gen/textureDimensions/70e26a.wgsl
+++ b/test/intrinsics/gen/textureDimensions/70e26a.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_70e26a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.hlsl
index 80e8478..509cbe6 100644
--- a/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<uint4> arg_0 : register(t0, space1);
void textureDimensions_70e26a() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_70e26a();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.spvasm
index 93669b5..b729123 100644
--- a/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_70e26a "textureDimensions_70e26a"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,33 +35,45 @@
%7 = OpTypeImage %uint 1D 0 0 0 2 R32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %18 = OpConstantNull %int
+ %22 = OpConstantNull %int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_70e26a = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %int %15
- OpStore %res %13
+%textureDimensions_70e26a = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_70e26a
+ %30 = OpFunctionCall %void %textureDimensions_70e26a
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_70e26a
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_70e26a
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_70e26a
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_70e26a
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.wgsl
index 5fa2f99..975437a 100644
--- a/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_70e26a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/71e8f7.wgsl b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl
index 5c3f959..bd1f976 100644
--- a/test/intrinsics/gen/textureDimensions/71e8f7.wgsl
+++ b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_71e8f7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.hlsl
index 27bb78a..a1121b7 100644
--- a/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<uint4> arg_0 : register(t0, space1);
void textureDimensions_71e8f7() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_71e8f7();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.spvasm
index 659fd98..5655892 100644
--- a/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_71e8f7 "textureDimensions_71e8f7"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %uint 2D 0 0 0 2 R32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %19 = OpConstantNull %v2int
+ %23 = OpConstantNull %v2int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_71e8f7 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %19
- %16 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v2int %16
- OpStore %res %13
+%textureDimensions_71e8f7 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %23
+ %20 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v2int %20
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_71e8f7
+ %31 = OpFunctionCall %void %textureDimensions_71e8f7
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_71e8f7
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_71e8f7
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_71e8f7
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_71e8f7
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.wgsl
index a78950c..3380b0e 100644
--- a/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_71e8f7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/72e5d6.wgsl b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl
index 33045e7..89e61d8 100644
--- a/test/intrinsics/gen/textureDimensions/72e5d6.wgsl
+++ b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_72e5d6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.hlsl
index f7a5391..85ff2aa 100644
--- a/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray arg_0 : register(t0, space1);
void textureDimensions_72e5d6() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_72e5d6();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.spvasm
index 09ce4e7..91db5ac 100644
--- a/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_72e5d6 "textureDimensions_72e5d6"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,37 +32,49 @@
%7 = OpTypeImage %float 2D 1 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%int_1 = OpConstant %int 1
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %21 = OpConstantNull %v2int
+ %25 = OpConstantNull %v2int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_72e5d6 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %21
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySizeLod %v3int %17 %int_1
- %12 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %12
+%textureDimensions_72e5d6 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %25
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySizeLod %v3int %21 %int_1
+ %16 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureDimensions_72e5d6
+ %33 = OpFunctionCall %void %textureDimensions_72e5d6
+ %34 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_72e5d6
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_72e5d6
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_72e5d6
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_72e5d6
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.wgsl
index d81fb59..1a2db86 100644
--- a/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_72e5d6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/75be9d.wgsl b/test/intrinsics/gen/textureDimensions/75be9d.wgsl
index e3135e0..d524f81 100644
--- a/test/intrinsics/gen/textureDimensions/75be9d.wgsl
+++ b/test/intrinsics/gen/textureDimensions/75be9d.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_75be9d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.hlsl
index 4847eda..4518519 100644
--- a/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCube<float4> arg_0 : register(t0, space1);
void textureDimensions_75be9d() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp.xyy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_75be9d();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.spvasm
index 85976e7..b8bad8f 100644
--- a/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_75be9d "textureDimensions_75be9d"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,37 +32,49 @@
%7 = OpTypeImage %float Cube 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%v2int = OpTypeVector %int 2
%int_1 = OpConstant %int 1
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %21 = OpConstantNull %v3int
+ %25 = OpConstantNull %v3int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_75be9d = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %21
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySizeLod %v2int %17 %int_1
- %12 = OpVectorShuffle %v3int %15 %15 0 1 1
- OpStore %res %12
+%textureDimensions_75be9d = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %25
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySizeLod %v2int %21 %int_1
+ %16 = OpVectorShuffle %v3int %19 %19 0 1 1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureDimensions_75be9d
+ %33 = OpFunctionCall %void %textureDimensions_75be9d
+ %34 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_75be9d
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_75be9d
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_75be9d
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_75be9d
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.wgsl
index 65e0b26..fa3ebce 100644
--- a/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_75be9d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/76e722.wgsl b/test/intrinsics/gen/textureDimensions/76e722.wgsl
index 641a922..3c1754b 100644
--- a/test/intrinsics/gen/textureDimensions/76e722.wgsl
+++ b/test/intrinsics/gen/textureDimensions/76e722.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_76e722();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.hlsl
index f8e330d..23371c9 100644
--- a/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCube arg_0 : register(t0, space1);
void textureDimensions_76e722() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp.xyy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_76e722();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.spvasm
index 2f5aadd..153c14b 100644
--- a/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_76e722 "textureDimensions_76e722"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,37 +32,49 @@
%7 = OpTypeImage %float Cube 1 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%v2int = OpTypeVector %int 2
%int_0 = OpConstant %int 0
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %21 = OpConstantNull %v3int
+ %25 = OpConstantNull %v3int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_76e722 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %21
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySizeLod %v2int %17 %int_0
- %12 = OpVectorShuffle %v3int %15 %15 0 1 1
- OpStore %res %12
+%textureDimensions_76e722 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %25
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySizeLod %v2int %21 %int_0
+ %16 = OpVectorShuffle %v3int %19 %19 0 1 1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureDimensions_76e722
+ %33 = OpFunctionCall %void %textureDimensions_76e722
+ %34 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_76e722
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_76e722
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_76e722
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_76e722
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.wgsl
index e69e66f..3f69e91 100644
--- a/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_76e722();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/770103.wgsl b/test/intrinsics/gen/textureDimensions/770103.wgsl
index bf9e0d9..326eb5f 100644
--- a/test/intrinsics/gen/textureDimensions/770103.wgsl
+++ b/test/intrinsics/gen/textureDimensions/770103.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_770103();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.hlsl
index 70cf96c..69fdd99 100644
--- a/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<float4> arg_0 : register(t0, space1);
void textureDimensions_770103() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_770103();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.spvasm
index 0847108..2bce881 100644
--- a/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_770103 "textureDimensions_770103"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %float 3D 0 0 0 2 R32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_770103 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %18
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %v3int %15
- OpStore %res %12
+%textureDimensions_770103 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %22
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v3int %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_770103
+ %30 = OpFunctionCall %void %textureDimensions_770103
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_770103
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_770103
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_770103
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_770103
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.wgsl
index 9e79ca4..b8ac441 100644
--- a/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_770103();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/7bb707.wgsl b/test/intrinsics/gen/textureDimensions/7bb707.wgsl
index 3b5d490..468b838 100644
--- a/test/intrinsics/gen/textureDimensions/7bb707.wgsl
+++ b/test/intrinsics/gen/textureDimensions/7bb707.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_7bb707();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.hlsl
index 9c245c2..ff67876 100644
--- a/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCube<int4> arg_0 : register(t0, space1);
void textureDimensions_7bb707() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp.xyy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_7bb707();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.spvasm
index 993f04a..d810420 100644
--- a/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_7bb707 "textureDimensions_7bb707"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %int Cube 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%v2int = OpTypeVector %int 2
%int_1 = OpConstant %int 1
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %21 = OpConstantNull %v3int
+ %25 = OpConstantNull %v3int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_7bb707 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %21
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySizeLod %v2int %17 %int_1
- %13 = OpVectorShuffle %v3int %15 %15 0 1 1
- OpStore %res %13
+%textureDimensions_7bb707 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %25
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySizeLod %v2int %21 %int_1
+ %17 = OpVectorShuffle %v3int %19 %19 0 1 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureDimensions_7bb707
+ %33 = OpFunctionCall %void %textureDimensions_7bb707
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_7bb707
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_7bb707
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_7bb707
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_7bb707
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.wgsl
index 0042867..ed56d4e 100644
--- a/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_7bb707();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/7bf826.wgsl b/test/intrinsics/gen/textureDimensions/7bf826.wgsl
index d8c9051..9d62d48 100644
--- a/test/intrinsics/gen/textureDimensions/7bf826.wgsl
+++ b/test/intrinsics/gen/textureDimensions/7bf826.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_7bf826();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.hlsl
index 50ced2c..cd4a7f5 100644
--- a/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray arg_0 : register(t0, space1);
void textureDimensions_7bf826() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_7bf826();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.spvasm
index e898a26..f4e79cb 100644
--- a/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_7bf826 "textureDimensions_7bf826"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,37 +32,49 @@
%7 = OpTypeImage %float 2D 1 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %21 = OpConstantNull %v2int
+ %25 = OpConstantNull %v2int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_7bf826 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %21
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySizeLod %v3int %17 %int_0
- %12 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %12
+%textureDimensions_7bf826 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %25
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySizeLod %v3int %21 %int_0
+ %16 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureDimensions_7bf826
+ %33 = OpFunctionCall %void %textureDimensions_7bf826
+ %34 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_7bf826
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_7bf826
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_7bf826
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_7bf826
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.wgsl
index 112470d..ce97c6b 100644
--- a/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_7bf826();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl
index 0f76288..6ddf461 100644
--- a/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl
+++ b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_7f5c2e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.hlsl
index a5c971c..e52ce55 100644
--- a/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<int4> arg_0 : register(u0, space1);
void textureDimensions_7f5c2e() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_7f5c2e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.spvasm
index ea3ec8c..b5079a3 100644
--- a/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_7f5c2e "textureDimensions_7f5c2e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,33 +35,45 @@
%7 = OpTypeImage %int 2D 0 0 0 2 Rg32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_7f5c2e = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v2int %15
- OpStore %res %13
+%textureDimensions_7f5c2e = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v2int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_7f5c2e
+ %30 = OpFunctionCall %void %textureDimensions_7f5c2e
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_7f5c2e
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_7f5c2e
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_7f5c2e
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_7f5c2e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.wgsl
index 3295f78..6fedeb1 100644
--- a/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_7f5c2e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/8028f3.wgsl b/test/intrinsics/gen/textureDimensions/8028f3.wgsl
index b6a6b4b..c4ccf01 100644
--- a/test/intrinsics/gen/textureDimensions/8028f3.wgsl
+++ b/test/intrinsics/gen/textureDimensions/8028f3.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_8028f3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.hlsl
index bd8d496..04a45e6 100644
--- a/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<float4> arg_0 : register(u0, space1);
void textureDimensions_8028f3() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_8028f3();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.spvasm
index 8eedc4b..37cba25 100644
--- a/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_8028f3 "textureDimensions_8028f3"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %float 3D 0 0 0 2 R32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_8028f3 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %18
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %v3int %15
- OpStore %res %12
+%textureDimensions_8028f3 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %22
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v3int %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_8028f3
+ %30 = OpFunctionCall %void %textureDimensions_8028f3
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_8028f3
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_8028f3
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_8028f3
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_8028f3
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.wgsl
index 75cf9c5..a8552be 100644
--- a/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_8028f3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/811679.wgsl b/test/intrinsics/gen/textureDimensions/811679.wgsl
index 184ac8f..f451436 100644
--- a/test/intrinsics/gen/textureDimensions/811679.wgsl
+++ b/test/intrinsics/gen/textureDimensions/811679.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_811679();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.hlsl
index b01fc27..566b02c 100644
--- a/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<uint4> arg_0 : register(u0, space1);
void textureDimensions_811679() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_811679();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.spvasm
index 235e2f9..0cd8381 100644
--- a/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_811679 "textureDimensions_811679"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %uint 3D 0 0 0 2 Rgba32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %19 = OpConstantNull %v3int
+ %23 = OpConstantNull %v3int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_811679 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %19
- %16 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v3int %16
- OpStore %res %13
+%textureDimensions_811679 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %23
+ %20 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v3int %20
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_811679
+ %31 = OpFunctionCall %void %textureDimensions_811679
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_811679
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_811679
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_811679
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_811679
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.wgsl
index 20d46b4..3912edc 100644
--- a/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_811679();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/820596.wgsl b/test/intrinsics/gen/textureDimensions/820596.wgsl
index e4fbff7..7b3229c 100644
--- a/test/intrinsics/gen/textureDimensions/820596.wgsl
+++ b/test/intrinsics/gen/textureDimensions/820596.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_820596();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.hlsl
index 0130c6e..82362a9 100644
--- a/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<uint4> arg_0 : register(u0, space1);
void textureDimensions_820596() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_820596();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.spvasm
index cfa018e..698abd1 100644
--- a/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_820596 "textureDimensions_820596"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,34 +35,46 @@
%7 = OpTypeImage %uint 3D 0 0 0 2 Rg32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %19 = OpConstantNull %v3int
+ %23 = OpConstantNull %v3int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_820596 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %19
- %16 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v3int %16
- OpStore %res %13
+%textureDimensions_820596 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %23
+ %20 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v3int %20
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_820596
+ %31 = OpFunctionCall %void %textureDimensions_820596
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_820596
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_820596
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_820596
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_820596
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.wgsl
index 82ef750..3372df2 100644
--- a/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_820596();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/82138e.wgsl b/test/intrinsics/gen/textureDimensions/82138e.wgsl
index adc59d2..240ff9a 100644
--- a/test/intrinsics/gen/textureDimensions/82138e.wgsl
+++ b/test/intrinsics/gen/textureDimensions/82138e.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_82138e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.hlsl
index 2f824cf..cd6085f 100644
--- a/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<uint4> arg_0 : register(t0, space1);
void textureDimensions_82138e() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_82138e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.spvasm
index 22715d5..5f80c26 100644
--- a/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_82138e "textureDimensions_82138e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %uint 2D 0 0 0 2 Rgba16ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %19 = OpConstantNull %v2int
+ %23 = OpConstantNull %v2int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_82138e = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %19
- %16 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v2int %16
- OpStore %res %13
+%textureDimensions_82138e = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %23
+ %20 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v2int %20
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_82138e
+ %31 = OpFunctionCall %void %textureDimensions_82138e
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_82138e
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_82138e
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_82138e
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_82138e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.wgsl
index 7e21445..7b8a309 100644
--- a/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_82138e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/8347ab.wgsl b/test/intrinsics/gen/textureDimensions/8347ab.wgsl
index 80ade64..ab9516f 100644
--- a/test/intrinsics/gen/textureDimensions/8347ab.wgsl
+++ b/test/intrinsics/gen/textureDimensions/8347ab.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_8347ab();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.hlsl
index eb82bb9..764a3be 100644
--- a/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<float4> arg_0 : register(t0, space1);
void textureDimensions_8347ab() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_8347ab();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.spvasm
index 63f5a4a..307182e 100644
--- a/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_8347ab "textureDimensions_8347ab"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %float 1D 0 0 0 2 Rgba8Snorm
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_8347ab = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %int %14
- OpStore %res %12
+%textureDimensions_8347ab = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %int %18
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureDimensions_8347ab
+ %29 = OpFunctionCall %void %textureDimensions_8347ab
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureDimensions_8347ab
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_8347ab
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_8347ab
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_8347ab
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.wgsl
index 2ad5bcb..b87625c 100644
--- a/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_8347ab();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/83ee5a.wgsl b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl
index b275c0b..cbd1466 100644
--- a/test/intrinsics/gen/textureDimensions/83ee5a.wgsl
+++ b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_83ee5a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.hlsl
index e4628b8..2d5bed0 100644
--- a/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<int4> arg_0 : register(u0, space1);
void textureDimensions_83ee5a() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_83ee5a();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.spvasm
index 46d81e1..818a993 100644
--- a/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_83ee5a "textureDimensions_83ee5a"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %int 2D 0 0 0 2 Rgba32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_83ee5a = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v2int %15
- OpStore %res %13
+%textureDimensions_83ee5a = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v2int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_83ee5a
+ %30 = OpFunctionCall %void %textureDimensions_83ee5a
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_83ee5a
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_83ee5a
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_83ee5a
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_83ee5a
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.wgsl
index c65be39..ac6d124 100644
--- a/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_83ee5a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/85d556.wgsl b/test/intrinsics/gen/textureDimensions/85d556.wgsl
index d9e829b..17c9db6 100644
--- a/test/intrinsics/gen/textureDimensions/85d556.wgsl
+++ b/test/intrinsics/gen/textureDimensions/85d556.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_85d556();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.hlsl
index ce3a43c..e028f7c 100644
--- a/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
void textureDimensions_85d556() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_85d556();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.spvasm
index ed97d5a..101c258 100644
--- a/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_85d556 "textureDimensions_85d556"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,37 +32,49 @@
%7 = OpTypeImage %float 2D 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%int_1 = OpConstant %int 1
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %21 = OpConstantNull %v2int
+ %25 = OpConstantNull %v2int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_85d556 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %21
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySizeLod %v3int %17 %int_1
- %12 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %12
+%textureDimensions_85d556 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %25
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySizeLod %v3int %21 %int_1
+ %16 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureDimensions_85d556
+ %33 = OpFunctionCall %void %textureDimensions_85d556
+ %34 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_85d556
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_85d556
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_85d556
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_85d556
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.wgsl
index d0074ca..673179f 100644
--- a/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_85d556();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/8799ee.wgsl b/test/intrinsics/gen/textureDimensions/8799ee.wgsl
index 72469f3..ab9e824 100644
--- a/test/intrinsics/gen/textureDimensions/8799ee.wgsl
+++ b/test/intrinsics/gen/textureDimensions/8799ee.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_8799ee();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.hlsl
index 149cef7..ee449f0 100644
--- a/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<int4> arg_0 : register(t0, space1);
void textureDimensions_8799ee() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_8799ee();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.spvasm
index 5d3e426..d00e641 100644
--- a/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_8799ee "textureDimensions_8799ee"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %int 3D 0 0 0 2 Rgba32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_8799ee = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v3int %15
- OpStore %res %13
+%textureDimensions_8799ee = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v3int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_8799ee
+ %30 = OpFunctionCall %void %textureDimensions_8799ee
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_8799ee
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_8799ee
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_8799ee
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_8799ee
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.wgsl
index 490113a..82f35a8 100644
--- a/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_8799ee();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/89a864.wgsl b/test/intrinsics/gen/textureDimensions/89a864.wgsl
index 778784c..5098dcf 100644
--- a/test/intrinsics/gen/textureDimensions/89a864.wgsl
+++ b/test/intrinsics/gen/textureDimensions/89a864.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_89a864();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.hlsl
index 77eda67..1b6ca0a 100644
--- a/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<float4> arg_0 : register(t0, space1);
void textureDimensions_89a864() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_89a864();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.spvasm
index 5d4534e..21c9a1f 100644
--- a/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_89a864 "textureDimensions_89a864"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %float 2D 0 0 0 2 Rgba16f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_89a864 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %18
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %v2int %15
- OpStore %res %12
+%textureDimensions_89a864 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v2int %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_89a864
+ %30 = OpFunctionCall %void %textureDimensions_89a864
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_89a864
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_89a864
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_89a864
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_89a864
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.wgsl
index d1c46be..b8e4b8c 100644
--- a/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_89a864();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl
index ac87df5..66f85c5 100644
--- a/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl
+++ b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_8aa4c4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.hlsl
index 609c45d..de03454 100644
--- a/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<float4> arg_0 : register(t0, space1);
void textureDimensions_8aa4c4() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_8aa4c4();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.spvasm
index 232ff24..109a999 100644
--- a/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_8aa4c4 "textureDimensions_8aa4c4"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,35 +32,47 @@
%7 = OpTypeImage %float 3D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %19 = OpConstantNull %v3int
+ %23 = OpConstantNull %v3int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_8aa4c4 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %19
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySizeLod %v3int %15 %int_0
- OpStore %res %12
+%textureDimensions_8aa4c4 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %23
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySizeLod %v3int %19 %int_0
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_8aa4c4
+ %31 = OpFunctionCall %void %textureDimensions_8aa4c4
+ %32 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_8aa4c4
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_8aa4c4
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_8aa4c4
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_8aa4c4
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.wgsl
index cbf79d1..aefbeb2 100644
--- a/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_8aa4c4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/8b4fff.wgsl b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl
index 7eb8bd5..1d28464 100644
--- a/test/intrinsics/gen/textureDimensions/8b4fff.wgsl
+++ b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_8b4fff();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.hlsl
index ac00230..548895b 100644
--- a/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<int4> arg_0 : register(t0, space1);
void textureDimensions_8b4fff() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_8b4fff();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.spvasm
index 6692c0f..d8b1432 100644
--- a/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_8b4fff "textureDimensions_8b4fff"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %int 2D 0 0 0 2 Rgba32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_8b4fff = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v2int %15
- OpStore %res %13
+%textureDimensions_8b4fff = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v2int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_8b4fff
+ %30 = OpFunctionCall %void %textureDimensions_8b4fff
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_8b4fff
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_8b4fff
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_8b4fff
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_8b4fff
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.wgsl
index ee0d0f6..5869ada 100644
--- a/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_8b4fff();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/8d89f8.wgsl b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl
index e57c3b3..d50e163 100644
--- a/test/intrinsics/gen/textureDimensions/8d89f8.wgsl
+++ b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_8d89f8();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.hlsl
index ac6eff3..b6af49c 100644
--- a/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<int4> arg_0 : register(t0, space1);
void textureDimensions_8d89f8() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_8d89f8();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.spvasm
index 69e2f9e..a8c50bc 100644
--- a/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_8d89f8 "textureDimensions_8d89f8"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,32 +35,44 @@
%7 = OpTypeImage %int 1D 0 0 0 2 R32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_8d89f8 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %int %14
- OpStore %res %13
+%textureDimensions_8d89f8 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %int %18
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureDimensions_8d89f8
+ %29 = OpFunctionCall %void %textureDimensions_8d89f8
+ %30 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureDimensions_8d89f8
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_8d89f8
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_8d89f8
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_8d89f8
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.wgsl
index af68992..4e4b06f 100644
--- a/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_8d89f8();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/8deb5e.wgsl b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl
index 6fdb2d4..1d9ae227 100644
--- a/test/intrinsics/gen/textureDimensions/8deb5e.wgsl
+++ b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_8deb5e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.hlsl
index c4107a4..fc59c20 100644
--- a/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<int4> arg_0 : register(t0, space1);
void textureDimensions_8deb5e() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_8deb5e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.spvasm
index d30a104..ca9d65b 100644
--- a/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_8deb5e "textureDimensions_8deb5e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %int 3D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %19 = OpConstantNull %v3int
+ %23 = OpConstantNull %v3int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_8deb5e = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %19
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySizeLod %v3int %15 %int_0
- OpStore %res %13
+%textureDimensions_8deb5e = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %23
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySizeLod %v3int %19 %int_0
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_8deb5e
+ %31 = OpFunctionCall %void %textureDimensions_8deb5e
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_8deb5e
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_8deb5e
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_8deb5e
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_8deb5e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.wgsl
index 4974865..8fdfbed 100644
--- a/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_8deb5e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/8fca0f.wgsl b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl
index bc6e1fa..3565528 100644
--- a/test/intrinsics/gen/textureDimensions/8fca0f.wgsl
+++ b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_8fca0f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.hlsl
index 8214607..dbacbfd 100644
--- a/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<float4> arg_0 : register(u0, space1);
void textureDimensions_8fca0f() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_8fca0f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.spvasm
index 8429e41..3c2dc1f 100644
--- a/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_8fca0f "textureDimensions_8fca0f"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %float 3D 0 0 0 2 Rgba32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_8fca0f = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %18
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %v3int %15
- OpStore %res %12
+%textureDimensions_8fca0f = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %22
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v3int %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_8fca0f
+ %30 = OpFunctionCall %void %textureDimensions_8fca0f
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_8fca0f
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_8fca0f
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_8fca0f
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_8fca0f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.wgsl
index b901463..bb7611f 100644
--- a/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_8fca0f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/9042ab.wgsl b/test/intrinsics/gen/textureDimensions/9042ab.wgsl
index 9c96fb8..251982f 100644
--- a/test/intrinsics/gen/textureDimensions/9042ab.wgsl
+++ b/test/intrinsics/gen/textureDimensions/9042ab.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_9042ab();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.hlsl
index a3b30b6..282b6bc 100644
--- a/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<uint4> arg_0 : register(u0, space1);
void textureDimensions_9042ab() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_9042ab();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.spvasm
index 62cae56..13fd167 100644
--- a/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_9042ab "textureDimensions_9042ab"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,36 +35,48 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %21 = OpConstantNull %v2int
+ %25 = OpConstantNull %v2int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_9042ab = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %21
- %18 = OpLoad %7 %arg_0
- %16 = OpImageQuerySize %v3int %18
- %13 = OpVectorShuffle %v2int %16 %16 0 1
- OpStore %res %13
+%textureDimensions_9042ab = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %25
+ %22 = OpLoad %7 %arg_0
+ %20 = OpImageQuerySize %v3int %22
+ %17 = OpVectorShuffle %v2int %20 %20 0 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureDimensions_9042ab
+ %33 = OpFunctionCall %void %textureDimensions_9042ab
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_9042ab
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_9042ab
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_9042ab
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_9042ab
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.wgsl
index b7936ee..e508ed0 100644
--- a/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_9042ab();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/91f42d.wgsl b/test/intrinsics/gen/textureDimensions/91f42d.wgsl
index d0da65c..87276b7 100644
--- a/test/intrinsics/gen/textureDimensions/91f42d.wgsl
+++ b/test/intrinsics/gen/textureDimensions/91f42d.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_91f42d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.hlsl
index 507282e..6466284 100644
--- a/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCubeArray<uint4> arg_0 : register(t0, space1);
void textureDimensions_91f42d() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp.xyy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_91f42d();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.spvasm
index 02e408d..d419675 100644
--- a/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.spvasm
@@ -1,27 +1,31 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability SampledCubeArray
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_91f42d "textureDimensions_91f42d"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,36 +34,48 @@
%7 = OpTypeImage %uint Cube 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_1 = OpConstant %int 1
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %21 = OpConstantNull %v3int
+ %25 = OpConstantNull %v3int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_91f42d = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %21
- %17 = OpLoad %7 %arg_0
- %16 = OpImageQuerySizeLod %v3int %17 %int_1
- %13 = OpVectorShuffle %v3int %16 %16 0 1 1
- OpStore %res %13
+%textureDimensions_91f42d = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %25
+ %21 = OpLoad %7 %arg_0
+ %20 = OpImageQuerySizeLod %v3int %21 %int_1
+ %17 = OpVectorShuffle %v3int %20 %20 0 1 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureDimensions_91f42d
+ %33 = OpFunctionCall %void %textureDimensions_91f42d
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_91f42d
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_91f42d
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_91f42d
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_91f42d
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.wgsl
index 2fbb191..a326415 100644
--- a/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_91f42d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/924742.wgsl b/test/intrinsics/gen/textureDimensions/924742.wgsl
index 8866e2d..785db05 100644
--- a/test/intrinsics/gen/textureDimensions/924742.wgsl
+++ b/test/intrinsics/gen/textureDimensions/924742.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_924742();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.hlsl
index 9485df7..d37de9d 100644
--- a/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<uint4> arg_0 : register(t0, space1);
void textureDimensions_924742() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_924742();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.spvasm
index cd49cac..5e4c2d2 100644
--- a/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_924742 "textureDimensions_924742"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,34 +35,46 @@
%7 = OpTypeImage %uint 3D 0 0 0 2 Rg32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %19 = OpConstantNull %v3int
+ %23 = OpConstantNull %v3int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_924742 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %19
- %16 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v3int %16
- OpStore %res %13
+%textureDimensions_924742 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %23
+ %20 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v3int %20
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_924742
+ %31 = OpFunctionCall %void %textureDimensions_924742
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_924742
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_924742
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_924742
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_924742
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.wgsl
index f497afa..0126b0e 100644
--- a/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_924742();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/92ad20.wgsl b/test/intrinsics/gen/textureDimensions/92ad20.wgsl
index c2f758f..b3aa5eb 100644
--- a/test/intrinsics/gen/textureDimensions/92ad20.wgsl
+++ b/test/intrinsics/gen/textureDimensions/92ad20.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_92ad20();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.hlsl
index 847c0c8..13de281 100644
--- a/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<uint4> arg_0 : register(t0, space1);
void textureDimensions_92ad20() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_92ad20();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.spvasm
index 7bfccd3..a60d51c 100644
--- a/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_92ad20 "textureDimensions_92ad20"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %uint 3D 0 0 0 2 Rgba8ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %19 = OpConstantNull %v3int
+ %23 = OpConstantNull %v3int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_92ad20 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %19
- %16 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v3int %16
- OpStore %res %13
+%textureDimensions_92ad20 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %23
+ %20 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v3int %20
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_92ad20
+ %31 = OpFunctionCall %void %textureDimensions_92ad20
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_92ad20
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_92ad20
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_92ad20
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_92ad20
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.wgsl
index f66e8a8..bb455ff 100644
--- a/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_92ad20();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/939fdb.wgsl b/test/intrinsics/gen/textureDimensions/939fdb.wgsl
index 1c92cde..37a80b1 100644
--- a/test/intrinsics/gen/textureDimensions/939fdb.wgsl
+++ b/test/intrinsics/gen/textureDimensions/939fdb.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_939fdb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.hlsl
index 66e5086..38786a8 100644
--- a/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D arg_0 : register(t0, space1);
void textureDimensions_939fdb() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_939fdb();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.spvasm
index a219560..2c0fc51 100644
--- a/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_939fdb "textureDimensions_939fdb"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,35 +32,47 @@
%7 = OpTypeImage %float 2D 1 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%int_0 = OpConstant %int 0
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %19 = OpConstantNull %v2int
+ %23 = OpConstantNull %v2int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_939fdb = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %19
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySizeLod %v2int %15 %int_0
- OpStore %res %12
+%textureDimensions_939fdb = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %23
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySizeLod %v2int %19 %int_0
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_939fdb
+ %31 = OpFunctionCall %void %textureDimensions_939fdb
+ %32 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_939fdb
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_939fdb
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_939fdb
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_939fdb
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.wgsl
index afb11df..98e8e49 100644
--- a/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_939fdb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/9572e5.wgsl b/test/intrinsics/gen/textureDimensions/9572e5.wgsl
index 17c6b56..a0450f5 100644
--- a/test/intrinsics/gen/textureDimensions/9572e5.wgsl
+++ b/test/intrinsics/gen/textureDimensions/9572e5.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_9572e5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.hlsl
index 3e53391..0e529a0 100644
--- a/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<float4> arg_0 : register(t0, space1);
void textureDimensions_9572e5() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_9572e5();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.spvasm
index 6b65e7c..bab2499 100644
--- a/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_9572e5 "textureDimensions_9572e5"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %float 3D 0 0 0 2 Rgba8
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_9572e5 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %18
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %v3int %15
- OpStore %res %12
+%textureDimensions_9572e5 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %22
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v3int %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_9572e5
+ %30 = OpFunctionCall %void %textureDimensions_9572e5
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_9572e5
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_9572e5
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_9572e5
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_9572e5
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.wgsl
index 2c75848..96d00a5 100644
--- a/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_9572e5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/998f6b.wgsl b/test/intrinsics/gen/textureDimensions/998f6b.wgsl
index 3fb8e60..f862bb7 100644
--- a/test/intrinsics/gen/textureDimensions/998f6b.wgsl
+++ b/test/intrinsics/gen/textureDimensions/998f6b.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_998f6b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.hlsl
index 27f1091..3d3813e 100644
--- a/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<uint4> arg_0 : register(t0, space1);
void textureDimensions_998f6b() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_998f6b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.spvasm
index 0a970f2..280d5db 100644
--- a/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_998f6b "textureDimensions_998f6b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,36 +34,48 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %21 = OpConstantNull %v2int
+ %25 = OpConstantNull %v2int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_998f6b = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %21
- %18 = OpLoad %7 %arg_0
- %16 = OpImageQuerySize %v3int %18
- %13 = OpVectorShuffle %v2int %16 %16 0 1
- OpStore %res %13
+%textureDimensions_998f6b = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %25
+ %22 = OpLoad %7 %arg_0
+ %20 = OpImageQuerySize %v3int %22
+ %17 = OpVectorShuffle %v2int %20 %20 0 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureDimensions_998f6b
+ %33 = OpFunctionCall %void %textureDimensions_998f6b
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_998f6b
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_998f6b
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_998f6b
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_998f6b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.wgsl
index e299aa9..ab83144 100644
--- a/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_998f6b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/9abfe5.wgsl b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl
index 54066f9..f902ec5 100644
--- a/test/intrinsics/gen/textureDimensions/9abfe5.wgsl
+++ b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_9abfe5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.hlsl
index 753587a..eafa206 100644
--- a/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<float4> arg_0 : register(u0, space1);
void textureDimensions_9abfe5() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_9abfe5();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.spvasm
index 6102757..1d99df4 100644
--- a/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_9abfe5 "textureDimensions_9abfe5"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %20 = OpConstantNull %v2int
+ %24 = OpConstantNull %v2int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_9abfe5 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %12 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %12
+%textureDimensions_9abfe5 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %16 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_9abfe5
+ %32 = OpFunctionCall %void %textureDimensions_9abfe5
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_9abfe5
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_9abfe5
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_9abfe5
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_9abfe5
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.wgsl
index 1d0b4d5..eaf4cb7 100644
--- a/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_9abfe5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/9c9c57.wgsl b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl
index 6020ce4..7a12b97 100644
--- a/test/intrinsics/gen/textureDimensions/9c9c57.wgsl
+++ b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_9c9c57();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.hlsl
index 18217fc..2b71c0a 100644
--- a/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<int4> arg_0 : register(t0, space1);
void textureDimensions_9c9c57() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_9c9c57();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.spvasm
index c6b4449..357711c 100644
--- a/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_9c9c57 "textureDimensions_9c9c57"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %int 2D 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%int_1 = OpConstant %int 1
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %21 = OpConstantNull %v2int
+ %25 = OpConstantNull %v2int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_9c9c57 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %21
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySizeLod %v3int %17 %int_1
- %13 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %13
+%textureDimensions_9c9c57 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %25
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySizeLod %v3int %21 %int_1
+ %17 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureDimensions_9c9c57
+ %33 = OpFunctionCall %void %textureDimensions_9c9c57
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_9c9c57
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_9c9c57
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_9c9c57
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_9c9c57
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.wgsl
index 20f18b7..57b235b 100644
--- a/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_9c9c57();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/9da9e2.wgsl b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl
index 58f6515..0a79b60 100644
--- a/test/intrinsics/gen/textureDimensions/9da9e2.wgsl
+++ b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_9da9e2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.hlsl
index 3b3689b..65426e4 100644
--- a/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<int4> arg_0 : register(u0, space1);
void textureDimensions_9da9e2() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_9da9e2();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.spvasm
index e31891f..6eb0177 100644
--- a/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_9da9e2 "textureDimensions_9da9e2"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,32 +35,44 @@
%7 = OpTypeImage %int 1D 0 0 0 2 Rgba8i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_9da9e2 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %int %14
- OpStore %res %13
+%textureDimensions_9da9e2 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %int %18
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureDimensions_9da9e2
+ %29 = OpFunctionCall %void %textureDimensions_9da9e2
+ %30 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureDimensions_9da9e2
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_9da9e2
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_9da9e2
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_9da9e2
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.wgsl
index 042e716..a1c58b1 100644
--- a/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_9da9e2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl
index 6a537c0..6e01a2f 100644
--- a/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl
+++ b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_9eb8d8();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.hlsl
index dcc6236..48afe18 100644
--- a/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<uint4> arg_0 : register(u0, space1);
void textureDimensions_9eb8d8() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_9eb8d8();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.spvasm
index 3882431..e4d6fea 100644
--- a/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_9eb8d8 "textureDimensions_9eb8d8"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %uint 2D 0 0 0 2 R32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %19 = OpConstantNull %v2int
+ %23 = OpConstantNull %v2int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_9eb8d8 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %19
- %16 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v2int %16
- OpStore %res %13
+%textureDimensions_9eb8d8 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %23
+ %20 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v2int %20
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_9eb8d8
+ %31 = OpFunctionCall %void %textureDimensions_9eb8d8
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_9eb8d8
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_9eb8d8
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_9eb8d8
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_9eb8d8
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.wgsl
index 0d67656..6e481c4 100644
--- a/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_9eb8d8();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/9f8e46.wgsl b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl
index 5688e42..7dfdd7a 100644
--- a/test/intrinsics/gen/textureDimensions/9f8e46.wgsl
+++ b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_9f8e46();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.hlsl
index 0e573aa..865eb30 100644
--- a/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<float4> arg_0 : register(t0, space1);
void textureDimensions_9f8e46() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_9f8e46();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.spvasm
index 0167c50..c102182 100644
--- a/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_9f8e46 "textureDimensions_9f8e46"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,35 +32,47 @@
%7 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%int_0 = OpConstant %int 0
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %19 = OpConstantNull %v2int
+ %23 = OpConstantNull %v2int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_9f8e46 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %19
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySizeLod %v2int %15 %int_0
- OpStore %res %12
+%textureDimensions_9f8e46 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %23
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySizeLod %v2int %19 %int_0
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_9f8e46
+ %31 = OpFunctionCall %void %textureDimensions_9f8e46
+ %32 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_9f8e46
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_9f8e46
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_9f8e46
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_9f8e46
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.wgsl
index be69dc6d..46dfdd4 100644
--- a/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_9f8e46();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/a0aad1.wgsl b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl
index 52a8778..1da9fbd 100644
--- a/test/intrinsics/gen/textureDimensions/a0aad1.wgsl
+++ b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_a0aad1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.hlsl
index 0209158..03d4ed9 100644
--- a/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<int4> arg_0 : register(t0, space1);
void textureDimensions_a0aad1() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_a0aad1();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.spvasm
index 20969b8..20f60aa 100644
--- a/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_a0aad1 "textureDimensions_a0aad1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %int 2D 0 0 0 2 R32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_a0aad1 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v2int %15
- OpStore %res %13
+%textureDimensions_a0aad1 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v2int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_a0aad1
+ %30 = OpFunctionCall %void %textureDimensions_a0aad1
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_a0aad1
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_a0aad1
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_a0aad1
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_a0aad1
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.wgsl
index ecedf37..2ea0a43 100644
--- a/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_a0aad1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl
index 987701c..aeef7e2 100644
--- a/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl
+++ b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_a0e4ec();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.hlsl
index 8938df9..9e7545b 100644
--- a/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<int4> arg_0 : register(t0, space1);
void textureDimensions_a0e4ec() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_a0e4ec();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.spvasm
index aef6121..c3bbdb2 100644
--- a/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_a0e4ec "textureDimensions_a0e4ec"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %int 3D 0 0 0 2 Rgba8i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_a0e4ec = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v3int %15
- OpStore %res %13
+%textureDimensions_a0e4ec = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v3int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_a0e4ec
+ %30 = OpFunctionCall %void %textureDimensions_a0e4ec
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_a0e4ec
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_a0e4ec
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_a0e4ec
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_a0e4ec
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.wgsl
index fa2d645..71446b5 100644
--- a/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_a0e4ec();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl
index 8509d5f..e864dc4 100644
--- a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl
+++ b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_a6ca1c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.hlsl
index 3485629..3f542da 100644
--- a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCube arg_0 : register(t0, space1);
void textureDimensions_a6ca1c() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp.xyy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_a6ca1c();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.spvasm
index e5d9159..93fb824 100644
--- a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_a6ca1c "textureDimensions_a6ca1c"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,37 +32,49 @@
%7 = OpTypeImage %float Cube 1 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%v2int = OpTypeVector %int 2
%int_1 = OpConstant %int 1
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %21 = OpConstantNull %v3int
+ %25 = OpConstantNull %v3int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_a6ca1c = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %21
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySizeLod %v2int %17 %int_1
- %12 = OpVectorShuffle %v3int %15 %15 0 1 1
- OpStore %res %12
+%textureDimensions_a6ca1c = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %25
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySizeLod %v2int %21 %int_1
+ %16 = OpVectorShuffle %v3int %19 %19 0 1 1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureDimensions_a6ca1c
+ %33 = OpFunctionCall %void %textureDimensions_a6ca1c
+ %34 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_a6ca1c
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_a6ca1c
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_a6ca1c
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_a6ca1c
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.wgsl
index 2c6b2bc..1efb31a 100644
--- a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_a6ca1c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/a7d565.wgsl b/test/intrinsics/gen/textureDimensions/a7d565.wgsl
index 94542d3..e5ae723 100644
--- a/test/intrinsics/gen/textureDimensions/a7d565.wgsl
+++ b/test/intrinsics/gen/textureDimensions/a7d565.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_a7d565();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.hlsl
index aa02095..025145a 100644
--- a/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<uint4> arg_0 : register(t0, space1);
void textureDimensions_a7d565() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_a7d565();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.spvasm
index bf76e16..a91bab2 100644
--- a/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.spvasm
@@ -1,27 +1,31 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_a7d565 "textureDimensions_a7d565"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %uint 1D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%_ptr_Function_int = OpTypePointer Function %int
- %19 = OpConstantNull %int
+ %23 = OpConstantNull %int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_a7d565 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %19
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySizeLod %int %15 %int_0
- OpStore %res %13
+%textureDimensions_a7d565 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %23
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySizeLod %int %19 %int_0
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_a7d565
+ %31 = OpFunctionCall %void %textureDimensions_a7d565
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_a7d565
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_a7d565
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_a7d565
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_a7d565
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.wgsl
index 194c128..4370c35 100644
--- a/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_a7d565();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/a863f2.wgsl b/test/intrinsics/gen/textureDimensions/a863f2.wgsl
index 104a9ee..dd6cfaf 100644
--- a/test/intrinsics/gen/textureDimensions/a863f2.wgsl
+++ b/test/intrinsics/gen/textureDimensions/a863f2.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_a863f2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.hlsl
index 1cc4b99..ebc454c 100644
--- a/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<float4> arg_0 : register(u0, space1);
void textureDimensions_a863f2() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_a863f2();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.spvasm
index 3ec7cf7..c1d9638 100644
--- a/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_a863f2 "textureDimensions_a863f2"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %float 1D 0 0 0 2 R32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_a863f2 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %int %14
- OpStore %res %12
+%textureDimensions_a863f2 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %int %18
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureDimensions_a863f2
+ %29 = OpFunctionCall %void %textureDimensions_a863f2
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureDimensions_a863f2
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_a863f2
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_a863f2
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_a863f2
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.wgsl
index cfb1854..28907fe 100644
--- a/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_a863f2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/ae457f.wgsl b/test/intrinsics/gen/textureDimensions/ae457f.wgsl
index 4b81975..4ce12af 100644
--- a/test/intrinsics/gen/textureDimensions/ae457f.wgsl
+++ b/test/intrinsics/gen/textureDimensions/ae457f.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_ae457f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.hlsl
index 67ab5d1..ca16cd7 100644
--- a/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<uint4> arg_0 : register(t0, space1);
void textureDimensions_ae457f() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_ae457f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.spvasm
index d65d270..0af7bba 100644
--- a/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_ae457f "textureDimensions_ae457f"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,36 +34,48 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %21 = OpConstantNull %v2int
+ %25 = OpConstantNull %v2int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_ae457f = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %21
- %18 = OpLoad %7 %arg_0
- %16 = OpImageQuerySize %v3int %18
- %13 = OpVectorShuffle %v2int %16 %16 0 1
- OpStore %res %13
+%textureDimensions_ae457f = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %25
+ %22 = OpLoad %7 %arg_0
+ %20 = OpImageQuerySize %v3int %22
+ %17 = OpVectorShuffle %v2int %20 %20 0 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureDimensions_ae457f
+ %33 = OpFunctionCall %void %textureDimensions_ae457f
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_ae457f
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_ae457f
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_ae457f
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_ae457f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.wgsl
index 7764208..bc281cd 100644
--- a/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_ae457f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/b0e16d.wgsl b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl
index 2f5db9e..cd70795 100644
--- a/test/intrinsics/gen/textureDimensions/b0e16d.wgsl
+++ b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_b0e16d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.hlsl
index 9f083d5..5e7a354 100644
--- a/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<int4> arg_0 : register(t0, space1);
void textureDimensions_b0e16d() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_b0e16d();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.spvasm
index 7c076e6..dc421fd 100644
--- a/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_b0e16d "textureDimensions_b0e16d"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %int 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
%int_1 = OpConstant %int 1
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %19 = OpConstantNull %v2int
+ %23 = OpConstantNull %v2int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_b0e16d = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %19
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySizeLod %v2int %15 %int_1
- OpStore %res %13
+%textureDimensions_b0e16d = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %23
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySizeLod %v2int %19 %int_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_b0e16d
+ %31 = OpFunctionCall %void %textureDimensions_b0e16d
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_b0e16d
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_b0e16d
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_b0e16d
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_b0e16d
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.wgsl
index 6908dfb..e2b0d3b 100644
--- a/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_b0e16d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/b91240.wgsl b/test/intrinsics/gen/textureDimensions/b91240.wgsl
index da39110..dc537f6 100644
--- a/test/intrinsics/gen/textureDimensions/b91240.wgsl
+++ b/test/intrinsics/gen/textureDimensions/b91240.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_b91240();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.hlsl
index 2b5ea2a..c5f0e3e 100644
--- a/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<float4> arg_0 : register(u0, space1);
void textureDimensions_b91240() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_b91240();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.spvasm
index 0ce5cc8..fbc7759 100644
--- a/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_b91240 "textureDimensions_b91240"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %float 2D 0 0 0 2 Rgba8Snorm
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_b91240 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %18
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %v2int %15
- OpStore %res %12
+%textureDimensions_b91240 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v2int %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_b91240
+ %30 = OpFunctionCall %void %textureDimensions_b91240
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_b91240
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_b91240
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_b91240
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_b91240
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.wgsl
index 18cb6c5..73263d7 100644
--- a/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_b91240();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/ba1481.wgsl b/test/intrinsics/gen/textureDimensions/ba1481.wgsl
index 870a110..c626070 100644
--- a/test/intrinsics/gen/textureDimensions/ba1481.wgsl
+++ b/test/intrinsics/gen/textureDimensions/ba1481.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_ba1481();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.hlsl
index b54cbda..4fdd1723 100644
--- a/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<float4> arg_0 : register(t0, space1);
void textureDimensions_ba1481() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_ba1481();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.spvasm
index 66376a0..618d11b 100644
--- a/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_ba1481 "textureDimensions_ba1481"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,35 +32,47 @@
%7 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%int_0 = OpConstant %int 0
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %19 = OpConstantNull %v2int
+ %23 = OpConstantNull %v2int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_ba1481 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %19
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySizeLod %v2int %15 %int_0
- OpStore %res %12
+%textureDimensions_ba1481 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %23
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySizeLod %v2int %19 %int_0
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_ba1481
+ %31 = OpFunctionCall %void %textureDimensions_ba1481
+ %32 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_ba1481
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_ba1481
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_ba1481
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_ba1481
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.wgsl
index 7fad75b..30aa106 100644
--- a/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_ba1481();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/ba6e15.wgsl b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl
index bb0be1d..32d6140 100644
--- a/test/intrinsics/gen/textureDimensions/ba6e15.wgsl
+++ b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_ba6e15();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.hlsl
index aee8136..3da4821 100644
--- a/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<float4> arg_0 : register(t0, space1);
void textureDimensions_ba6e15() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_ba6e15();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.spvasm
index a49144e..2e033df 100644
--- a/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_ba6e15 "textureDimensions_ba6e15"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %float 2D 0 0 0 2 R32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_ba6e15 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %18
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %v2int %15
- OpStore %res %12
+%textureDimensions_ba6e15 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v2int %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_ba6e15
+ %30 = OpFunctionCall %void %textureDimensions_ba6e15
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_ba6e15
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_ba6e15
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_ba6e15
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_ba6e15
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.wgsl
index a1bde09..ef3d759 100644
--- a/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_ba6e15();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/bb3dde.wgsl b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl
index c16641c..c0174c3 100644
--- a/test/intrinsics/gen/textureDimensions/bb3dde.wgsl
+++ b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_bb3dde();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.hlsl
index 456c682..830d2b5 100644
--- a/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<int4> arg_0 : register(u0, space1);
void textureDimensions_bb3dde() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_bb3dde();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.spvasm
index e828d98..5524466 100644
--- a/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_bb3dde "textureDimensions_bb3dde"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %int 3D 0 0 0 2 Rgba32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_bb3dde = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v3int %15
- OpStore %res %13
+%textureDimensions_bb3dde = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v3int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_bb3dde
+ %30 = OpFunctionCall %void %textureDimensions_bb3dde
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_bb3dde
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_bb3dde
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_bb3dde
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_bb3dde
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.wgsl
index e754d08..364b3b2 100644
--- a/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_bb3dde();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl
index 824cc37..6f984cb4 100644
--- a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl
+++ b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_bdf2ee();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.hlsl
index d309747..0864e71 100644
--- a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCubeArray arg_0 : register(t0, space1);
void textureDimensions_bdf2ee() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp.xyy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_bdf2ee();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.spvasm
index 95ab289..2f13378 100644
--- a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.spvasm
@@ -1,27 +1,31 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability SampledCubeArray
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_bdf2ee "textureDimensions_bdf2ee"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %float Cube 1 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %20 = OpConstantNull %v3int
+ %24 = OpConstantNull %v3int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_bdf2ee = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %20
- %16 = OpLoad %7 %arg_0
- %15 = OpImageQuerySizeLod %v3int %16 %int_0
- %12 = OpVectorShuffle %v3int %15 %15 0 1 1
- OpStore %res %12
+%textureDimensions_bdf2ee = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %24
+ %20 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySizeLod %v3int %20 %int_0
+ %16 = OpVectorShuffle %v3int %19 %19 0 1 1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_bdf2ee
+ %32 = OpFunctionCall %void %textureDimensions_bdf2ee
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_bdf2ee
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_bdf2ee
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_bdf2ee
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_bdf2ee
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.wgsl
index 97f8936..f16cd62 100644
--- a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_bdf2ee();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/c2215f.wgsl b/test/intrinsics/gen/textureDimensions/c2215f.wgsl
index 9a6a731..e634dbc 100644
--- a/test/intrinsics/gen/textureDimensions/c2215f.wgsl
+++ b/test/intrinsics/gen/textureDimensions/c2215f.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_c2215f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.hlsl
index dcb01ec..a0bf314 100644
--- a/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
void textureDimensions_c2215f() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_c2215f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.spvasm
index a4eb711..52cc05f 100644
--- a/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_c2215f "textureDimensions_c2215f"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %float 2D 0 1 0 2 R32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %20 = OpConstantNull %v2int
+ %24 = OpConstantNull %v2int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_c2215f = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %12 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %12
+%textureDimensions_c2215f = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %16 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_c2215f
+ %32 = OpFunctionCall %void %textureDimensions_c2215f
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_c2215f
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_c2215f
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_c2215f
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_c2215f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.wgsl
index 1835175..e2a2736 100644
--- a/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_c2215f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/c30e75.wgsl b/test/intrinsics/gen/textureDimensions/c30e75.wgsl
index 3a27045..e03228c 100644
--- a/test/intrinsics/gen/textureDimensions/c30e75.wgsl
+++ b/test/intrinsics/gen/textureDimensions/c30e75.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_c30e75();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.hlsl
index 2c32e82..187d499 100644
--- a/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<int4> arg_0 : register(u0, space1);
void textureDimensions_c30e75() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_c30e75();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.spvasm
index 8e8edd9..6bfa57c 100644
--- a/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_c30e75 "textureDimensions_c30e75"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %int 2D 0 0 0 2 R32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_c30e75 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v2int %15
- OpStore %res %13
+%textureDimensions_c30e75 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v2int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_c30e75
+ %30 = OpFunctionCall %void %textureDimensions_c30e75
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_c30e75
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_c30e75
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_c30e75
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_c30e75
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.wgsl
index 2419e83..aa76018 100644
--- a/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_c30e75();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/c60b66.wgsl b/test/intrinsics/gen/textureDimensions/c60b66.wgsl
index 7e62f03..d8bff2a 100644
--- a/test/intrinsics/gen/textureDimensions/c60b66.wgsl
+++ b/test/intrinsics/gen/textureDimensions/c60b66.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_c60b66();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.hlsl
index 21925cc..25d2b08 100644
--- a/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<int4> arg_0 : register(t0, space1);
void textureDimensions_c60b66() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_c60b66();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.spvasm
index 339b568..7f6cf25 100644
--- a/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_c60b66 "textureDimensions_c60b66"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,32 +35,44 @@
%7 = OpTypeImage %int 1D 0 0 0 2 Rgba16i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_c60b66 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %int %14
- OpStore %res %13
+%textureDimensions_c60b66 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %int %18
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureDimensions_c60b66
+ %29 = OpFunctionCall %void %textureDimensions_c60b66
+ %30 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureDimensions_c60b66
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_c60b66
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_c60b66
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_c60b66
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.wgsl
index 9825a31..d023435 100644
--- a/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_c60b66();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/c74533.wgsl b/test/intrinsics/gen/textureDimensions/c74533.wgsl
index d6eb0a1..72535e4 100644
--- a/test/intrinsics/gen/textureDimensions/c74533.wgsl
+++ b/test/intrinsics/gen/textureDimensions/c74533.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_c74533();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.hlsl
index bc9d1ef..447186a 100644
--- a/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<uint4> arg_0 : register(t0, space1);
void textureDimensions_c74533() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_c74533();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.spvasm
index d03a057..433d410 100644
--- a/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_c74533 "textureDimensions_c74533"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %uint 2D 0 0 0 2 Rgba32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %19 = OpConstantNull %v2int
+ %23 = OpConstantNull %v2int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_c74533 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %19
- %16 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v2int %16
- OpStore %res %13
+%textureDimensions_c74533 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %23
+ %20 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v2int %20
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_c74533
+ %31 = OpFunctionCall %void %textureDimensions_c74533
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_c74533
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_c74533
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_c74533
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_c74533
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.wgsl
index f232e4f..8acd040 100644
--- a/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_c74533();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/c7943d.wgsl b/test/intrinsics/gen/textureDimensions/c7943d.wgsl
index cc6af89..8043723 100644
--- a/test/intrinsics/gen/textureDimensions/c7943d.wgsl
+++ b/test/intrinsics/gen/textureDimensions/c7943d.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_c7943d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.hlsl
index 3c90423..a5d7e28 100644
--- a/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<uint4> arg_0 : register(u0, space1);
void textureDimensions_c7943d() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_c7943d();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.spvasm
index 7c935b0..15af643 100644
--- a/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_c7943d "textureDimensions_c7943d"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %uint 2D 0 0 0 2 Rgba8ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %19 = OpConstantNull %v2int
+ %23 = OpConstantNull %v2int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_c7943d = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %19
- %16 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v2int %16
- OpStore %res %13
+%textureDimensions_c7943d = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %23
+ %20 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v2int %20
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_c7943d
+ %31 = OpFunctionCall %void %textureDimensions_c7943d
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_c7943d
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_c7943d
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_c7943d
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_c7943d
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.wgsl
index bcb79d8..a78b4f4 100644
--- a/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_c7943d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/caaabb.wgsl b/test/intrinsics/gen/textureDimensions/caaabb.wgsl
index e563cf2..23f494c 100644
--- a/test/intrinsics/gen/textureDimensions/caaabb.wgsl
+++ b/test/intrinsics/gen/textureDimensions/caaabb.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_caaabb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.hlsl
index 69e4489..fae0f87 100644
--- a/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<int4> arg_0 : register(t0, space1);
void textureDimensions_caaabb() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_caaabb();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.spvasm
index cb25aca..c0faeb1 100644
--- a/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_caaabb "textureDimensions_caaabb"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,35 +35,47 @@
%7 = OpTypeImage %int 2D 0 1 0 2 Rg32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %20 = OpConstantNull %v2int
+ %24 = OpConstantNull %v2int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_caaabb = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %13 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %13
+%textureDimensions_caaabb = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %17 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_caaabb
+ %32 = OpFunctionCall %void %textureDimensions_caaabb
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_caaabb
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_caaabb
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_caaabb
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_caaabb
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.wgsl
index 90c1c28..1e79cdb 100644
--- a/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_caaabb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/cc5478.wgsl b/test/intrinsics/gen/textureDimensions/cc5478.wgsl
index ddf9b2c..72a7056 100644
--- a/test/intrinsics/gen/textureDimensions/cc5478.wgsl
+++ b/test/intrinsics/gen/textureDimensions/cc5478.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_cc5478();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.hlsl
index 0f9326e..2fbc2ad 100644
--- a/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<float4> arg_0 : register(t0, space1);
void textureDimensions_cc5478() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_cc5478();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.spvasm
index 6bec852..ab716b1 100644
--- a/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_cc5478 "textureDimensions_cc5478"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %float 1D 0 0 0 2 Rgba8
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_cc5478 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %int %14
- OpStore %res %12
+%textureDimensions_cc5478 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %int %18
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureDimensions_cc5478
+ %29 = OpFunctionCall %void %textureDimensions_cc5478
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureDimensions_cc5478
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_cc5478
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_cc5478
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_cc5478
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.wgsl
index baf34af..94d868a 100644
--- a/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_cc5478();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/cc968c.wgsl b/test/intrinsics/gen/textureDimensions/cc968c.wgsl
index 53edbe6..811876d 100644
--- a/test/intrinsics/gen/textureDimensions/cc968c.wgsl
+++ b/test/intrinsics/gen/textureDimensions/cc968c.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_cc968c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.hlsl
index 3410404..48cc885 100644
--- a/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<int4> arg_0 : register(u0, space1);
void textureDimensions_cc968c() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_cc968c();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.spvasm
index a1322ae..ce06dbb 100644
--- a/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.spvasm
@@ -1,22 +1,25 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_cc968c "textureDimensions_cc968c"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -24,6 +27,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -32,32 +36,44 @@
%7 = OpTypeImage %int 1D 0 0 0 2 Rg32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_cc968c = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %int %14
- OpStore %res %13
+%textureDimensions_cc968c = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %int %18
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureDimensions_cc968c
+ %29 = OpFunctionCall %void %textureDimensions_cc968c
+ %30 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureDimensions_cc968c
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_cc968c
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_cc968c
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_cc968c
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.wgsl
index fa5b5b2..0535708 100644
--- a/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_cc968c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/cccc17.wgsl b/test/intrinsics/gen/textureDimensions/cccc17.wgsl
index 4a95021..12dda6d 100644
--- a/test/intrinsics/gen/textureDimensions/cccc17.wgsl
+++ b/test/intrinsics/gen/textureDimensions/cccc17.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_cccc17();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.hlsl
index 743516c..468f704 100644
--- a/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCube<int4> arg_0 : register(t0, space1);
void textureDimensions_cccc17() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp.xyy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_cccc17();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.spvasm
index 4d67eeb..b725471 100644
--- a/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_cccc17 "textureDimensions_cccc17"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %int Cube 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%v2int = OpTypeVector %int 2
%int_0 = OpConstant %int 0
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %21 = OpConstantNull %v3int
+ %25 = OpConstantNull %v3int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_cccc17 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %21
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySizeLod %v2int %17 %int_0
- %13 = OpVectorShuffle %v3int %15 %15 0 1 1
- OpStore %res %13
+%textureDimensions_cccc17 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %25
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySizeLod %v2int %21 %int_0
+ %17 = OpVectorShuffle %v3int %19 %19 0 1 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureDimensions_cccc17
+ %33 = OpFunctionCall %void %textureDimensions_cccc17
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_cccc17
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_cccc17
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_cccc17
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_cccc17
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.wgsl
index 7b1d7bd..36fc6c1 100644
--- a/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_cccc17();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/cccc8f.wgsl b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl
index 663339f..aad493d 100644
--- a/test/intrinsics/gen/textureDimensions/cccc8f.wgsl
+++ b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_cccc8f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.hlsl
index 0888f24..2971b4b 100644
--- a/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<float4> arg_0 : register(u0, space1);
void textureDimensions_cccc8f() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_cccc8f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.spvasm
index ffb7c50..c12ca5c 100644
--- a/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_cccc8f "textureDimensions_cccc8f"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %float 1D 0 0 0 2 Rgba8Snorm
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_cccc8f = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %int %14
- OpStore %res %12
+%textureDimensions_cccc8f = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %int %18
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureDimensions_cccc8f
+ %29 = OpFunctionCall %void %textureDimensions_cccc8f
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureDimensions_cccc8f
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_cccc8f
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_cccc8f
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_cccc8f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.wgsl
index a7b4ce0..84b8ce7 100644
--- a/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_cccc8f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/cd76a7.wgsl b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl
index 5025753..9025bb5 100644
--- a/test/intrinsics/gen/textureDimensions/cd76a7.wgsl
+++ b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_cd76a7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.hlsl
index babcfe1..f616593 100644
--- a/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<float4> arg_0 : register(u0, space1);
void textureDimensions_cd76a7() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_cd76a7();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.spvasm
index b1b8e49..546e8a1 100644
--- a/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_cd76a7 "textureDimensions_cd76a7"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %float 3D 0 0 0 2 Rgba8
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_cd76a7 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %18
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %v3int %15
- OpStore %res %12
+%textureDimensions_cd76a7 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %22
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v3int %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_cd76a7
+ %30 = OpFunctionCall %void %textureDimensions_cd76a7
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_cd76a7
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_cd76a7
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_cd76a7
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_cd76a7
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.wgsl
index ff0d168..808c1ae 100644
--- a/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_cd76a7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/cdaff9.wgsl b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl
index 2383f87..6a155878 100644
--- a/test/intrinsics/gen/textureDimensions/cdaff9.wgsl
+++ b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_cdaff9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.hlsl
index c7fba3f..95cb20b 100644
--- a/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<float4> arg_0 : register(t0, space1);
void textureDimensions_cdaff9() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_cdaff9();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.spvasm
index ca690e7..0b9efd8 100644
--- a/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_cdaff9 "textureDimensions_cdaff9"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %float 3D 0 0 0 2 Rgba32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_cdaff9 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %18
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %v3int %15
- OpStore %res %12
+%textureDimensions_cdaff9 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %22
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v3int %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_cdaff9
+ %30 = OpFunctionCall %void %textureDimensions_cdaff9
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_cdaff9
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_cdaff9
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_cdaff9
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_cdaff9
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.wgsl
index f69c2b5..2f6b64c 100644
--- a/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_cdaff9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/cdf473.wgsl b/test/intrinsics/gen/textureDimensions/cdf473.wgsl
index 9a18a7d..0c2d7b4 100644
--- a/test/intrinsics/gen/textureDimensions/cdf473.wgsl
+++ b/test/intrinsics/gen/textureDimensions/cdf473.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_cdf473();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.hlsl
index 0c847db..1f10d18 100644
--- a/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<int4> arg_0 : register(u0, space1);
void textureDimensions_cdf473() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_cdf473();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.spvasm
index 674d1c4..946919e 100644
--- a/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_cdf473 "textureDimensions_cdf473"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %20 = OpConstantNull %v2int
+ %24 = OpConstantNull %v2int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_cdf473 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %13 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %13
+%textureDimensions_cdf473 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %17 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_cdf473
+ %32 = OpFunctionCall %void %textureDimensions_cdf473
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_cdf473
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_cdf473
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_cdf473
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_cdf473
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.wgsl
index 9f02298..f25baa9 100644
--- a/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_cdf473();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/cec841.wgsl b/test/intrinsics/gen/textureDimensions/cec841.wgsl
index f341fe2..d8d4e1f 100644
--- a/test/intrinsics/gen/textureDimensions/cec841.wgsl
+++ b/test/intrinsics/gen/textureDimensions/cec841.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_cec841();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.hlsl
index 44fed34..e99586d 100644
--- a/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
void textureDimensions_cec841() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_cec841();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.spvasm
index caa966a..419ce59 100644
--- a/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_cec841 "textureDimensions_cec841"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,37 +32,49 @@
%7 = OpTypeImage %float 2D 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %21 = OpConstantNull %v2int
+ %25 = OpConstantNull %v2int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_cec841 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %21
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySizeLod %v3int %17 %int_0
- %12 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %12
+%textureDimensions_cec841 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %25
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySizeLod %v3int %21 %int_0
+ %16 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureDimensions_cec841
+ %33 = OpFunctionCall %void %textureDimensions_cec841
+ %34 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_cec841
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_cec841
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_cec841
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_cec841
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.wgsl
index fa1ee13..902e7c7 100644
--- a/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_cec841();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/cf1d42.wgsl b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl
index a06115f..6315cb0 100644
--- a/test/intrinsics/gen/textureDimensions/cf1d42.wgsl
+++ b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_cf1d42();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.hlsl
index 06a1367..49a3eb8 100644
--- a/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<float4> arg_0 : register(t0, space1);
void textureDimensions_cf1d42() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_cf1d42();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.spvasm
index 03d962d..b9e6602 100644
--- a/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_cf1d42 "textureDimensions_cf1d42"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %float 1D 0 0 0 2 Rgba16f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_cf1d42 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %int %14
- OpStore %res %12
+%textureDimensions_cf1d42 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %int %18
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureDimensions_cf1d42
+ %29 = OpFunctionCall %void %textureDimensions_cf1d42
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureDimensions_cf1d42
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_cf1d42
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_cf1d42
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_cf1d42
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.wgsl
index bdae356..4a3610d 100644
--- a/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_cf1d42();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/cf7e43.wgsl b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl
index 30cf759..05036fa 100644
--- a/test/intrinsics/gen/textureDimensions/cf7e43.wgsl
+++ b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_cf7e43();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.hlsl
index b2e6947..1cba320 100644
--- a/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<float4> arg_0 : register(u0, space1);
void textureDimensions_cf7e43() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_cf7e43();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.spvasm
index b268aae..f4aec52 100644
--- a/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_cf7e43 "textureDimensions_cf7e43"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %float 3D 0 0 0 2 Rgba8Snorm
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_cf7e43 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %18
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %v3int %15
- OpStore %res %12
+%textureDimensions_cf7e43 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %22
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v3int %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_cf7e43
+ %30 = OpFunctionCall %void %textureDimensions_cf7e43
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_cf7e43
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_cf7e43
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_cf7e43
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_cf7e43
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.wgsl
index ccdd94f..db7d588 100644
--- a/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_cf7e43();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/d40b9e.wgsl b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl
index 2387895..6e76502 100644
--- a/test/intrinsics/gen/textureDimensions/d40b9e.wgsl
+++ b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_d40b9e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.hlsl
index 2943bb5..2dd0690 100644
--- a/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<int4> arg_0 : register(t0, space1);
void textureDimensions_d40b9e() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_d40b9e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.spvasm
index 9408183..05a43cf 100644
--- a/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_d40b9e "textureDimensions_d40b9e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %int 2D 0 0 0 2 Rgba8i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_d40b9e = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v2int %15
- OpStore %res %13
+%textureDimensions_d40b9e = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v2int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_d40b9e
+ %30 = OpFunctionCall %void %textureDimensions_d40b9e
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_d40b9e
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_d40b9e
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_d40b9e
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_d40b9e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.wgsl
index 83398fb..a3480ee 100644
--- a/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_d40b9e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/d4106f.wgsl b/test/intrinsics/gen/textureDimensions/d4106f.wgsl
index fee84c3..80a4a42 100644
--- a/test/intrinsics/gen/textureDimensions/d4106f.wgsl
+++ b/test/intrinsics/gen/textureDimensions/d4106f.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_d4106f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.hlsl
index c38086e..630ecd7 100644
--- a/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<int4> arg_0 : register(t0, space1);
void textureDimensions_d4106f() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_d4106f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.spvasm
index 5ab2c0b..642a64a 100644
--- a/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_d4106f "textureDimensions_d4106f"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %int 2D 0 0 0 2 Rgba16i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_d4106f = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v2int %15
- OpStore %res %13
+%textureDimensions_d4106f = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v2int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_d4106f
+ %30 = OpFunctionCall %void %textureDimensions_d4106f
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_d4106f
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_d4106f
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_d4106f
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_d4106f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.wgsl
index fd06290..3dd7473 100644
--- a/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_d4106f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/d8f951.wgsl b/test/intrinsics/gen/textureDimensions/d8f951.wgsl
index dc9570a..8b6d2cc 100644
--- a/test/intrinsics/gen/textureDimensions/d8f951.wgsl
+++ b/test/intrinsics/gen/textureDimensions/d8f951.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_d8f951();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.hlsl
index 819ca59..bd74f95 100644
--- a/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<float4> arg_0 : register(t0, space1);
void textureDimensions_d8f951() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_d8f951();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.spvasm
index 16cdf49..11b7e33 100644
--- a/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_d8f951 "textureDimensions_d8f951"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %float 1D 0 0 0 2 R32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_d8f951 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %int %14
- OpStore %res %12
+%textureDimensions_d8f951 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %int %18
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureDimensions_d8f951
+ %29 = OpFunctionCall %void %textureDimensions_d8f951
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureDimensions_d8f951
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_d8f951
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_d8f951
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_d8f951
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.wgsl
index c41b14d..b807203 100644
--- a/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_d8f951();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/da3099.wgsl b/test/intrinsics/gen/textureDimensions/da3099.wgsl
index 5df347c..a44128f 100644
--- a/test/intrinsics/gen/textureDimensions/da3099.wgsl
+++ b/test/intrinsics/gen/textureDimensions/da3099.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_da3099();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.hlsl
index c474ad5..e927c7b 100644
--- a/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<uint4> arg_0 : register(t0, space1);
void textureDimensions_da3099() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_da3099();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.spvasm
index bf8331e..3930ab3 100644
--- a/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_da3099 "textureDimensions_da3099"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %uint 3D 0 0 0 2 Rgba16ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %19 = OpConstantNull %v3int
+ %23 = OpConstantNull %v3int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_da3099 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %19
- %16 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v3int %16
- OpStore %res %13
+%textureDimensions_da3099 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %23
+ %20 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v3int %20
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_da3099
+ %31 = OpFunctionCall %void %textureDimensions_da3099
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_da3099
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_da3099
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_da3099
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_da3099
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.wgsl
index cd9fdad..738261e 100644
--- a/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_da3099();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/daf7c0.wgsl b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl
index 3594279..bcc7647 100644
--- a/test/intrinsics/gen/textureDimensions/daf7c0.wgsl
+++ b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_daf7c0();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.hlsl
index df5ba6f..9f62901 100644
--- a/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DMS<int4> arg_0 : register(t0, space1);
void textureDimensions_daf7c0() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_daf7c0();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.spvasm
index 3f0b9f7..b766be7 100644
--- a/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_daf7c0 "textureDimensions_daf7c0"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,33 +33,45 @@
%7 = OpTypeImage %int 2D 0 0 1 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_daf7c0 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v2int %15
- OpStore %res %13
+%textureDimensions_daf7c0 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v2int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_daf7c0
+ %30 = OpFunctionCall %void %textureDimensions_daf7c0
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_daf7c0
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_daf7c0
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_daf7c0
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_daf7c0
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.wgsl
index 181c2f0..769f80e 100644
--- a/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_daf7c0();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/dba47c.wgsl b/test/intrinsics/gen/textureDimensions/dba47c.wgsl
index fe52a14..2880170 100644
--- a/test/intrinsics/gen/textureDimensions/dba47c.wgsl
+++ b/test/intrinsics/gen/textureDimensions/dba47c.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_dba47c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.hlsl
index 297cde7..18b7207 100644
--- a/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<uint4> arg_0 : register(t0, space1);
void textureDimensions_dba47c() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_dba47c();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.spvasm
index 54b70a5..ef594fb 100644
--- a/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_dba47c "textureDimensions_dba47c"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,33 +35,45 @@
%7 = OpTypeImage %uint 1D 0 0 0 2 Rgba32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %18 = OpConstantNull %int
+ %22 = OpConstantNull %int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_dba47c = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %int %15
- OpStore %res %13
+%textureDimensions_dba47c = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_dba47c
+ %30 = OpFunctionCall %void %textureDimensions_dba47c
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_dba47c
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_dba47c
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_dba47c
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_dba47c
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.wgsl
index f702afb..e8ad8b5 100644
--- a/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_dba47c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl
index 4e72a14..c8d7ed9 100644
--- a/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl
+++ b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_dc2dd0();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.hlsl
index a5f39b1..b85d0a4 100644
--- a/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<uint4> arg_0 : register(u0, space1);
void textureDimensions_dc2dd0() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_dc2dd0();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.spvasm
index fee701f..9c1d4c4 100644
--- a/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_dc2dd0 "textureDimensions_dc2dd0"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,33 +35,45 @@
%7 = OpTypeImage %uint 1D 0 0 0 2 Rgba8ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %18 = OpConstantNull %int
+ %22 = OpConstantNull %int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_dc2dd0 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %int %15
- OpStore %res %13
+%textureDimensions_dc2dd0 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_dc2dd0
+ %30 = OpFunctionCall %void %textureDimensions_dc2dd0
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_dc2dd0
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_dc2dd0
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_dc2dd0
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_dc2dd0
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.wgsl
index 03c58ba..cbfe2d9 100644
--- a/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_dc2dd0();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/e10157.wgsl b/test/intrinsics/gen/textureDimensions/e10157.wgsl
index abe6f69..a9463ad 100644
--- a/test/intrinsics/gen/textureDimensions/e10157.wgsl
+++ b/test/intrinsics/gen/textureDimensions/e10157.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_e10157();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.hlsl
index 46f2239..ba15033 100644
--- a/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<uint4> arg_0 : register(t0, space1);
void textureDimensions_e10157() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_e10157();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.spvasm
index 333a4c1..f662392 100644
--- a/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_e10157 "textureDimensions_e10157"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %uint 2D 0 0 0 2 Rgba8ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %19 = OpConstantNull %v2int
+ %23 = OpConstantNull %v2int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_e10157 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %19
- %16 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v2int %16
- OpStore %res %13
+%textureDimensions_e10157 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %23
+ %20 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v2int %20
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_e10157
+ %31 = OpFunctionCall %void %textureDimensions_e10157
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_e10157
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_e10157
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_e10157
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_e10157
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.wgsl
index 4d62897..cea3ee5 100644
--- a/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_e10157();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/e22247.wgsl b/test/intrinsics/gen/textureDimensions/e22247.wgsl
index 9f27264..8eaa52a 100644
--- a/test/intrinsics/gen/textureDimensions/e22247.wgsl
+++ b/test/intrinsics/gen/textureDimensions/e22247.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_e22247();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.hlsl
index d62e4c4..b8173a6 100644
--- a/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCubeArray<int4> arg_0 : register(t0, space1);
void textureDimensions_e22247() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp.xyy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_e22247();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.spvasm
index 818d5e7..2649987 100644
--- a/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.spvasm
@@ -1,27 +1,31 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability SampledCubeArray
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_e22247 "textureDimensions_e22247"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %int Cube 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%int_1 = OpConstant %int 1
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %20 = OpConstantNull %v3int
+ %24 = OpConstantNull %v3int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_e22247 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %20
- %16 = OpLoad %7 %arg_0
- %15 = OpImageQuerySizeLod %v3int %16 %int_1
- %13 = OpVectorShuffle %v3int %15 %15 0 1 1
- OpStore %res %13
+%textureDimensions_e22247 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %24
+ %20 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySizeLod %v3int %20 %int_1
+ %17 = OpVectorShuffle %v3int %19 %19 0 1 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_e22247
+ %32 = OpFunctionCall %void %textureDimensions_e22247
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_e22247
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_e22247
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_e22247
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_e22247
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.wgsl
index 520a4c4..7e079ed 100644
--- a/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_e22247();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/e93464.wgsl b/test/intrinsics/gen/textureDimensions/e93464.wgsl
index fe88bb9..20cf789 100644
--- a/test/intrinsics/gen/textureDimensions/e93464.wgsl
+++ b/test/intrinsics/gen/textureDimensions/e93464.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_e93464();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.hlsl
index 77def20..ce99f9c 100644
--- a/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<int4> arg_0 : register(t0, space1);
void textureDimensions_e93464() {
@@ -6,9 +10,10 @@
int res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_e93464();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.spvasm
index c6da4ff..8a86884 100644
--- a/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.spvasm
@@ -1,22 +1,25 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_e93464 "textureDimensions_e93464"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -24,6 +27,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -32,32 +36,44 @@
%7 = OpTypeImage %int 1D 0 0 0 2 Rg32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_e93464 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %int %14
- OpStore %res %13
+%textureDimensions_e93464 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %int %18
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureDimensions_e93464
+ %29 = OpFunctionCall %void %textureDimensions_e93464
+ %30 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureDimensions_e93464
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_e93464
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_e93464
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_e93464
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.wgsl
index f017f43..57ba706 100644
--- a/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_e93464();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/e9628c.wgsl b/test/intrinsics/gen/textureDimensions/e9628c.wgsl
index 2ad145c..8072e78 100644
--- a/test/intrinsics/gen/textureDimensions/e9628c.wgsl
+++ b/test/intrinsics/gen/textureDimensions/e9628c.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_e9628c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.hlsl
index 5272b2d..ffafc1f 100644
--- a/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
void textureDimensions_e9628c() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_e9628c();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.spvasm
index 64d21e6..75e4e59 100644
--- a/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_e9628c "textureDimensions_e9628c"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %20 = OpConstantNull %v2int
+ %24 = OpConstantNull %v2int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_e9628c = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %12 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %12
+%textureDimensions_e9628c = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %16 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_e9628c
+ %32 = OpFunctionCall %void %textureDimensions_e9628c
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_e9628c
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_e9628c
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_e9628c
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_e9628c
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.wgsl
index 25127fe..f159ee1 100644
--- a/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_e9628c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/e9e96c.wgsl b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl
index 0237b9f..a34bc49 100644
--- a/test/intrinsics/gen/textureDimensions/e9e96c.wgsl
+++ b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_e9e96c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.hlsl
index efb7f4d..b2c594b 100644
--- a/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<float4> arg_0 : register(u0, space1);
void textureDimensions_e9e96c() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_e9e96c();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.spvasm
index 03ca8d5..959f5e1 100644
--- a/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_e9e96c "textureDimensions_e9e96c"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %float 2D 0 1 0 2 R32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %20 = OpConstantNull %v2int
+ %24 = OpConstantNull %v2int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_e9e96c = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %12 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %12
+%textureDimensions_e9e96c = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %16 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_e9e96c
+ %32 = OpFunctionCall %void %textureDimensions_e9e96c
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_e9e96c
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_e9e96c
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_e9e96c
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_e9e96c
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.wgsl
index 7cafbf8..80b69f6 100644
--- a/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_e9e96c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/e9fe54.wgsl b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl
index c9413c2..e12e6c9 100644
--- a/test/intrinsics/gen/textureDimensions/e9fe54.wgsl
+++ b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_e9fe54();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.hlsl
index c6793f2..562ae94 100644
--- a/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<uint4> arg_0 : register(t0, space1);
void textureDimensions_e9fe54() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_e9fe54();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.spvasm
index c9c5d5b..469d0dd 100644
--- a/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_e9fe54 "textureDimensions_e9fe54"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,34 +35,46 @@
%7 = OpTypeImage %uint 2D 0 0 0 2 Rg32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %19 = OpConstantNull %v2int
+ %23 = OpConstantNull %v2int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_e9fe54 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %19
- %16 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v2int %16
- OpStore %res %13
+%textureDimensions_e9fe54 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %23
+ %20 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v2int %20
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_e9fe54
+ %31 = OpFunctionCall %void %textureDimensions_e9fe54
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_e9fe54
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_e9fe54
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_e9fe54
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_e9fe54
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.wgsl
index cd6f322..c5a4c06a 100644
--- a/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_e9fe54();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/e9fe58.wgsl b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl
index 92d0fa1..8ad365a 100644
--- a/test/intrinsics/gen/textureDimensions/e9fe58.wgsl
+++ b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_e9fe58();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.hlsl
index 3a61c1e..ff7df2f 100644
--- a/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<uint4> arg_0 : register(t0, space1);
void textureDimensions_e9fe58() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_e9fe58();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.spvasm
index da7d41f..6058fa6 100644
--- a/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_e9fe58 "textureDimensions_e9fe58"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,36 +34,48 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 R32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %21 = OpConstantNull %v2int
+ %25 = OpConstantNull %v2int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_e9fe58 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %21
- %18 = OpLoad %7 %arg_0
- %16 = OpImageQuerySize %v3int %18
- %13 = OpVectorShuffle %v2int %16 %16 0 1
- OpStore %res %13
+%textureDimensions_e9fe58 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %25
+ %22 = OpLoad %7 %arg_0
+ %20 = OpImageQuerySize %v3int %22
+ %17 = OpVectorShuffle %v2int %20 %20 0 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureDimensions_e9fe58
+ %33 = OpFunctionCall %void %textureDimensions_e9fe58
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_e9fe58
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_e9fe58
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_e9fe58
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_e9fe58
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.wgsl
index 7b81767..f6d3e7e 100644
--- a/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_e9fe58();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl
index 8e328a8..91a4c17 100644
--- a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl
+++ b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_eda4e3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.hlsl
index 6034d6e..50bf525 100644
--- a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCubeArray<float4> arg_0 : register(t0, space1);
void textureDimensions_eda4e3() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp.xyy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_eda4e3();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.spvasm
index 83a4af6..694581b 100644
--- a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.spvasm
@@ -1,27 +1,31 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability SampledCubeArray
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_eda4e3 "textureDimensions_eda4e3"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %float Cube 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_1 = OpConstant %int 1
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %20 = OpConstantNull %v3int
+ %24 = OpConstantNull %v3int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_eda4e3 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %20
- %16 = OpLoad %7 %arg_0
- %15 = OpImageQuerySizeLod %v3int %16 %int_1
- %12 = OpVectorShuffle %v3int %15 %15 0 1 1
- OpStore %res %12
+%textureDimensions_eda4e3 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %24
+ %20 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySizeLod %v3int %20 %int_1
+ %16 = OpVectorShuffle %v3int %19 %19 0 1 1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_eda4e3
+ %32 = OpFunctionCall %void %textureDimensions_eda4e3
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_eda4e3
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_eda4e3
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_eda4e3
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_eda4e3
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.wgsl
index 148c5de..64770e4 100644
--- a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_eda4e3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/ef5b89.wgsl b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl
index 3273bca..e3cd45b 100644
--- a/test/intrinsics/gen/textureDimensions/ef5b89.wgsl
+++ b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_ef5b89();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.hlsl
index e7ff858..cc597c8 100644
--- a/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DMS<float4> arg_0 : register(t0, space1);
void textureDimensions_ef5b89() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_ef5b89();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.spvasm
index dbe5181..7a808a9 100644
--- a/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_ef5b89 "textureDimensions_ef5b89"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,34 +32,46 @@
%7 = OpTypeImage %float 2D 0 0 1 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_ef5b89 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %18
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %v2int %15
- OpStore %res %12
+%textureDimensions_ef5b89 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v2int %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_ef5b89
+ %30 = OpFunctionCall %void %textureDimensions_ef5b89
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_ef5b89
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_ef5b89
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_ef5b89
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_ef5b89
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.wgsl
index dc089a7..f22145a 100644
--- a/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_ef5b89();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/efc8a4.wgsl b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl
index f0c4563..b8518f9 100644
--- a/test/intrinsics/gen/textureDimensions/efc8a4.wgsl
+++ b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_efc8a4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.hlsl
index ed94895..a461b2c 100644
--- a/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<int4> arg_0 : register(t0, space1);
void textureDimensions_efc8a4() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp.xyz;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_efc8a4();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.spvasm
index 4c2a8d3..c4abad8 100644
--- a/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_efc8a4 "textureDimensions_efc8a4"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %int 3D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%int_1 = OpConstant %int 1
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %19 = OpConstantNull %v3int
+ %23 = OpConstantNull %v3int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_efc8a4 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %19
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySizeLod %v3int %15 %int_1
- OpStore %res %13
+%textureDimensions_efc8a4 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %23
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySizeLod %v3int %19 %int_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_efc8a4
+ %31 = OpFunctionCall %void %textureDimensions_efc8a4
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_efc8a4
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_efc8a4
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_efc8a4
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_efc8a4
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.wgsl
index 88c7e1e..ac65d80 100644
--- a/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_efc8a4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/f1b72b.wgsl b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl
index bda8cbc..7ff1484 100644
--- a/test/intrinsics/gen/textureDimensions/f1b72b.wgsl
+++ b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_f1b72b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.hlsl
index 5d97904..618544b 100644
--- a/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<float4> arg_0 : register(t0, space1);
void textureDimensions_f1b72b() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_f1b72b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.spvasm
index a17cf54..1d87771 100644
--- a/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_f1b72b "textureDimensions_f1b72b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %float 2D 0 0 0 2 Rgba32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_f1b72b = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %18
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %v2int %15
- OpStore %res %12
+%textureDimensions_f1b72b = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v2int %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_f1b72b
+ %30 = OpFunctionCall %void %textureDimensions_f1b72b
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_f1b72b
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_f1b72b
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_f1b72b
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_f1b72b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.wgsl
index e74dca4..7b8c55c 100644
--- a/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_f1b72b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/f507c9.wgsl b/test/intrinsics/gen/textureDimensions/f507c9.wgsl
index 99025ba..407c7b6 100644
--- a/test/intrinsics/gen/textureDimensions/f507c9.wgsl
+++ b/test/intrinsics/gen/textureDimensions/f507c9.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_f507c9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.hlsl
index e083f66..df608e5 100644
--- a/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCube<float4> arg_0 : register(t0, space1);
void textureDimensions_f507c9() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp.xyy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_f507c9();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.spvasm
index 4827f1a..4e489d1 100644
--- a/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_f507c9 "textureDimensions_f507c9"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,37 +32,49 @@
%7 = OpTypeImage %float Cube 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%v2int = OpTypeVector %int 2
%int_0 = OpConstant %int 0
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %21 = OpConstantNull %v3int
+ %25 = OpConstantNull %v3int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_f507c9 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %21
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySizeLod %v2int %17 %int_0
- %12 = OpVectorShuffle %v3int %15 %15 0 1 1
- OpStore %res %12
+%textureDimensions_f507c9 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %25
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySizeLod %v2int %21 %int_0
+ %16 = OpVectorShuffle %v3int %19 %19 0 1 1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureDimensions_f507c9
+ %33 = OpFunctionCall %void %textureDimensions_f507c9
+ %34 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_f507c9
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_f507c9
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_f507c9
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_f507c9
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.wgsl
index 98211b7..5f62f50 100644
--- a/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_f507c9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/f70326.wgsl b/test/intrinsics/gen/textureDimensions/f70326.wgsl
index fe667e8..424adf0 100644
--- a/test/intrinsics/gen/textureDimensions/f70326.wgsl
+++ b/test/intrinsics/gen/textureDimensions/f70326.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_f70326();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.hlsl
index 01c94f2..2a2bd88 100644
--- a/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCubeArray<int4> arg_0 : register(t0, space1);
void textureDimensions_f70326() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp.xyy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_f70326();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.spvasm
index 70a5677..f1a58b4 100644
--- a/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.spvasm
@@ -1,27 +1,31 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability SampledCubeArray
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_f70326 "textureDimensions_f70326"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %int Cube 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %20 = OpConstantNull %v3int
+ %24 = OpConstantNull %v3int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_f70326 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %20
- %16 = OpLoad %7 %arg_0
- %15 = OpImageQuerySizeLod %v3int %16 %int_0
- %13 = OpVectorShuffle %v3int %15 %15 0 1 1
- OpStore %res %13
+%textureDimensions_f70326 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %24
+ %20 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySizeLod %v3int %20 %int_0
+ %17 = OpVectorShuffle %v3int %19 %19 0 1 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_f70326
+ %32 = OpFunctionCall %void %textureDimensions_f70326
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_f70326
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_f70326
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_f70326
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_f70326
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.wgsl
index e1de80d..6209bb2 100644
--- a/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_f70326();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/f7145b.wgsl b/test/intrinsics/gen/textureDimensions/f7145b.wgsl
index 908ea16..935495f 100644
--- a/test/intrinsics/gen/textureDimensions/f7145b.wgsl
+++ b/test/intrinsics/gen/textureDimensions/f7145b.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_f7145b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.hlsl
index 5b964ae..3d13419 100644
--- a/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<uint4> arg_0 : register(t0, space1);
void textureDimensions_f7145b() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_f7145b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.spvasm
index a484942..fe17045 100644
--- a/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_f7145b "textureDimensions_f7145b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,47 @@
%7 = OpTypeImage %uint 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%int_1 = OpConstant %int 1
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %20 = OpConstantNull %v2int
+ %24 = OpConstantNull %v2int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_f7145b = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %20
- %16 = OpLoad %7 %arg_0
- %13 = OpImageQuerySizeLod %v2int %16 %int_1
- OpStore %res %13
+%textureDimensions_f7145b = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %24
+ %20 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySizeLod %v2int %20 %int_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_f7145b
+ %32 = OpFunctionCall %void %textureDimensions_f7145b
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_f7145b
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_f7145b
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_f7145b
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_f7145b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.wgsl
index 6da9903..9b443d8 100644
--- a/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_f7145b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl
index b1fc576..22a9796 100644
--- a/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl
+++ b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_f7aa9e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.hlsl
index 23a9a6c..3f90585 100644
--- a/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<int4> arg_0 : register(t0, space1);
void textureDimensions_f7aa9e() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_f7aa9e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.spvasm
index 8e629d6..19ff511 100644
--- a/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_f7aa9e "textureDimensions_f7aa9e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %20 = OpConstantNull %v2int
+ %24 = OpConstantNull %v2int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_f7aa9e = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %13 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %13
+%textureDimensions_f7aa9e = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %17 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_f7aa9e
+ %32 = OpFunctionCall %void %textureDimensions_f7aa9e
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_f7aa9e
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_f7aa9e
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_f7aa9e
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_f7aa9e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.wgsl
index 8f51070..2fa399f 100644
--- a/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_f7aa9e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/f7e436.wgsl b/test/intrinsics/gen/textureDimensions/f7e436.wgsl
index 3aafa81..8490481 100644
--- a/test/intrinsics/gen/textureDimensions/f7e436.wgsl
+++ b/test/intrinsics/gen/textureDimensions/f7e436.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_f7e436();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.hlsl
index 49ca1c1..0d1a0f3 100644
--- a/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<uint4> arg_0 : register(t0, space1);
void textureDimensions_f7e436() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_f7e436();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.spvasm
index 75f7e65..e6cc284 100644
--- a/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_f7e436 "textureDimensions_f7e436"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,36 +34,48 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %21 = OpConstantNull %v2int
+ %25 = OpConstantNull %v2int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_f7e436 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %21
- %18 = OpLoad %7 %arg_0
- %16 = OpImageQuerySize %v3int %18
- %13 = OpVectorShuffle %v2int %16 %16 0 1
- OpStore %res %13
+%textureDimensions_f7e436 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %25
+ %22 = OpLoad %7 %arg_0
+ %20 = OpImageQuerySize %v3int %22
+ %17 = OpVectorShuffle %v2int %20 %20 0 1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureDimensions_f7e436
+ %33 = OpFunctionCall %void %textureDimensions_f7e436
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_f7e436
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_f7e436
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_f7e436
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_f7e436
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.wgsl
index 5b003c5..0b0ef26 100644
--- a/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_f7e436();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/f931c7.wgsl b/test/intrinsics/gen/textureDimensions/f931c7.wgsl
index a434674..d684e54 100644
--- a/test/intrinsics/gen/textureDimensions/f931c7.wgsl
+++ b/test/intrinsics/gen/textureDimensions/f931c7.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_f931c7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.hlsl
index 611e994..2cef0e7 100644
--- a/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<float4> arg_0 : register(u0, space1);
void textureDimensions_f931c7() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_f931c7();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.spvasm
index 726ba5b..e1e3209 100644
--- a/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_f931c7 "textureDimensions_f931c7"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %float 2D 0 0 0 2 R32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_f931c7 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %18
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %v2int %15
- OpStore %res %12
+%textureDimensions_f931c7 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v2int %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_f931c7
+ %30 = OpFunctionCall %void %textureDimensions_f931c7
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_f931c7
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_f931c7
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_f931c7
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_f931c7
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.wgsl
index 4253c30..0d82fc1 100644
--- a/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_f931c7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/fa90e1.wgsl b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl
index bfe7139..7d6e1a4 100644
--- a/test/intrinsics/gen/textureDimensions/fa90e1.wgsl
+++ b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_fa90e1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.hlsl
index f5f998f..d91cb26 100644
--- a/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<float4> arg_0 : register(t0, space1);
void textureDimensions_fa90e1() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_fa90e1();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.spvasm
index e52ec7d..c997daa 100644
--- a/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_fa90e1 "textureDimensions_fa90e1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %float 2D 0 0 0 2 Rg32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_fa90e1 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %18
- %15 = OpLoad %7 %arg_0
- %12 = OpImageQuerySize %v2int %15
- OpStore %res %12
+%textureDimensions_fa90e1 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %22
+ %19 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySize %v2int %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureDimensions_fa90e1
+ %30 = OpFunctionCall %void %textureDimensions_fa90e1
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_fa90e1
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_fa90e1
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_fa90e1
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_fa90e1
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.wgsl
index 546939f..e7a2306 100644
--- a/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_fa90e1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/fa9859.wgsl b/test/intrinsics/gen/textureDimensions/fa9859.wgsl
index 25ce897..d0b6130 100644
--- a/test/intrinsics/gen/textureDimensions/fa9859.wgsl
+++ b/test/intrinsics/gen/textureDimensions/fa9859.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_fa9859();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.hlsl
index 9808fe7..032a856 100644
--- a/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<int4> arg_0 : register(t0, space1);
void textureDimensions_fa9859() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_fa9859();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.spvasm
index 3d933f0..231e68a 100644
--- a/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_fa9859 "textureDimensions_fa9859"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %int 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
%int_0 = OpConstant %int 0
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %19 = OpConstantNull %v2int
+ %23 = OpConstantNull %v2int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_fa9859 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %19
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySizeLod %v2int %15 %int_0
- OpStore %res %13
+%textureDimensions_fa9859 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %23
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySizeLod %v2int %19 %int_0
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_fa9859
+ %31 = OpFunctionCall %void %textureDimensions_fa9859
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_fa9859
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_fa9859
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_fa9859
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_fa9859
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.wgsl
index dab6521..eec2447 100644
--- a/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_fa9859();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/fb5670.wgsl b/test/intrinsics/gen/textureDimensions/fb5670.wgsl
index 3567a74..4461338 100644
--- a/test/intrinsics/gen/textureDimensions/fb5670.wgsl
+++ b/test/intrinsics/gen/textureDimensions/fb5670.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_fb5670();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.hlsl
index f749526..371a86f 100644
--- a/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<float4> arg_0 : register(u0, space1);
void textureDimensions_fb5670() {
@@ -6,9 +10,10 @@
int2 res = tint_tmp.xy;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_fb5670();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.spvasm
index 3cb0894..79530cb 100644
--- a/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_fb5670 "textureDimensions_fb5670"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,36 +34,48 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rg32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %20 = OpConstantNull %v2int
+ %24 = OpConstantNull %v2int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_fb5670 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %12 = OpVectorShuffle %v2int %15 %15 0 1
- OpStore %res %12
+%textureDimensions_fb5670 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %16 = OpVectorShuffle %v2int %19 %19 0 1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureDimensions_fb5670
+ %32 = OpFunctionCall %void %textureDimensions_fb5670
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_fb5670
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_fb5670
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_fb5670
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_fb5670
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.wgsl
index fc9f484..9e57cf6 100644
--- a/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_fb5670();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl
index ce6e8f9..24175a2 100644
--- a/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl
+++ b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_fbbe4d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.hlsl
index 227e90d..e65ba3e 100644
--- a/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<uint4> arg_0 : register(t0, space1);
void textureDimensions_fbbe4d() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_fbbe4d();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.spvasm
index cb79fac..6333e2c 100644
--- a/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_fbbe4d "textureDimensions_fbbe4d"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %uint 3D 0 0 0 2 R32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %19 = OpConstantNull %v3int
+ %23 = OpConstantNull %v3int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_fbbe4d = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %19
- %16 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v3int %16
- OpStore %res %13
+%textureDimensions_fbbe4d = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %23
+ %20 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v3int %20
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_fbbe4d
+ %31 = OpFunctionCall %void %textureDimensions_fbbe4d
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_fbbe4d
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_fbbe4d
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_fbbe4d
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_fbbe4d
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.wgsl
index 1b311d4..724fec4 100644
--- a/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_fbbe4d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/fcac78.wgsl b/test/intrinsics/gen/textureDimensions/fcac78.wgsl
index f8ce06e..89ee977 100644
--- a/test/intrinsics/gen/textureDimensions/fcac78.wgsl
+++ b/test/intrinsics/gen/textureDimensions/fcac78.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_fcac78();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.hlsl
index 97f637e..e4f8e2d 100644
--- a/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<uint4> arg_0 : register(u0, space1);
void textureDimensions_fcac78() {
@@ -6,9 +10,10 @@
int3 res = tint_tmp;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureDimensions_fcac78();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.spvasm
index bdb36a8..bc049db 100644
--- a/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureDimensions_fcac78 "textureDimensions_fcac78"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %uint 3D 0 0 0 2 Rgba8ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_v3int = OpTypePointer Function %v3int
- %19 = OpConstantNull %v3int
+ %23 = OpConstantNull %v3int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureDimensions_fcac78 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %19
- %16 = OpLoad %7 %arg_0
- %13 = OpImageQuerySize %v3int %16
- OpStore %res %13
+%textureDimensions_fcac78 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3int Function %23
+ %20 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySize %v3int %20
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureDimensions_fcac78
+ %31 = OpFunctionCall %void %textureDimensions_fcac78
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_fcac78
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_fcac78
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_fcac78
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_fcac78
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.wgsl
index 9d4ec34..a5ca00a 100644
--- a/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureDimensions_fcac78();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/050c33.wgsl b/test/intrinsics/gen/textureLoad/050c33.wgsl
index 851d695..15c9891 100644
--- a/test/intrinsics/gen/textureLoad/050c33.wgsl
+++ b/test/intrinsics/gen/textureLoad/050c33.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_050c33();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.hlsl
index 8d3867f..e286d63 100644
--- a/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<uint4> arg_0 : register(t0, space1);
void textureLoad_050c33() {
uint4 res = arg_0.Load(int3(0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_050c33();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.spvasm
index a51c315..53494b3 100644
--- a/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_050c33 "textureLoad_050c33"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,36 +34,48 @@
%7 = OpTypeImage %uint 2D 0 0 0 2 Rg32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4uint = OpTypeVector %uint 4
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %21 = OpConstantNull %v4uint
+ %25 = OpConstantNull %v4uint
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_050c33 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %21
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4uint %15 %18
- OpStore %res %13
+%textureLoad_050c33 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %25
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4uint %19 %22
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureLoad_050c33
+ %33 = OpFunctionCall %void %textureLoad_050c33
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureLoad_050c33
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_050c33
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureLoad_050c33
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_050c33
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.wgsl
index 3f9f0d4..e02cdf0 100644
--- a/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_050c33();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/072e26.wgsl b/test/intrinsics/gen/textureLoad/072e26.wgsl
index db79f26..b1b917e 100644
--- a/test/intrinsics/gen/textureLoad/072e26.wgsl
+++ b/test/intrinsics/gen/textureLoad/072e26.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_072e26();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.hlsl
index ac98d37..808d51c 100644
--- a/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
void textureLoad_072e26() {
float4 res = arg_0.Load(int4(0, 0, 1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_072e26();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.spvasm
index 0294e5f..a8951cb 100644
--- a/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 40
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_072e26 "textureLoad_072e26"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,38 +32,48 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %22 = OpConstantNull %v4float
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_072e26 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %22
- %14 = OpLoad %7 %arg_0
- %12 = OpImageRead %v4float %14 %19
- OpStore %res %12
+%textureLoad_072e26 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageRead %v4float %17 %22
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %24 = OpLabel
- OpStore %tint_pointsize %float_1
- %26 = OpFunctionCall %void %textureLoad_072e26
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
%28 = OpLabel
- %29 = OpFunctionCall %void %textureLoad_072e26
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %31 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ OpStore %tint_pointsize %float_1
%32 = OpFunctionCall %void %textureLoad_072e26
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_072e26
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_072e26
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.wgsl
index 2aa87e5..be1af70 100644
--- a/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_072e26();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/078bc4.wgsl b/test/intrinsics/gen/textureLoad/078bc4.wgsl
index 8d8dad3..4546bd6 100644
--- a/test/intrinsics/gen/textureLoad/078bc4.wgsl
+++ b/test/intrinsics/gen/textureLoad/078bc4.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_078bc4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.hlsl
index 794a8fa..75a3b4e 100644
--- a/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<float4> arg_0 : register(t0, space1);
void textureLoad_078bc4() {
float4 res = arg_0.Load(int3(0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_078bc4();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.spvasm
index ecf39b1..197f248 100644
--- a/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_078bc4 "textureLoad_078bc4"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,36 +32,46 @@
%7 = OpTypeImage %float 2D 0 0 0 2 Rgba8Snorm
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %17 = OpConstantNull %v2int
+ %20 = OpConstantNull %v2int
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %20 = OpConstantNull %v4float
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_078bc4 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %20
- %14 = OpLoad %7 %arg_0
- %12 = OpImageRead %v4float %14 %17
- OpStore %res %12
+%textureLoad_078bc4 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageRead %v4float %17 %20
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
- OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_078bc4
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
%26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_078bc4
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
%30 = OpFunctionCall %void %textureLoad_078bc4
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureLoad_078bc4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_078bc4
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.wgsl
index b93303f..f2f0460 100644
--- a/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_078bc4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/127e12.wgsl b/test/intrinsics/gen/textureLoad/127e12.wgsl
index 8070e3c..f30845c 100644
--- a/test/intrinsics/gen/textureLoad/127e12.wgsl
+++ b/test/intrinsics/gen/textureLoad/127e12.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_127e12();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.hlsl
index c4a8638..b1efa7f 100644
--- a/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<uint4> arg_0 : register(t0, space1);
void textureLoad_127e12() {
uint4 res = arg_0.Load(int4(0, 0, 1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_127e12();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.spvasm
index 28b884f..91bdb87 100644
--- a/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 43
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_127e12 "textureLoad_127e12"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,38 +33,50 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4uint = OpTypeVector %uint 4
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %20 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %24 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %23 = OpConstantNull %v4uint
+ %27 = OpConstantNull %v4uint
+ %28 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_127e12 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %23
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4uint %15 %20
- OpStore %res %13
+%textureLoad_127e12 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %27
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4uint %19 %24
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %25 = OpLabel
+%tint_symbol_2 = OpFunction %void None %28
+%tint_symbol = OpFunctionParameter %v4float
+ %31 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %33 = OpLabel
OpStore %tint_pointsize %float_1
- %27 = OpFunctionCall %void %textureLoad_127e12
+ %35 = OpFunctionCall %void %textureLoad_127e12
+ %36 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureLoad_127e12
+%fragment_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_127e12
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureLoad_127e12
+%compute_main = OpFunction %void None %13
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureLoad_127e12
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.wgsl
index 1890d11..aed5d39 100644
--- a/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_127e12();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/1561a7.wgsl b/test/intrinsics/gen/textureLoad/1561a7.wgsl
index 44c713e..c80775f 100644
--- a/test/intrinsics/gen/textureLoad/1561a7.wgsl
+++ b/test/intrinsics/gen/textureLoad/1561a7.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_1561a7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.hlsl
index c571701..74ea856 100644
--- a/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<uint4> arg_0 : register(t0, space1);
void textureLoad_1561a7() {
uint4 res = arg_0.Load(int2(1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_1561a7();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.spvasm
index aa226e0..a25cc2b 100644
--- a/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_1561a7 "textureLoad_1561a7"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %uint 1D 0 0 0 2 R32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4uint = OpTypeVector %uint 4
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %20 = OpConstantNull %v4uint
+ %24 = OpConstantNull %v4uint
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_1561a7 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %20
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4uint %15 %int_1
- OpStore %res %13
+%textureLoad_1561a7 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %24
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4uint %19 %int_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_1561a7
+ %32 = OpFunctionCall %void %textureLoad_1561a7
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_1561a7
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_1561a7
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureLoad_1561a7
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_1561a7
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.wgsl
index 85e7bac..4aa8b44 100644
--- a/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_1561a7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/19cf87.wgsl b/test/intrinsics/gen/textureLoad/19cf87.wgsl
index 561eea2..aec562b 100644
--- a/test/intrinsics/gen/textureLoad/19cf87.wgsl
+++ b/test/intrinsics/gen/textureLoad/19cf87.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_19cf87();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.hlsl
index dfaa30b..5f11c6a 100644
--- a/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D arg_0 : register(t0, space1);
void textureLoad_19cf87() {
float res = arg_0.Load(int3(0, 0, 0), 1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_19cf87();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.spvasm
index 08cba67..dfa8896 100644
--- a/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.spvasm
@@ -1,25 +1,29 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 40
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_19cf87 "textureLoad_19cf87"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -27,37 +31,48 @@
%7 = OpTypeImage %float 2D 1 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %18 = OpConstantNull %v2int
+ %21 = OpConstantNull %v2int
%int_1 = OpConstant %int 1
%_ptr_Function_float = OpTypePointer Function %float
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_19cf87 = OpFunction %void None %8
- %11 = OpLabel
+%textureLoad_19cf87 = OpFunction %void None %12
+ %15 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %15 = OpLoad %7 %arg_0
- %13 = OpImageFetch %v4float %15 %18 Lod %int_1
- %12 = OpCompositeExtract %float %13 0
- OpStore %res %12
+ %18 = OpLoad %7 %arg_0
+ %17 = OpImageFetch %v4float %18 %21 Lod %int_1
+ %16 = OpCompositeExtract %float %17 0
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %23 = OpLabel
- OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureLoad_19cf87
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureLoad_19cf87
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %8
+%vertex_main = OpFunction %void None %12
%30 = OpLabel
- %31 = OpFunctionCall %void %textureLoad_19cf87
+ OpStore %tint_pointsize %float_1
+ %32 = OpFunctionCall %void %textureLoad_19cf87
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_19cf87
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_19cf87
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.wgsl
index 6170911..91d4c2e 100644
--- a/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_19cf87();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/1a062f.wgsl b/test/intrinsics/gen/textureLoad/1a062f.wgsl
index 4d030e7..d481613 100644
--- a/test/intrinsics/gen/textureLoad/1a062f.wgsl
+++ b/test/intrinsics/gen/textureLoad/1a062f.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_1a062f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.hlsl
index d55f5bf..dcdfed8 100644
--- a/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
void textureLoad_1a062f() {
float4 res = arg_0.Load(int4(0, 0, 1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_1a062f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.spvasm
index 9fa17bc..dcc4463 100644
--- a/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 40
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_1a062f "textureLoad_1a062f"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,38 +32,48 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %22 = OpConstantNull %v4float
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_1a062f = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %22
- %14 = OpLoad %7 %arg_0
- %12 = OpImageRead %v4float %14 %19
- OpStore %res %12
+%textureLoad_1a062f = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageRead %v4float %17 %22
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %24 = OpLabel
- OpStore %tint_pointsize %float_1
- %26 = OpFunctionCall %void %textureLoad_1a062f
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
%28 = OpLabel
- %29 = OpFunctionCall %void %textureLoad_1a062f
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %31 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ OpStore %tint_pointsize %float_1
%32 = OpFunctionCall %void %textureLoad_1a062f
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_1a062f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_1a062f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.wgsl
index 81a3f1f..7c6460a 100644
--- a/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_1a062f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/1a8452.wgsl b/test/intrinsics/gen/textureLoad/1a8452.wgsl
index 33f2e74..3f0239d 100644
--- a/test/intrinsics/gen/textureLoad/1a8452.wgsl
+++ b/test/intrinsics/gen/textureLoad/1a8452.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_1a8452();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.hlsl
index ca566ee..3df19c6 100644
--- a/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<uint4> arg_0 : register(t0, space1);
void textureLoad_1a8452() {
uint4 res = arg_0.Load(int2(1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_1a8452();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.spvasm
index 33cabbb..024845b 100644
--- a/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_1a8452 "textureLoad_1a8452"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %uint 1D 0 0 0 2 Rgba8ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4uint = OpTypeVector %uint 4
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %20 = OpConstantNull %v4uint
+ %24 = OpConstantNull %v4uint
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_1a8452 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %20
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4uint %15 %int_1
- OpStore %res %13
+%textureLoad_1a8452 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %24
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4uint %19 %int_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_1a8452
+ %32 = OpFunctionCall %void %textureLoad_1a8452
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_1a8452
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_1a8452
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureLoad_1a8452
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_1a8452
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.wgsl
index ac00f2b..61bda65 100644
--- a/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_1a8452();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/1b8588.wgsl b/test/intrinsics/gen/textureLoad/1b8588.wgsl
index 9f9aa3c..ff1bc98 100644
--- a/test/intrinsics/gen/textureLoad/1b8588.wgsl
+++ b/test/intrinsics/gen/textureLoad/1b8588.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_1b8588();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.hlsl
index 2839532..3e094b8 100644
--- a/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<uint4> arg_0 : register(t0, space1);
void textureLoad_1b8588() {
uint4 res = arg_0.Load(int2(1, 0), 1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_1b8588();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.spvasm
index bbb2eb8..718494f 100644
--- a/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_1b8588 "textureLoad_1b8588"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,47 @@
%7 = OpTypeImage %uint 1D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4uint = OpTypeVector %uint 4
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %20 = OpConstantNull %v4uint
+ %24 = OpConstantNull %v4uint
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_1b8588 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %20
- %15 = OpLoad %7 %arg_0
- %13 = OpImageFetch %v4uint %15 %int_1 Lod %int_1
- OpStore %res %13
+%textureLoad_1b8588 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %24
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageFetch %v4uint %19 %int_1 Lod %int_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_1b8588
+ %32 = OpFunctionCall %void %textureLoad_1b8588
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_1b8588
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_1b8588
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureLoad_1b8588
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_1b8588
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.wgsl
index 643b291..b921099 100644
--- a/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_1b8588();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/1f2016.wgsl b/test/intrinsics/gen/textureLoad/1f2016.wgsl
index 9203100..d547cfb 100644
--- a/test/intrinsics/gen/textureLoad/1f2016.wgsl
+++ b/test/intrinsics/gen/textureLoad/1f2016.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_1f2016();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.hlsl
index 58fdcc6..d4d2513 100644
--- a/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<float4> arg_0 : register(t0, space1);
void textureLoad_1f2016() {
float4 res = arg_0.Load(int4(0, 0, 0, 0), 1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_1f2016();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.spvasm
index e619f07..75b765a 100644
--- a/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.spvasm
@@ -1,25 +1,29 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_1f2016 "textureLoad_1f2016"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -27,37 +31,47 @@
%7 = OpTypeImage %float 3D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %17 = OpConstantNull %v3int
+ %20 = OpConstantNull %v3int
%int_1 = OpConstant %int 1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %21 = OpConstantNull %v4float
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_1f2016 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %21
- %14 = OpLoad %7 %arg_0
- %12 = OpImageFetch %v4float %14 %17 Lod %int_1
- OpStore %res %12
+%textureLoad_1f2016 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageFetch %v4float %17 %20 Lod %int_1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %23 = OpLabel
- OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureLoad_1f2016
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
%27 = OpLabel
- %28 = OpFunctionCall %void %textureLoad_1f2016
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %30 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ OpStore %tint_pointsize %float_1
%31 = OpFunctionCall %void %textureLoad_1f2016
+ %32 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureLoad_1f2016
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_1f2016
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.wgsl
index 94202f9..895b702 100644
--- a/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_1f2016();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/20fa2f.wgsl b/test/intrinsics/gen/textureLoad/20fa2f.wgsl
index 3ea6735..0715932 100644
--- a/test/intrinsics/gen/textureLoad/20fa2f.wgsl
+++ b/test/intrinsics/gen/textureLoad/20fa2f.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_20fa2f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.hlsl
index ad5376e..addc787 100644
--- a/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
void textureLoad_20fa2f() {
float4 res = arg_0.Load(int4(0, 0, 1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_20fa2f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.spvasm
index 38e66ad..131ef51 100644
--- a/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_20fa2f "textureLoad_20fa2f"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,38 +33,48 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rg32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %22 = OpConstantNull %v4float
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_20fa2f = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %22
- %14 = OpLoad %7 %arg_0
- %12 = OpImageRead %v4float %14 %19
- OpStore %res %12
+%textureLoad_20fa2f = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageRead %v4float %17 %22
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %24 = OpLabel
- OpStore %tint_pointsize %float_1
- %26 = OpFunctionCall %void %textureLoad_20fa2f
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
%28 = OpLabel
- %29 = OpFunctionCall %void %textureLoad_20fa2f
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %31 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ OpStore %tint_pointsize %float_1
%32 = OpFunctionCall %void %textureLoad_20fa2f
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_20fa2f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_20fa2f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.wgsl
index ef0765a..1f5f4cf 100644
--- a/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_20fa2f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/276a2c.wgsl b/test/intrinsics/gen/textureLoad/276a2c.wgsl
index 8a841e7..1f543c6 100644
--- a/test/intrinsics/gen/textureLoad/276a2c.wgsl
+++ b/test/intrinsics/gen/textureLoad/276a2c.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_276a2c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.hlsl
index 1e7103a..aa337f1 100644
--- a/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<uint4> arg_0 : register(t0, space1);
void textureLoad_276a2c() {
uint4 res = arg_0.Load(int2(1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_276a2c();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.spvasm
index fa976935..4df9680 100644
--- a/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_276a2c "textureLoad_276a2c"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %uint 1D 0 0 0 2 Rgba32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4uint = OpTypeVector %uint 4
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %20 = OpConstantNull %v4uint
+ %24 = OpConstantNull %v4uint
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_276a2c = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %20
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4uint %15 %int_1
- OpStore %res %13
+%textureLoad_276a2c = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %24
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4uint %19 %int_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_276a2c
+ %32 = OpFunctionCall %void %textureLoad_276a2c
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_276a2c
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_276a2c
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureLoad_276a2c
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_276a2c
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.wgsl
index b8110cd..03d832b 100644
--- a/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_276a2c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/2887d7.wgsl b/test/intrinsics/gen/textureLoad/2887d7.wgsl
index 1f2018c..961fba0 100644
--- a/test/intrinsics/gen/textureLoad/2887d7.wgsl
+++ b/test/intrinsics/gen/textureLoad/2887d7.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_2887d7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.hlsl
index b3b3d1e..9e78927 100644
--- a/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<float4> arg_0 : register(t0, space1);
void textureLoad_2887d7() {
float4 res = arg_0.Load(int2(1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_2887d7();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.spvasm
index 8a626fd..e78db05 100644
--- a/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_2887d7 "textureLoad_2887d7"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,45 @@
%7 = OpTypeImage %float 1D 0 0 0 2 Rgba32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %19 = OpConstantNull %v4float
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_2887d7 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %19
- %14 = OpLoad %7 %arg_0
- %12 = OpImageRead %v4float %14 %int_1
- OpStore %res %12
+%textureLoad_2887d7 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageRead %v4float %17 %int_1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
- OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureLoad_2887d7
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
%25 = OpLabel
- %26 = OpFunctionCall %void %textureLoad_2887d7
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ OpStore %tint_pointsize %float_1
%29 = OpFunctionCall %void %textureLoad_2887d7
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureLoad_2887d7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_2887d7
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.wgsl
index fdcb0fd..1e7da98 100644
--- a/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_2887d7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/2ae485.wgsl b/test/intrinsics/gen/textureLoad/2ae485.wgsl
index 6f9958f..0c5b1e6 100644
--- a/test/intrinsics/gen/textureLoad/2ae485.wgsl
+++ b/test/intrinsics/gen/textureLoad/2ae485.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_2ae485();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.hlsl
index f7bc458..11ca6c7 100644
--- a/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<int4> arg_0 : register(t0, space1);
void textureLoad_2ae485() {
int4 res = arg_0.Load(int3(0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_2ae485();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.spvasm
index 017de96..988dba1 100644
--- a/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_2ae485 "textureLoad_2ae485"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,47 @@
%7 = OpTypeImage %int 2D 0 0 0 2 Rgba16i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4int = OpTypeVector %int 4
%v2int = OpTypeVector %int 2
- %17 = OpConstantNull %v2int
+ %21 = OpConstantNull %v2int
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %20 = OpConstantNull %v4int
+ %24 = OpConstantNull %v4int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_2ae485 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %20
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4int %15 %17
- OpStore %res %13
+%textureLoad_2ae485 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %24
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4int %19 %21
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_2ae485
+ %32 = OpFunctionCall %void %textureLoad_2ae485
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_2ae485
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_2ae485
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureLoad_2ae485
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_2ae485
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.wgsl
index c15430e..94ee8c4 100644
--- a/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_2ae485();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl
index c04b9f5..d5d2260 100644
--- a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl
+++ b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_2d6cf7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.hlsl
index b747bda..ac1b9b7 100644
--- a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<int4> arg_0 : register(t0, space1);
void textureLoad_2d6cf7() {
int4 res = arg_0.Load(int2(1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_2d6cf7();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.spvasm
index dc72114..988604b 100644
--- a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_2d6cf7 "textureLoad_2d6cf7"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,34 +35,46 @@
%7 = OpTypeImage %int 1D 0 0 0 2 Rg32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4int = OpTypeVector %int 4
%int_1 = OpConstant %int 1
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %19 = OpConstantNull %v4int
+ %23 = OpConstantNull %v4int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_2d6cf7 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %19
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4int %15 %int_1
- OpStore %res %13
+%textureLoad_2d6cf7 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %23
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4int %19 %int_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureLoad_2d6cf7
+ %31 = OpFunctionCall %void %textureLoad_2d6cf7
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureLoad_2d6cf7
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureLoad_2d6cf7
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureLoad_2d6cf7
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_2d6cf7
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.wgsl
index 1ada169..ead2ebf 100644
--- a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_2d6cf7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl
index eccc28c..a22a1db 100644
--- a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl
+++ b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_3c0d9e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.hlsl
index 560a7c3..74eb0ee 100644
--- a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<uint4> arg_0 : register(t0, space1);
void textureLoad_3c0d9e() {
uint4 res = arg_0.Load(int3(0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_3c0d9e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.spvasm
index 0dee741..fbc42a7 100644
--- a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_3c0d9e "textureLoad_3c0d9e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %uint 2D 0 0 0 2 Rgba8ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4uint = OpTypeVector %uint 4
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %21 = OpConstantNull %v4uint
+ %25 = OpConstantNull %v4uint
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_3c0d9e = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %21
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4uint %15 %18
- OpStore %res %13
+%textureLoad_3c0d9e = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %25
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4uint %19 %22
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureLoad_3c0d9e
+ %33 = OpFunctionCall %void %textureLoad_3c0d9e
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureLoad_3c0d9e
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_3c0d9e
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureLoad_3c0d9e
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_3c0d9e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.wgsl
index 36608fe..90a425b 100644
--- a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_3c0d9e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/3c9587.wgsl b/test/intrinsics/gen/textureLoad/3c9587.wgsl
index 9d4616b..dde893f 100644
--- a/test/intrinsics/gen/textureLoad/3c9587.wgsl
+++ b/test/intrinsics/gen/textureLoad/3c9587.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_3c9587();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.hlsl
index a351a56..3cc65d9 100644
--- a/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<float4> arg_0 : register(t0, space1);
void textureLoad_3c9587() {
float4 res = arg_0.Load(int3(0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_3c9587();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.spvasm
index a209011..b358084 100644
--- a/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_3c9587 "textureLoad_3c9587"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,36 +32,46 @@
%7 = OpTypeImage %float 2D 0 0 0 2 Rgba8
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %17 = OpConstantNull %v2int
+ %20 = OpConstantNull %v2int
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %20 = OpConstantNull %v4float
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_3c9587 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %20
- %14 = OpLoad %7 %arg_0
- %12 = OpImageRead %v4float %14 %17
- OpStore %res %12
+%textureLoad_3c9587 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageRead %v4float %17 %20
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
- OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_3c9587
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
%26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_3c9587
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
%30 = OpFunctionCall %void %textureLoad_3c9587
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureLoad_3c9587
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_3c9587
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.wgsl
index 887771f..c0e77d0 100644
--- a/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_3c9587();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/3d001b.wgsl b/test/intrinsics/gen/textureLoad/3d001b.wgsl
index 5c663cd..52b5b7b 100644
--- a/test/intrinsics/gen/textureLoad/3d001b.wgsl
+++ b/test/intrinsics/gen/textureLoad/3d001b.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_3d001b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.hlsl
index 0576fe6..0919175 100644
--- a/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<int4> arg_0 : register(t0, space1);
void textureLoad_3d001b() {
int4 res = arg_0.Load(int4(0, 0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_3d001b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.spvasm
index 61dba8e..efff9eb 100644
--- a/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_3d001b "textureLoad_3d001b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,47 @@
%7 = OpTypeImage %int 3D 0 0 0 2 Rgba8i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4int = OpTypeVector %int 4
%v3int = OpTypeVector %int 3
- %17 = OpConstantNull %v3int
+ %21 = OpConstantNull %v3int
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %20 = OpConstantNull %v4int
+ %24 = OpConstantNull %v4int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_3d001b = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %20
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4int %15 %17
- OpStore %res %13
+%textureLoad_3d001b = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %24
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4int %19 %21
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_3d001b
+ %32 = OpFunctionCall %void %textureLoad_3d001b
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_3d001b
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_3d001b
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureLoad_3d001b
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_3d001b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.wgsl
index 3ef3d15..47f2b47 100644
--- a/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_3d001b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/3d9c90.wgsl b/test/intrinsics/gen/textureLoad/3d9c90.wgsl
index 09e6ede..5b916fc 100644
--- a/test/intrinsics/gen/textureLoad/3d9c90.wgsl
+++ b/test/intrinsics/gen/textureLoad/3d9c90.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_3d9c90();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.hlsl
index e169362..e991854 100644
--- a/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<float4> arg_0 : register(t0, space1);
void textureLoad_3d9c90() {
float4 res = arg_0.Load(int4(0, 0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_3d9c90();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.spvasm
index b41a433..0e81340 100644
--- a/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_3d9c90 "textureLoad_3d9c90"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,36 +32,46 @@
%7 = OpTypeImage %float 3D 0 0 0 2 Rgba32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %17 = OpConstantNull %v3int
+ %20 = OpConstantNull %v3int
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %20 = OpConstantNull %v4float
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_3d9c90 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %20
- %14 = OpLoad %7 %arg_0
- %12 = OpImageRead %v4float %14 %17
- OpStore %res %12
+%textureLoad_3d9c90 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageRead %v4float %17 %20
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
- OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_3d9c90
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
%26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_3d9c90
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
%30 = OpFunctionCall %void %textureLoad_3d9c90
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureLoad_3d9c90
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_3d9c90
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.wgsl
index 546b4dc..5110820 100644
--- a/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_3d9c90();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/484344.wgsl b/test/intrinsics/gen/textureLoad/484344.wgsl
index 941c5c1..44ba759 100644
--- a/test/intrinsics/gen/textureLoad/484344.wgsl
+++ b/test/intrinsics/gen/textureLoad/484344.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_484344();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/484344.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.hlsl
index 76de864..69a42db 100644
--- a/test/intrinsics/gen/textureLoad/484344.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<float4> arg_0 : register(t0, space1);
void textureLoad_484344() {
float4 res = arg_0.Load(int3(0, 0, 0), 1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_484344();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/484344.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.spvasm
index 083475d..df04a3f 100644
--- a/test/intrinsics/gen/textureLoad/484344.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.spvasm
@@ -1,25 +1,29 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_484344 "textureLoad_484344"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -27,37 +31,47 @@
%7 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %17 = OpConstantNull %v2int
+ %20 = OpConstantNull %v2int
%int_1 = OpConstant %int 1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %21 = OpConstantNull %v4float
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_484344 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %21
- %14 = OpLoad %7 %arg_0
- %12 = OpImageFetch %v4float %14 %17 Lod %int_1
- OpStore %res %12
+%textureLoad_484344 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageFetch %v4float %17 %20 Lod %int_1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %23 = OpLabel
- OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureLoad_484344
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
%27 = OpLabel
- %28 = OpFunctionCall %void %textureLoad_484344
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %30 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ OpStore %tint_pointsize %float_1
%31 = OpFunctionCall %void %textureLoad_484344
+ %32 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureLoad_484344
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_484344
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/484344.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.wgsl
index 8776b0a..054b079 100644
--- a/test/intrinsics/gen/textureLoad/484344.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_484344();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/4fd803.wgsl b/test/intrinsics/gen/textureLoad/4fd803.wgsl
index 747d2ad..e55655d 100644
--- a/test/intrinsics/gen/textureLoad/4fd803.wgsl
+++ b/test/intrinsics/gen/textureLoad/4fd803.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_4fd803();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.hlsl
index 7e4d6c0..e2cb13e 100644
--- a/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<int4> arg_0 : register(t0, space1);
void textureLoad_4fd803() {
int4 res = arg_0.Load(int4(0, 0, 0, 0), 1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_4fd803();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.spvasm
index 8ca0c65..4387f2b 100644
--- a/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.spvasm
@@ -1,25 +1,29 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_4fd803 "textureLoad_4fd803"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,36 +32,48 @@
%7 = OpTypeImage %int 3D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4int = OpTypeVector %int 4
%v3int = OpTypeVector %int 3
- %17 = OpConstantNull %v3int
+ %21 = OpConstantNull %v3int
%int_1 = OpConstant %int 1
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %21 = OpConstantNull %v4int
+ %25 = OpConstantNull %v4int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_4fd803 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %21
- %15 = OpLoad %7 %arg_0
- %13 = OpImageFetch %v4int %15 %17 Lod %int_1
- OpStore %res %13
+%textureLoad_4fd803 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %25
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageFetch %v4int %19 %21 Lod %int_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureLoad_4fd803
+ %33 = OpFunctionCall %void %textureLoad_4fd803
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureLoad_4fd803
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_4fd803
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureLoad_4fd803
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_4fd803
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.wgsl
index 6bea105..45ce291 100644
--- a/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_4fd803();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/505aa2.wgsl b/test/intrinsics/gen/textureLoad/505aa2.wgsl
index 476e534..7ca4b04 100644
--- a/test/intrinsics/gen/textureLoad/505aa2.wgsl
+++ b/test/intrinsics/gen/textureLoad/505aa2.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_505aa2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.hlsl
index df305d0..587912c 100644
--- a/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<int4> arg_0 : register(t0, space1);
void textureLoad_505aa2() {
int4 res = arg_0.Load(int4(0, 0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_505aa2();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.spvasm
index 799937e..48057a7 100644
--- a/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_505aa2 "textureLoad_505aa2"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,47 @@
%7 = OpTypeImage %int 3D 0 0 0 2 R32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4int = OpTypeVector %int 4
%v3int = OpTypeVector %int 3
- %17 = OpConstantNull %v3int
+ %21 = OpConstantNull %v3int
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %20 = OpConstantNull %v4int
+ %24 = OpConstantNull %v4int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_505aa2 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %20
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4int %15 %17
- OpStore %res %13
+%textureLoad_505aa2 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %24
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4int %19 %21
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_505aa2
+ %32 = OpFunctionCall %void %textureLoad_505aa2
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_505aa2
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_505aa2
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureLoad_505aa2
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_505aa2
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.wgsl
index 380f1f9..4e4c985 100644
--- a/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_505aa2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/519ab5.wgsl b/test/intrinsics/gen/textureLoad/519ab5.wgsl
index 018941a..6d2ffff 100644
--- a/test/intrinsics/gen/textureLoad/519ab5.wgsl
+++ b/test/intrinsics/gen/textureLoad/519ab5.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_519ab5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.hlsl
index 2a8f26b..2dbc3ca 100644
--- a/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<float4> arg_0 : register(t0, space1);
void textureLoad_519ab5() {
float4 res = arg_0.Load(int2(1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_519ab5();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.spvasm
index 6afde50..3eb5d5a 100644
--- a/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_519ab5 "textureLoad_519ab5"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,45 @@
%7 = OpTypeImage %float 1D 0 0 0 2 Rgba8
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %19 = OpConstantNull %v4float
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_519ab5 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %19
- %14 = OpLoad %7 %arg_0
- %12 = OpImageRead %v4float %14 %int_1
- OpStore %res %12
+%textureLoad_519ab5 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageRead %v4float %17 %int_1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
- OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureLoad_519ab5
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
%25 = OpLabel
- %26 = OpFunctionCall %void %textureLoad_519ab5
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ OpStore %tint_pointsize %float_1
%29 = OpFunctionCall %void %textureLoad_519ab5
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureLoad_519ab5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_519ab5
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.wgsl
index 2135d0d..aa8b4a4 100644
--- a/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_519ab5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/53378a.wgsl b/test/intrinsics/gen/textureLoad/53378a.wgsl
index 7b22635..518b5d4 100644
--- a/test/intrinsics/gen/textureLoad/53378a.wgsl
+++ b/test/intrinsics/gen/textureLoad/53378a.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_53378a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.hlsl
index 0d1db96..784f6e4 100644
--- a/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<int4> arg_0 : register(t0, space1);
void textureLoad_53378a() {
int4 res = arg_0.Load(int3(0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_53378a();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.spvasm
index b916b86..795cae1 100644
--- a/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_53378a "textureLoad_53378a"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %int 2D 0 0 0 2 Rg32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4int = OpTypeVector %int 4
%v2int = OpTypeVector %int 2
- %17 = OpConstantNull %v2int
+ %21 = OpConstantNull %v2int
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %20 = OpConstantNull %v4int
+ %24 = OpConstantNull %v4int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_53378a = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %20
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4int %15 %17
- OpStore %res %13
+%textureLoad_53378a = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %24
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4int %19 %21
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_53378a
+ %32 = OpFunctionCall %void %textureLoad_53378a
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_53378a
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_53378a
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureLoad_53378a
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_53378a
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.wgsl
index 0310fa3..d0647006 100644
--- a/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_53378a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/560573.wgsl b/test/intrinsics/gen/textureLoad/560573.wgsl
index 172dccd..b231a5d 100644
--- a/test/intrinsics/gen/textureLoad/560573.wgsl
+++ b/test/intrinsics/gen/textureLoad/560573.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_560573();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/560573.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.hlsl
index 4543212..f5ac476 100644
--- a/test/intrinsics/gen/textureLoad/560573.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<int4> arg_0 : register(t0, space1);
void textureLoad_560573() {
int4 res = arg_0.Load(int4(0, 0, 1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_560573();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/560573.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.spvasm
index 36259a7..7922760 100644
--- a/test/intrinsics/gen/textureLoad/560573.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 42
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_560573 "textureLoad_560573"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,37 +33,49 @@
%7 = OpTypeImage %int 2D 0 1 0 2 R32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4int = OpTypeVector %int 4
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %22 = OpConstantNull %v4int
+ %26 = OpConstantNull %v4int
+ %27 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_560573 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %22
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4int %15 %19
- OpStore %res %13
+%textureLoad_560573 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %26
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4int %19 %23
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %24 = OpLabel
+%tint_symbol_2 = OpFunction %void None %27
+%tint_symbol = OpFunctionParameter %v4float
+ %30 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
OpStore %tint_pointsize %float_1
- %26 = OpFunctionCall %void %textureLoad_560573
+ %34 = OpFunctionCall %void %textureLoad_560573
+ %35 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureLoad_560573
+%fragment_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_560573
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureLoad_560573
+%compute_main = OpFunction %void None %13
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureLoad_560573
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/560573.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.wgsl
index 3a6f48e..e464c72 100644
--- a/test/intrinsics/gen/textureLoad/560573.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_560573();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/582015.wgsl b/test/intrinsics/gen/textureLoad/582015.wgsl
index 07d3370..d1dd700 100644
--- a/test/intrinsics/gen/textureLoad/582015.wgsl
+++ b/test/intrinsics/gen/textureLoad/582015.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_582015();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/582015.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.hlsl
index cb7a094..42e6c5b 100644
--- a/test/intrinsics/gen/textureLoad/582015.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<int4> arg_0 : register(t0, space1);
void textureLoad_582015() {
int4 res = arg_0.Load(int4(0, 0, 1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_582015();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/582015.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.spvasm
index 0af201a..8ab0dc0 100644
--- a/test/intrinsics/gen/textureLoad/582015.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 42
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_582015 "textureLoad_582015"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,37 +33,49 @@
%7 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4int = OpTypeVector %int 4
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %22 = OpConstantNull %v4int
+ %26 = OpConstantNull %v4int
+ %27 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_582015 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %22
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4int %15 %19
- OpStore %res %13
+%textureLoad_582015 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %26
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4int %19 %23
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %24 = OpLabel
+%tint_symbol_2 = OpFunction %void None %27
+%tint_symbol = OpFunctionParameter %v4float
+ %30 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
OpStore %tint_pointsize %float_1
- %26 = OpFunctionCall %void %textureLoad_582015
+ %34 = OpFunctionCall %void %textureLoad_582015
+ %35 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureLoad_582015
+%fragment_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_582015
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureLoad_582015
+%compute_main = OpFunction %void None %13
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureLoad_582015
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/582015.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.wgsl
index 21b6237..07a18af 100644
--- a/test/intrinsics/gen/textureLoad/582015.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_582015();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl
index 1b876ab..ff4b817 100644
--- a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl
+++ b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_5a2f9d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.hlsl
index 2d4ad36..26e3af2 100644
--- a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<int4> arg_0 : register(t0, space1);
void textureLoad_5a2f9d() {
int4 res = arg_0.Load(int2(1, 0), 1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_5a2f9d();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.spvasm
index 82ae564..dffe9a1 100644
--- a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_5a2f9d "textureLoad_5a2f9d"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %int 1D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4int = OpTypeVector %int 4
%int_1 = OpConstant %int 1
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %19 = OpConstantNull %v4int
+ %23 = OpConstantNull %v4int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_5a2f9d = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %19
- %15 = OpLoad %7 %arg_0
- %13 = OpImageFetch %v4int %15 %int_1 Lod %int_1
- OpStore %res %13
+%textureLoad_5a2f9d = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %23
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageFetch %v4int %19 %int_1 Lod %int_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureLoad_5a2f9d
+ %31 = OpFunctionCall %void %textureLoad_5a2f9d
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureLoad_5a2f9d
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureLoad_5a2f9d
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureLoad_5a2f9d
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_5a2f9d
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.wgsl
index 22da997..28a202b 100644
--- a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_5a2f9d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl
index a698444..66b788e 100644
--- a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl
+++ b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_5bb7fb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.hlsl
index 82ce725..3ea73c1 100644
--- a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<uint4> arg_0 : register(t0, space1);
void textureLoad_5bb7fb() {
uint4 res = arg_0.Load(int2(1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_5bb7fb();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.spvasm
index e82fd45..45b99ca 100644
--- a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_5bb7fb "textureLoad_5bb7fb"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,35 +35,47 @@
%7 = OpTypeImage %uint 1D 0 0 0 2 Rg32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4uint = OpTypeVector %uint 4
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %20 = OpConstantNull %v4uint
+ %24 = OpConstantNull %v4uint
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_5bb7fb = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %20
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4uint %15 %int_1
- OpStore %res %13
+%textureLoad_5bb7fb = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %24
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4uint %19 %int_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_5bb7fb
+ %32 = OpFunctionCall %void %textureLoad_5bb7fb
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_5bb7fb
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_5bb7fb
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureLoad_5bb7fb
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_5bb7fb
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.wgsl
index 9336c2d..28eb64c 100644
--- a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_5bb7fb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl
index 605696e..19039d6 100644
--- a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl
+++ b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_5d0a2f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.hlsl
index 279b8b2..5bc1492 100644
--- a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<uint4> arg_0 : register(t0, space1);
void textureLoad_5d0a2f() {
uint4 res = arg_0.Load(int4(0, 0, 1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_5d0a2f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.spvasm
index 1393b72..eb612ce 100644
--- a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 43
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_5d0a2f "textureLoad_5d0a2f"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,38 +33,50 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 R32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4uint = OpTypeVector %uint 4
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %20 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %24 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %23 = OpConstantNull %v4uint
+ %27 = OpConstantNull %v4uint
+ %28 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_5d0a2f = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %23
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4uint %15 %20
- OpStore %res %13
+%textureLoad_5d0a2f = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %27
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4uint %19 %24
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %25 = OpLabel
+%tint_symbol_2 = OpFunction %void None %28
+%tint_symbol = OpFunctionParameter %v4float
+ %31 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %33 = OpLabel
OpStore %tint_pointsize %float_1
- %27 = OpFunctionCall %void %textureLoad_5d0a2f
+ %35 = OpFunctionCall %void %textureLoad_5d0a2f
+ %36 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureLoad_5d0a2f
+%fragment_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_5d0a2f
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureLoad_5d0a2f
+%compute_main = OpFunction %void None %13
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureLoad_5d0a2f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.wgsl
index 57d879a..281d549 100644
--- a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_5d0a2f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/6154d4.wgsl b/test/intrinsics/gen/textureLoad/6154d4.wgsl
index 4cffca1..3ef3e3f 100644
--- a/test/intrinsics/gen/textureLoad/6154d4.wgsl
+++ b/test/intrinsics/gen/textureLoad/6154d4.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_6154d4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.hlsl
index f66dcc0..505dd5b 100644
--- a/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<uint4> arg_0 : register(t0, space1);
void textureLoad_6154d4() {
uint4 res = arg_0.Load(int3(0, 0, 0), 1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_6154d4();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.spvasm
index c9b3a24..86aaa23 100644
--- a/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.spvasm
@@ -1,25 +1,29 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 42
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_6154d4 "textureLoad_6154d4"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,37 +32,49 @@
%7 = OpTypeImage %uint 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4uint = OpTypeVector %uint 4
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
%int_1 = OpConstant %int 1
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %22 = OpConstantNull %v4uint
+ %26 = OpConstantNull %v4uint
+ %27 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_6154d4 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %22
- %15 = OpLoad %7 %arg_0
- %13 = OpImageFetch %v4uint %15 %18 Lod %int_1
- OpStore %res %13
+%textureLoad_6154d4 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %26
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageFetch %v4uint %19 %22 Lod %int_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %24 = OpLabel
+%tint_symbol_2 = OpFunction %void None %27
+%tint_symbol = OpFunctionParameter %v4float
+ %30 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
OpStore %tint_pointsize %float_1
- %26 = OpFunctionCall %void %textureLoad_6154d4
+ %34 = OpFunctionCall %void %textureLoad_6154d4
+ %35 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureLoad_6154d4
+%fragment_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_6154d4
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureLoad_6154d4
+%compute_main = OpFunction %void None %13
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureLoad_6154d4
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.wgsl
index 21aa49a..c9eec01 100644
--- a/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_6154d4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/62d125.wgsl b/test/intrinsics/gen/textureLoad/62d125.wgsl
index c3e1ed0..f8bcc8c 100644
--- a/test/intrinsics/gen/textureLoad/62d125.wgsl
+++ b/test/intrinsics/gen/textureLoad/62d125.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_62d125();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.hlsl
index d099ebf..a00da07 100644
--- a/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<float4> arg_0 : register(t0, space1);
void textureLoad_62d125() {
float4 res = arg_0.Load(int4(0, 0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_62d125();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.spvasm
index 34ab6f8..3dda898 100644
--- a/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_62d125 "textureLoad_62d125"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,36 +32,46 @@
%7 = OpTypeImage %float 3D 0 0 0 2 Rgba8Snorm
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %17 = OpConstantNull %v3int
+ %20 = OpConstantNull %v3int
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %20 = OpConstantNull %v4float
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_62d125 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %20
- %14 = OpLoad %7 %arg_0
- %12 = OpImageRead %v4float %14 %17
- OpStore %res %12
+%textureLoad_62d125 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageRead %v4float %17 %20
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
- OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_62d125
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
%26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_62d125
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
%30 = OpFunctionCall %void %textureLoad_62d125
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureLoad_62d125
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_62d125
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.wgsl
index 1035db6..a0f70c0 100644
--- a/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_62d125();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/6678b6.wgsl b/test/intrinsics/gen/textureLoad/6678b6.wgsl
index d862939..b919321 100644
--- a/test/intrinsics/gen/textureLoad/6678b6.wgsl
+++ b/test/intrinsics/gen/textureLoad/6678b6.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_6678b6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.hlsl
index c412e7c..299001d 100644
--- a/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<int4> arg_0 : register(t0, space1);
void textureLoad_6678b6() {
int4 res = arg_0.Load(int2(1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_6678b6();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.spvasm
index d0098ed..a6aa4bb 100644
--- a/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_6678b6 "textureLoad_6678b6"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %int 1D 0 0 0 2 Rgba16i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4int = OpTypeVector %int 4
%int_1 = OpConstant %int 1
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %19 = OpConstantNull %v4int
+ %23 = OpConstantNull %v4int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_6678b6 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %19
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4int %15 %int_1
- OpStore %res %13
+%textureLoad_6678b6 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %23
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4int %19 %int_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureLoad_6678b6
+ %31 = OpFunctionCall %void %textureLoad_6678b6
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureLoad_6678b6
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureLoad_6678b6
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureLoad_6678b6
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_6678b6
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.wgsl
index 65efde1..3eede21 100644
--- a/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_6678b6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/67edca.wgsl b/test/intrinsics/gen/textureLoad/67edca.wgsl
index 934f632..bce74a8 100644
--- a/test/intrinsics/gen/textureLoad/67edca.wgsl
+++ b/test/intrinsics/gen/textureLoad/67edca.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_67edca();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.hlsl
index ef0fc27..b84fd9e 100644
--- a/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<uint4> arg_0 : register(t0, space1);
void textureLoad_67edca() {
uint4 res = arg_0.Load(int4(0, 0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_67edca();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.spvasm
index 5e13182..a5092e1 100644
--- a/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_67edca "textureLoad_67edca"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %uint 3D 0 0 0 2 Rgba32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4uint = OpTypeVector %uint 4
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %21 = OpConstantNull %v4uint
+ %25 = OpConstantNull %v4uint
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_67edca = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %21
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4uint %15 %18
- OpStore %res %13
+%textureLoad_67edca = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %25
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4uint %19 %22
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureLoad_67edca
+ %33 = OpFunctionCall %void %textureLoad_67edca
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureLoad_67edca
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_67edca
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureLoad_67edca
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_67edca
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.wgsl
index 48f60e9..aae3e6c 100644
--- a/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_67edca();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/749704.wgsl b/test/intrinsics/gen/textureLoad/749704.wgsl
index ecb0e5c..d0b1140 100644
--- a/test/intrinsics/gen/textureLoad/749704.wgsl
+++ b/test/intrinsics/gen/textureLoad/749704.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_749704();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/749704.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.hlsl
index 8743700..6e53408 100644
--- a/test/intrinsics/gen/textureLoad/749704.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<uint4> arg_0 : register(t0, space1);
void textureLoad_749704() {
uint4 res = arg_0.Load(int3(0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_749704();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/749704.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.spvasm
index 9826b95..09d9512 100644
--- a/test/intrinsics/gen/textureLoad/749704.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_749704 "textureLoad_749704"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %uint 2D 0 0 0 2 R32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4uint = OpTypeVector %uint 4
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %21 = OpConstantNull %v4uint
+ %25 = OpConstantNull %v4uint
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_749704 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %21
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4uint %15 %18
- OpStore %res %13
+%textureLoad_749704 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %25
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4uint %19 %22
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureLoad_749704
+ %33 = OpFunctionCall %void %textureLoad_749704
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureLoad_749704
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_749704
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureLoad_749704
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_749704
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/749704.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.wgsl
index ac72def..40aa2c4 100644
--- a/test/intrinsics/gen/textureLoad/749704.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_749704();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/79e697.wgsl b/test/intrinsics/gen/textureLoad/79e697.wgsl
index 2beff2a..bda80de 100644
--- a/test/intrinsics/gen/textureLoad/79e697.wgsl
+++ b/test/intrinsics/gen/textureLoad/79e697.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_79e697();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.hlsl
index d7eef53..de1d8ac 100644
--- a/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<int4> arg_0 : register(t0, space1);
void textureLoad_79e697() {
int4 res = arg_0.Load(int4(0, 0, 1, 0), 1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_79e697();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.spvasm
index a588443..8c010bc 100644
--- a/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.spvasm
@@ -1,25 +1,29 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 42
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_79e697 "textureLoad_79e697"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,37 +32,49 @@
%7 = OpTypeImage %int 2D 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4int = OpTypeVector %int 4
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %22 = OpConstantNull %v4int
+ %26 = OpConstantNull %v4int
+ %27 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_79e697 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %22
- %15 = OpLoad %7 %arg_0
- %13 = OpImageFetch %v4int %15 %19 Lod %int_1
- OpStore %res %13
+%textureLoad_79e697 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %26
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageFetch %v4int %19 %23 Lod %int_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %24 = OpLabel
+%tint_symbol_2 = OpFunction %void None %27
+%tint_symbol = OpFunctionParameter %v4float
+ %30 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
OpStore %tint_pointsize %float_1
- %26 = OpFunctionCall %void %textureLoad_79e697
+ %34 = OpFunctionCall %void %textureLoad_79e697
+ %35 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureLoad_79e697
+%fragment_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_79e697
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureLoad_79e697
+%compute_main = OpFunction %void None %13
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureLoad_79e697
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.wgsl
index f22e4e2..5fc4573 100644
--- a/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_79e697();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/7c90e5.wgsl b/test/intrinsics/gen/textureLoad/7c90e5.wgsl
index c45502f..073bf9f 100644
--- a/test/intrinsics/gen/textureLoad/7c90e5.wgsl
+++ b/test/intrinsics/gen/textureLoad/7c90e5.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_7c90e5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.hlsl
index d04ec21..bfa8878 100644
--- a/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<uint4> arg_0 : register(t0, space1);
void textureLoad_7c90e5() {
uint4 res = arg_0.Load(int4(0, 0, 1, 0), 1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_7c90e5();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.spvasm
index 238c678..ff1f583 100644
--- a/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.spvasm
@@ -1,25 +1,29 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 43
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_7c90e5 "textureLoad_7c90e5"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,38 +32,50 @@
%7 = OpTypeImage %uint 2D 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4uint = OpTypeVector %uint 4
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %20 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %24 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %23 = OpConstantNull %v4uint
+ %27 = OpConstantNull %v4uint
+ %28 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_7c90e5 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %23
- %15 = OpLoad %7 %arg_0
- %13 = OpImageFetch %v4uint %15 %20 Lod %int_1
- OpStore %res %13
+%textureLoad_7c90e5 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %27
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageFetch %v4uint %19 %24 Lod %int_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %25 = OpLabel
+%tint_symbol_2 = OpFunction %void None %28
+%tint_symbol = OpFunctionParameter %v4float
+ %31 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %33 = OpLabel
OpStore %tint_pointsize %float_1
- %27 = OpFunctionCall %void %textureLoad_7c90e5
+ %35 = OpFunctionCall %void %textureLoad_7c90e5
+ %36 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureLoad_7c90e5
+%fragment_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_7c90e5
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureLoad_7c90e5
+%compute_main = OpFunction %void None %13
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureLoad_7c90e5
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.wgsl
index e5ebce3..7b287ca 100644
--- a/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_7c90e5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/81c381.wgsl b/test/intrinsics/gen/textureLoad/81c381.wgsl
index 8d1b0cb..d67162f 100644
--- a/test/intrinsics/gen/textureLoad/81c381.wgsl
+++ b/test/intrinsics/gen/textureLoad/81c381.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_81c381();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.hlsl
index fdca8d1..a998818 100644
--- a/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<float4> arg_0 : register(t0, space1);
void textureLoad_81c381() {
float4 res = arg_0.Load(int2(1, 0), 1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_81c381();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.spvasm
index b5702bb..507f5f4 100644
--- a/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_81c381 "textureLoad_81c381"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,35 +32,45 @@
%7 = OpTypeImage %float 1D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %19 = OpConstantNull %v4float
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_81c381 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %19
- %14 = OpLoad %7 %arg_0
- %12 = OpImageFetch %v4float %14 %int_1 Lod %int_1
- OpStore %res %12
+%textureLoad_81c381 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageFetch %v4float %17 %int_1 Lod %int_1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
- OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureLoad_81c381
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
%25 = OpLabel
- %26 = OpFunctionCall %void %textureLoad_81c381
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ OpStore %tint_pointsize %float_1
%29 = OpFunctionCall %void %textureLoad_81c381
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureLoad_81c381
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_81c381
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.wgsl
index 458368b..8eee606 100644
--- a/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_81c381();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/83cea4.wgsl b/test/intrinsics/gen/textureLoad/83cea4.wgsl
index 097007a..fe0a681 100644
--- a/test/intrinsics/gen/textureLoad/83cea4.wgsl
+++ b/test/intrinsics/gen/textureLoad/83cea4.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_83cea4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.hlsl
index decc049..57b1ada 100644
--- a/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<uint4> arg_0 : register(t0, space1);
void textureLoad_83cea4() {
uint4 res = arg_0.Load(int2(1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_83cea4();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.spvasm
index 73bb99c..b4e9a02 100644
--- a/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_83cea4 "textureLoad_83cea4"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %uint 1D 0 0 0 2 Rgba16ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4uint = OpTypeVector %uint 4
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %20 = OpConstantNull %v4uint
+ %24 = OpConstantNull %v4uint
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_83cea4 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %20
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4uint %15 %int_1
- OpStore %res %13
+%textureLoad_83cea4 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %24
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4uint %19 %int_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_83cea4
+ %32 = OpFunctionCall %void %textureLoad_83cea4
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_83cea4
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_83cea4
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureLoad_83cea4
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_83cea4
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.wgsl
index 04820c2..747041d 100644
--- a/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_83cea4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/87be85.wgsl b/test/intrinsics/gen/textureLoad/87be85.wgsl
index 0ce5ed9..0c03122 100644
--- a/test/intrinsics/gen/textureLoad/87be85.wgsl
+++ b/test/intrinsics/gen/textureLoad/87be85.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_87be85();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.hlsl
index 776a68d..80ebe74 100644
--- a/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
void textureLoad_87be85() {
float4 res = arg_0.Load(int4(0, 0, 1, 0), 1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_87be85();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.spvasm
index bb3b579..45fb473 100644
--- a/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.spvasm
@@ -1,25 +1,29 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 40
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_87be85 "textureLoad_87be85"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -27,38 +31,48 @@
%7 = OpTypeImage %float 2D 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %22 = OpConstantNull %v4float
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_87be85 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %22
- %14 = OpLoad %7 %arg_0
- %12 = OpImageFetch %v4float %14 %19 Lod %int_1
- OpStore %res %12
+%textureLoad_87be85 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageFetch %v4float %17 %22 Lod %int_1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %24 = OpLabel
- OpStore %tint_pointsize %float_1
- %26 = OpFunctionCall %void %textureLoad_87be85
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
%28 = OpLabel
- %29 = OpFunctionCall %void %textureLoad_87be85
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %31 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ OpStore %tint_pointsize %float_1
%32 = OpFunctionCall %void %textureLoad_87be85
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_87be85
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_87be85
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.wgsl
index 5029fff..aff0007 100644
--- a/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_87be85();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/8acf41.wgsl b/test/intrinsics/gen/textureLoad/8acf41.wgsl
index f5e787e..8e92b1e 100644
--- a/test/intrinsics/gen/textureLoad/8acf41.wgsl
+++ b/test/intrinsics/gen/textureLoad/8acf41.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_8acf41();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.hlsl
index 7ea3d47..66a7786 100644
--- a/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<float4> arg_0 : register(t0, space1);
void textureLoad_8acf41() {
float4 res = arg_0.Load(int3(0, 0, 0), 0);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_8acf41();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.spvasm
index c639aff..7f64a6b 100644
--- a/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.spvasm
@@ -1,25 +1,29 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_8acf41 "textureLoad_8acf41"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -27,37 +31,47 @@
%7 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %17 = OpConstantNull %v2int
+ %20 = OpConstantNull %v2int
%int_0 = OpConstant %int 0
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %21 = OpConstantNull %v4float
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_8acf41 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %21
- %14 = OpLoad %7 %arg_0
- %12 = OpImageFetch %v4float %14 %17 Lod %int_0
- OpStore %res %12
+%textureLoad_8acf41 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageFetch %v4float %17 %20 Lod %int_0
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %23 = OpLabel
- OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureLoad_8acf41
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
%27 = OpLabel
- %28 = OpFunctionCall %void %textureLoad_8acf41
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %30 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ OpStore %tint_pointsize %float_1
%31 = OpFunctionCall %void %textureLoad_8acf41
+ %32 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureLoad_8acf41
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_8acf41
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.wgsl
index fc9278e..e618619 100644
--- a/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_8acf41();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/8e5032.wgsl b/test/intrinsics/gen/textureLoad/8e5032.wgsl
index 16885de..ac7f62e 100644
--- a/test/intrinsics/gen/textureLoad/8e5032.wgsl
+++ b/test/intrinsics/gen/textureLoad/8e5032.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_8e5032();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.hlsl
index 3b15dee..835ba46 100644
--- a/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<uint4> arg_0 : register(t0, space1);
void textureLoad_8e5032() {
uint4 res = arg_0.Load(int4(0, 0, 1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_8e5032();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.spvasm
index d348de0..905a82e 100644
--- a/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 43
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_8e5032 "textureLoad_8e5032"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,38 +34,50 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4uint = OpTypeVector %uint 4
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %20 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %24 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %23 = OpConstantNull %v4uint
+ %27 = OpConstantNull %v4uint
+ %28 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_8e5032 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %23
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4uint %15 %20
- OpStore %res %13
+%textureLoad_8e5032 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %27
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4uint %19 %24
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %25 = OpLabel
+%tint_symbol_2 = OpFunction %void None %28
+%tint_symbol = OpFunctionParameter %v4float
+ %31 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %33 = OpLabel
OpStore %tint_pointsize %float_1
- %27 = OpFunctionCall %void %textureLoad_8e5032
+ %35 = OpFunctionCall %void %textureLoad_8e5032
+ %36 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureLoad_8e5032
+%fragment_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_8e5032
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureLoad_8e5032
+%compute_main = OpFunction %void None %13
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureLoad_8e5032
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.wgsl
index e3d7995..eda9388 100644
--- a/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_8e5032();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/936952.wgsl b/test/intrinsics/gen/textureLoad/936952.wgsl
index 8354199..52b40fb 100644
--- a/test/intrinsics/gen/textureLoad/936952.wgsl
+++ b/test/intrinsics/gen/textureLoad/936952.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_936952();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/936952.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.hlsl
index 416f4e1..6d6f30e 100644
--- a/test/intrinsics/gen/textureLoad/936952.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
void textureLoad_936952() {
float4 res = arg_0.Load(int4(0, 0, 1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_936952();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/936952.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.spvasm
index 57aab33..f9a43f4 100644
--- a/test/intrinsics/gen/textureLoad/936952.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 40
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_936952 "textureLoad_936952"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,38 +32,48 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %22 = OpConstantNull %v4float
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_936952 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %22
- %14 = OpLoad %7 %arg_0
- %12 = OpImageRead %v4float %14 %19
- OpStore %res %12
+%textureLoad_936952 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageRead %v4float %17 %22
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %24 = OpLabel
- OpStore %tint_pointsize %float_1
- %26 = OpFunctionCall %void %textureLoad_936952
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
%28 = OpLabel
- %29 = OpFunctionCall %void %textureLoad_936952
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %31 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ OpStore %tint_pointsize %float_1
%32 = OpFunctionCall %void %textureLoad_936952
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_936952
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_936952
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/936952.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.wgsl
index 618a8cf..750c3ef 100644
--- a/test/intrinsics/gen/textureLoad/936952.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_936952();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/9a7c90.wgsl b/test/intrinsics/gen/textureLoad/9a7c90.wgsl
index 6d893bb..8106700 100644
--- a/test/intrinsics/gen/textureLoad/9a7c90.wgsl
+++ b/test/intrinsics/gen/textureLoad/9a7c90.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_9a7c90();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.hlsl
index 65f8c55..827f787 100644
--- a/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<uint4> arg_0 : register(t0, space1);
void textureLoad_9a7c90() {
uint4 res = arg_0.Load(int4(0, 0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_9a7c90();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.spvasm
index 3e11609..4225db9 100644
--- a/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_9a7c90 "textureLoad_9a7c90"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %uint 3D 0 0 0 2 Rgba8ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4uint = OpTypeVector %uint 4
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %21 = OpConstantNull %v4uint
+ %25 = OpConstantNull %v4uint
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_9a7c90 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %21
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4uint %15 %18
- OpStore %res %13
+%textureLoad_9a7c90 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %25
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4uint %19 %22
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureLoad_9a7c90
+ %33 = OpFunctionCall %void %textureLoad_9a7c90
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureLoad_9a7c90
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_9a7c90
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureLoad_9a7c90
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_9a7c90
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.wgsl
index 99b2bda..355df01 100644
--- a/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_9a7c90();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/9b2667.wgsl b/test/intrinsics/gen/textureLoad/9b2667.wgsl
index a204e9d..2e755b0 100644
--- a/test/intrinsics/gen/textureLoad/9b2667.wgsl
+++ b/test/intrinsics/gen/textureLoad/9b2667.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_9b2667();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.hlsl
index 5bd840f..2152818 100644
--- a/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray arg_0 : register(t0, space1);
void textureLoad_9b2667() {
float res = arg_0.Load(int4(0, 0, 1, 0), 1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_9b2667();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.spvasm
index 8d6f3b2..ca60678 100644
--- a/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.spvasm
@@ -1,25 +1,29 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 41
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_9b2667 "textureLoad_9b2667"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -27,38 +31,49 @@
%7 = OpTypeImage %float 2D 1 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %20 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%_ptr_Function_float = OpTypePointer Function %float
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_9b2667 = OpFunction %void None %8
- %11 = OpLabel
+%textureLoad_9b2667 = OpFunction %void None %12
+ %15 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %15 = OpLoad %7 %arg_0
- %13 = OpImageFetch %v4float %15 %20 Lod %int_1
- %12 = OpCompositeExtract %float %13 0
- OpStore %res %12
+ %18 = OpLoad %7 %arg_0
+ %17 = OpImageFetch %v4float %18 %23 Lod %int_1
+ %16 = OpCompositeExtract %float %17 0
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %24 = OpLabel
- OpStore %tint_pointsize %float_1
- %26 = OpFunctionCall %void %textureLoad_9b2667
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureLoad_9b2667
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %8
+%vertex_main = OpFunction %void None %12
%31 = OpLabel
- %32 = OpFunctionCall %void %textureLoad_9b2667
+ OpStore %tint_pointsize %float_1
+ %33 = OpFunctionCall %void %textureLoad_9b2667
+ %34 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_9b2667
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_9b2667
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.wgsl
index aa5e716..2acf8e0 100644
--- a/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_9b2667();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/9c2a14.wgsl b/test/intrinsics/gen/textureLoad/9c2a14.wgsl
index cf25b4b..e1bfa9f 100644
--- a/test/intrinsics/gen/textureLoad/9c2a14.wgsl
+++ b/test/intrinsics/gen/textureLoad/9c2a14.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_9c2a14();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.hlsl
index 52098a7..276225f 100644
--- a/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<float4> arg_0 : register(t0, space1);
void textureLoad_9c2a14() {
float4 res = arg_0.Load(int3(0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_9c2a14();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.spvasm
index 895e3cd..12be9be 100644
--- a/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_9c2a14 "textureLoad_9c2a14"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,46 @@
%7 = OpTypeImage %float 2D 0 0 0 2 Rg32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %17 = OpConstantNull %v2int
+ %20 = OpConstantNull %v2int
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %20 = OpConstantNull %v4float
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_9c2a14 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %20
- %14 = OpLoad %7 %arg_0
- %12 = OpImageRead %v4float %14 %17
- OpStore %res %12
+%textureLoad_9c2a14 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageRead %v4float %17 %20
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
- OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_9c2a14
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
%26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_9c2a14
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
%30 = OpFunctionCall %void %textureLoad_9c2a14
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureLoad_9c2a14
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_9c2a14
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.wgsl
index fdd5a28..35f6a52 100644
--- a/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_9c2a14();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/a583c9.wgsl b/test/intrinsics/gen/textureLoad/a583c9.wgsl
index 6b503a3..e1689e8 100644
--- a/test/intrinsics/gen/textureLoad/a583c9.wgsl
+++ b/test/intrinsics/gen/textureLoad/a583c9.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_a583c9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.hlsl
index 58d4c23..eb15d89 100644
--- a/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DMS<float4> arg_0 : register(t0, space1);
void textureLoad_a583c9() {
float4 res = arg_0.Load(int3(0, 0, 0), 1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_a583c9();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.spvasm
index d1d4806..4bdec9c 100644
--- a/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.spvasm
@@ -1,25 +1,29 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 39
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_a583c9 "textureLoad_a583c9"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -27,37 +31,47 @@
%7 = OpTypeImage %float 2D 0 0 1 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %17 = OpConstantNull %v2int
+ %20 = OpConstantNull %v2int
%int_1 = OpConstant %int 1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %21 = OpConstantNull %v4float
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_a583c9 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %21
- %14 = OpLoad %7 %arg_0
- %12 = OpImageFetch %v4float %14 %17 Sample %int_1
- OpStore %res %12
+%textureLoad_a583c9 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageFetch %v4float %17 %20 Sample %int_1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %23 = OpLabel
- OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureLoad_a583c9
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
%27 = OpLabel
- %28 = OpFunctionCall %void %textureLoad_a583c9
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %30 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ OpStore %tint_pointsize %float_1
%31 = OpFunctionCall %void %textureLoad_a583c9
+ %32 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureLoad_a583c9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_a583c9
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.wgsl
index 0eb7d2f..dbe3069 100644
--- a/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_a583c9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/a6a85a.wgsl b/test/intrinsics/gen/textureLoad/a6a85a.wgsl
index 1c7be46..4258aa8 100644
--- a/test/intrinsics/gen/textureLoad/a6a85a.wgsl
+++ b/test/intrinsics/gen/textureLoad/a6a85a.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_a6a85a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.hlsl
index c30dc1f..7d1daa3 100644
--- a/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<float4> arg_0 : register(t0, space1);
void textureLoad_a6a85a() {
float4 res = arg_0.Load(int4(0, 0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_a6a85a();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.spvasm
index 43cd94e..c596cec 100644
--- a/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_a6a85a "textureLoad_a6a85a"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,36 +32,46 @@
%7 = OpTypeImage %float 3D 0 0 0 2 Rgba8
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %17 = OpConstantNull %v3int
+ %20 = OpConstantNull %v3int
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %20 = OpConstantNull %v4float
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_a6a85a = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %20
- %14 = OpLoad %7 %arg_0
- %12 = OpImageRead %v4float %14 %17
- OpStore %res %12
+%textureLoad_a6a85a = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageRead %v4float %17 %20
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
- OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_a6a85a
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
%26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_a6a85a
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
%30 = OpFunctionCall %void %textureLoad_a6a85a
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureLoad_a6a85a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_a6a85a
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.wgsl
index 89dc933..4ad2dcdb 100644
--- a/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_a6a85a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/a6b61d.wgsl b/test/intrinsics/gen/textureLoad/a6b61d.wgsl
index 52c4f5f..7563b53 100644
--- a/test/intrinsics/gen/textureLoad/a6b61d.wgsl
+++ b/test/intrinsics/gen/textureLoad/a6b61d.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_a6b61d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.hlsl
index bdce0ae..2b2be1c 100644
--- a/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<int4> arg_0 : register(t0, space1);
void textureLoad_a6b61d() {
int4 res = arg_0.Load(int4(0, 0, 1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_a6b61d();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.spvasm
index 0b8fdaa..c147986 100644
--- a/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 42
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_a6b61d "textureLoad_a6b61d"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,37 +33,49 @@
%7 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4int = OpTypeVector %int 4
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %22 = OpConstantNull %v4int
+ %26 = OpConstantNull %v4int
+ %27 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_a6b61d = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %22
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4int %15 %19
- OpStore %res %13
+%textureLoad_a6b61d = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %26
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4int %19 %23
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %24 = OpLabel
+%tint_symbol_2 = OpFunction %void None %27
+%tint_symbol = OpFunctionParameter %v4float
+ %30 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
OpStore %tint_pointsize %float_1
- %26 = OpFunctionCall %void %textureLoad_a6b61d
+ %34 = OpFunctionCall %void %textureLoad_a6b61d
+ %35 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureLoad_a6b61d
+%fragment_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_a6b61d
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureLoad_a6b61d
+%compute_main = OpFunction %void None %13
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureLoad_a6b61d
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.wgsl
index a3e6393..daf68a4 100644
--- a/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_a6b61d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl
index 42d9f0b..1513d1e 100644
--- a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl
+++ b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_a7a3c3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.hlsl
index 791b428..e4dc952 100644
--- a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<int4> arg_0 : register(t0, space1);
void textureLoad_a7a3c3() {
int4 res = arg_0.Load(int4(0, 0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_a7a3c3();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.spvasm
index b068e66..c6402f5 100644
--- a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_a7a3c3 "textureLoad_a7a3c3"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,47 @@
%7 = OpTypeImage %int 3D 0 0 0 2 Rgba16i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4int = OpTypeVector %int 4
%v3int = OpTypeVector %int 3
- %17 = OpConstantNull %v3int
+ %21 = OpConstantNull %v3int
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %20 = OpConstantNull %v4int
+ %24 = OpConstantNull %v4int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_a7a3c3 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %20
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4int %15 %17
- OpStore %res %13
+%textureLoad_a7a3c3 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %24
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4int %19 %21
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_a7a3c3
+ %32 = OpFunctionCall %void %textureLoad_a7a3c3
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_a7a3c3
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_a7a3c3
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureLoad_a7a3c3
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_a7a3c3
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.wgsl
index d6ad3c5..fdd3652 100644
--- a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_a7a3c3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl
index a2861bf..71fc60a 100644
--- a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl
+++ b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_a9a9f5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.hlsl
index 9c47a89..197e741 100644
--- a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<uint4> arg_0 : register(t0, space1);
void textureLoad_a9a9f5() {
uint4 res = arg_0.Load(int4(0, 0, 0, 0), 1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_a9a9f5();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.spvasm
index 83b174d..a8b53e1 100644
--- a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.spvasm
@@ -1,25 +1,29 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 42
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_a9a9f5 "textureLoad_a9a9f5"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,37 +32,49 @@
%7 = OpTypeImage %uint 3D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4uint = OpTypeVector %uint 4
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
%int_1 = OpConstant %int 1
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %22 = OpConstantNull %v4uint
+ %26 = OpConstantNull %v4uint
+ %27 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_a9a9f5 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %22
- %15 = OpLoad %7 %arg_0
- %13 = OpImageFetch %v4uint %15 %18 Lod %int_1
- OpStore %res %13
+%textureLoad_a9a9f5 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %26
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageFetch %v4uint %19 %22 Lod %int_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %24 = OpLabel
+%tint_symbol_2 = OpFunction %void None %27
+%tint_symbol = OpFunctionParameter %v4float
+ %30 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
OpStore %tint_pointsize %float_1
- %26 = OpFunctionCall %void %textureLoad_a9a9f5
+ %34 = OpFunctionCall %void %textureLoad_a9a9f5
+ %35 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureLoad_a9a9f5
+%fragment_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_a9a9f5
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureLoad_a9a9f5
+%compute_main = OpFunction %void None %13
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureLoad_a9a9f5
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.wgsl
index 5a07216..f472d29 100644
--- a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_a9a9f5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/b1bf79.wgsl b/test/intrinsics/gen/textureLoad/b1bf79.wgsl
index 9bdf759..e642b98 100644
--- a/test/intrinsics/gen/textureLoad/b1bf79.wgsl
+++ b/test/intrinsics/gen/textureLoad/b1bf79.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_b1bf79();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.hlsl
index f65c488..259d694 100644
--- a/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<int4> arg_0 : register(t0, space1);
void textureLoad_b1bf79() {
int4 res = arg_0.Load(int4(0, 0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_b1bf79();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.spvasm
index 168c98a..0f24aa3 100644
--- a/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_b1bf79 "textureLoad_b1bf79"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,47 @@
%7 = OpTypeImage %int 3D 0 0 0 2 Rgba32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4int = OpTypeVector %int 4
%v3int = OpTypeVector %int 3
- %17 = OpConstantNull %v3int
+ %21 = OpConstantNull %v3int
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %20 = OpConstantNull %v4int
+ %24 = OpConstantNull %v4int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_b1bf79 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %20
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4int %15 %17
- OpStore %res %13
+%textureLoad_b1bf79 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %24
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4int %19 %21
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_b1bf79
+ %32 = OpFunctionCall %void %textureLoad_b1bf79
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_b1bf79
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_b1bf79
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureLoad_b1bf79
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_b1bf79
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.wgsl
index c722eb3..92d14f4 100644
--- a/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_b1bf79();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/b58c6d.wgsl b/test/intrinsics/gen/textureLoad/b58c6d.wgsl
index 60239d0..0c59154 100644
--- a/test/intrinsics/gen/textureLoad/b58c6d.wgsl
+++ b/test/intrinsics/gen/textureLoad/b58c6d.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_b58c6d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.hlsl
index 1989266..082b239 100644
--- a/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
void textureLoad_b58c6d() {
float4 res = arg_0.Load(int4(0, 0, 1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_b58c6d();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.spvasm
index 784789e..90c5ef4 100644
--- a/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 40
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_b58c6d "textureLoad_b58c6d"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,38 +32,48 @@
%7 = OpTypeImage %float 2D 0 1 0 2 R32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %22 = OpConstantNull %v4float
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_b58c6d = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %22
- %14 = OpLoad %7 %arg_0
- %12 = OpImageRead %v4float %14 %19
- OpStore %res %12
+%textureLoad_b58c6d = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageRead %v4float %17 %22
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %24 = OpLabel
- OpStore %tint_pointsize %float_1
- %26 = OpFunctionCall %void %textureLoad_b58c6d
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
%28 = OpLabel
- %29 = OpFunctionCall %void %textureLoad_b58c6d
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %31 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ OpStore %tint_pointsize %float_1
%32 = OpFunctionCall %void %textureLoad_b58c6d
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_b58c6d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_b58c6d
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.wgsl
index 4f945bc..f6bc2f4 100644
--- a/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_b58c6d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/b6c458.wgsl b/test/intrinsics/gen/textureLoad/b6c458.wgsl
index 3989081..3a24ac5 100644
--- a/test/intrinsics/gen/textureLoad/b6c458.wgsl
+++ b/test/intrinsics/gen/textureLoad/b6c458.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_b6c458();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.hlsl
index ae9a17e..de41bd5 100644
--- a/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<uint4> arg_0 : register(t0, space1);
void textureLoad_b6c458() {
uint4 res = arg_0.Load(int3(0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_b6c458();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.spvasm
index 40a4ccb..e1939f4 100644
--- a/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_b6c458 "textureLoad_b6c458"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %uint 2D 0 0 0 2 Rgba32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4uint = OpTypeVector %uint 4
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %21 = OpConstantNull %v4uint
+ %25 = OpConstantNull %v4uint
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_b6c458 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %21
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4uint %15 %18
- OpStore %res %13
+%textureLoad_b6c458 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %25
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4uint %19 %22
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureLoad_b6c458
+ %33 = OpFunctionCall %void %textureLoad_b6c458
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureLoad_b6c458
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_b6c458
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureLoad_b6c458
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_b6c458
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.wgsl
index 317bcc4..4bf8545 100644
--- a/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_b6c458();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/bfd154.wgsl b/test/intrinsics/gen/textureLoad/bfd154.wgsl
index 0ae454d..7da431f 100644
--- a/test/intrinsics/gen/textureLoad/bfd154.wgsl
+++ b/test/intrinsics/gen/textureLoad/bfd154.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_bfd154();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.hlsl
index ef2856b..829545d 100644
--- a/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<uint4> arg_0 : register(t0, space1);
void textureLoad_bfd154() {
uint4 res = arg_0.Load(int4(0, 0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_bfd154();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.spvasm
index 5fe780f..8a748cb 100644
--- a/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_bfd154 "textureLoad_bfd154"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %uint 3D 0 0 0 2 R32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4uint = OpTypeVector %uint 4
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %21 = OpConstantNull %v4uint
+ %25 = OpConstantNull %v4uint
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_bfd154 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %21
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4uint %15 %18
- OpStore %res %13
+%textureLoad_bfd154 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %25
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4uint %19 %22
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureLoad_bfd154
+ %33 = OpFunctionCall %void %textureLoad_bfd154
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureLoad_bfd154
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_bfd154
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureLoad_bfd154
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_bfd154
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.wgsl
index 45d2471..0acf1d8 100644
--- a/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_bfd154();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/c02b74.wgsl b/test/intrinsics/gen/textureLoad/c02b74.wgsl
index 88beec8..4561a35 100644
--- a/test/intrinsics/gen/textureLoad/c02b74.wgsl
+++ b/test/intrinsics/gen/textureLoad/c02b74.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_c02b74();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.hlsl
index 0260e3b..4ae0129 100644
--- a/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<float4> arg_0 : register(t0, space1);
void textureLoad_c02b74() {
float4 res = arg_0.Load(int2(1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_c02b74();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.spvasm
index 79294d5..9bba940 100644
--- a/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_c02b74 "textureLoad_c02b74"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,45 @@
%7 = OpTypeImage %float 1D 0 0 0 2 Rgba16f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %19 = OpConstantNull %v4float
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_c02b74 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %19
- %14 = OpLoad %7 %arg_0
- %12 = OpImageRead %v4float %14 %int_1
- OpStore %res %12
+%textureLoad_c02b74 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageRead %v4float %17 %int_1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
- OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureLoad_c02b74
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
%25 = OpLabel
- %26 = OpFunctionCall %void %textureLoad_c02b74
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ OpStore %tint_pointsize %float_1
%29 = OpFunctionCall %void %textureLoad_c02b74
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureLoad_c02b74
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_c02b74
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.wgsl
index 82ce81a..855caf6 100644
--- a/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_c02b74();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/c07013.wgsl b/test/intrinsics/gen/textureLoad/c07013.wgsl
index 7fea1e2..c4c53f2 100644
--- a/test/intrinsics/gen/textureLoad/c07013.wgsl
+++ b/test/intrinsics/gen/textureLoad/c07013.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_c07013();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.hlsl
index 66daded..e68f692 100644
--- a/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<float4> arg_0 : register(t0, space1);
void textureLoad_c07013() {
float4 res = arg_0.Load(int3(0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_c07013();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.spvasm
index 1ac9c62a..167cd45 100644
--- a/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_c07013 "textureLoad_c07013"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,36 +32,46 @@
%7 = OpTypeImage %float 2D 0 0 0 2 R32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %17 = OpConstantNull %v2int
+ %20 = OpConstantNull %v2int
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %20 = OpConstantNull %v4float
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_c07013 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %20
- %14 = OpLoad %7 %arg_0
- %12 = OpImageRead %v4float %14 %17
- OpStore %res %12
+%textureLoad_c07013 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageRead %v4float %17 %20
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
- OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_c07013
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
%26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_c07013
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
%30 = OpFunctionCall %void %textureLoad_c07013
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureLoad_c07013
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_c07013
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.wgsl
index 4d58718..39db351 100644
--- a/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_c07013();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/c2a480.wgsl b/test/intrinsics/gen/textureLoad/c2a480.wgsl
index 2736bfe..ba6108f 100644
--- a/test/intrinsics/gen/textureLoad/c2a480.wgsl
+++ b/test/intrinsics/gen/textureLoad/c2a480.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_c2a480();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.hlsl
index 95b3490..272864f 100644
--- a/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<int4> arg_0 : register(t0, space1);
void textureLoad_c2a480() {
int4 res = arg_0.Load(int3(0, 0, 0), 1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_c2a480();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.spvasm
index 4c6fed7..05f013f 100644
--- a/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.spvasm
@@ -1,25 +1,29 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_c2a480 "textureLoad_c2a480"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,36 +32,48 @@
%7 = OpTypeImage %int 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4int = OpTypeVector %int 4
%v2int = OpTypeVector %int 2
- %17 = OpConstantNull %v2int
+ %21 = OpConstantNull %v2int
%int_1 = OpConstant %int 1
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %21 = OpConstantNull %v4int
+ %25 = OpConstantNull %v4int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_c2a480 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %21
- %15 = OpLoad %7 %arg_0
- %13 = OpImageFetch %v4int %15 %17 Lod %int_1
- OpStore %res %13
+%textureLoad_c2a480 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %25
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageFetch %v4int %19 %21 Lod %int_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureLoad_c2a480
+ %33 = OpFunctionCall %void %textureLoad_c2a480
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureLoad_c2a480
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_c2a480
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureLoad_c2a480
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_c2a480
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.wgsl
index 41189cf..5a9704f 100644
--- a/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_c2a480();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/c378ee.wgsl b/test/intrinsics/gen/textureLoad/c378ee.wgsl
index b602b0b..e87185c 100644
--- a/test/intrinsics/gen/textureLoad/c378ee.wgsl
+++ b/test/intrinsics/gen/textureLoad/c378ee.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_c378ee();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.hlsl
index 05ac6e1..72633ce 100644
--- a/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DMS<uint4> arg_0 : register(t0, space1);
void textureLoad_c378ee() {
uint4 res = arg_0.Load(int3(0, 0, 0), 1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_c378ee();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.spvasm
index 5a547d0..ce95a40 100644
--- a/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.spvasm
@@ -1,25 +1,29 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 42
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_c378ee "textureLoad_c378ee"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,37 +32,49 @@
%7 = OpTypeImage %uint 2D 0 0 1 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4uint = OpTypeVector %uint 4
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
%int_1 = OpConstant %int 1
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %22 = OpConstantNull %v4uint
+ %26 = OpConstantNull %v4uint
+ %27 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_c378ee = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %22
- %15 = OpLoad %7 %arg_0
- %13 = OpImageFetch %v4uint %15 %18 Sample %int_1
- OpStore %res %13
+%textureLoad_c378ee = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %26
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageFetch %v4uint %19 %22 Sample %int_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %24 = OpLabel
+%tint_symbol_2 = OpFunction %void None %27
+%tint_symbol = OpFunctionParameter %v4float
+ %30 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
OpStore %tint_pointsize %float_1
- %26 = OpFunctionCall %void %textureLoad_c378ee
+ %34 = OpFunctionCall %void %textureLoad_c378ee
+ %35 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureLoad_c378ee
+%fragment_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_c378ee
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureLoad_c378ee
+%compute_main = OpFunction %void None %13
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureLoad_c378ee
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.wgsl
index f118f6e..aeefcf2 100644
--- a/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_c378ee();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/c40dcb.wgsl b/test/intrinsics/gen/textureLoad/c40dcb.wgsl
index ba0ed97..c7c4f01 100644
--- a/test/intrinsics/gen/textureLoad/c40dcb.wgsl
+++ b/test/intrinsics/gen/textureLoad/c40dcb.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_c40dcb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.hlsl
index f12a0a9..65968e3 100644
--- a/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<uint4> arg_0 : register(t0, space1);
void textureLoad_c40dcb() {
uint4 res = arg_0.Load(int4(0, 0, 1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_c40dcb();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.spvasm
index 340717f..a9bc04b 100644
--- a/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 43
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_c40dcb "textureLoad_c40dcb"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,38 +33,50 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4uint = OpTypeVector %uint 4
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %20 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %24 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %23 = OpConstantNull %v4uint
+ %27 = OpConstantNull %v4uint
+ %28 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_c40dcb = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %23
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4uint %15 %20
- OpStore %res %13
+%textureLoad_c40dcb = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %27
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4uint %19 %24
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %25 = OpLabel
+%tint_symbol_2 = OpFunction %void None %28
+%tint_symbol = OpFunctionParameter %v4float
+ %31 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %33 = OpLabel
OpStore %tint_pointsize %float_1
- %27 = OpFunctionCall %void %textureLoad_c40dcb
+ %35 = OpFunctionCall %void %textureLoad_c40dcb
+ %36 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureLoad_c40dcb
+%fragment_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_c40dcb
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureLoad_c40dcb
+%compute_main = OpFunction %void None %13
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureLoad_c40dcb
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.wgsl
index e215fc8..43965d8 100644
--- a/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_c40dcb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/c456bc.wgsl b/test/intrinsics/gen/textureLoad/c456bc.wgsl
index 484739d..4a6f8cf 100644
--- a/test/intrinsics/gen/textureLoad/c456bc.wgsl
+++ b/test/intrinsics/gen/textureLoad/c456bc.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_c456bc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.hlsl
index e0648d8..f844a2d 100644
--- a/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<float4> arg_0 : register(t0, space1);
void textureLoad_c456bc() {
float4 res = arg_0.Load(int4(0, 0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_c456bc();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.spvasm
index 92d96ed..4fe7b44 100644
--- a/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_c456bc "textureLoad_c456bc"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,36 +32,46 @@
%7 = OpTypeImage %float 3D 0 0 0 2 R32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %17 = OpConstantNull %v3int
+ %20 = OpConstantNull %v3int
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %20 = OpConstantNull %v4float
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_c456bc = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %20
- %14 = OpLoad %7 %arg_0
- %12 = OpImageRead %v4float %14 %17
- OpStore %res %12
+%textureLoad_c456bc = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageRead %v4float %17 %20
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
- OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_c456bc
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
%26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_c456bc
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
%30 = OpFunctionCall %void %textureLoad_c456bc
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureLoad_c456bc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_c456bc
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.wgsl
index 0c3ace9..a85b4e0 100644
--- a/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_c456bc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/c7cbed.wgsl b/test/intrinsics/gen/textureLoad/c7cbed.wgsl
index 983bfe3..9a6fe84 100644
--- a/test/intrinsics/gen/textureLoad/c7cbed.wgsl
+++ b/test/intrinsics/gen/textureLoad/c7cbed.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_c7cbed();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.hlsl
index 1ad636d..1aa1c65 100644
--- a/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<float4> arg_0 : register(t0, space1);
void textureLoad_c7cbed() {
float4 res = arg_0.Load(int2(1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_c7cbed();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.spvasm
index d63ee64..7ffe7de 100644
--- a/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_c7cbed "textureLoad_c7cbed"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,45 @@
%7 = OpTypeImage %float 1D 0 0 0 2 R32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %19 = OpConstantNull %v4float
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_c7cbed = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %19
- %14 = OpLoad %7 %arg_0
- %12 = OpImageRead %v4float %14 %int_1
- OpStore %res %12
+%textureLoad_c7cbed = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageRead %v4float %17 %int_1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
- OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureLoad_c7cbed
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
%25 = OpLabel
- %26 = OpFunctionCall %void %textureLoad_c7cbed
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ OpStore %tint_pointsize %float_1
%29 = OpFunctionCall %void %textureLoad_c7cbed
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureLoad_c7cbed
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_c7cbed
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.wgsl
index 76bbb34..4b77212 100644
--- a/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_c7cbed();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/c9cc40.wgsl b/test/intrinsics/gen/textureLoad/c9cc40.wgsl
index 0825e3e..06ad93c 100644
--- a/test/intrinsics/gen/textureLoad/c9cc40.wgsl
+++ b/test/intrinsics/gen/textureLoad/c9cc40.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_c9cc40();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.hlsl
index c46ef6a..0b7eed0 100644
--- a/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<int4> arg_0 : register(t0, space1);
void textureLoad_c9cc40() {
int4 res = arg_0.Load(int2(1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_c9cc40();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.spvasm
index 7716717..753bb15 100644
--- a/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_c9cc40 "textureLoad_c9cc40"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %int 1D 0 0 0 2 Rgba8i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4int = OpTypeVector %int 4
%int_1 = OpConstant %int 1
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %19 = OpConstantNull %v4int
+ %23 = OpConstantNull %v4int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_c9cc40 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %19
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4int %15 %int_1
- OpStore %res %13
+%textureLoad_c9cc40 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %23
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4int %19 %int_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureLoad_c9cc40
+ %31 = OpFunctionCall %void %textureLoad_c9cc40
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureLoad_c9cc40
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureLoad_c9cc40
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureLoad_c9cc40
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_c9cc40
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.wgsl
index 8cc7670..73ec9de 100644
--- a/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_c9cc40();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/d5c48d.wgsl b/test/intrinsics/gen/textureLoad/d5c48d.wgsl
index 8578b86..8078256 100644
--- a/test/intrinsics/gen/textureLoad/d5c48d.wgsl
+++ b/test/intrinsics/gen/textureLoad/d5c48d.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_d5c48d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.hlsl
index 3bb75ac..980b696 100644
--- a/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<float4> arg_0 : register(t0, space1);
void textureLoad_d5c48d() {
float4 res = arg_0.Load(int3(0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_d5c48d();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.spvasm
index 194a0dc..a1ae055 100644
--- a/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_d5c48d "textureLoad_d5c48d"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,36 +32,46 @@
%7 = OpTypeImage %float 2D 0 0 0 2 Rgba32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %17 = OpConstantNull %v2int
+ %20 = OpConstantNull %v2int
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %20 = OpConstantNull %v4float
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_d5c48d = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %20
- %14 = OpLoad %7 %arg_0
- %12 = OpImageRead %v4float %14 %17
- OpStore %res %12
+%textureLoad_d5c48d = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageRead %v4float %17 %20
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
- OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_d5c48d
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
%26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_d5c48d
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
%30 = OpFunctionCall %void %textureLoad_d5c48d
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureLoad_d5c48d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_d5c48d
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.wgsl
index 111f88a..d795c88 100644
--- a/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_d5c48d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/d81c57.wgsl b/test/intrinsics/gen/textureLoad/d81c57.wgsl
index c59a55a..ae7b2b5 100644
--- a/test/intrinsics/gen/textureLoad/d81c57.wgsl
+++ b/test/intrinsics/gen/textureLoad/d81c57.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_d81c57();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.hlsl
index 3c88ef9..0e463d6 100644
--- a/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<float4> arg_0 : register(t0, space1);
void textureLoad_d81c57() {
float4 res = arg_0.Load(int2(1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_d81c57();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.spvasm
index a0a3217..b81e75f 100644
--- a/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_d81c57 "textureLoad_d81c57"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,45 @@
%7 = OpTypeImage %float 1D 0 0 0 2 Rg32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %19 = OpConstantNull %v4float
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_d81c57 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %19
- %14 = OpLoad %7 %arg_0
- %12 = OpImageRead %v4float %14 %int_1
- OpStore %res %12
+%textureLoad_d81c57 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageRead %v4float %17 %int_1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
- OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureLoad_d81c57
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
%25 = OpLabel
- %26 = OpFunctionCall %void %textureLoad_d81c57
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ OpStore %tint_pointsize %float_1
%29 = OpFunctionCall %void %textureLoad_d81c57
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureLoad_d81c57
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_d81c57
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.wgsl
index ef9b797..c014838 100644
--- a/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_d81c57();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/d8617f.wgsl b/test/intrinsics/gen/textureLoad/d8617f.wgsl
index 7a14592..ae08838 100644
--- a/test/intrinsics/gen/textureLoad/d8617f.wgsl
+++ b/test/intrinsics/gen/textureLoad/d8617f.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_d8617f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.hlsl
index 2f96813..8dcb976 100644
--- a/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<int4> arg_0 : register(t0, space1);
void textureLoad_d8617f() {
int4 res = arg_0.Load(int4(0, 0, 1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_d8617f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.spvasm
index c478e65..42c7ef1 100644
--- a/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 42
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_d8617f "textureLoad_d8617f"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,37 +34,49 @@
%7 = OpTypeImage %int 2D 0 1 0 2 Rg32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4int = OpTypeVector %int 4
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %22 = OpConstantNull %v4int
+ %26 = OpConstantNull %v4int
+ %27 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_d8617f = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %22
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4int %15 %19
- OpStore %res %13
+%textureLoad_d8617f = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %26
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4int %19 %23
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %24 = OpLabel
+%tint_symbol_2 = OpFunction %void None %27
+%tint_symbol = OpFunctionParameter %v4float
+ %30 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
OpStore %tint_pointsize %float_1
- %26 = OpFunctionCall %void %textureLoad_d8617f
+ %34 = OpFunctionCall %void %textureLoad_d8617f
+ %35 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureLoad_d8617f
+%fragment_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_d8617f
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureLoad_d8617f
+%compute_main = OpFunction %void None %13
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureLoad_d8617f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.wgsl
index 7a9f7a3..892d025 100644
--- a/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_d8617f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/dbd554.wgsl b/test/intrinsics/gen/textureLoad/dbd554.wgsl
index d14f010..dd0da28 100644
--- a/test/intrinsics/gen/textureLoad/dbd554.wgsl
+++ b/test/intrinsics/gen/textureLoad/dbd554.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_dbd554();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.hlsl
index 8cbc99e..9d0223f 100644
--- a/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<int4> arg_0 : register(t0, space1);
void textureLoad_dbd554() {
int4 res = arg_0.Load(int3(0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_dbd554();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.spvasm
index 384a41e..c92fb06 100644
--- a/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_dbd554 "textureLoad_dbd554"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,47 @@
%7 = OpTypeImage %int 2D 0 0 0 2 Rgba32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4int = OpTypeVector %int 4
%v2int = OpTypeVector %int 2
- %17 = OpConstantNull %v2int
+ %21 = OpConstantNull %v2int
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %20 = OpConstantNull %v4int
+ %24 = OpConstantNull %v4int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_dbd554 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %20
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4int %15 %17
- OpStore %res %13
+%textureLoad_dbd554 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %24
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4int %19 %21
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_dbd554
+ %32 = OpFunctionCall %void %textureLoad_dbd554
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_dbd554
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_dbd554
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureLoad_dbd554
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_dbd554
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.wgsl
index 2e967b4..3cbc34f 100644
--- a/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_dbd554();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/ddeed3.wgsl b/test/intrinsics/gen/textureLoad/ddeed3.wgsl
index 282486b..229e692 100644
--- a/test/intrinsics/gen/textureLoad/ddeed3.wgsl
+++ b/test/intrinsics/gen/textureLoad/ddeed3.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_ddeed3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.hlsl
index dc13a6a..d3fb264 100644
--- a/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<int4> arg_0 : register(t0, space1);
void textureLoad_ddeed3() {
int4 res = arg_0.Load(int2(1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_ddeed3();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.spvasm
index f64fd4b..70a6894 100644
--- a/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_ddeed3 "textureLoad_ddeed3"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %int 1D 0 0 0 2 Rgba32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4int = OpTypeVector %int 4
%int_1 = OpConstant %int 1
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %19 = OpConstantNull %v4int
+ %23 = OpConstantNull %v4int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_ddeed3 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %19
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4int %15 %int_1
- OpStore %res %13
+%textureLoad_ddeed3 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %23
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4int %19 %int_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureLoad_ddeed3
+ %31 = OpFunctionCall %void %textureLoad_ddeed3
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureLoad_ddeed3
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureLoad_ddeed3
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureLoad_ddeed3
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_ddeed3
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.wgsl
index 90301b7..c5757d2 100644
--- a/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_ddeed3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/dee8e7.wgsl b/test/intrinsics/gen/textureLoad/dee8e7.wgsl
index 28cb9dc..e9c7f72 100644
--- a/test/intrinsics/gen/textureLoad/dee8e7.wgsl
+++ b/test/intrinsics/gen/textureLoad/dee8e7.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_dee8e7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.hlsl
index f11845c..aa4d787 100644
--- a/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<int4> arg_0 : register(t0, space1);
void textureLoad_dee8e7() {
int4 res = arg_0.Load(int3(0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_dee8e7();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.spvasm
index 35d8476..913ff16 100644
--- a/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_dee8e7 "textureLoad_dee8e7"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,47 @@
%7 = OpTypeImage %int 2D 0 0 0 2 Rgba8i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4int = OpTypeVector %int 4
%v2int = OpTypeVector %int 2
- %17 = OpConstantNull %v2int
+ %21 = OpConstantNull %v2int
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %20 = OpConstantNull %v4int
+ %24 = OpConstantNull %v4int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_dee8e7 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %20
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4int %15 %17
- OpStore %res %13
+%textureLoad_dee8e7 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %24
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4int %19 %21
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_dee8e7
+ %32 = OpFunctionCall %void %textureLoad_dee8e7
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_dee8e7
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_dee8e7
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureLoad_dee8e7
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_dee8e7
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.wgsl
index 9d7c3f9..c21dfb7 100644
--- a/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_dee8e7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl
index 5323c08..648d0ba61 100644
--- a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl
+++ b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_e3d2cc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.hlsl
index 724f813..3861e2e 100644
--- a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DMS<int4> arg_0 : register(t0, space1);
void textureLoad_e3d2cc() {
int4 res = arg_0.Load(int3(0, 0, 0), 1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_e3d2cc();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.spvasm
index c3ba65e..c51e959 100644
--- a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.spvasm
@@ -1,25 +1,29 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_e3d2cc "textureLoad_e3d2cc"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,36 +32,48 @@
%7 = OpTypeImage %int 2D 0 0 1 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4int = OpTypeVector %int 4
%v2int = OpTypeVector %int 2
- %17 = OpConstantNull %v2int
+ %21 = OpConstantNull %v2int
%int_1 = OpConstant %int 1
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %21 = OpConstantNull %v4int
+ %25 = OpConstantNull %v4int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_e3d2cc = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %21
- %15 = OpLoad %7 %arg_0
- %13 = OpImageFetch %v4int %15 %17 Sample %int_1
- OpStore %res %13
+%textureLoad_e3d2cc = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %25
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageFetch %v4int %19 %21 Sample %int_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureLoad_e3d2cc
+ %33 = OpFunctionCall %void %textureLoad_e3d2cc
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureLoad_e3d2cc
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_e3d2cc
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureLoad_e3d2cc
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_e3d2cc
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.wgsl
index eccdf9b..decb417 100644
--- a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_e3d2cc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/e65916.wgsl b/test/intrinsics/gen/textureLoad/e65916.wgsl
index c5cd6f4..95166c3 100644
--- a/test/intrinsics/gen/textureLoad/e65916.wgsl
+++ b/test/intrinsics/gen/textureLoad/e65916.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_e65916();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.hlsl
index 1184561..9cd3006 100644
--- a/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<int4> arg_0 : register(t0, space1);
void textureLoad_e65916() {
int4 res = arg_0.Load(int4(0, 0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_e65916();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.spvasm
index c46e235..cb68194 100644
--- a/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_e65916 "textureLoad_e65916"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %int 3D 0 0 0 2 Rg32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4int = OpTypeVector %int 4
%v3int = OpTypeVector %int 3
- %17 = OpConstantNull %v3int
+ %21 = OpConstantNull %v3int
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %20 = OpConstantNull %v4int
+ %24 = OpConstantNull %v4int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_e65916 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %20
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4int %15 %17
- OpStore %res %13
+%textureLoad_e65916 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %24
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4int %19 %21
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_e65916
+ %32 = OpFunctionCall %void %textureLoad_e65916
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_e65916
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_e65916
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureLoad_e65916
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_e65916
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.wgsl
index f3f6648..33db37a 100644
--- a/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_e65916();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/e893d7.wgsl b/test/intrinsics/gen/textureLoad/e893d7.wgsl
index 7774ade..8ceb8c1 100644
--- a/test/intrinsics/gen/textureLoad/e893d7.wgsl
+++ b/test/intrinsics/gen/textureLoad/e893d7.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_e893d7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.hlsl
index d3f874e..c14dc82 100644
--- a/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<float4> arg_0 : register(t0, space1);
void textureLoad_e893d7() {
float4 res = arg_0.Load(int3(0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_e893d7();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.spvasm
index 3268cd2..55cf3f9 100644
--- a/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_e893d7 "textureLoad_e893d7"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,36 +32,46 @@
%7 = OpTypeImage %float 2D 0 0 0 2 Rgba16f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %17 = OpConstantNull %v2int
+ %20 = OpConstantNull %v2int
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %20 = OpConstantNull %v4float
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_e893d7 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %20
- %14 = OpLoad %7 %arg_0
- %12 = OpImageRead %v4float %14 %17
- OpStore %res %12
+%textureLoad_e893d7 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageRead %v4float %17 %20
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
- OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_e893d7
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
%26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_e893d7
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
%30 = OpFunctionCall %void %textureLoad_e893d7
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureLoad_e893d7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_e893d7
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.wgsl
index 4cb54fa..48373a5 100644
--- a/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_e893d7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/eb573b.wgsl b/test/intrinsics/gen/textureLoad/eb573b.wgsl
index 895a08d..38d4ce4 100644
--- a/test/intrinsics/gen/textureLoad/eb573b.wgsl
+++ b/test/intrinsics/gen/textureLoad/eb573b.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_eb573b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.hlsl
index a4fc90a..c1468f7 100644
--- a/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<int4> arg_0 : register(t0, space1);
void textureLoad_eb573b() {
int4 res = arg_0.Load(int3(0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_eb573b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.spvasm
index fbebdb8..44212e5 100644
--- a/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_eb573b "textureLoad_eb573b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,47 @@
%7 = OpTypeImage %int 2D 0 0 0 2 R32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4int = OpTypeVector %int 4
%v2int = OpTypeVector %int 2
- %17 = OpConstantNull %v2int
+ %21 = OpConstantNull %v2int
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %20 = OpConstantNull %v4int
+ %24 = OpConstantNull %v4int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_eb573b = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %20
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4int %15 %17
- OpStore %res %13
+%textureLoad_eb573b = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %24
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4int %19 %21
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_eb573b
+ %32 = OpFunctionCall %void %textureLoad_eb573b
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_eb573b
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_eb573b
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureLoad_eb573b
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_eb573b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.wgsl
index 9b8ee43..11af36e 100644
--- a/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_eb573b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/ecc823.wgsl b/test/intrinsics/gen/textureLoad/ecc823.wgsl
index 5ee1d3d..744ad3b 100644
--- a/test/intrinsics/gen/textureLoad/ecc823.wgsl
+++ b/test/intrinsics/gen/textureLoad/ecc823.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_ecc823();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.hlsl
index 7a7b63c..b43c88d 100644
--- a/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<uint4> arg_0 : register(t0, space1);
void textureLoad_ecc823() {
uint4 res = arg_0.Load(int3(0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_ecc823();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.spvasm
index 19b1a05..75c412a 100644
--- a/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_ecc823 "textureLoad_ecc823"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %uint 2D 0 0 0 2 Rgba16ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4uint = OpTypeVector %uint 4
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %18 = OpConstantNull %v2int
+ %22 = OpConstantNull %v2int
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %21 = OpConstantNull %v4uint
+ %25 = OpConstantNull %v4uint
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_ecc823 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %21
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4uint %15 %18
- OpStore %res %13
+%textureLoad_ecc823 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %25
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4uint %19 %22
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureLoad_ecc823
+ %33 = OpFunctionCall %void %textureLoad_ecc823
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureLoad_ecc823
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_ecc823
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureLoad_ecc823
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_ecc823
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.wgsl
index 9a6a788..3e5e549 100644
--- a/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_ecc823();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/ef5405.wgsl b/test/intrinsics/gen/textureLoad/ef5405.wgsl
index 8273c31..3561c84 100644
--- a/test/intrinsics/gen/textureLoad/ef5405.wgsl
+++ b/test/intrinsics/gen/textureLoad/ef5405.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_ef5405();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.hlsl
index e36270c..865105e 100644
--- a/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<uint4> arg_0 : register(t0, space1);
void textureLoad_ef5405() {
uint4 res = arg_0.Load(int4(0, 0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_ef5405();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.spvasm
index e14736c..35c2672 100644
--- a/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_ef5405 "textureLoad_ef5405"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,36 +34,48 @@
%7 = OpTypeImage %uint 3D 0 0 0 2 Rg32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4uint = OpTypeVector %uint 4
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %21 = OpConstantNull %v4uint
+ %25 = OpConstantNull %v4uint
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_ef5405 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %21
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4uint %15 %18
- OpStore %res %13
+%textureLoad_ef5405 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %25
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4uint %19 %22
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureLoad_ef5405
+ %33 = OpFunctionCall %void %textureLoad_ef5405
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureLoad_ef5405
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_ef5405
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureLoad_ef5405
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_ef5405
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.wgsl
index 3a9ed28..68c90ba 100644
--- a/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_ef5405();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/f06b69.wgsl b/test/intrinsics/gen/textureLoad/f06b69.wgsl
index 72c83bb..2707fbf 100644
--- a/test/intrinsics/gen/textureLoad/f06b69.wgsl
+++ b/test/intrinsics/gen/textureLoad/f06b69.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_f06b69();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.hlsl
index 981779d..a74f63d 100644
--- a/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<int4> arg_0 : register(t0, space1);
void textureLoad_f06b69() {
int4 res = arg_0.Load(int2(1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_f06b69();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.spvasm
index 7394181..c51dbef 100644
--- a/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_f06b69 "textureLoad_f06b69"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %int 1D 0 0 0 2 R32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4int = OpTypeVector %int 4
%int_1 = OpConstant %int 1
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %19 = OpConstantNull %v4int
+ %23 = OpConstantNull %v4int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_f06b69 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %19
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4int %15 %int_1
- OpStore %res %13
+%textureLoad_f06b69 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %23
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4int %19 %int_1
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureLoad_f06b69
+ %31 = OpFunctionCall %void %textureLoad_f06b69
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureLoad_f06b69
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureLoad_f06b69
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureLoad_f06b69
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_f06b69
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.wgsl
index aa69f05..c20a1cd 100644
--- a/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_f06b69();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/f379e2.wgsl b/test/intrinsics/gen/textureLoad/f379e2.wgsl
index eccd87f..6f6e2bb 100644
--- a/test/intrinsics/gen/textureLoad/f379e2.wgsl
+++ b/test/intrinsics/gen/textureLoad/f379e2.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_f379e2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.hlsl
index de2e3ed..b9cef99 100644
--- a/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
void textureLoad_f379e2() {
float4 res = arg_0.Load(int4(0, 0, 1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_f379e2();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.spvasm
index 903570c..5261954 100644
--- a/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 40
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_f379e2 "textureLoad_f379e2"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,38 +32,48 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rgba8
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %22 = OpConstantNull %v4float
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_f379e2 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %22
- %14 = OpLoad %7 %arg_0
- %12 = OpImageRead %v4float %14 %19
- OpStore %res %12
+%textureLoad_f379e2 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageRead %v4float %17 %22
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %24 = OpLabel
- OpStore %tint_pointsize %float_1
- %26 = OpFunctionCall %void %textureLoad_f379e2
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
%28 = OpLabel
- %29 = OpFunctionCall %void %textureLoad_f379e2
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %31 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ OpStore %tint_pointsize %float_1
%32 = OpFunctionCall %void %textureLoad_f379e2
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_f379e2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_f379e2
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.wgsl
index ac8b4b3..a554623 100644
--- a/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_f379e2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/f56e6f.wgsl b/test/intrinsics/gen/textureLoad/f56e6f.wgsl
index 17a3654..8931760 100644
--- a/test/intrinsics/gen/textureLoad/f56e6f.wgsl
+++ b/test/intrinsics/gen/textureLoad/f56e6f.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_f56e6f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.hlsl
index 866fd9d..4824067 100644
--- a/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<uint4> arg_0 : register(t0, space1);
void textureLoad_f56e6f() {
uint4 res = arg_0.Load(int4(0, 0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_f56e6f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.spvasm
index 882c01e..22cb292 100644
--- a/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_f56e6f "textureLoad_f56e6f"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %uint 3D 0 0 0 2 Rgba16ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4uint = OpTypeVector %uint 4
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %18 = OpConstantNull %v3int
+ %22 = OpConstantNull %v3int
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %21 = OpConstantNull %v4uint
+ %25 = OpConstantNull %v4uint
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_f56e6f = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %21
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4uint %15 %18
- OpStore %res %13
+%textureLoad_f56e6f = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %25
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4uint %19 %22
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureLoad_f56e6f
+ %33 = OpFunctionCall %void %textureLoad_f56e6f
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureLoad_f56e6f
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_f56e6f
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureLoad_f56e6f
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureLoad_f56e6f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.wgsl
index c6ee7db..394ca11 100644
--- a/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_f56e6f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/f74bd8.wgsl b/test/intrinsics/gen/textureLoad/f74bd8.wgsl
index 37f1354..76e287e 100644
--- a/test/intrinsics/gen/textureLoad/f74bd8.wgsl
+++ b/test/intrinsics/gen/textureLoad/f74bd8.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_f74bd8();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.hlsl
index 2745df6..786fc1a 100644
--- a/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<float4> arg_0 : register(t0, space1);
void textureLoad_f74bd8() {
float4 res = arg_0.Load(int4(0, 0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_f74bd8();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.spvasm
index 1713cb8..2c1f115 100644
--- a/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_f74bd8 "textureLoad_f74bd8"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,46 @@
%7 = OpTypeImage %float 3D 0 0 0 2 Rg32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %17 = OpConstantNull %v3int
+ %20 = OpConstantNull %v3int
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %20 = OpConstantNull %v4float
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_f74bd8 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %20
- %14 = OpLoad %7 %arg_0
- %12 = OpImageRead %v4float %14 %17
- OpStore %res %12
+%textureLoad_f74bd8 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageRead %v4float %17 %20
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
- OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_f74bd8
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
%26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_f74bd8
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
%30 = OpFunctionCall %void %textureLoad_f74bd8
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureLoad_f74bd8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_f74bd8
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.wgsl
index 91cf301..5402217 100644
--- a/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_f74bd8();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/fc6d36.wgsl b/test/intrinsics/gen/textureLoad/fc6d36.wgsl
index 48ae1d7..9fc35a4 100644
--- a/test/intrinsics/gen/textureLoad/fc6d36.wgsl
+++ b/test/intrinsics/gen/textureLoad/fc6d36.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_fc6d36();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.hlsl
index b35937a..a25f805 100644
--- a/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<int4> arg_0 : register(t0, space1);
void textureLoad_fc6d36() {
int4 res = arg_0.Load(int4(0, 0, 1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_fc6d36();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.spvasm
index 7f42977..6165d01 100644
--- a/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 42
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_fc6d36 "textureLoad_fc6d36"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,37 +33,49 @@
%7 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4int = OpTypeVector %int 4
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%_ptr_Function_v4int = OpTypePointer Function %v4int
- %22 = OpConstantNull %v4int
+ %26 = OpConstantNull %v4int
+ %27 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_fc6d36 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4int Function %22
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4int %15 %19
- OpStore %res %13
+%textureLoad_fc6d36 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4int Function %26
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4int %19 %23
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %24 = OpLabel
+%tint_symbol_2 = OpFunction %void None %27
+%tint_symbol = OpFunctionParameter %v4float
+ %30 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
OpStore %tint_pointsize %float_1
- %26 = OpFunctionCall %void %textureLoad_fc6d36
+ %34 = OpFunctionCall %void %textureLoad_fc6d36
+ %35 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureLoad_fc6d36
+%fragment_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureLoad_fc6d36
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureLoad_fc6d36
+%compute_main = OpFunction %void None %13
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureLoad_fc6d36
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.wgsl
index c08523c..6ab0bc3 100644
--- a/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_fc6d36();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/fdebd0.wgsl b/test/intrinsics/gen/textureLoad/fdebd0.wgsl
index 5a977ac..b7e25d6 100644
--- a/test/intrinsics/gen/textureLoad/fdebd0.wgsl
+++ b/test/intrinsics/gen/textureLoad/fdebd0.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_fdebd0();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.hlsl
index e1ddcca..827c69a 100644
--- a/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<uint4> arg_0 : register(t0, space1);
void textureLoad_fdebd0() {
uint4 res = arg_0.Load(int4(0, 0, 1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_fdebd0();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.spvasm
index e773e58..5c8c83f 100644
--- a/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 43
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_fdebd0 "textureLoad_fdebd0"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,38 +33,50 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v4uint = OpTypeVector %uint 4
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %20 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %24 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %23 = OpConstantNull %v4uint
+ %27 = OpConstantNull %v4uint
+ %28 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_fdebd0 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_v4uint Function %23
- %15 = OpLoad %7 %arg_0
- %13 = OpImageRead %v4uint %15 %20
- OpStore %res %13
+%textureLoad_fdebd0 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v4uint Function %27
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageRead %v4uint %19 %24
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %25 = OpLabel
+%tint_symbol_2 = OpFunction %void None %28
+%tint_symbol = OpFunctionParameter %v4float
+ %31 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %33 = OpLabel
OpStore %tint_pointsize %float_1
- %27 = OpFunctionCall %void %textureLoad_fdebd0
+ %35 = OpFunctionCall %void %textureLoad_fdebd0
+ %36 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureLoad_fdebd0
+%fragment_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureLoad_fdebd0
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureLoad_fdebd0
+%compute_main = OpFunction %void None %13
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureLoad_fdebd0
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.wgsl
index 8993373..1e9118c 100644
--- a/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_fdebd0();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/fe222a.wgsl b/test/intrinsics/gen/textureLoad/fe222a.wgsl
index 0f8f960..1683f24 100644
--- a/test/intrinsics/gen/textureLoad/fe222a.wgsl
+++ b/test/intrinsics/gen/textureLoad/fe222a.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_fe222a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.hlsl
index bb2a0b0..79bb239 100644
--- a/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture1D<float4> arg_0 : register(t0, space1);
void textureLoad_fe222a() {
float4 res = arg_0.Load(int2(1, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_fe222a();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.spvasm
index 7ef1da7..e9b82b3 100644
--- a/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_fe222a "textureLoad_fe222a"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,45 @@
%7 = OpTypeImage %float 1D 0 0 0 2 Rgba8Snorm
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %19 = OpConstantNull %v4float
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_fe222a = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %19
- %14 = OpLoad %7 %arg_0
- %12 = OpImageRead %v4float %14 %int_1
- OpStore %res %12
+%textureLoad_fe222a = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageRead %v4float %17 %int_1
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
- OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureLoad_fe222a
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
%25 = OpLabel
- %26 = OpFunctionCall %void %textureLoad_fe222a
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ OpStore %tint_pointsize %float_1
%29 = OpFunctionCall %void %textureLoad_fe222a
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureLoad_fe222a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureLoad_fe222a
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.wgsl
index f6ac8774..5f27e75206 100644
--- a/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_fe222a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/feab99.wgsl b/test/intrinsics/gen/textureLoad/feab99.wgsl
index 8f36ccb..83a15a7 100644
--- a/test/intrinsics/gen/textureLoad/feab99.wgsl
+++ b/test/intrinsics/gen/textureLoad/feab99.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_feab99();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.hlsl
index 03c7b20..faa6202 100644
--- a/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<float4> arg_0 : register(t0, space1);
void textureLoad_feab99() {
float4 res = arg_0.Load(int4(0, 0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureLoad_feab99();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.spvasm
index 31c2a72..f0af0c0 100644
--- a/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureLoad_feab99 "textureLoad_feab99"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,36 +32,46 @@
%7 = OpTypeImage %float 3D 0 0 0 2 Rgba16f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
- %void = OpTypeVoid
- %8 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %17 = OpConstantNull %v3int
+ %20 = OpConstantNull %v3int
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %20 = OpConstantNull %v4float
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureLoad_feab99 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %20
- %14 = OpLoad %7 %arg_0
- %12 = OpImageRead %v4float %14 %17
- OpStore %res %12
+%textureLoad_feab99 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %11
+ %17 = OpLoad %7 %arg_0
+ %16 = OpImageRead %v4float %17 %20
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
- OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureLoad_feab99
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
%26 = OpLabel
- %27 = OpFunctionCall %void %textureLoad_feab99
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
%30 = OpFunctionCall %void %textureLoad_feab99
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureLoad_feab99
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureLoad_feab99
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.wgsl
index c0de2b4..cb8f4b6 100644
--- a/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureLoad_feab99();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/024820.wgsl b/test/intrinsics/gen/textureNumLayers/024820.wgsl
index fa64259..3f91929 100644
--- a/test/intrinsics/gen/textureNumLayers/024820.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/024820.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_024820();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.hlsl
index 066e3c3..f6361b4 100644
--- a/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
void textureNumLayers_024820() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_024820();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.spvasm
index a5b63d2..45ba7e6 100644
--- a/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_024820 "textureNumLayers_024820"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,36 +32,48 @@
%7 = OpTypeImage %float 2D 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
+ %24 = OpConstantNull %int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_024820 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %20
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySizeLod %v3int %16 %int_0
- %12 = OpCompositeExtract %int %14 2
- OpStore %res %12
+%textureNumLayers_024820 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %24
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySizeLod %v3int %20 %int_0
+ %16 = OpCompositeExtract %int %18 2
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureNumLayers_024820
+ %32 = OpFunctionCall %void %textureNumLayers_024820
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_024820
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_024820
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureNumLayers_024820
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_024820
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.wgsl
index 923f42d..51a0daf 100644
--- a/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_024820();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/053df7.wgsl b/test/intrinsics/gen/textureNumLayers/053df7.wgsl
index a8e1565..6f9c2e2 100644
--- a/test/intrinsics/gen/textureNumLayers/053df7.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/053df7.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_053df7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.hlsl
index 5d43efd..22ac339 100644
--- a/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCubeArray<uint4> arg_0 : register(t0, space1);
void textureNumLayers_053df7() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_053df7();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.spvasm
index 405ee4a..9dcf75f6 100644
--- a/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.spvasm
@@ -1,27 +1,31 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability SampledCubeArray
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_053df7 "textureNumLayers_053df7"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,36 +34,48 @@
%7 = OpTypeImage %uint Cube 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
+ %25 = OpConstantNull %int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_053df7 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySizeLod %v3int %17 %int_0
- %13 = OpCompositeExtract %int %15 2
- OpStore %res %13
+%textureNumLayers_053df7 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %25
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySizeLod %v3int %21 %int_0
+ %17 = OpCompositeExtract %int %19 2
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureNumLayers_053df7
+ %33 = OpFunctionCall %void %textureNumLayers_053df7
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLayers_053df7
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLayers_053df7
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureNumLayers_053df7
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureNumLayers_053df7
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.wgsl
index 2ff71e2..b890752 100644
--- a/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_053df7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl
index c3530b1..e730303 100644
--- a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_058cc3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.hlsl
index bea559a..5f55531 100644
--- a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<int4> arg_0 : register(u0, space1);
void textureNumLayers_058cc3() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_058cc3();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.spvasm
index 9871813..c6295ab 100644
--- a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_058cc3 "textureNumLayers_058cc3"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,34 +35,46 @@
%7 = OpTypeImage %int 2D 0 1 0 2 Rg32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %19 = OpConstantNull %int
+ %23 = OpConstantNull %int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_058cc3 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %19
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySize %v3int %16
- %13 = OpCompositeExtract %int %14 2
- OpStore %res %13
+%textureNumLayers_058cc3 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %23
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySize %v3int %20
+ %17 = OpCompositeExtract %int %18 2
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureNumLayers_058cc3
+ %31 = OpFunctionCall %void %textureNumLayers_058cc3
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLayers_058cc3
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_058cc3
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_058cc3
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_058cc3
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.wgsl
index 9ca4230..1a2a38d 100644
--- a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_058cc3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl
index 7522096..7b272c6 100644
--- a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_09d05d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.hlsl
index 8b0879e..653d721 100644
--- a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<float4> arg_0 : register(u0, space1);
void textureNumLayers_09d05d() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_09d05d();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.spvasm
index 6bbf3f5..875a32d 100644
--- a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_09d05d "textureNumLayers_09d05d"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,47 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rgba8
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %19 = OpConstantNull %int
+ %23 = OpConstantNull %int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_09d05d = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %19
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySize %v3int %16
- %12 = OpCompositeExtract %int %14 2
- OpStore %res %12
+%textureNumLayers_09d05d = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %23
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySize %v3int %20
+ %16 = OpCompositeExtract %int %18 2
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureNumLayers_09d05d
+ %31 = OpFunctionCall %void %textureNumLayers_09d05d
+ %32 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLayers_09d05d
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_09d05d
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_09d05d
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_09d05d
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.wgsl
index 16aa0f2..5235e46 100644
--- a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_09d05d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl
index 33f4131..b7d78e4 100644
--- a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_13b4ce();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.hlsl
index a363038..bd389a5 100644
--- a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<int4> arg_0 : register(u0, space1);
void textureNumLayers_13b4ce() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_13b4ce();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.spvasm
index 0c5d315..b718fb6 100644
--- a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_13b4ce "textureNumLayers_13b4ce"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %19 = OpConstantNull %int
+ %23 = OpConstantNull %int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_13b4ce = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %19
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySize %v3int %16
- %13 = OpCompositeExtract %int %14 2
- OpStore %res %13
+%textureNumLayers_13b4ce = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %23
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySize %v3int %20
+ %17 = OpCompositeExtract %int %18 2
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureNumLayers_13b4ce
+ %31 = OpFunctionCall %void %textureNumLayers_13b4ce
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLayers_13b4ce
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_13b4ce
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_13b4ce
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_13b4ce
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.wgsl
index f6dfe9f..783081f 100644
--- a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_13b4ce();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl
index 568367e..91c4471 100644
--- a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_22e53b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.hlsl
index 1d275f4..bf761c3 100644
--- a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<int4> arg_0 : register(u0, space1);
void textureNumLayers_22e53b() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_22e53b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.spvasm
index 162d072..8cb1c31 100644
--- a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_22e53b "textureNumLayers_22e53b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %int 2D 0 1 0 2 R32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %19 = OpConstantNull %int
+ %23 = OpConstantNull %int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_22e53b = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %19
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySize %v3int %16
- %13 = OpCompositeExtract %int %14 2
- OpStore %res %13
+%textureNumLayers_22e53b = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %23
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySize %v3int %20
+ %17 = OpCompositeExtract %int %18 2
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureNumLayers_22e53b
+ %31 = OpFunctionCall %void %textureNumLayers_22e53b
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLayers_22e53b
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_22e53b
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_22e53b
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_22e53b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.wgsl
index 8e51176..4932ed6 100644
--- a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_22e53b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl
index d0ac8df..47ccd68 100644
--- a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_2f6bb3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.hlsl
index b4f5780..4ca6059 100644
--- a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<uint4> arg_0 : register(t0, space1);
void textureNumLayers_2f6bb3() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_2f6bb3();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.spvasm
index deb036d..397d281 100644
--- a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_2f6bb3 "textureNumLayers_2f6bb3"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 R32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
+ %24 = OpConstantNull %int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_2f6bb3 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %13 = OpCompositeExtract %int %15 2
- OpStore %res %13
+%textureNumLayers_2f6bb3 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %17 = OpCompositeExtract %int %19 2
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureNumLayers_2f6bb3
+ %32 = OpFunctionCall %void %textureNumLayers_2f6bb3
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_2f6bb3
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_2f6bb3
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureNumLayers_2f6bb3
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_2f6bb3
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.wgsl
index 841cafc..105f35f 100644
--- a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_2f6bb3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/315298.wgsl b/test/intrinsics/gen/textureNumLayers/315298.wgsl
index 1cd07fd..fe36fe8 100644
--- a/test/intrinsics/gen/textureNumLayers/315298.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/315298.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_315298();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.hlsl
index 637db42..effba23 100644
--- a/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<int4> arg_0 : register(t0, space1);
void textureNumLayers_315298() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_315298();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.spvasm
index 3ff059a..7ec4325 100644
--- a/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_315298 "textureNumLayers_315298"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %19 = OpConstantNull %int
+ %23 = OpConstantNull %int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_315298 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %19
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySize %v3int %16
- %13 = OpCompositeExtract %int %14 2
- OpStore %res %13
+%textureNumLayers_315298 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %23
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySize %v3int %20
+ %17 = OpCompositeExtract %int %18 2
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureNumLayers_315298
+ %31 = OpFunctionCall %void %textureNumLayers_315298
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLayers_315298
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_315298
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_315298
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_315298
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.wgsl
index 5f0a525..6cf6c73 100644
--- a/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_315298();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl
index 2dd6eaa..52e4111 100644
--- a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_3615e3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.hlsl
index acb2945..22456f5 100644
--- a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<int4> arg_0 : register(t0, space1);
void textureNumLayers_3615e3() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_3615e3();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.spvasm
index ecc75ef..b3125c4 100644
--- a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_3615e3 "textureNumLayers_3615e3"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %19 = OpConstantNull %int
+ %23 = OpConstantNull %int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_3615e3 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %19
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySize %v3int %16
- %13 = OpCompositeExtract %int %14 2
- OpStore %res %13
+%textureNumLayers_3615e3 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %23
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySize %v3int %20
+ %17 = OpCompositeExtract %int %18 2
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureNumLayers_3615e3
+ %31 = OpFunctionCall %void %textureNumLayers_3615e3
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLayers_3615e3
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_3615e3
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_3615e3
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_3615e3
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.wgsl
index f248320..42d36f2 100644
--- a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_3615e3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl
index 044fa99..ba10380 100644
--- a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_390fd5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.hlsl
index 9ab80c5..ea1bd83 100644
--- a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<uint4> arg_0 : register(t0, space1);
void textureNumLayers_390fd5() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_390fd5();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.spvasm
index cd442f8..bbe77b3 100644
--- a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_390fd5 "textureNumLayers_390fd5"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
+ %24 = OpConstantNull %int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_390fd5 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %13 = OpCompositeExtract %int %15 2
- OpStore %res %13
+%textureNumLayers_390fd5 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %17 = OpCompositeExtract %int %19 2
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureNumLayers_390fd5
+ %32 = OpFunctionCall %void %textureNumLayers_390fd5
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_390fd5
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_390fd5
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureNumLayers_390fd5
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_390fd5
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.wgsl
index 91b250e..1d83dcc 100644
--- a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_390fd5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/45155d.wgsl b/test/intrinsics/gen/textureNumLayers/45155d.wgsl
index ab2be8b3..57f8b7b 100644
--- a/test/intrinsics/gen/textureNumLayers/45155d.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/45155d.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_45155d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.hlsl
index ba95843..48a7c25 100644
--- a/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
void textureNumLayers_45155d() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_45155d();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.spvasm
index dde6292..6d2daac 100644
--- a/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_45155d "textureNumLayers_45155d"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,47 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rgba8
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %19 = OpConstantNull %int
+ %23 = OpConstantNull %int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_45155d = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %19
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySize %v3int %16
- %12 = OpCompositeExtract %int %14 2
- OpStore %res %12
+%textureNumLayers_45155d = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %23
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySize %v3int %20
+ %16 = OpCompositeExtract %int %18 2
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureNumLayers_45155d
+ %31 = OpFunctionCall %void %textureNumLayers_45155d
+ %32 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLayers_45155d
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_45155d
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_45155d
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_45155d
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.wgsl
index 107a74c..756cf9f 100644
--- a/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_45155d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl
index 45bf5f8..61ea692 100644
--- a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_4bf67b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.hlsl
index 629aa52..40be9f8 100644
--- a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<int4> arg_0 : register(t0, space1);
void textureNumLayers_4bf67b() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_4bf67b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.spvasm
index 12bd477..4ccb269 100644
--- a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_4bf67b "textureNumLayers_4bf67b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %int 2D 0 1 0 2 R32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %19 = OpConstantNull %int
+ %23 = OpConstantNull %int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_4bf67b = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %19
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySize %v3int %16
- %13 = OpCompositeExtract %int %14 2
- OpStore %res %13
+%textureNumLayers_4bf67b = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %23
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySize %v3int %20
+ %17 = OpCompositeExtract %int %18 2
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureNumLayers_4bf67b
+ %31 = OpFunctionCall %void %textureNumLayers_4bf67b
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLayers_4bf67b
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_4bf67b
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_4bf67b
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_4bf67b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.wgsl
index 2185d73..f3c2619 100644
--- a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_4bf67b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/562013.wgsl b/test/intrinsics/gen/textureNumLayers/562013.wgsl
index 3215988..7dc062a 100644
--- a/test/intrinsics/gen/textureNumLayers/562013.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/562013.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_562013();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.hlsl
index 273ab51..beecae2 100644
--- a/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<float4> arg_0 : register(u0, space1);
void textureNumLayers_562013() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_562013();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.spvasm
index 2f25a38..4dd95b2 100644
--- a/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_562013 "textureNumLayers_562013"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,47 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %19 = OpConstantNull %int
+ %23 = OpConstantNull %int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_562013 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %19
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySize %v3int %16
- %12 = OpCompositeExtract %int %14 2
- OpStore %res %12
+%textureNumLayers_562013 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %23
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySize %v3int %20
+ %16 = OpCompositeExtract %int %18 2
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureNumLayers_562013
+ %31 = OpFunctionCall %void %textureNumLayers_562013
+ %32 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLayers_562013
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_562013
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_562013
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_562013
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.wgsl
index 5a217b6..c2c48bd 100644
--- a/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_562013();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/57092f.wgsl b/test/intrinsics/gen/textureNumLayers/57092f.wgsl
index f752ba0..46828ea 100644
--- a/test/intrinsics/gen/textureNumLayers/57092f.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/57092f.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_57092f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.hlsl
index e50de13..fa6c025a 100644
--- a/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<uint4> arg_0 : register(t0, space1);
void textureNumLayers_57092f() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_57092f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.spvasm
index fdfa698..11e5d4a 100644
--- a/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_57092f "textureNumLayers_57092f"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
+ %24 = OpConstantNull %int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_57092f = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %13 = OpCompositeExtract %int %15 2
- OpStore %res %13
+%textureNumLayers_57092f = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %17 = OpCompositeExtract %int %19 2
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureNumLayers_57092f
+ %32 = OpFunctionCall %void %textureNumLayers_57092f
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_57092f
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_57092f
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureNumLayers_57092f
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_57092f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.wgsl
index eb7bac5..b7f2f18 100644
--- a/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_57092f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl
index a53d9ee..a1b97e1 100644
--- a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_5d59cd();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.hlsl
index 86b51cb..ee91b15 100644
--- a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCubeArray<float4> arg_0 : register(t0, space1);
void textureNumLayers_5d59cd() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_5d59cd();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.spvasm
index 3dc3190..dee75ea 100644
--- a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.spvasm
@@ -1,27 +1,31 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability SampledCubeArray
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_5d59cd "textureNumLayers_5d59cd"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %float Cube 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
+ %24 = OpConstantNull %int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_5d59cd = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %20
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySizeLod %v3int %16 %int_0
- %12 = OpCompositeExtract %int %14 2
- OpStore %res %12
+%textureNumLayers_5d59cd = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %24
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySizeLod %v3int %20 %int_0
+ %16 = OpCompositeExtract %int %18 2
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureNumLayers_5d59cd
+ %32 = OpFunctionCall %void %textureNumLayers_5d59cd
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_5d59cd
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_5d59cd
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureNumLayers_5d59cd
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_5d59cd
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.wgsl
index 6d6fd6c..8da9f14 100644
--- a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_5d59cd();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl
index 82ac2b3..fcac6c4 100644
--- a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_68a65b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.hlsl
index edfd072..b685542 100644
--- a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<float4> arg_0 : register(u0, space1);
void textureNumLayers_68a65b() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_68a65b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.spvasm
index 1643448..f31077f 100644
--- a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_68a65b "textureNumLayers_68a65b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,47 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %19 = OpConstantNull %int
+ %23 = OpConstantNull %int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_68a65b = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %19
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySize %v3int %16
- %12 = OpCompositeExtract %int %14 2
- OpStore %res %12
+%textureNumLayers_68a65b = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %23
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySize %v3int %20
+ %16 = OpCompositeExtract %int %18 2
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureNumLayers_68a65b
+ %31 = OpFunctionCall %void %textureNumLayers_68a65b
+ %32 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLayers_68a65b
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_68a65b
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_68a65b
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_68a65b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.wgsl
index 5b331c2..606e2b0 100644
--- a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_68a65b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl
index 54b0615..1edd06a 100644
--- a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_778bd1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.hlsl
index 4bbc51c..e93accf 100644
--- a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCubeArray arg_0 : register(t0, space1);
void textureNumLayers_778bd1() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_778bd1();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.spvasm
index 8c57768..ab55f07 100644
--- a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.spvasm
@@ -1,27 +1,31 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability SampledCubeArray
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_778bd1 "textureNumLayers_778bd1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %float Cube 1 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
+ %24 = OpConstantNull %int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_778bd1 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %20
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySizeLod %v3int %16 %int_0
- %12 = OpCompositeExtract %int %14 2
- OpStore %res %12
+%textureNumLayers_778bd1 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %24
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySizeLod %v3int %20 %int_0
+ %16 = OpCompositeExtract %int %18 2
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureNumLayers_778bd1
+ %32 = OpFunctionCall %void %textureNumLayers_778bd1
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_778bd1
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_778bd1
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureNumLayers_778bd1
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_778bd1
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.wgsl
index 43e7c18..7f5a1c2 100644
--- a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_778bd1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl
index 846381a..8aaf851 100644
--- a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_7f1937();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.hlsl
index 2017e6e..537a9c6 100644
--- a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<float4> arg_0 : register(u0, space1);
void textureNumLayers_7f1937() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_7f1937();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.spvasm
index d20fcb0..8789a55 100644
--- a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_7f1937 "textureNumLayers_7f1937"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rg32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %19 = OpConstantNull %int
+ %23 = OpConstantNull %int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_7f1937 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %19
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySize %v3int %16
- %12 = OpCompositeExtract %int %14 2
- OpStore %res %12
+%textureNumLayers_7f1937 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %23
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySize %v3int %20
+ %16 = OpCompositeExtract %int %18 2
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureNumLayers_7f1937
+ %31 = OpFunctionCall %void %textureNumLayers_7f1937
+ %32 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLayers_7f1937
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_7f1937
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_7f1937
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_7f1937
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.wgsl
index ffec0d1..4378023 100644
--- a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_7f1937();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/85f980.wgsl b/test/intrinsics/gen/textureNumLayers/85f980.wgsl
index 665ad71..ae6dc7a 100644
--- a/test/intrinsics/gen/textureNumLayers/85f980.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/85f980.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_85f980();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.hlsl
index c0aa9c7..32e8d54 100644
--- a/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCubeArray<int4> arg_0 : register(t0, space1);
void textureNumLayers_85f980() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_85f980();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.spvasm
index f9ce61f..18ef1fc 100644
--- a/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.spvasm
@@ -1,27 +1,31 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability SampledCubeArray
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_85f980 "textureNumLayers_85f980"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %int Cube 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
+ %24 = OpConstantNull %int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_85f980 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %20
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySizeLod %v3int %16 %int_0
- %13 = OpCompositeExtract %int %14 2
- OpStore %res %13
+%textureNumLayers_85f980 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %24
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySizeLod %v3int %20 %int_0
+ %17 = OpCompositeExtract %int %18 2
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureNumLayers_85f980
+ %32 = OpFunctionCall %void %textureNumLayers_85f980
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_85f980
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_85f980
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureNumLayers_85f980
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_85f980
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.wgsl
index b076871..199d4ca 100644
--- a/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_85f980();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/87953e.wgsl b/test/intrinsics/gen/textureNumLayers/87953e.wgsl
index 0e8fbe7..c12d10f 100644
--- a/test/intrinsics/gen/textureNumLayers/87953e.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/87953e.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_87953e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.hlsl
index 96d638f..585cae7 100644
--- a/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<uint4> arg_0 : register(t0, space1);
void textureNumLayers_87953e() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_87953e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.spvasm
index 8671f4a..053b87c 100644
--- a/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_87953e "textureNumLayers_87953e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,36 +33,48 @@
%7 = OpTypeImage %uint 2D 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
+ %25 = OpConstantNull %int
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_87953e = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySizeLod %v3int %17 %int_0
- %13 = OpCompositeExtract %int %15 2
- OpStore %res %13
+%textureNumLayers_87953e = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %25
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySizeLod %v3int %21 %int_0
+ %17 = OpCompositeExtract %int %19 2
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureNumLayers_87953e
+ %33 = OpFunctionCall %void %textureNumLayers_87953e
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLayers_87953e
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLayers_87953e
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureNumLayers_87953e
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureNumLayers_87953e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.wgsl
index cfd9b95..3ebba1a 100644
--- a/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_87953e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl
index 423f9c8..0550578 100644
--- a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_893e7c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.hlsl
index 507cb89..09cee4c 100644
--- a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<int4> arg_0 : register(t0, space1);
void textureNumLayers_893e7c() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_893e7c();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.spvasm
index 445ed71..898ee2c 100644
--- a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_893e7c "textureNumLayers_893e7c"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,47 @@
%7 = OpTypeImage %int 2D 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
+ %24 = OpConstantNull %int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_893e7c = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %20
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySizeLod %v3int %16 %int_0
- %13 = OpCompositeExtract %int %14 2
- OpStore %res %13
+%textureNumLayers_893e7c = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %24
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySizeLod %v3int %20 %int_0
+ %17 = OpCompositeExtract %int %18 2
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureNumLayers_893e7c
+ %32 = OpFunctionCall %void %textureNumLayers_893e7c
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_893e7c
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_893e7c
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureNumLayers_893e7c
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_893e7c
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.wgsl
index eb3bf2f..951867a 100644
--- a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_893e7c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/938763.wgsl b/test/intrinsics/gen/textureNumLayers/938763.wgsl
index 22adab5..f77d011 100644
--- a/test/intrinsics/gen/textureNumLayers/938763.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/938763.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_938763();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.hlsl
index 47da08a..1e411b3 100644
--- a/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<uint4> arg_0 : register(t0, space1);
void textureNumLayers_938763() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_938763();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.spvasm
index 7fcf149..7a8a0ea 100644
--- a/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_938763 "textureNumLayers_938763"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,35 +35,47 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
+ %24 = OpConstantNull %int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_938763 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %13 = OpCompositeExtract %int %15 2
- OpStore %res %13
+%textureNumLayers_938763 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %17 = OpCompositeExtract %int %19 2
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureNumLayers_938763
+ %32 = OpFunctionCall %void %textureNumLayers_938763
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_938763
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_938763
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureNumLayers_938763
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_938763
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.wgsl
index c7a5abc..b898ee9 100644
--- a/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_938763();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl
index 26d33d5..2d30393 100644
--- a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_9700fb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.hlsl
index d08ca80..9c34748 100644
--- a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<uint4> arg_0 : register(u0, space1);
void textureNumLayers_9700fb() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_9700fb();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.spvasm
index 76f48e3..24e0ac5 100644
--- a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_9700fb "textureNumLayers_9700fb"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
+ %24 = OpConstantNull %int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_9700fb = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %13 = OpCompositeExtract %int %15 2
- OpStore %res %13
+%textureNumLayers_9700fb = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %17 = OpCompositeExtract %int %19 2
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureNumLayers_9700fb
+ %32 = OpFunctionCall %void %textureNumLayers_9700fb
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_9700fb
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_9700fb
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureNumLayers_9700fb
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_9700fb
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.wgsl
index b63c56d..09a5873 100644
--- a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_9700fb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl
index c3967a4..8868b3f 100644
--- a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_a216d2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.hlsl
index 749335c..0d1373e 100644
--- a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<int4> arg_0 : register(u0, space1);
void textureNumLayers_a216d2() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_a216d2();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.spvasm
index 092addb..36439d2 100644
--- a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_a216d2 "textureNumLayers_a216d2"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %19 = OpConstantNull %int
+ %23 = OpConstantNull %int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_a216d2 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %19
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySize %v3int %16
- %13 = OpCompositeExtract %int %14 2
- OpStore %res %13
+%textureNumLayers_a216d2 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %23
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySize %v3int %20
+ %17 = OpCompositeExtract %int %18 2
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureNumLayers_a216d2
+ %31 = OpFunctionCall %void %textureNumLayers_a216d2
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLayers_a216d2
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_a216d2
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_a216d2
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_a216d2
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.wgsl
index 1f18aa0..595c790 100644
--- a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_a216d2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl
index 5fd1c96..39c9586 100644
--- a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_aa08a7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.hlsl
index 4c10784..8290a5f 100644
--- a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
void textureNumLayers_aa08a7() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_aa08a7();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.spvasm
index 499db63..e282d0c 100644
--- a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_aa08a7 "textureNumLayers_aa08a7"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rg32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %19 = OpConstantNull %int
+ %23 = OpConstantNull %int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_aa08a7 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %19
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySize %v3int %16
- %12 = OpCompositeExtract %int %14 2
- OpStore %res %12
+%textureNumLayers_aa08a7 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %23
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySize %v3int %20
+ %16 = OpCompositeExtract %int %18 2
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureNumLayers_aa08a7
+ %31 = OpFunctionCall %void %textureNumLayers_aa08a7
+ %32 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLayers_aa08a7
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_aa08a7
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_aa08a7
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_aa08a7
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.wgsl
index 82ed03c..37ada31 100644
--- a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_aa08a7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl
index b089716..1bc7e47 100644
--- a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_ab0c9b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.hlsl
index c5887d5..a2d0741 100644
--- a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<int4> arg_0 : register(t0, space1);
void textureNumLayers_ab0c9b() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_ab0c9b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.spvasm
index 5e486fd..296cafd 100644
--- a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_ab0c9b "textureNumLayers_ab0c9b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,34 +35,46 @@
%7 = OpTypeImage %int 2D 0 1 0 2 Rg32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %19 = OpConstantNull %int
+ %23 = OpConstantNull %int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_ab0c9b = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %19
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySize %v3int %16
- %13 = OpCompositeExtract %int %14 2
- OpStore %res %13
+%textureNumLayers_ab0c9b = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %23
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySize %v3int %20
+ %17 = OpCompositeExtract %int %18 2
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureNumLayers_ab0c9b
+ %31 = OpFunctionCall %void %textureNumLayers_ab0c9b
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLayers_ab0c9b
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_ab0c9b
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_ab0c9b
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_ab0c9b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.wgsl
index 1d19a42..86e0e6a 100644
--- a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_ab0c9b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl
index ea80719..7b3ec57 100644
--- a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_b8cd76();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.hlsl
index 0e8a101..5536f90 100644
--- a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
void textureNumLayers_b8cd76() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_b8cd76();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.spvasm
index 109c12e..553f041 100644
--- a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_b8cd76 "textureNumLayers_b8cd76"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,47 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %19 = OpConstantNull %int
+ %23 = OpConstantNull %int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_b8cd76 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %19
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySize %v3int %16
- %12 = OpCompositeExtract %int %14 2
- OpStore %res %12
+%textureNumLayers_b8cd76 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %23
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySize %v3int %20
+ %16 = OpCompositeExtract %int %18 2
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureNumLayers_b8cd76
+ %31 = OpFunctionCall %void %textureNumLayers_b8cd76
+ %32 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLayers_b8cd76
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_b8cd76
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_b8cd76
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_b8cd76
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.wgsl
index c769c1e..e06a165 100644
--- a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_b8cd76();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl
index 0bed34b..f6b5a6d 100644
--- a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_be1d70();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.hlsl
index a29e8bc..d46a506 100644
--- a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
void textureNumLayers_be1d70() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_be1d70();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.spvasm
index cbe7eff..591fbc2 100644
--- a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_be1d70 "textureNumLayers_be1d70"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,47 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %19 = OpConstantNull %int
+ %23 = OpConstantNull %int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_be1d70 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %19
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySize %v3int %16
- %12 = OpCompositeExtract %int %14 2
- OpStore %res %12
+%textureNumLayers_be1d70 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %23
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySize %v3int %20
+ %16 = OpCompositeExtract %int %18 2
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureNumLayers_be1d70
+ %31 = OpFunctionCall %void %textureNumLayers_be1d70
+ %32 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLayers_be1d70
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_be1d70
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_be1d70
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_be1d70
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.wgsl
index 3474b24..6e4fd3a 100644
--- a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_be1d70();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl
index b10c464..fcdcdad5 100644
--- a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_be3acb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.hlsl
index fe927b3..b4c71f9 100644
--- a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
void textureNumLayers_be3acb() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_be3acb();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.spvasm
index 9f51dbd..c3bc5c4 100644
--- a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_be3acb "textureNumLayers_be3acb"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,47 @@
%7 = OpTypeImage %float 2D 0 1 0 2 R32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %19 = OpConstantNull %int
+ %23 = OpConstantNull %int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_be3acb = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %19
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySize %v3int %16
- %12 = OpCompositeExtract %int %14 2
- OpStore %res %12
+%textureNumLayers_be3acb = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %23
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySize %v3int %20
+ %16 = OpCompositeExtract %int %18 2
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureNumLayers_be3acb
+ %31 = OpFunctionCall %void %textureNumLayers_be3acb
+ %32 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLayers_be3acb
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_be3acb
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_be3acb
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_be3acb
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.wgsl
index 1d18e59..d986afd 100644
--- a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_be3acb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/c09917.wgsl b/test/intrinsics/gen/textureNumLayers/c09917.wgsl
index 45daa99..ed3ff19 100644
--- a/test/intrinsics/gen/textureNumLayers/c09917.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/c09917.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_c09917();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.hlsl
index 5753eb4..3f110af 100644
--- a/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<uint4> arg_0 : register(t0, space1);
void textureNumLayers_c09917() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_c09917();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.spvasm
index 98505af..8238315 100644
--- a/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_c09917 "textureNumLayers_c09917"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
+ %24 = OpConstantNull %int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_c09917 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %13 = OpCompositeExtract %int %15 2
- OpStore %res %13
+%textureNumLayers_c09917 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %17 = OpCompositeExtract %int %19 2
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureNumLayers_c09917
+ %32 = OpFunctionCall %void %textureNumLayers_c09917
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_c09917
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_c09917
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureNumLayers_c09917
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_c09917
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.wgsl
index bb20c2f..d57c706 100644
--- a/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_c09917();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl
index 248fbc9..e0dbae2 100644
--- a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_c7c7f2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.hlsl
index 4b59760..2043efa 100644
--- a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
void textureNumLayers_c7c7f2() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_c7c7f2();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.spvasm
index ed6686c..516bb38 100644
--- a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_c7c7f2 "textureNumLayers_c7c7f2"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,47 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %19 = OpConstantNull %int
+ %23 = OpConstantNull %int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_c7c7f2 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %19
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySize %v3int %16
- %12 = OpCompositeExtract %int %14 2
- OpStore %res %12
+%textureNumLayers_c7c7f2 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %23
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySize %v3int %20
+ %16 = OpCompositeExtract %int %18 2
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureNumLayers_c7c7f2
+ %31 = OpFunctionCall %void %textureNumLayers_c7c7f2
+ %32 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLayers_c7c7f2
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_c7c7f2
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_c7c7f2
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_c7c7f2
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.wgsl
index f4de08f..781b878 100644
--- a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_c7c7f2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl
index 146b08d..a2ab9bb 100644
--- a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_cd5dc8();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.hlsl
index 4107f8c..07fc309 100644
--- a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<uint4> arg_0 : register(u0, space1);
void textureNumLayers_cd5dc8() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_cd5dc8();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.spvasm
index 29ca74b..e084d97 100644
--- a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_cd5dc8 "textureNumLayers_cd5dc8"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
+ %24 = OpConstantNull %int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_cd5dc8 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %13 = OpCompositeExtract %int %15 2
- OpStore %res %13
+%textureNumLayers_cd5dc8 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %17 = OpCompositeExtract %int %19 2
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureNumLayers_cd5dc8
+ %32 = OpFunctionCall %void %textureNumLayers_cd5dc8
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_cd5dc8
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_cd5dc8
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureNumLayers_cd5dc8
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_cd5dc8
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.wgsl
index bddc9ba..b90de11 100644
--- a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_cd5dc8();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl
index 191034b..d41c52c 100644
--- a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_d5b228();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.hlsl
index 2dad2ce..ff73afa 100644
--- a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<float4> arg_0 : register(u0, space1);
void textureNumLayers_d5b228() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_d5b228();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.spvasm
index dd55d2b..090fad2 100644
--- a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_d5b228 "textureNumLayers_d5b228"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,47 @@
%7 = OpTypeImage %float 2D 0 1 0 2 R32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %19 = OpConstantNull %int
+ %23 = OpConstantNull %int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_d5b228 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %19
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySize %v3int %16
- %12 = OpCompositeExtract %int %14 2
- OpStore %res %12
+%textureNumLayers_d5b228 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %23
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySize %v3int %20
+ %16 = OpCompositeExtract %int %18 2
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureNumLayers_d5b228
+ %31 = OpFunctionCall %void %textureNumLayers_d5b228
+ %32 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLayers_d5b228
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_d5b228
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_d5b228
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_d5b228
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.wgsl
index e5f7a25..5aab279 100644
--- a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_d5b228();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/e15642.wgsl b/test/intrinsics/gen/textureNumLayers/e15642.wgsl
index 92e4477..c463fcf 100644
--- a/test/intrinsics/gen/textureNumLayers/e15642.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/e15642.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_e15642();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.hlsl
index 6615530..961f796 100644
--- a/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<int4> arg_0 : register(t0, space1);
void textureNumLayers_e15642() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_e15642();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.spvasm
index 15c5d3b..652d1e1 100644
--- a/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_e15642 "textureNumLayers_e15642"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonWritable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %19 = OpConstantNull %int
+ %23 = OpConstantNull %int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_e15642 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %19
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySize %v3int %16
- %13 = OpCompositeExtract %int %14 2
- OpStore %res %13
+%textureNumLayers_e15642 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %23
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySize %v3int %20
+ %17 = OpCompositeExtract %int %18 2
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureNumLayers_e15642
+ %31 = OpFunctionCall %void %textureNumLayers_e15642
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLayers_e15642
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_e15642
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_e15642
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_e15642
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.wgsl
index 4c1ec30..2545c66 100644
--- a/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_e15642();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl
index 5564e7a..a7cb687 100644
--- a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_e31be1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.hlsl
index 68850da..f430c71 100644
--- a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<float4> arg_0 : register(u0, space1);
void textureNumLayers_e31be1() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_e31be1();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.spvasm
index 905e2ae..5ce6c9f 100644
--- a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_e31be1 "textureNumLayers_e31be1"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,47 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %19 = OpConstantNull %int
+ %23 = OpConstantNull %int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_e31be1 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %19
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySize %v3int %16
- %12 = OpCompositeExtract %int %14 2
- OpStore %res %12
+%textureNumLayers_e31be1 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %23
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySize %v3int %20
+ %16 = OpCompositeExtract %int %18 2
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureNumLayers_e31be1
+ %31 = OpFunctionCall %void %textureNumLayers_e31be1
+ %32 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLayers_e31be1
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_e31be1
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_e31be1
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_e31be1
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.wgsl
index 910a278..bf169dd 100644
--- a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_e31be1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl
index 831f136..a1c215d 100644
--- a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_e653c0();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.hlsl
index 5d59267..365d3f7 100644
--- a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray arg_0 : register(t0, space1);
void textureNumLayers_e653c0() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_e653c0();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.spvasm
index a8ae9ae..1502876 100644
--- a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_e653c0 "textureNumLayers_e653c0"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,36 +32,48 @@
%7 = OpTypeImage %float 2D 1 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
+ %24 = OpConstantNull %int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_e653c0 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %20
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySizeLod %v3int %16 %int_0
- %12 = OpCompositeExtract %int %14 2
- OpStore %res %12
+%textureNumLayers_e653c0 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %24
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySizeLod %v3int %20 %int_0
+ %16 = OpCompositeExtract %int %18 2
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureNumLayers_e653c0
+ %32 = OpFunctionCall %void %textureNumLayers_e653c0
+ %33 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_e653c0
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_e653c0
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureNumLayers_e653c0
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_e653c0
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.wgsl
index f133adb..ec3a276 100644
--- a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_e653c0();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl
index 60e2445..d1b2dda 100644
--- a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_ee942f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.hlsl
index 33663d4..5a05122 100644
--- a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<uint4> arg_0 : register(u0, space1);
void textureNumLayers_ee942f() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_ee942f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.spvasm
index 773fc74..bd63c9d 100644
--- a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_ee942f "textureNumLayers_ee942f"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 R32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
+ %24 = OpConstantNull %int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_ee942f = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %13 = OpCompositeExtract %int %15 2
- OpStore %res %13
+%textureNumLayers_ee942f = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %17 = OpCompositeExtract %int %19 2
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureNumLayers_ee942f
+ %32 = OpFunctionCall %void %textureNumLayers_ee942f
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_ee942f
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_ee942f
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureNumLayers_ee942f
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_ee942f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.wgsl
index 7874222..2ba778e 100644
--- a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_ee942f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/f33005.wgsl b/test/intrinsics/gen/textureNumLayers/f33005.wgsl
index 96fc3e3..a3b91d0 100644
--- a/test/intrinsics/gen/textureNumLayers/f33005.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/f33005.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_f33005();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.hlsl
index 28dbfcb..2c03b1b 100644
--- a/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<int4> arg_0 : register(u0, space1);
void textureNumLayers_f33005() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_f33005();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.spvasm
index 7237b6c..46349d8 100644
--- a/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_f33005 "textureNumLayers_f33005"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,34 +34,46 @@
%7 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %19 = OpConstantNull %int
+ %23 = OpConstantNull %int
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_f33005 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %19
- %16 = OpLoad %7 %arg_0
- %14 = OpImageQuerySize %v3int %16
- %13 = OpCompositeExtract %int %14 2
- OpStore %res %13
+%textureNumLayers_f33005 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %23
+ %20 = OpLoad %7 %arg_0
+ %18 = OpImageQuerySize %v3int %20
+ %17 = OpCompositeExtract %int %18 2
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureNumLayers_f33005
+ %31 = OpFunctionCall %void %textureNumLayers_f33005
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLayers_f33005
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_f33005
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_f33005
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_f33005
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.wgsl
index 8211300..2141b9c 100644
--- a/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_f33005();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl
index 47277d1..f9624cf 100644
--- a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_fcec98();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.hlsl
index 921abf0..09ec6a4 100644
--- a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<uint4> arg_0 : register(u0, space1);
void textureNumLayers_fcec98() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_fcec98();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.spvasm
index 8c8256e..cf2b552 100644
--- a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.spvasm
@@ -1,21 +1,24 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_fcec98 "textureNumLayers_fcec98"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -31,35 +35,47 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
+ %24 = OpConstantNull %int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_fcec98 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %13 = OpCompositeExtract %int %15 2
- OpStore %res %13
+%textureNumLayers_fcec98 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %17 = OpCompositeExtract %int %19 2
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureNumLayers_fcec98
+ %32 = OpFunctionCall %void %textureNumLayers_fcec98
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_fcec98
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_fcec98
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureNumLayers_fcec98
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_fcec98
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.wgsl
index f3cdcf8..d4c9e25 100644
--- a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_fcec98();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl
index 077109c..8bcbc36 100644
--- a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_ff5e89();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.hlsl
index 52e8e30..677e9f7 100644
--- a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<uint4> arg_0 : register(u0, space1);
void textureNumLayers_ff5e89() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLayers_ff5e89();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.spvasm
index 43e4afa..8608934 100644
--- a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLayers_ff5e89 "textureNumLayers_ff5e89"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,35 +34,47 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
+ %24 = OpConstantNull %int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLayers_ff5e89 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %20
- %17 = OpLoad %7 %arg_0
- %15 = OpImageQuerySize %v3int %17
- %13 = OpCompositeExtract %int %15 2
- OpStore %res %13
+%textureNumLayers_ff5e89 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %24
+ %21 = OpLoad %7 %arg_0
+ %19 = OpImageQuerySize %v3int %21
+ %17 = OpCompositeExtract %int %19 2
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureNumLayers_ff5e89
+ %32 = OpFunctionCall %void %textureNumLayers_ff5e89
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_ff5e89
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_ff5e89
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureNumLayers_ff5e89
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_ff5e89
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.wgsl
index dc726f5..a5ddef8 100644
--- a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLayers_ff5e89();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl
index 2782726..51879a8 100644
--- a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_076cb5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.hlsl
index 0356601..c70ebf9 100644
--- a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCube arg_0 : register(t0, space1);
void textureNumLevels_076cb5() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLevels_076cb5();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.spvasm
index c4b65d1..ab98b40 100644
--- a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLevels_076cb5 "textureNumLevels_076cb5"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,33 +32,45 @@
%7 = OpTypeImage %float Cube 1 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLevels_076cb5 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %12 = OpImageQueryLevels %int %14
- OpStore %res %12
+%textureNumLevels_076cb5 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQueryLevels %int %18
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureNumLevels_076cb5
+ %29 = OpFunctionCall %void %textureNumLevels_076cb5
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureNumLevels_076cb5
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_076cb5
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLevels_076cb5
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_076cb5
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.wgsl
index 42cfdbf..3fea2c8 100644
--- a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_076cb5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/080d95.wgsl b/test/intrinsics/gen/textureNumLevels/080d95.wgsl
index 5f13a72..22da686 100644
--- a/test/intrinsics/gen/textureNumLevels/080d95.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/080d95.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_080d95();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.hlsl
index bced17a..8faf945 100644
--- a/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCube<int4> arg_0 : register(t0, space1);
void textureNumLevels_080d95() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLevels_080d95();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.spvasm
index 76c0cb7..63bb114 100644
--- a/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLevels_080d95 "textureNumLevels_080d95"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,32 +33,44 @@
%7 = OpTypeImage %int Cube 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLevels_080d95 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %13 = OpImageQueryLevels %int %14
- OpStore %res %13
+%textureNumLevels_080d95 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %17 = OpImageQueryLevels %int %18
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureNumLevels_080d95
+ %29 = OpFunctionCall %void %textureNumLevels_080d95
+ %30 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureNumLevels_080d95
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_080d95
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLevels_080d95
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_080d95
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.wgsl
index b358276..653a894 100644
--- a/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_080d95();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl
index 9f5c5dd..45f2fe9 100644
--- a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_09ddd0();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.hlsl
index ce4bd02..bc09a54 100644
--- a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<uint4> arg_0 : register(t0, space1);
void textureNumLevels_09ddd0() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLevels_09ddd0();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.spvasm
index 83b255f..2f369db 100644
--- a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLevels_09ddd0 "textureNumLevels_09ddd0"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,33 +33,45 @@
%7 = OpTypeImage %uint 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %18 = OpConstantNull %int
+ %22 = OpConstantNull %int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLevels_09ddd0 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQueryLevels %int %15
- OpStore %res %13
+%textureNumLevels_09ddd0 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQueryLevels %int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureNumLevels_09ddd0
+ %30 = OpFunctionCall %void %textureNumLevels_09ddd0
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_09ddd0
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLevels_09ddd0
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLevels_09ddd0
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLevels_09ddd0
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.wgsl
index 12ca9ff..20b55f0 100644
--- a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_09ddd0();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/105988.wgsl b/test/intrinsics/gen/textureNumLevels/105988.wgsl
index e03ec03..25ffb94 100644
--- a/test/intrinsics/gen/textureNumLevels/105988.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/105988.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_105988();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.hlsl
index 5e09644..6e9874f 100644
--- a/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
void textureNumLevels_105988() {
@@ -6,9 +10,10 @@
int res = tint_tmp.w;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLevels_105988();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.spvasm
index 3bf9719..7a3b6a8 100644
--- a/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLevels_105988 "textureNumLevels_105988"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,33 +32,45 @@
%7 = OpTypeImage %float 2D 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLevels_105988 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %12 = OpImageQueryLevels %int %14
- OpStore %res %12
+%textureNumLevels_105988 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQueryLevels %int %18
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureNumLevels_105988
+ %29 = OpFunctionCall %void %textureNumLevels_105988
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureNumLevels_105988
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_105988
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLevels_105988
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_105988
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.wgsl
index 60b58b2..8a3178d 100644
--- a/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_105988();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/23f750.wgsl b/test/intrinsics/gen/textureNumLevels/23f750.wgsl
index 41cc9eb..004a8a4 100644
--- a/test/intrinsics/gen/textureNumLevels/23f750.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/23f750.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_23f750();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.hlsl
index 54c42b1..0787fa2 100644
--- a/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<int4> arg_0 : register(t0, space1);
void textureNumLevels_23f750() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLevels_23f750();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.spvasm
index 0d83d80..e1fc4b0 100644
--- a/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLevels_23f750 "textureNumLevels_23f750"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,32 +33,44 @@
%7 = OpTypeImage %int 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLevels_23f750 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %13 = OpImageQueryLevels %int %14
- OpStore %res %13
+%textureNumLevels_23f750 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %17 = OpImageQueryLevels %int %18
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureNumLevels_23f750
+ %29 = OpFunctionCall %void %textureNumLevels_23f750
+ %30 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureNumLevels_23f750
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_23f750
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLevels_23f750
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_23f750
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.wgsl
index 26ea98a..cb8a248 100644
--- a/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_23f750();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl
index ff12574..94362c0 100644
--- a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_2c3575();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.hlsl
index 0bd3455..c6e6088 100644
--- a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCubeArray arg_0 : register(t0, space1);
void textureNumLevels_2c3575() {
@@ -6,9 +10,10 @@
int res = tint_tmp.w;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLevels_2c3575();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.spvasm
index 671ebe5..2e68eb3 100644
--- a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.spvasm
@@ -1,27 +1,31 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability SampledCubeArray
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLevels_2c3575 "textureNumLevels_2c3575"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,33 +33,45 @@
%7 = OpTypeImage %float Cube 1 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLevels_2c3575 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %12 = OpImageQueryLevels %int %14
- OpStore %res %12
+%textureNumLevels_2c3575 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQueryLevels %int %18
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureNumLevels_2c3575
+ %29 = OpFunctionCall %void %textureNumLevels_2c3575
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureNumLevels_2c3575
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_2c3575
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLevels_2c3575
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_2c3575
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.wgsl
index 2cd56a5..c81e5e0 100644
--- a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_2c3575();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl
index 3aaae38..0db0538 100644
--- a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_5101cf();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.hlsl
index 4e35f0d..015129b 100644
--- a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<uint4> arg_0 : register(t0, space1);
void textureNumLevels_5101cf() {
@@ -6,9 +10,10 @@
int res = tint_tmp.w;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLevels_5101cf();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.spvasm
index 3ec9308..893e54d 100644
--- a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLevels_5101cf "textureNumLevels_5101cf"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,33 +33,45 @@
%7 = OpTypeImage %uint 2D 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %18 = OpConstantNull %int
+ %22 = OpConstantNull %int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLevels_5101cf = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQueryLevels %int %15
- OpStore %res %13
+%textureNumLevels_5101cf = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQueryLevels %int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureNumLevels_5101cf
+ %30 = OpFunctionCall %void %textureNumLevels_5101cf
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_5101cf
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLevels_5101cf
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLevels_5101cf
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLevels_5101cf
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.wgsl
index fcb851a..a09fa48 100644
--- a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_5101cf();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl
index c56b159..4b1bf08 100644
--- a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_897aaf();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.hlsl
index 4b312a9..27dff52 100644
--- a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCube<float4> arg_0 : register(t0, space1);
void textureNumLevels_897aaf() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLevels_897aaf();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.spvasm
index f8da41f..7f4e14e 100644
--- a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLevels_897aaf "textureNumLevels_897aaf"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,33 +32,45 @@
%7 = OpTypeImage %float Cube 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLevels_897aaf = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %12 = OpImageQueryLevels %int %14
- OpStore %res %12
+%textureNumLevels_897aaf = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQueryLevels %int %18
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureNumLevels_897aaf
+ %29 = OpFunctionCall %void %textureNumLevels_897aaf
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureNumLevels_897aaf
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_897aaf
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLevels_897aaf
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_897aaf
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.wgsl
index e3ebba5..e50b822 100644
--- a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_897aaf();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl
index d6a4013..7a732a6 100644
--- a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_9da7a5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.hlsl
index 9572320..357c8f1 100644
--- a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<int4> arg_0 : register(t0, space1);
void textureNumLevels_9da7a5() {
@@ -6,9 +10,10 @@
int res = tint_tmp.w;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLevels_9da7a5();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.spvasm
index cf77846..705b961 100644
--- a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLevels_9da7a5 "textureNumLevels_9da7a5"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,32 +33,44 @@
%7 = OpTypeImage %int 3D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLevels_9da7a5 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %13 = OpImageQueryLevels %int %14
- OpStore %res %13
+%textureNumLevels_9da7a5 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %17 = OpImageQueryLevels %int %18
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureNumLevels_9da7a5
+ %29 = OpFunctionCall %void %textureNumLevels_9da7a5
+ %30 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureNumLevels_9da7a5
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_9da7a5
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLevels_9da7a5
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_9da7a5
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.wgsl
index 77ca44a..553de75 100644
--- a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_9da7a5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl
index 0647fbc..84619bc 100644
--- a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_a91c03();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.hlsl
index 150bdad..040d13f 100644
--- a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCubeArray<int4> arg_0 : register(t0, space1);
void textureNumLevels_a91c03() {
@@ -6,9 +10,10 @@
int res = tint_tmp.w;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLevels_a91c03();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.spvasm
index ad51d5b..8fef955 100644
--- a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.spvasm
@@ -1,27 +1,31 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability SampledCubeArray
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLevels_a91c03 "textureNumLevels_a91c03"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,32 +34,44 @@
%7 = OpTypeImage %int Cube 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLevels_a91c03 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %13 = OpImageQueryLevels %int %14
- OpStore %res %13
+%textureNumLevels_a91c03 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %17 = OpImageQueryLevels %int %18
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureNumLevels_a91c03
+ %29 = OpFunctionCall %void %textureNumLevels_a91c03
+ %30 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureNumLevels_a91c03
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_a91c03
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLevels_a91c03
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_a91c03
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.wgsl
index 3df9c9a..6210fcf 100644
--- a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_a91c03();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl
index f7692cf..0ef4321 100644
--- a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_aee7c8();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.hlsl
index 72487b6..d57d775 100644
--- a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCubeArray<float4> arg_0 : register(t0, space1);
void textureNumLevels_aee7c8() {
@@ -6,9 +10,10 @@
int res = tint_tmp.w;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLevels_aee7c8();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.spvasm
index 69d6d18..690441a 100644
--- a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.spvasm
@@ -1,27 +1,31 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability SampledCubeArray
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLevels_aee7c8 "textureNumLevels_aee7c8"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,33 +33,45 @@
%7 = OpTypeImage %float Cube 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLevels_aee7c8 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %12 = OpImageQueryLevels %int %14
- OpStore %res %12
+%textureNumLevels_aee7c8 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQueryLevels %int %18
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureNumLevels_aee7c8
+ %29 = OpFunctionCall %void %textureNumLevels_aee7c8
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureNumLevels_aee7c8
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_aee7c8
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLevels_aee7c8
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_aee7c8
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.wgsl
index c962a08..d72d4f9 100644
--- a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_aee7c8();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl
index 6973944..429de95 100644
--- a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_b1b12b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.hlsl
index 6ef32a8..20efec7 100644
--- a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D arg_0 : register(t0, space1);
void textureNumLevels_b1b12b() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLevels_b1b12b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.spvasm
index 38e8686..7263834 100644
--- a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLevels_b1b12b "textureNumLevels_b1b12b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,33 +32,45 @@
%7 = OpTypeImage %float 2D 1 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLevels_b1b12b = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %12 = OpImageQueryLevels %int %14
- OpStore %res %12
+%textureNumLevels_b1b12b = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQueryLevels %int %18
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureNumLevels_b1b12b
+ %29 = OpFunctionCall %void %textureNumLevels_b1b12b
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureNumLevels_b1b12b
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_b1b12b
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLevels_b1b12b
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_b1b12b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.wgsl
index 049e8fe..feabd39 100644
--- a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_b1b12b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl
index 8a828c7..89b7bc2 100644
--- a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_b4f5ea();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.hlsl
index 508d470..68f7697 100644
--- a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<uint4> arg_0 : register(t0, space1);
void textureNumLevels_b4f5ea() {
@@ -6,9 +10,10 @@
int res = tint_tmp.w;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLevels_b4f5ea();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.spvasm
index 7f154b6..23c469e 100644
--- a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLevels_b4f5ea "textureNumLevels_b4f5ea"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,33 +33,45 @@
%7 = OpTypeImage %uint 3D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %18 = OpConstantNull %int
+ %22 = OpConstantNull %int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLevels_b4f5ea = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQueryLevels %int %15
- OpStore %res %13
+%textureNumLevels_b4f5ea = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQueryLevels %int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureNumLevels_b4f5ea
+ %30 = OpFunctionCall %void %textureNumLevels_b4f5ea
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_b4f5ea
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLevels_b4f5ea
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLevels_b4f5ea
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLevels_b4f5ea
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.wgsl
index 7039b94..dab2815 100644
--- a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_b4f5ea();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl
index 03e60ce..7a3fdfd 100644
--- a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_d004a9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.hlsl
index 50f4727..4266415 100644
--- a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<int4> arg_0 : register(t0, space1);
void textureNumLevels_d004a9() {
@@ -6,9 +10,10 @@
int res = tint_tmp.w;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLevels_d004a9();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.spvasm
index 2c1f0f8..18fa3a1 100644
--- a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLevels_d004a9 "textureNumLevels_d004a9"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,32 +33,44 @@
%7 = OpTypeImage %int 2D 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLevels_d004a9 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %13 = OpImageQueryLevels %int %14
- OpStore %res %13
+%textureNumLevels_d004a9 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %17 = OpImageQueryLevels %int %18
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureNumLevels_d004a9
+ %29 = OpFunctionCall %void %textureNumLevels_d004a9
+ %30 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureNumLevels_d004a9
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_d004a9
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLevels_d004a9
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_d004a9
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.wgsl
index 7252959..b782e1e 100644
--- a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_d004a9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl
index 887a74d..76f4446 100644
--- a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_dca09e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.hlsl
index c99f1f5..a06ee63 100644
--- a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<float4> arg_0 : register(t0, space1);
void textureNumLevels_dca09e() {
@@ -6,9 +10,10 @@
int res = tint_tmp.w;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLevels_dca09e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.spvasm
index 1df5c53..025d472 100644
--- a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLevels_dca09e "textureNumLevels_dca09e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,33 +32,45 @@
%7 = OpTypeImage %float 3D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLevels_dca09e = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %12 = OpImageQueryLevels %int %14
- OpStore %res %12
+%textureNumLevels_dca09e = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQueryLevels %int %18
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureNumLevels_dca09e
+ %29 = OpFunctionCall %void %textureNumLevels_dca09e
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureNumLevels_dca09e
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_dca09e
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLevels_dca09e
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_dca09e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.wgsl
index d4e4a04..89ab726 100644
--- a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_dca09e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/e67231.wgsl b/test/intrinsics/gen/textureNumLevels/e67231.wgsl
index f8aca61..bda7ba2 100644
--- a/test/intrinsics/gen/textureNumLevels/e67231.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/e67231.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_e67231();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.hlsl
index 9650c58..e0c8b84 100644
--- a/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<float4> arg_0 : register(t0, space1);
void textureNumLevels_e67231() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLevels_e67231();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.spvasm
index cd2fa74..b2e72df 100644
--- a/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLevels_e67231 "textureNumLevels_e67231"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,33 +32,45 @@
%7 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLevels_e67231 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %12 = OpImageQueryLevels %int %14
- OpStore %res %12
+%textureNumLevels_e67231 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQueryLevels %int %18
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureNumLevels_e67231
+ %29 = OpFunctionCall %void %textureNumLevels_e67231
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureNumLevels_e67231
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_e67231
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLevels_e67231
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_e67231
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.wgsl
index ec3dbc1..bd49a99 100644
--- a/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_e67231();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl
index c4d7935..6936e5c 100644
--- a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_ed078b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.hlsl
index 96fdcf8..72fdf4c 100644
--- a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCube<uint4> arg_0 : register(t0, space1);
void textureNumLevels_ed078b() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLevels_ed078b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.spvasm
index 54f3ef5..7713a7e 100644
--- a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLevels_ed078b "textureNumLevels_ed078b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,33 +33,45 @@
%7 = OpTypeImage %uint Cube 0 0 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %18 = OpConstantNull %int
+ %22 = OpConstantNull %int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLevels_ed078b = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQueryLevels %int %15
- OpStore %res %13
+%textureNumLevels_ed078b = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQueryLevels %int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureNumLevels_ed078b
+ %30 = OpFunctionCall %void %textureNumLevels_ed078b
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_ed078b
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLevels_ed078b
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLevels_ed078b
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLevels_ed078b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.wgsl
index cd4237d..949c1e5 100644
--- a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_ed078b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl
index 7f05b5c..9f2c8cd 100644
--- a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_f46ec6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.hlsl
index a40d646..cb9af05 100644
--- a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCubeArray<uint4> arg_0 : register(t0, space1);
void textureNumLevels_f46ec6() {
@@ -6,9 +10,10 @@
int res = tint_tmp.w;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLevels_f46ec6();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.spvasm
index 0a842b6..6c31bf7 100644
--- a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.spvasm
@@ -1,27 +1,31 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability SampledCubeArray
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLevels_f46ec6 "textureNumLevels_f46ec6"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,33 +34,45 @@
%7 = OpTypeImage %uint Cube 0 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %18 = OpConstantNull %int
+ %22 = OpConstantNull %int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLevels_f46ec6 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQueryLevels %int %15
- OpStore %res %13
+%textureNumLevels_f46ec6 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQueryLevels %int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureNumLevels_f46ec6
+ %30 = OpFunctionCall %void %textureNumLevels_f46ec6
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_f46ec6
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLevels_f46ec6
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLevels_f46ec6
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLevels_f46ec6
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.wgsl
index fa0b57a..4a52159 100644
--- a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_f46ec6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl
index 364f974..865c922 100644
--- a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_f5828d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.hlsl
index 370e9e9..bd9da4c 100644
--- a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray arg_0 : register(t0, space1);
void textureNumLevels_f5828d() {
@@ -6,9 +10,10 @@
int res = tint_tmp.w;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumLevels_f5828d();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.spvasm
index 7691bf9..5013da4 100644
--- a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumLevels_f5828d "textureNumLevels_f5828d"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,33 +32,45 @@
%7 = OpTypeImage %float 2D 1 1 0 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumLevels_f5828d = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %12 = OpImageQueryLevels %int %14
- OpStore %res %12
+%textureNumLevels_f5828d = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQueryLevels %int %18
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureNumLevels_f5828d
+ %29 = OpFunctionCall %void %textureNumLevels_f5828d
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureNumLevels_f5828d
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_f5828d
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLevels_f5828d
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_f5828d
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.wgsl
index 5602040..cb1948c 100644
--- a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumLevels_f5828d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl
index 1f161e5..561b73e 100644
--- a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl
+++ b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumSamples_2c6f14();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.hlsl
index a304fa0..5349dfa 100644
--- a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DMS<float4> arg_0 : register(t0, space1);
void textureNumSamples_2c6f14() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumSamples_2c6f14();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.spvasm
index 3babdf6..9536280 100644
--- a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumSamples_2c6f14 "textureNumSamples_2c6f14"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,33 +32,45 @@
%7 = OpTypeImage %float 2D 0 0 1 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumSamples_2c6f14 = OpFunction %void None %8
- %11 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %12 = OpImageQuerySamples %int %14
- OpStore %res %12
+%textureNumSamples_2c6f14 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %16 = OpImageQuerySamples %int %18
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureNumSamples_2c6f14
+ %29 = OpFunctionCall %void %textureNumSamples_2c6f14
+ %30 = OpFunctionCall %void %tint_symbol_2 %11
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %8
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureNumSamples_2c6f14
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumSamples_2c6f14
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumSamples_2c6f14
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumSamples_2c6f14
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.wgsl
index f1f538b..9b3b2c4 100644
--- a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumSamples_2c6f14();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl
index b29f0bd..ead1c72 100644
--- a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl
+++ b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumSamples_42f8bb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.hlsl
index 99a0973..1243e4d 100644
--- a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DMS<uint4> arg_0 : register(t0, space1);
void textureNumSamples_42f8bb() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumSamples_42f8bb();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.spvasm
index 646c0b0..5ebd9f3 100644
--- a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumSamples_42f8bb "textureNumSamples_42f8bb"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,33 +33,45 @@
%7 = OpTypeImage %uint 2D 0 0 1 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%_ptr_Function_int = OpTypePointer Function %int
- %18 = OpConstantNull %int
+ %22 = OpConstantNull %int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumSamples_42f8bb = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %18
- %15 = OpLoad %7 %arg_0
- %13 = OpImageQuerySamples %int %15
- OpStore %res %13
+%textureNumSamples_42f8bb = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %22
+ %19 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySamples %int %19
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureNumSamples_42f8bb
+ %30 = OpFunctionCall %void %textureNumSamples_42f8bb
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumSamples_42f8bb
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumSamples_42f8bb
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumSamples_42f8bb
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumSamples_42f8bb
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.wgsl
index bf84412..f1b303f 100644
--- a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumSamples_42f8bb();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumSamples/449d23.wgsl b/test/intrinsics/gen/textureNumSamples/449d23.wgsl
index b92b2e4..4865a1c 100644
--- a/test/intrinsics/gen/textureNumSamples/449d23.wgsl
+++ b/test/intrinsics/gen/textureNumSamples/449d23.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumSamples_449d23();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.hlsl
index 7709661..040f168 100644
--- a/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DMS<int4> arg_0 : register(t0, space1);
void textureNumSamples_449d23() {
@@ -6,9 +10,10 @@
int res = tint_tmp.z;
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureNumSamples_449d23();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.spvasm
index 60f158a..66f448c 100644
--- a/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.spvasm
@@ -1,26 +1,30 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureNumSamples_449d23 "textureNumSamples_449d23"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,32 +33,44 @@
%7 = OpTypeImage %int 2D 0 0 1 1 Unknown
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%_ptr_Function_int = OpTypePointer Function %int
- %17 = OpConstantNull %int
+ %21 = OpConstantNull %int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureNumSamples_449d23 = OpFunction %void None %9
- %12 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %17
- %14 = OpLoad %7 %arg_0
- %13 = OpImageQuerySamples %int %14
- OpStore %res %13
+%textureNumSamples_449d23 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_int Function %21
+ %18 = OpLoad %7 %arg_0
+ %17 = OpImageQuerySamples %int %18
+ OpStore %res %17
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureNumSamples_449d23
+ %29 = OpFunctionCall %void %textureNumSamples_449d23
+ %30 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureNumSamples_449d23
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumSamples_449d23
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumSamples_449d23
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumSamples_449d23
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.wgsl
index 7c15b3e..e2c0811 100644
--- a/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureNumSamples_449d23();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl
index 9ed9bae..6c3da5f 100644
--- a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl
+++ b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl
@@ -29,8 +29,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleGrad_21402b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.hlsl
index 5ad324f..5387f2e 100644
--- a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<float4> arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
@@ -5,9 +9,10 @@
float4 res = arg_0.SampleGrad(arg_1, float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureSampleGrad_21402b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.spvasm
index 0241ae0..757d428 100644
--- a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -13,8 +13,11 @@
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureSampleGrad_21402b "textureSampleGrad_21402b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -33,38 +37,48 @@
%10 = OpTypeSampler
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
%arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
- %void = OpTypeVoid
- %11 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %19 = OpTypeSampledImage %7
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %14 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %22 = OpTypeSampledImage %7
%v3float = OpTypeVector %float 3
- %22 = OpConstantNull %v3float
+ %25 = OpConstantNull %v3float
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %25 = OpConstantNull %v4float
+ %28 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureSampleGrad_21402b = OpFunction %void None %11
- %14 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %25
- %17 = OpLoad %10 %arg_1
- %18 = OpLoad %7 %arg_0
- %20 = OpSampledImage %19 %18 %17
- %15 = OpImageSampleExplicitLod %v4float %20 %22 Grad %22 %22
- OpStore %res %15
+%textureSampleGrad_21402b = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %14
+ %20 = OpLoad %10 %arg_1
+ %21 = OpLoad %7 %arg_0
+ %23 = OpSampledImage %22 %21 %20
+ %19 = OpImageSampleExplicitLod %v4float %23 %25 Grad %25 %25
+ OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %11
- %27 = OpLabel
- OpStore %tint_pointsize %float_1
- %29 = OpFunctionCall %void %textureSampleGrad_21402b
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %11
+%tint_symbol_2 = OpFunction %void None %28
+%tint_symbol = OpFunctionParameter %v4float
%31 = OpLabel
- %32 = OpFunctionCall %void %textureSampleGrad_21402b
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %11
- %34 = OpLabel
+%vertex_main = OpFunction %void None %15
+ %33 = OpLabel
+ OpStore %tint_pointsize %float_1
%35 = OpFunctionCall %void %textureSampleGrad_21402b
+ %36 = OpFunctionCall %void %tint_symbol_2 %14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureSampleGrad_21402b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureSampleGrad_21402b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.wgsl
index 59d954e..d7f061f 100644
--- a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.wgsl
@@ -7,8 +7,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleGrad_21402b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl
index 009ad75..9429060 100644
--- a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl
+++ b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl
@@ -29,8 +29,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleGrad_2ecd8f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.hlsl
index 2c7cb0f..eac63da 100644
--- a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
@@ -5,9 +9,10 @@
float4 res = arg_0.SampleGrad(arg_1, float3(0.0f, 0.0f, float(1)), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureSampleGrad_2ecd8f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.spvasm
index b0f83d4..da65931 100644
--- a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -13,8 +13,11 @@
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureSampleGrad_2ecd8f "textureSampleGrad_2ecd8f"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -33,44 +37,54 @@
%10 = OpTypeSampler
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
%arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
- %void = OpTypeVoid
- %11 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %19 = OpTypeSampledImage %7
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %14 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %22 = OpTypeSampledImage %7
%v3float = OpTypeVector %float 3
%float_0 = OpConstant %float 0
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v2float = OpTypeVector %float 2
- %28 = OpConstantNull %v2float
+ %31 = OpConstantNull %v2float
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %31 = OpConstantNull %v4float
+ %34 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureSampleGrad_2ecd8f = OpFunction %void None %11
- %14 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %31
- %17 = OpLoad %10 %arg_1
- %18 = OpLoad %7 %arg_0
- %20 = OpSampledImage %19 %18 %17
- %23 = OpConvertSToF %float %int_1
- %26 = OpCompositeConstruct %v3float %float_0 %float_0 %23
- %15 = OpImageSampleExplicitLod %v4float %20 %26 Grad %28 %28
- OpStore %res %15
+%textureSampleGrad_2ecd8f = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %14
+ %20 = OpLoad %10 %arg_1
+ %21 = OpLoad %7 %arg_0
+ %23 = OpSampledImage %22 %21 %20
+ %26 = OpConvertSToF %float %int_1
+ %29 = OpCompositeConstruct %v3float %float_0 %float_0 %26
+ %19 = OpImageSampleExplicitLod %v4float %23 %29 Grad %31 %31
+ OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %11
- %33 = OpLabel
- OpStore %tint_pointsize %float_1
- %35 = OpFunctionCall %void %textureSampleGrad_2ecd8f
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %11
+%tint_symbol_2 = OpFunction %void None %34
+%tint_symbol = OpFunctionParameter %v4float
%37 = OpLabel
- %38 = OpFunctionCall %void %textureSampleGrad_2ecd8f
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %11
- %40 = OpLabel
+%vertex_main = OpFunction %void None %15
+ %39 = OpLabel
+ OpStore %tint_pointsize %float_1
%41 = OpFunctionCall %void %textureSampleGrad_2ecd8f
+ %42 = OpFunctionCall %void %tint_symbol_2 %14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureSampleGrad_2ecd8f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureSampleGrad_2ecd8f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.wgsl
index eba29dfa..c44c109 100644
--- a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.wgsl
@@ -7,8 +7,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleGrad_2ecd8f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl
index 2c535b9..1b486d1 100644
--- a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl
+++ b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl
@@ -29,8 +29,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleGrad_468f88();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.hlsl
index 912a6da..f61c326 100644
--- a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<float4> arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
@@ -5,9 +9,10 @@
float4 res = arg_0.SampleGrad(arg_1, float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f), int2(0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureSampleGrad_468f88();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.spvasm
index c112502..9d30fbc 100644
--- a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -13,8 +13,11 @@
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureSampleGrad_468f88 "textureSampleGrad_468f88"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -33,41 +37,51 @@
%10 = OpTypeSampler
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
%arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
- %void = OpTypeVoid
- %11 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %19 = OpTypeSampledImage %7
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %14 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %22 = OpTypeSampledImage %7
%v2float = OpTypeVector %float 2
- %22 = OpConstantNull %v2float
+ %25 = OpConstantNull %v2float
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %25 = OpConstantNull %v2int
+ %28 = OpConstantNull %v2int
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %28 = OpConstantNull %v4float
+ %31 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureSampleGrad_468f88 = OpFunction %void None %11
- %14 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %28
- %17 = OpLoad %10 %arg_1
- %18 = OpLoad %7 %arg_0
- %20 = OpSampledImage %19 %18 %17
- %15 = OpImageSampleExplicitLod %v4float %20 %22 Grad|ConstOffset %22 %22 %25
- OpStore %res %15
+%textureSampleGrad_468f88 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %14
+ %20 = OpLoad %10 %arg_1
+ %21 = OpLoad %7 %arg_0
+ %23 = OpSampledImage %22 %21 %20
+ %19 = OpImageSampleExplicitLod %v4float %23 %25 Grad|ConstOffset %25 %25 %28
+ OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %11
- %30 = OpLabel
- OpStore %tint_pointsize %float_1
- %32 = OpFunctionCall %void %textureSampleGrad_468f88
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %11
+%tint_symbol_2 = OpFunction %void None %31
+%tint_symbol = OpFunctionParameter %v4float
%34 = OpLabel
- %35 = OpFunctionCall %void %textureSampleGrad_468f88
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %11
- %37 = OpLabel
+%vertex_main = OpFunction %void None %15
+ %36 = OpLabel
+ OpStore %tint_pointsize %float_1
%38 = OpFunctionCall %void %textureSampleGrad_468f88
+ %39 = OpFunctionCall %void %tint_symbol_2 %14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureSampleGrad_468f88
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureSampleGrad_468f88
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.wgsl
index 3d447de..e0a8eff 100644
--- a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.wgsl
@@ -7,8 +7,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleGrad_468f88();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleGrad/521263.wgsl b/test/intrinsics/gen/textureSampleGrad/521263.wgsl
index bd953b6..50c6737 100644
--- a/test/intrinsics/gen/textureSampleGrad/521263.wgsl
+++ b/test/intrinsics/gen/textureSampleGrad/521263.wgsl
@@ -29,8 +29,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleGrad_521263();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.hlsl
index e877437..ca916b1 100644
--- a/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<float4> arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
@@ -5,9 +9,10 @@
float4 res = arg_0.SampleGrad(arg_1, float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureSampleGrad_521263();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.spvasm
index daa1cf8..415b703 100644
--- a/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -13,8 +13,11 @@
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureSampleGrad_521263 "textureSampleGrad_521263"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -33,38 +37,48 @@
%10 = OpTypeSampler
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
%arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
- %void = OpTypeVoid
- %11 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %19 = OpTypeSampledImage %7
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %14 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %22 = OpTypeSampledImage %7
%v2float = OpTypeVector %float 2
- %22 = OpConstantNull %v2float
+ %25 = OpConstantNull %v2float
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %25 = OpConstantNull %v4float
+ %28 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureSampleGrad_521263 = OpFunction %void None %11
- %14 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %25
- %17 = OpLoad %10 %arg_1
- %18 = OpLoad %7 %arg_0
- %20 = OpSampledImage %19 %18 %17
- %15 = OpImageSampleExplicitLod %v4float %20 %22 Grad %22 %22
- OpStore %res %15
+%textureSampleGrad_521263 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %14
+ %20 = OpLoad %10 %arg_1
+ %21 = OpLoad %7 %arg_0
+ %23 = OpSampledImage %22 %21 %20
+ %19 = OpImageSampleExplicitLod %v4float %23 %25 Grad %25 %25
+ OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %11
- %27 = OpLabel
- OpStore %tint_pointsize %float_1
- %29 = OpFunctionCall %void %textureSampleGrad_521263
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %11
+%tint_symbol_2 = OpFunction %void None %28
+%tint_symbol = OpFunctionParameter %v4float
%31 = OpLabel
- %32 = OpFunctionCall %void %textureSampleGrad_521263
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %11
- %34 = OpLabel
+%vertex_main = OpFunction %void None %15
+ %33 = OpLabel
+ OpStore %tint_pointsize %float_1
%35 = OpFunctionCall %void %textureSampleGrad_521263
+ %36 = OpFunctionCall %void %tint_symbol_2 %14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureSampleGrad_521263
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureSampleGrad_521263
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.wgsl
index 283882b..7647aca 100644
--- a/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.wgsl
@@ -7,8 +7,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleGrad_521263();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl
index e8f8c81..ef0434c 100644
--- a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl
+++ b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl
@@ -29,8 +29,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleGrad_5312f4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.hlsl
index add7e25..e0eb958 100644
--- a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCube<float4> arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
@@ -5,9 +9,10 @@
float4 res = arg_0.SampleGrad(arg_1, float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureSampleGrad_5312f4();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.spvasm
index 018f69a..0cc1c9a 100644
--- a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -13,8 +13,11 @@
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureSampleGrad_5312f4 "textureSampleGrad_5312f4"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -33,38 +37,48 @@
%10 = OpTypeSampler
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
%arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
- %void = OpTypeVoid
- %11 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %19 = OpTypeSampledImage %7
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %14 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %22 = OpTypeSampledImage %7
%v3float = OpTypeVector %float 3
- %22 = OpConstantNull %v3float
+ %25 = OpConstantNull %v3float
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %25 = OpConstantNull %v4float
+ %28 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureSampleGrad_5312f4 = OpFunction %void None %11
- %14 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %25
- %17 = OpLoad %10 %arg_1
- %18 = OpLoad %7 %arg_0
- %20 = OpSampledImage %19 %18 %17
- %15 = OpImageSampleExplicitLod %v4float %20 %22 Grad %22 %22
- OpStore %res %15
+%textureSampleGrad_5312f4 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %14
+ %20 = OpLoad %10 %arg_1
+ %21 = OpLoad %7 %arg_0
+ %23 = OpSampledImage %22 %21 %20
+ %19 = OpImageSampleExplicitLod %v4float %23 %25 Grad %25 %25
+ OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %11
- %27 = OpLabel
- OpStore %tint_pointsize %float_1
- %29 = OpFunctionCall %void %textureSampleGrad_5312f4
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %11
+%tint_symbol_2 = OpFunction %void None %28
+%tint_symbol = OpFunctionParameter %v4float
%31 = OpLabel
- %32 = OpFunctionCall %void %textureSampleGrad_5312f4
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %11
- %34 = OpLabel
+%vertex_main = OpFunction %void None %15
+ %33 = OpLabel
+ OpStore %tint_pointsize %float_1
%35 = OpFunctionCall %void %textureSampleGrad_5312f4
+ %36 = OpFunctionCall %void %tint_symbol_2 %14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureSampleGrad_5312f4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureSampleGrad_5312f4
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.wgsl
index fe32c14..3e3a8fa 100644
--- a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.wgsl
@@ -7,8 +7,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleGrad_5312f4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl
index 3c64dda..6f3e3b3 100644
--- a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl
+++ b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl
@@ -29,8 +29,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleGrad_872f00();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.hlsl
index cbe1a90..7b4c65f 100644
--- a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
@@ -5,9 +9,10 @@
float4 res = arg_0.SampleGrad(arg_1, float3(0.0f, 0.0f, float(1)), float2(0.0f, 0.0f), float2(0.0f, 0.0f), int2(0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureSampleGrad_872f00();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.spvasm
index 3d88c6f..4cb56d1 100644
--- a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 44
+; Bound: 51
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -13,8 +13,11 @@
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureSampleGrad_872f00 "textureSampleGrad_872f00"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -33,46 +37,56 @@
%10 = OpTypeSampler
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
%arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
- %void = OpTypeVoid
- %11 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %19 = OpTypeSampledImage %7
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %14 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %22 = OpTypeSampledImage %7
%v3float = OpTypeVector %float 3
%float_0 = OpConstant %float 0
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v2float = OpTypeVector %float 2
- %28 = OpConstantNull %v2float
+ %31 = OpConstantNull %v2float
%v2int = OpTypeVector %int 2
- %30 = OpConstantNull %v2int
+ %33 = OpConstantNull %v2int
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %33 = OpConstantNull %v4float
+ %36 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureSampleGrad_872f00 = OpFunction %void None %11
- %14 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %33
- %17 = OpLoad %10 %arg_1
- %18 = OpLoad %7 %arg_0
- %20 = OpSampledImage %19 %18 %17
- %23 = OpConvertSToF %float %int_1
- %26 = OpCompositeConstruct %v3float %float_0 %float_0 %23
- %15 = OpImageSampleExplicitLod %v4float %20 %26 Grad|ConstOffset %28 %28 %30
- OpStore %res %15
+%textureSampleGrad_872f00 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %14
+ %20 = OpLoad %10 %arg_1
+ %21 = OpLoad %7 %arg_0
+ %23 = OpSampledImage %22 %21 %20
+ %26 = OpConvertSToF %float %int_1
+ %29 = OpCompositeConstruct %v3float %float_0 %float_0 %26
+ %19 = OpImageSampleExplicitLod %v4float %23 %29 Grad|ConstOffset %31 %31 %33
+ OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %11
- %35 = OpLabel
- OpStore %tint_pointsize %float_1
- %37 = OpFunctionCall %void %textureSampleGrad_872f00
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %11
+%tint_symbol_2 = OpFunction %void None %36
+%tint_symbol = OpFunctionParameter %v4float
%39 = OpLabel
- %40 = OpFunctionCall %void %textureSampleGrad_872f00
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %11
- %42 = OpLabel
+%vertex_main = OpFunction %void None %15
+ %41 = OpLabel
+ OpStore %tint_pointsize %float_1
%43 = OpFunctionCall %void %textureSampleGrad_872f00
+ %44 = OpFunctionCall %void %tint_symbol_2 %14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %46 = OpLabel
+ %47 = OpFunctionCall %void %textureSampleGrad_872f00
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %49 = OpLabel
+ %50 = OpFunctionCall %void %textureSampleGrad_872f00
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.wgsl
index 1519468..5d9c220 100644
--- a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.wgsl
@@ -7,8 +7,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleGrad_872f00();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl
index dd1843c..0688c3b 100644
--- a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl
+++ b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl
@@ -29,8 +29,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleGrad_e383db();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.hlsl
index c5e5cb1..4fd9ec2 100644
--- a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCubeArray<float4> arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
@@ -5,9 +9,10 @@
float4 res = arg_0.SampleGrad(arg_1, float4(0.0f, 0.0f, 0.0f, float(1)), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureSampleGrad_e383db();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.spvasm
index f53698c..6a84f1f 100644
--- a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.spvasm
@@ -1,12 +1,12 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 48
; Schema: 0
OpCapability Shader
OpCapability SampledCubeArray
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -14,8 +14,11 @@
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureSampleGrad_e383db "textureSampleGrad_e383db"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -24,6 +27,7 @@
OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -34,43 +38,53 @@
%10 = OpTypeSampler
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
%arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
- %void = OpTypeVoid
- %11 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %19 = OpTypeSampledImage %7
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %14 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %22 = OpTypeSampledImage %7
%float_0 = OpConstant %float 0
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v3float = OpTypeVector %float 3
- %27 = OpConstantNull %v3float
+ %30 = OpConstantNull %v3float
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %30 = OpConstantNull %v4float
+ %33 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureSampleGrad_e383db = OpFunction %void None %11
- %14 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %30
- %17 = OpLoad %10 %arg_1
- %18 = OpLoad %7 %arg_0
- %20 = OpSampledImage %19 %18 %17
- %22 = OpConvertSToF %float %int_1
- %25 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %22
- %15 = OpImageSampleExplicitLod %v4float %20 %25 Grad %27 %27
- OpStore %res %15
+%textureSampleGrad_e383db = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %14
+ %20 = OpLoad %10 %arg_1
+ %21 = OpLoad %7 %arg_0
+ %23 = OpSampledImage %22 %21 %20
+ %25 = OpConvertSToF %float %int_1
+ %28 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %25
+ %19 = OpImageSampleExplicitLod %v4float %23 %28 Grad %30 %30
+ OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %11
- %32 = OpLabel
- OpStore %tint_pointsize %float_1
- %34 = OpFunctionCall %void %textureSampleGrad_e383db
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %11
+%tint_symbol_2 = OpFunction %void None %33
+%tint_symbol = OpFunctionParameter %v4float
%36 = OpLabel
- %37 = OpFunctionCall %void %textureSampleGrad_e383db
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %11
- %39 = OpLabel
+%vertex_main = OpFunction %void None %15
+ %38 = OpLabel
+ OpStore %tint_pointsize %float_1
%40 = OpFunctionCall %void %textureSampleGrad_e383db
+ %41 = OpFunctionCall %void %tint_symbol_2 %14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureSampleGrad_e383db
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %46 = OpLabel
+ %47 = OpFunctionCall %void %textureSampleGrad_e383db
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.wgsl
index a528a16..24058e1 100644
--- a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.wgsl
@@ -7,8 +7,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleGrad_e383db();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl
index 0570dd9..fdaa7c1 100644
--- a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl
+++ b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl
@@ -29,8 +29,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleGrad_e9a2f7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.hlsl
index aeb9445..f06b186 100644
--- a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<float4> arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
@@ -5,9 +9,10 @@
float4 res = arg_0.SampleGrad(arg_1, float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), int3(0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureSampleGrad_e9a2f7();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.spvasm
index e523af4..b13faa0 100644
--- a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -13,8 +13,11 @@
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureSampleGrad_e9a2f7 "textureSampleGrad_e9a2f7"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -33,41 +37,51 @@
%10 = OpTypeSampler
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
%arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
- %void = OpTypeVoid
- %11 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %19 = OpTypeSampledImage %7
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %14 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %22 = OpTypeSampledImage %7
%v3float = OpTypeVector %float 3
- %22 = OpConstantNull %v3float
+ %25 = OpConstantNull %v3float
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %25 = OpConstantNull %v3int
+ %28 = OpConstantNull %v3int
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %28 = OpConstantNull %v4float
+ %31 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureSampleGrad_e9a2f7 = OpFunction %void None %11
- %14 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %28
- %17 = OpLoad %10 %arg_1
- %18 = OpLoad %7 %arg_0
- %20 = OpSampledImage %19 %18 %17
- %15 = OpImageSampleExplicitLod %v4float %20 %22 Grad|ConstOffset %22 %22 %25
- OpStore %res %15
+%textureSampleGrad_e9a2f7 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %14
+ %20 = OpLoad %10 %arg_1
+ %21 = OpLoad %7 %arg_0
+ %23 = OpSampledImage %22 %21 %20
+ %19 = OpImageSampleExplicitLod %v4float %23 %25 Grad|ConstOffset %25 %25 %28
+ OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %11
- %30 = OpLabel
- OpStore %tint_pointsize %float_1
- %32 = OpFunctionCall %void %textureSampleGrad_e9a2f7
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %11
+%tint_symbol_2 = OpFunction %void None %31
+%tint_symbol = OpFunctionParameter %v4float
%34 = OpLabel
- %35 = OpFunctionCall %void %textureSampleGrad_e9a2f7
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %11
- %37 = OpLabel
+%vertex_main = OpFunction %void None %15
+ %36 = OpLabel
+ OpStore %tint_pointsize %float_1
%38 = OpFunctionCall %void %textureSampleGrad_e9a2f7
+ %39 = OpFunctionCall %void %tint_symbol_2 %14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureSampleGrad_e9a2f7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureSampleGrad_e9a2f7
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.wgsl
index e92d43a..0448afb 100644
--- a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.wgsl
@@ -7,8 +7,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleGrad_e9a2f7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl
index b557f04..97d0aad 100644
--- a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl
@@ -29,8 +29,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_02be59();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.hlsl
index e67e8af..35661af 100644
--- a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
@@ -5,9 +9,10 @@
float res = arg_0.SampleLevel(arg_1, float2(0.0f, 0.0f), 1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureSampleLevel_02be59();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.spvasm
index de6563c..9887bb9 100644
--- a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 47
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -13,8 +13,11 @@
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureSampleLevel_02be59 "textureSampleLevel_02be59"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -33,41 +37,52 @@
%10 = OpTypeSampler
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
%arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
- %void = OpTypeVoid
- %11 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %20 = OpTypeSampledImage %7
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %14 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %23 = OpTypeSampledImage %7
%v2float = OpTypeVector %float 2
- %23 = OpConstantNull %v2float
+ %26 = OpConstantNull %v2float
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_Function_float = OpTypePointer Function %float
+ %32 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureSampleLevel_02be59 = OpFunction %void None %11
- %14 = OpLabel
+%textureSampleLevel_02be59 = OpFunction %void None %15
+ %18 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %18 = OpLoad %10 %arg_1
- %19 = OpLoad %7 %arg_0
- %21 = OpSampledImage %20 %19 %18
- %24 = OpConvertSToF %float %int_1
- %16 = OpImageSampleExplicitLod %v4float %21 %23 Lod %24
- %15 = OpCompositeExtract %float %16 0
- OpStore %res %15
+ %21 = OpLoad %10 %arg_1
+ %22 = OpLoad %7 %arg_0
+ %24 = OpSampledImage %23 %22 %21
+ %27 = OpConvertSToF %float %int_1
+ %20 = OpImageSampleExplicitLod %v4float %24 %26 Lod %27
+ %19 = OpCompositeExtract %float %20 0
+ OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %11
- %30 = OpLabel
- OpStore %tint_pointsize %float_1
- %32 = OpFunctionCall %void %textureSampleLevel_02be59
+%tint_symbol_2 = OpFunction %void None %32
+%tint_symbol = OpFunctionParameter %v4float
+ %35 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %11
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureSampleLevel_02be59
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %11
+%vertex_main = OpFunction %void None %15
%37 = OpLabel
- %38 = OpFunctionCall %void %textureSampleLevel_02be59
+ OpStore %tint_pointsize %float_1
+ %39 = OpFunctionCall %void %textureSampleLevel_02be59
+ %40 = OpFunctionCall %void %tint_symbol_2 %14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureSampleLevel_02be59
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %45 = OpLabel
+ %46 = OpFunctionCall %void %textureSampleLevel_02be59
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.wgsl
index c2f0d11..467c56b 100644
--- a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.wgsl
@@ -7,8 +7,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_02be59();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl
index d7dd70b..00bdfbf 100644
--- a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl
@@ -29,8 +29,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_0bdd9a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.hlsl
index 7267bff..d0c44fc 100644
--- a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCubeArray<float4> arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
@@ -5,9 +9,10 @@
float4 res = arg_0.SampleLevel(arg_1, float4(0.0f, 0.0f, 0.0f, float(1)), 1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureSampleLevel_0bdd9a();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.spvasm
index ea7ebbf..5d4ebad 100644
--- a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.spvasm
@@ -1,12 +1,12 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
; Schema: 0
OpCapability Shader
OpCapability SampledCubeArray
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -14,8 +14,11 @@
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureSampleLevel_0bdd9a "textureSampleLevel_0bdd9a"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -24,6 +27,7 @@
OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -34,41 +38,51 @@
%10 = OpTypeSampler
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
%arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
- %void = OpTypeVoid
- %11 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %19 = OpTypeSampledImage %7
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %14 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %22 = OpTypeSampledImage %7
%float_0 = OpConstant %float 0
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%float_1 = OpConstant %float 1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %29 = OpConstantNull %v4float
-%textureSampleLevel_0bdd9a = OpFunction %void None %11
- %14 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %29
- %17 = OpLoad %10 %arg_1
- %18 = OpLoad %7 %arg_0
- %20 = OpSampledImage %19 %18 %17
- %22 = OpConvertSToF %float %int_1
- %25 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %22
- %15 = OpImageSampleExplicitLod %v4float %20 %25 Lod %float_1
- OpStore %res %15
+ %32 = OpTypeFunction %void %v4float
+%textureSampleLevel_0bdd9a = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %14
+ %20 = OpLoad %10 %arg_1
+ %21 = OpLoad %7 %arg_0
+ %23 = OpSampledImage %22 %21 %20
+ %25 = OpConvertSToF %float %int_1
+ %28 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %25
+ %19 = OpImageSampleExplicitLod %v4float %23 %28 Lod %float_1
+ OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %11
- %31 = OpLabel
- OpStore %tint_pointsize %float_1
- %32 = OpFunctionCall %void %textureSampleLevel_0bdd9a
+%tint_symbol_2 = OpFunction %void None %32
+%tint_symbol = OpFunctionParameter %v4float
+ %35 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %11
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureSampleLevel_0bdd9a
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %11
+%vertex_main = OpFunction %void None %15
%37 = OpLabel
+ OpStore %tint_pointsize %float_1
%38 = OpFunctionCall %void %textureSampleLevel_0bdd9a
+ %39 = OpFunctionCall %void %tint_symbol_2 %14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureSampleLevel_0bdd9a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureSampleLevel_0bdd9a
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.wgsl
index 1e77805..1b313b9 100644
--- a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.wgsl
@@ -7,8 +7,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_0bdd9a();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl
index e983a8c..df7ab39 100644
--- a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl
@@ -29,8 +29,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_1b0291();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.hlsl
index dd4acbf..b2aacb4 100644
--- a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCube arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
@@ -5,9 +9,10 @@
float res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, 0.0f), 1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureSampleLevel_1b0291();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.spvasm
index a0202c2..f93c2a5 100644
--- a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 47
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -13,8 +13,11 @@
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureSampleLevel_1b0291 "textureSampleLevel_1b0291"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -33,41 +37,52 @@
%10 = OpTypeSampler
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
%arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
- %void = OpTypeVoid
- %11 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %20 = OpTypeSampledImage %7
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %14 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %23 = OpTypeSampledImage %7
%v3float = OpTypeVector %float 3
- %23 = OpConstantNull %v3float
+ %26 = OpConstantNull %v3float
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_Function_float = OpTypePointer Function %float
+ %32 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureSampleLevel_1b0291 = OpFunction %void None %11
- %14 = OpLabel
+%textureSampleLevel_1b0291 = OpFunction %void None %15
+ %18 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %18 = OpLoad %10 %arg_1
- %19 = OpLoad %7 %arg_0
- %21 = OpSampledImage %20 %19 %18
- %24 = OpConvertSToF %float %int_1
- %16 = OpImageSampleExplicitLod %v4float %21 %23 Lod %24
- %15 = OpCompositeExtract %float %16 0
- OpStore %res %15
+ %21 = OpLoad %10 %arg_1
+ %22 = OpLoad %7 %arg_0
+ %24 = OpSampledImage %23 %22 %21
+ %27 = OpConvertSToF %float %int_1
+ %20 = OpImageSampleExplicitLod %v4float %24 %26 Lod %27
+ %19 = OpCompositeExtract %float %20 0
+ OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %11
- %30 = OpLabel
- OpStore %tint_pointsize %float_1
- %32 = OpFunctionCall %void %textureSampleLevel_1b0291
+%tint_symbol_2 = OpFunction %void None %32
+%tint_symbol = OpFunctionParameter %v4float
+ %35 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %11
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureSampleLevel_1b0291
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %11
+%vertex_main = OpFunction %void None %15
%37 = OpLabel
- %38 = OpFunctionCall %void %textureSampleLevel_1b0291
+ OpStore %tint_pointsize %float_1
+ %39 = OpFunctionCall %void %textureSampleLevel_1b0291
+ %40 = OpFunctionCall %void %tint_symbol_2 %14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureSampleLevel_1b0291
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %45 = OpLabel
+ %46 = OpFunctionCall %void %textureSampleLevel_1b0291
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.wgsl
index e24aebb..50a6b8a 100644
--- a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.wgsl
@@ -7,8 +7,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_1b0291();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl
index cbb37ce..c1a02b5 100644
--- a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl
@@ -29,8 +29,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_1bf73e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.hlsl
index f1ef0f0..1e738d3 100644
--- a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
@@ -5,9 +9,10 @@
float res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, float(1)), 1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureSampleLevel_1bf73e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.spvasm
index 2f2429b..8462388 100644
--- a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 49
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -13,8 +13,11 @@
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureSampleLevel_1bf73e "textureSampleLevel_1bf73e"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -33,43 +37,54 @@
%10 = OpTypeSampler
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
%arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
- %void = OpTypeVoid
- %11 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %20 = OpTypeSampledImage %7
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %14 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %23 = OpTypeSampledImage %7
%v3float = OpTypeVector %float 3
%float_0 = OpConstant %float 0
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_Function_float = OpTypePointer Function %float
+ %34 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureSampleLevel_1bf73e = OpFunction %void None %11
- %14 = OpLabel
+%textureSampleLevel_1bf73e = OpFunction %void None %15
+ %18 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %18 = OpLoad %10 %arg_1
- %19 = OpLoad %7 %arg_0
- %21 = OpSampledImage %20 %19 %18
- %24 = OpConvertSToF %float %int_1
- %27 = OpCompositeConstruct %v3float %float_0 %float_0 %24
- %28 = OpConvertSToF %float %int_1
- %16 = OpImageSampleExplicitLod %v4float %21 %27 Lod %28
- %15 = OpCompositeExtract %float %16 0
- OpStore %res %15
+ %21 = OpLoad %10 %arg_1
+ %22 = OpLoad %7 %arg_0
+ %24 = OpSampledImage %23 %22 %21
+ %27 = OpConvertSToF %float %int_1
+ %30 = OpCompositeConstruct %v3float %float_0 %float_0 %27
+ %31 = OpConvertSToF %float %int_1
+ %20 = OpImageSampleExplicitLod %v4float %24 %30 Lod %31
+ %19 = OpCompositeExtract %float %20 0
+ OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %11
- %32 = OpLabel
- OpStore %tint_pointsize %float_1
- %34 = OpFunctionCall %void %textureSampleLevel_1bf73e
+%tint_symbol_2 = OpFunction %void None %34
+%tint_symbol = OpFunctionParameter %v4float
+ %37 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %11
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureSampleLevel_1bf73e
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %11
+%vertex_main = OpFunction %void None %15
%39 = OpLabel
- %40 = OpFunctionCall %void %textureSampleLevel_1bf73e
+ OpStore %tint_pointsize %float_1
+ %41 = OpFunctionCall %void %textureSampleLevel_1bf73e
+ %42 = OpFunctionCall %void %tint_symbol_2 %14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureSampleLevel_1bf73e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureSampleLevel_1bf73e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.wgsl
index c76783b..a0f783e 100644
--- a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.wgsl
@@ -7,8 +7,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_1bf73e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl
index 8c7e833..8fd17be 100644
--- a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl
@@ -29,8 +29,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_302be4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.hlsl
index 3476f09..4fb0a22 100644
--- a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
@@ -5,9 +9,10 @@
float4 res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, float(1)), 1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureSampleLevel_302be4();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.spvasm
index f6b4e48..febef40 100644
--- a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 47
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -13,8 +13,11 @@
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureSampleLevel_302be4 "textureSampleLevel_302be4"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -33,42 +37,52 @@
%10 = OpTypeSampler
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
%arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
- %void = OpTypeVoid
- %11 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %19 = OpTypeSampledImage %7
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %14 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %22 = OpTypeSampledImage %7
%v3float = OpTypeVector %float 3
%float_0 = OpConstant %float 0
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%float_1 = OpConstant %float 1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %30 = OpConstantNull %v4float
-%textureSampleLevel_302be4 = OpFunction %void None %11
- %14 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %30
- %17 = OpLoad %10 %arg_1
- %18 = OpLoad %7 %arg_0
- %20 = OpSampledImage %19 %18 %17
- %23 = OpConvertSToF %float %int_1
- %26 = OpCompositeConstruct %v3float %float_0 %float_0 %23
- %15 = OpImageSampleExplicitLod %v4float %20 %26 Lod %float_1
- OpStore %res %15
+ %33 = OpTypeFunction %void %v4float
+%textureSampleLevel_302be4 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %14
+ %20 = OpLoad %10 %arg_1
+ %21 = OpLoad %7 %arg_0
+ %23 = OpSampledImage %22 %21 %20
+ %26 = OpConvertSToF %float %int_1
+ %29 = OpCompositeConstruct %v3float %float_0 %float_0 %26
+ %19 = OpImageSampleExplicitLod %v4float %23 %29 Lod %float_1
+ OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %11
- %32 = OpLabel
- OpStore %tint_pointsize %float_1
- %33 = OpFunctionCall %void %textureSampleLevel_302be4
+%tint_symbol_2 = OpFunction %void None %33
+%tint_symbol = OpFunctionParameter %v4float
+ %36 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %11
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureSampleLevel_302be4
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %11
+%vertex_main = OpFunction %void None %15
%38 = OpLabel
+ OpStore %tint_pointsize %float_1
%39 = OpFunctionCall %void %textureSampleLevel_302be4
+ %40 = OpFunctionCall %void %tint_symbol_2 %14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureSampleLevel_302be4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %45 = OpLabel
+ %46 = OpFunctionCall %void %textureSampleLevel_302be4
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.wgsl
index e2c86f1..f631dca 100644
--- a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.wgsl
@@ -7,8 +7,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_302be4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl
index 20c5d2d..df7abe8 100644
--- a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl
@@ -29,8 +29,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_47daa4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.hlsl
index 1fa7f91..70e06bd 100644
--- a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
@@ -5,9 +9,10 @@
float res = arg_0.SampleLevel(arg_1, float2(0.0f, 0.0f), 1, int2(0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureSampleLevel_47daa4();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.spvasm
index 237ca8a..c42defb 100644
--- a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 41
+; Bound: 49
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -13,8 +13,11 @@
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureSampleLevel_47daa4 "textureSampleLevel_47daa4"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -33,43 +37,54 @@
%10 = OpTypeSampler
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
%arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
- %void = OpTypeVoid
- %11 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %20 = OpTypeSampledImage %7
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %14 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %23 = OpTypeSampledImage %7
%v2float = OpTypeVector %float 2
- %23 = OpConstantNull %v2float
+ %26 = OpConstantNull %v2float
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
- %28 = OpConstantNull %v2int
+ %31 = OpConstantNull %v2int
%_ptr_Function_float = OpTypePointer Function %float
+ %34 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureSampleLevel_47daa4 = OpFunction %void None %11
- %14 = OpLabel
+%textureSampleLevel_47daa4 = OpFunction %void None %15
+ %18 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %18 = OpLoad %10 %arg_1
- %19 = OpLoad %7 %arg_0
- %21 = OpSampledImage %20 %19 %18
- %24 = OpConvertSToF %float %int_1
- %16 = OpImageSampleExplicitLod %v4float %21 %23 Lod|ConstOffset %24 %28
- %15 = OpCompositeExtract %float %16 0
- OpStore %res %15
+ %21 = OpLoad %10 %arg_1
+ %22 = OpLoad %7 %arg_0
+ %24 = OpSampledImage %23 %22 %21
+ %27 = OpConvertSToF %float %int_1
+ %20 = OpImageSampleExplicitLod %v4float %24 %26 Lod|ConstOffset %27 %31
+ %19 = OpCompositeExtract %float %20 0
+ OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %11
- %32 = OpLabel
- OpStore %tint_pointsize %float_1
- %34 = OpFunctionCall %void %textureSampleLevel_47daa4
+%tint_symbol_2 = OpFunction %void None %34
+%tint_symbol = OpFunctionParameter %v4float
+ %37 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %11
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureSampleLevel_47daa4
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %11
+%vertex_main = OpFunction %void None %15
%39 = OpLabel
- %40 = OpFunctionCall %void %textureSampleLevel_47daa4
+ OpStore %tint_pointsize %float_1
+ %41 = OpFunctionCall %void %textureSampleLevel_47daa4
+ %42 = OpFunctionCall %void %tint_symbol_2 %14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureSampleLevel_47daa4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureSampleLevel_47daa4
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.wgsl
index 7c3690f..21b05c1 100644
--- a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.wgsl
@@ -7,8 +7,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_47daa4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl
index 17be2cb..58203cb 100644
--- a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl
@@ -29,8 +29,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_690d95();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.hlsl
index 104391c..2f5f8b17 100644
--- a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<float4> arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
@@ -5,9 +9,10 @@
float4 res = arg_0.SampleLevel(arg_1, float2(0.0f, 0.0f), 1.0f, int2(0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureSampleLevel_690d95();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.spvasm
index 459833d..4c6afe0 100644
--- a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -13,8 +13,11 @@
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureSampleLevel_690d95 "textureSampleLevel_690d95"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -33,41 +37,51 @@
%10 = OpTypeSampler
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
%arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
- %void = OpTypeVoid
- %11 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %19 = OpTypeSampledImage %7
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %14 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %22 = OpTypeSampledImage %7
%v2float = OpTypeVector %float 2
- %22 = OpConstantNull %v2float
+ %25 = OpConstantNull %v2float
%float_1 = OpConstant %float 1
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %26 = OpConstantNull %v2int
+ %29 = OpConstantNull %v2int
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %29 = OpConstantNull %v4float
-%textureSampleLevel_690d95 = OpFunction %void None %11
- %14 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %29
- %17 = OpLoad %10 %arg_1
- %18 = OpLoad %7 %arg_0
- %20 = OpSampledImage %19 %18 %17
- %15 = OpImageSampleExplicitLod %v4float %20 %22 Lod|ConstOffset %float_1 %26
- OpStore %res %15
+ %32 = OpTypeFunction %void %v4float
+%textureSampleLevel_690d95 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %14
+ %20 = OpLoad %10 %arg_1
+ %21 = OpLoad %7 %arg_0
+ %23 = OpSampledImage %22 %21 %20
+ %19 = OpImageSampleExplicitLod %v4float %23 %25 Lod|ConstOffset %float_1 %29
+ OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %11
- %31 = OpLabel
- OpStore %tint_pointsize %float_1
- %32 = OpFunctionCall %void %textureSampleLevel_690d95
+%tint_symbol_2 = OpFunction %void None %32
+%tint_symbol = OpFunctionParameter %v4float
+ %35 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %11
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureSampleLevel_690d95
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %11
+%vertex_main = OpFunction %void None %15
%37 = OpLabel
+ OpStore %tint_pointsize %float_1
%38 = OpFunctionCall %void %textureSampleLevel_690d95
+ %39 = OpFunctionCall %void %tint_symbol_2 %14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureSampleLevel_690d95
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureSampleLevel_690d95
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.wgsl
index 6296395..505e311 100644
--- a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.wgsl
@@ -7,8 +7,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_690d95();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/979816.wgsl b/test/intrinsics/gen/textureSampleLevel/979816.wgsl
index ca08cfa..88a0bae 100644
--- a/test/intrinsics/gen/textureSampleLevel/979816.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/979816.wgsl
@@ -29,8 +29,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_979816();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.hlsl
index 3955bcf..872c6af 100644
--- a/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<float4> arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
@@ -5,9 +9,10 @@
float4 res = arg_0.SampleLevel(arg_1, float2(0.0f, 0.0f), 0.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureSampleLevel_979816();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.spvasm
index 13c9866..c8f76e0 100644
--- a/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 37
+; Bound: 44
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -13,8 +13,11 @@
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureSampleLevel_979816 "textureSampleLevel_979816"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -33,39 +37,49 @@
%10 = OpTypeSampler
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
%arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
- %void = OpTypeVoid
- %11 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %19 = OpTypeSampledImage %7
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %14 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %22 = OpTypeSampledImage %7
%v2float = OpTypeVector %float 2
- %22 = OpConstantNull %v2float
+ %25 = OpConstantNull %v2float
%float_0 = OpConstant %float 0
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %26 = OpConstantNull %v4float
+ %29 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureSampleLevel_979816 = OpFunction %void None %11
- %14 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %26
- %17 = OpLoad %10 %arg_1
- %18 = OpLoad %7 %arg_0
- %20 = OpSampledImage %19 %18 %17
- %15 = OpImageSampleExplicitLod %v4float %20 %22 Lod %float_0
- OpStore %res %15
+%textureSampleLevel_979816 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %14
+ %20 = OpLoad %10 %arg_1
+ %21 = OpLoad %7 %arg_0
+ %23 = OpSampledImage %22 %21 %20
+ %19 = OpImageSampleExplicitLod %v4float %23 %25 Lod %float_0
+ OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %11
- %28 = OpLabel
- OpStore %tint_pointsize %float_1
- %30 = OpFunctionCall %void %textureSampleLevel_979816
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %11
+%tint_symbol_2 = OpFunction %void None %29
+%tint_symbol = OpFunctionParameter %v4float
%32 = OpLabel
- %33 = OpFunctionCall %void %textureSampleLevel_979816
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %11
- %35 = OpLabel
+%vertex_main = OpFunction %void None %15
+ %34 = OpLabel
+ OpStore %tint_pointsize %float_1
%36 = OpFunctionCall %void %textureSampleLevel_979816
+ %37 = OpFunctionCall %void %tint_symbol_2 %14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureSampleLevel_979816
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureSampleLevel_979816
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.wgsl
index aef0711..26ba255 100644
--- a/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.wgsl
@@ -7,8 +7,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_979816();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl
index edd4bab..233f3d1 100644
--- a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl
@@ -29,8 +29,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_9bd37b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.hlsl
index b0833fb..0db8ec8 100644
--- a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<float4> arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
@@ -5,9 +9,10 @@
float4 res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, 0.0f), 1.0f, int3(0, 0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureSampleLevel_9bd37b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.spvasm
index fbc52c7..bbb579d 100644
--- a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 39
+; Bound: 46
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -13,8 +13,11 @@
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureSampleLevel_9bd37b "textureSampleLevel_9bd37b"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -33,41 +37,51 @@
%10 = OpTypeSampler
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
%arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
- %void = OpTypeVoid
- %11 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %19 = OpTypeSampledImage %7
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %14 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %22 = OpTypeSampledImage %7
%v3float = OpTypeVector %float 3
- %22 = OpConstantNull %v3float
+ %25 = OpConstantNull %v3float
%float_1 = OpConstant %float 1
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %26 = OpConstantNull %v3int
+ %29 = OpConstantNull %v3int
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %29 = OpConstantNull %v4float
-%textureSampleLevel_9bd37b = OpFunction %void None %11
- %14 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %29
- %17 = OpLoad %10 %arg_1
- %18 = OpLoad %7 %arg_0
- %20 = OpSampledImage %19 %18 %17
- %15 = OpImageSampleExplicitLod %v4float %20 %22 Lod|ConstOffset %float_1 %26
- OpStore %res %15
+ %32 = OpTypeFunction %void %v4float
+%textureSampleLevel_9bd37b = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %14
+ %20 = OpLoad %10 %arg_1
+ %21 = OpLoad %7 %arg_0
+ %23 = OpSampledImage %22 %21 %20
+ %19 = OpImageSampleExplicitLod %v4float %23 %25 Lod|ConstOffset %float_1 %29
+ OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %11
- %31 = OpLabel
- OpStore %tint_pointsize %float_1
- %32 = OpFunctionCall %void %textureSampleLevel_9bd37b
+%tint_symbol_2 = OpFunction %void None %32
+%tint_symbol = OpFunctionParameter %v4float
+ %35 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %11
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureSampleLevel_9bd37b
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %11
+%vertex_main = OpFunction %void None %15
%37 = OpLabel
+ OpStore %tint_pointsize %float_1
%38 = OpFunctionCall %void %textureSampleLevel_9bd37b
+ %39 = OpFunctionCall %void %tint_symbol_2 %14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureSampleLevel_9bd37b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureSampleLevel_9bd37b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.wgsl
index c8d0cb1..e6986c4 100644
--- a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.wgsl
@@ -7,8 +7,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_9bd37b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl
index cbda792..8c5cd80 100644
--- a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl
@@ -29,8 +29,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_a4af26();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.hlsl
index 0e20614..4afbbb1 100644
--- a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray<float4> arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
@@ -5,9 +9,10 @@
float4 res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, float(1)), 1.0f, int2(0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureSampleLevel_a4af26();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.spvasm
index f6449ee..188ce07 100644
--- a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 42
+; Bound: 49
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -13,8 +13,11 @@
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureSampleLevel_a4af26 "textureSampleLevel_a4af26"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -33,44 +37,54 @@
%10 = OpTypeSampler
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
%arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
- %void = OpTypeVoid
- %11 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %19 = OpTypeSampledImage %7
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %14 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %22 = OpTypeSampledImage %7
%v3float = OpTypeVector %float 3
%float_0 = OpConstant %float 0
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%float_1 = OpConstant %float 1
%v2int = OpTypeVector %int 2
- %29 = OpConstantNull %v2int
+ %32 = OpConstantNull %v2int
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %32 = OpConstantNull %v4float
-%textureSampleLevel_a4af26 = OpFunction %void None %11
- %14 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %32
- %17 = OpLoad %10 %arg_1
- %18 = OpLoad %7 %arg_0
- %20 = OpSampledImage %19 %18 %17
- %23 = OpConvertSToF %float %int_1
- %26 = OpCompositeConstruct %v3float %float_0 %float_0 %23
- %15 = OpImageSampleExplicitLod %v4float %20 %26 Lod|ConstOffset %float_1 %29
- OpStore %res %15
+ %35 = OpTypeFunction %void %v4float
+%textureSampleLevel_a4af26 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %14
+ %20 = OpLoad %10 %arg_1
+ %21 = OpLoad %7 %arg_0
+ %23 = OpSampledImage %22 %21 %20
+ %26 = OpConvertSToF %float %int_1
+ %29 = OpCompositeConstruct %v3float %float_0 %float_0 %26
+ %19 = OpImageSampleExplicitLod %v4float %23 %29 Lod|ConstOffset %float_1 %32
+ OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %11
- %34 = OpLabel
- OpStore %tint_pointsize %float_1
- %35 = OpFunctionCall %void %textureSampleLevel_a4af26
+%tint_symbol_2 = OpFunction %void None %35
+%tint_symbol = OpFunctionParameter %v4float
+ %38 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %11
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureSampleLevel_a4af26
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %11
+%vertex_main = OpFunction %void None %15
%40 = OpLabel
+ OpStore %tint_pointsize %float_1
%41 = OpFunctionCall %void %textureSampleLevel_a4af26
+ %42 = OpFunctionCall %void %tint_symbol_2 %14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %44 = OpLabel
+ %45 = OpFunctionCall %void %textureSampleLevel_a4af26
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureSampleLevel_a4af26
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.wgsl
index db51737..6c46516 100644
--- a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.wgsl
@@ -7,8 +7,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_a4af26();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl
index ad8f483..d6690e1 100644
--- a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl
@@ -29,8 +29,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_abfcc0();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.hlsl
index 8ec0780..4cfd9c8 100644
--- a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture3D<float4> arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
@@ -5,9 +9,10 @@
float4 res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, 0.0f), 1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureSampleLevel_abfcc0();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.spvasm
index 9ad4e35..3b16f62 100644
--- a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -13,8 +13,11 @@
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureSampleLevel_abfcc0 "textureSampleLevel_abfcc0"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -33,38 +37,48 @@
%10 = OpTypeSampler
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
%arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
- %void = OpTypeVoid
- %11 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %19 = OpTypeSampledImage %7
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %14 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %22 = OpTypeSampledImage %7
%v3float = OpTypeVector %float 3
- %22 = OpConstantNull %v3float
+ %25 = OpConstantNull %v3float
%float_1 = OpConstant %float 1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %26 = OpConstantNull %v4float
-%textureSampleLevel_abfcc0 = OpFunction %void None %11
- %14 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %26
- %17 = OpLoad %10 %arg_1
- %18 = OpLoad %7 %arg_0
- %20 = OpSampledImage %19 %18 %17
- %15 = OpImageSampleExplicitLod %v4float %20 %22 Lod %float_1
- OpStore %res %15
+ %29 = OpTypeFunction %void %v4float
+%textureSampleLevel_abfcc0 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %14
+ %20 = OpLoad %10 %arg_1
+ %21 = OpLoad %7 %arg_0
+ %23 = OpSampledImage %22 %21 %20
+ %19 = OpImageSampleExplicitLod %v4float %23 %25 Lod %float_1
+ OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %11
- %28 = OpLabel
- OpStore %tint_pointsize %float_1
- %29 = OpFunctionCall %void %textureSampleLevel_abfcc0
+%tint_symbol_2 = OpFunction %void None %29
+%tint_symbol = OpFunctionParameter %v4float
+ %32 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %11
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureSampleLevel_abfcc0
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %11
+%vertex_main = OpFunction %void None %15
%34 = OpLabel
+ OpStore %tint_pointsize %float_1
%35 = OpFunctionCall %void %textureSampleLevel_abfcc0
+ %36 = OpFunctionCall %void %tint_symbol_2 %14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureSampleLevel_abfcc0
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureSampleLevel_abfcc0
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.wgsl
index 0613aea..f883e50 100644
--- a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.wgsl
@@ -7,8 +7,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_abfcc0();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl
index 36ed893..5aff852 100644
--- a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl
@@ -29,8 +29,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_ae5e39();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.hlsl
index 69978eb..7f7fe7e 100644
--- a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCubeArray arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
@@ -5,9 +9,10 @@
float res = arg_0.SampleLevel(arg_1, float4(0.0f, 0.0f, 0.0f, float(1)), 1);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureSampleLevel_ae5e39();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.spvasm
index 907f80d..d895f59 100644
--- a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.spvasm
@@ -1,12 +1,12 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 40
+; Bound: 48
; Schema: 0
OpCapability Shader
OpCapability SampledCubeArray
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -14,8 +14,11 @@
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureSampleLevel_ae5e39 "textureSampleLevel_ae5e39"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -24,6 +27,7 @@
OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -34,42 +38,53 @@
%10 = OpTypeSampler
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
%arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
- %void = OpTypeVoid
- %11 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %20 = OpTypeSampledImage %7
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %14 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %23 = OpTypeSampledImage %7
%float_0 = OpConstant %float 0
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_Function_float = OpTypePointer Function %float
+ %33 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureSampleLevel_ae5e39 = OpFunction %void None %11
- %14 = OpLabel
+%textureSampleLevel_ae5e39 = OpFunction %void None %15
+ %18 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %18 = OpLoad %10 %arg_1
- %19 = OpLoad %7 %arg_0
- %21 = OpSampledImage %20 %19 %18
- %23 = OpConvertSToF %float %int_1
- %26 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %23
- %27 = OpConvertSToF %float %int_1
- %16 = OpImageSampleExplicitLod %v4float %21 %26 Lod %27
- %15 = OpCompositeExtract %float %16 0
- OpStore %res %15
+ %21 = OpLoad %10 %arg_1
+ %22 = OpLoad %7 %arg_0
+ %24 = OpSampledImage %23 %22 %21
+ %26 = OpConvertSToF %float %int_1
+ %29 = OpCompositeConstruct %v4float %float_0 %float_0 %float_0 %26
+ %30 = OpConvertSToF %float %int_1
+ %20 = OpImageSampleExplicitLod %v4float %24 %29 Lod %30
+ %19 = OpCompositeExtract %float %20 0
+ OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %11
- %31 = OpLabel
- OpStore %tint_pointsize %float_1
- %33 = OpFunctionCall %void %textureSampleLevel_ae5e39
+%tint_symbol_2 = OpFunction %void None %33
+%tint_symbol = OpFunctionParameter %v4float
+ %36 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %11
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureSampleLevel_ae5e39
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %11
+%vertex_main = OpFunction %void None %15
%38 = OpLabel
- %39 = OpFunctionCall %void %textureSampleLevel_ae5e39
+ OpStore %tint_pointsize %float_1
+ %40 = OpFunctionCall %void %textureSampleLevel_ae5e39
+ %41 = OpFunctionCall %void %tint_symbol_2 %14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureSampleLevel_ae5e39
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %46 = OpLabel
+ %47 = OpFunctionCall %void %textureSampleLevel_ae5e39
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.wgsl
index aaca367..0756a43 100644
--- a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.wgsl
@@ -7,8 +7,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_ae5e39();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl
index c25cf35..f22f02f 100644
--- a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl
@@ -29,8 +29,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_ba93b3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.hlsl
index 91349dd..193e4ab 100644
--- a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2DArray arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
@@ -5,9 +9,10 @@
float res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, float(1)), 1, int2(0, 0));
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureSampleLevel_ba93b3();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.spvasm
index 27be8b2..fc2622a 100644
--- a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 43
+; Bound: 51
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -13,8 +13,11 @@
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureSampleLevel_ba93b3 "textureSampleLevel_ba93b3"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -33,45 +37,56 @@
%10 = OpTypeSampler
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
%arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
- %void = OpTypeVoid
- %11 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %20 = OpTypeSampledImage %7
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %14 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %23 = OpTypeSampledImage %7
%v3float = OpTypeVector %float 3
%float_0 = OpConstant %float 0
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
- %30 = OpConstantNull %v2int
+ %33 = OpConstantNull %v2int
%_ptr_Function_float = OpTypePointer Function %float
+ %36 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureSampleLevel_ba93b3 = OpFunction %void None %11
- %14 = OpLabel
+%textureSampleLevel_ba93b3 = OpFunction %void None %15
+ %18 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %18 = OpLoad %10 %arg_1
- %19 = OpLoad %7 %arg_0
- %21 = OpSampledImage %20 %19 %18
- %24 = OpConvertSToF %float %int_1
- %27 = OpCompositeConstruct %v3float %float_0 %float_0 %24
- %28 = OpConvertSToF %float %int_1
- %16 = OpImageSampleExplicitLod %v4float %21 %27 Lod|ConstOffset %28 %30
- %15 = OpCompositeExtract %float %16 0
- OpStore %res %15
+ %21 = OpLoad %10 %arg_1
+ %22 = OpLoad %7 %arg_0
+ %24 = OpSampledImage %23 %22 %21
+ %27 = OpConvertSToF %float %int_1
+ %30 = OpCompositeConstruct %v3float %float_0 %float_0 %27
+ %31 = OpConvertSToF %float %int_1
+ %20 = OpImageSampleExplicitLod %v4float %24 %30 Lod|ConstOffset %31 %33
+ %19 = OpCompositeExtract %float %20 0
+ OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %11
- %34 = OpLabel
- OpStore %tint_pointsize %float_1
- %36 = OpFunctionCall %void %textureSampleLevel_ba93b3
+%tint_symbol_2 = OpFunction %void None %36
+%tint_symbol = OpFunctionParameter %v4float
+ %39 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %11
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureSampleLevel_ba93b3
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %11
+%vertex_main = OpFunction %void None %15
%41 = OpLabel
- %42 = OpFunctionCall %void %textureSampleLevel_ba93b3
+ OpStore %tint_pointsize %float_1
+ %43 = OpFunctionCall %void %textureSampleLevel_ba93b3
+ %44 = OpFunctionCall %void %tint_symbol_2 %14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %46 = OpLabel
+ %47 = OpFunctionCall %void %textureSampleLevel_ba93b3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %49 = OpLabel
+ %50 = OpFunctionCall %void %textureSampleLevel_ba93b3
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.wgsl
index de65319..2d3ff58 100644
--- a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.wgsl
@@ -7,8 +7,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_ba93b3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl
index d510ee8..4890371 100644
--- a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl
@@ -29,8 +29,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_c32df7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.hlsl
index dddaff2..86fcaa0 100644
--- a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
TextureCube<float4> arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
@@ -5,9 +9,10 @@
float4 res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, 0.0f), 1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureSampleLevel_c32df7();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.spvasm
index e16c043..0f377ee 100644
--- a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -13,8 +13,11 @@
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureSampleLevel_c32df7 "textureSampleLevel_c32df7"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -33,38 +37,48 @@
%10 = OpTypeSampler
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
%arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
- %void = OpTypeVoid
- %11 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %19 = OpTypeSampledImage %7
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %14 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %22 = OpTypeSampledImage %7
%v3float = OpTypeVector %float 3
- %22 = OpConstantNull %v3float
+ %25 = OpConstantNull %v3float
%float_1 = OpConstant %float 1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %26 = OpConstantNull %v4float
-%textureSampleLevel_c32df7 = OpFunction %void None %11
- %14 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %26
- %17 = OpLoad %10 %arg_1
- %18 = OpLoad %7 %arg_0
- %20 = OpSampledImage %19 %18 %17
- %15 = OpImageSampleExplicitLod %v4float %20 %22 Lod %float_1
- OpStore %res %15
+ %29 = OpTypeFunction %void %v4float
+%textureSampleLevel_c32df7 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %14
+ %20 = OpLoad %10 %arg_1
+ %21 = OpLoad %7 %arg_0
+ %23 = OpSampledImage %22 %21 %20
+ %19 = OpImageSampleExplicitLod %v4float %23 %25 Lod %float_1
+ OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %11
- %28 = OpLabel
- OpStore %tint_pointsize %float_1
- %29 = OpFunctionCall %void %textureSampleLevel_c32df7
+%tint_symbol_2 = OpFunction %void None %29
+%tint_symbol = OpFunctionParameter %v4float
+ %32 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %11
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureSampleLevel_c32df7
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %11
+%vertex_main = OpFunction %void None %15
%34 = OpLabel
+ OpStore %tint_pointsize %float_1
%35 = OpFunctionCall %void %textureSampleLevel_c32df7
+ %36 = OpFunctionCall %void %tint_symbol_2 %14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureSampleLevel_c32df7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureSampleLevel_c32df7
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.wgsl
index 556751a..aef0bf5 100644
--- a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.wgsl
@@ -7,8 +7,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_c32df7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl
index 39e1e8c..b145d8a 100644
--- a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl
@@ -29,8 +29,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_c6aca6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.hlsl
index 6e7600d..5987ae8 100644
--- a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.hlsl
@@ -1,3 +1,7 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
Texture2D<float4> arg_0 : register(t0, space1);
SamplerState arg_1 : register(s1, space1);
@@ -5,9 +9,10 @@
float4 res = arg_0.SampleLevel(arg_1, float2(0.0f, 0.0f), 1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureSampleLevel_c6aca6();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.spvasm
index 9404477..3c7813d 100644
--- a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 43
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
@@ -13,8 +13,11 @@
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
OpName %arg_1 "arg_1"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureSampleLevel_c6aca6 "textureSampleLevel_c6aca6"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -23,6 +26,7 @@
OpDecorate %arg_0 Binding 0
OpDecorate %arg_1 DescriptorSet 1
OpDecorate %arg_1 Binding 1
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -33,38 +37,48 @@
%10 = OpTypeSampler
%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10
%arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant
- %void = OpTypeVoid
- %11 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %19 = OpTypeSampledImage %7
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %14 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %14
+ %void = OpTypeVoid
+ %15 = OpTypeFunction %void
+ %22 = OpTypeSampledImage %7
%v2float = OpTypeVector %float 2
- %22 = OpConstantNull %v2float
+ %25 = OpConstantNull %v2float
%float_1 = OpConstant %float 1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %26 = OpConstantNull %v4float
-%textureSampleLevel_c6aca6 = OpFunction %void None %11
- %14 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %26
- %17 = OpLoad %10 %arg_1
- %18 = OpLoad %7 %arg_0
- %20 = OpSampledImage %19 %18 %17
- %15 = OpImageSampleExplicitLod %v4float %20 %22 Lod %float_1
- OpStore %res %15
+ %29 = OpTypeFunction %void %v4float
+%textureSampleLevel_c6aca6 = OpFunction %void None %15
+ %18 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %14
+ %20 = OpLoad %10 %arg_1
+ %21 = OpLoad %7 %arg_0
+ %23 = OpSampledImage %22 %21 %20
+ %19 = OpImageSampleExplicitLod %v4float %23 %25 Lod %float_1
+ OpStore %res %19
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %11
- %28 = OpLabel
- OpStore %tint_pointsize %float_1
- %29 = OpFunctionCall %void %textureSampleLevel_c6aca6
+%tint_symbol_2 = OpFunction %void None %29
+%tint_symbol = OpFunctionParameter %v4float
+ %32 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %11
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureSampleLevel_c6aca6
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %11
+%vertex_main = OpFunction %void None %15
%34 = OpLabel
+ OpStore %tint_pointsize %float_1
%35 = OpFunctionCall %void %textureSampleLevel_c6aca6
+ %36 = OpFunctionCall %void %tint_symbol_2 %14
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %15
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureSampleLevel_c6aca6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %15
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureSampleLevel_c6aca6
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.wgsl
index 3baacae..04fac3a 100644
--- a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.wgsl
@@ -7,8 +7,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureSampleLevel_c6aca6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/05ce15.wgsl b/test/intrinsics/gen/textureStore/05ce15.wgsl
index f0df428..877e6f0 100644
--- a/test/intrinsics/gen/textureStore/05ce15.wgsl
+++ b/test/intrinsics/gen/textureStore/05ce15.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_05ce15();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.hlsl
index d38cd87..ca8dc95 100644
--- a/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<float4> arg_0 : register(u0, space1);
void textureStore_05ce15() {
arg_0[int2(0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_05ce15();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.spvasm
index d9b79d5..ee23e7f 100644
--- a/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 36
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_05ce15 "textureStore_05ce15"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -27,33 +31,43 @@
%7 = OpTypeImage %float 2D 0 0 0 2 Rgba32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %16 = OpConstantNull %v2int
- %v4float = OpTypeVector %float 4
- %18 = OpConstantNull %v4float
+ %20 = OpConstantNull %v2int
+ %21 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_05ce15 = OpFunction %void None %8
- %11 = OpLabel
- %13 = OpLoad %7 %arg_0
- OpImageWrite %13 %16 %18
+%textureStore_05ce15 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %7 %arg_0
+ OpImageWrite %17 %20 %11
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
- OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_05ce15
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %21
+%tint_symbol = OpFunctionParameter %v4float
%24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_05ce15
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %26 = OpLabel
+ OpStore %tint_pointsize %float_1
%28 = OpFunctionCall %void %textureStore_05ce15
+ %29 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureStore_05ce15
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_05ce15
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.wgsl
index 75c0ae2..f31db20 100644
--- a/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_05ce15();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/064c7f.wgsl b/test/intrinsics/gen/textureStore/064c7f.wgsl
index caa9253..a999c8b 100644
--- a/test/intrinsics/gen/textureStore/064c7f.wgsl
+++ b/test/intrinsics/gen/textureStore/064c7f.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_064c7f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.hlsl
index 85108a6..f627b4d 100644
--- a/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<float4> arg_0 : register(u0, space1);
void textureStore_064c7f() {
arg_0[int2(0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_064c7f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.spvasm
index 97edb60..b4bba70 100644
--- a/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 36
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_064c7f "textureStore_064c7f"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,33 +32,43 @@
%7 = OpTypeImage %float 2D 0 0 0 2 Rg32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %16 = OpConstantNull %v2int
- %v4float = OpTypeVector %float 4
- %18 = OpConstantNull %v4float
+ %20 = OpConstantNull %v2int
+ %21 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_064c7f = OpFunction %void None %8
- %11 = OpLabel
- %13 = OpLoad %7 %arg_0
- OpImageWrite %13 %16 %18
+%textureStore_064c7f = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %7 %arg_0
+ OpImageWrite %17 %20 %11
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
- OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_064c7f
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %21
+%tint_symbol = OpFunctionParameter %v4float
%24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_064c7f
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %26 = OpLabel
+ OpStore %tint_pointsize %float_1
%28 = OpFunctionCall %void %textureStore_064c7f
+ %29 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureStore_064c7f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_064c7f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.wgsl
index 500c2a1..46247d5 100644
--- a/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_064c7f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/068641.wgsl b/test/intrinsics/gen/textureStore/068641.wgsl
index b5a277b..27c616e 100644
--- a/test/intrinsics/gen/textureStore/068641.wgsl
+++ b/test/intrinsics/gen/textureStore/068641.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_068641();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/068641.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/068641.wgsl.expected.hlsl
index e744a5e..89951d9 100644
--- a/test/intrinsics/gen/textureStore/068641.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/068641.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<uint4> arg_0 : register(u0, space1);
void textureStore_068641() {
arg_0[int3(0, 0, 0)] = uint4(0u, 0u, 0u, 0u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_068641();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/068641.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/068641.wgsl.expected.spvasm
index 17de556..ad9d55c 100644
--- a/test/intrinsics/gen/textureStore/068641.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/068641.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_068641 "textureStore_068641"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,33 +32,45 @@
%7 = OpTypeImage %uint 3D 0 0 0 2 Rgba16ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %17 = OpConstantNull %v3int
+ %21 = OpConstantNull %v3int
%v4uint = OpTypeVector %uint 4
- %19 = OpConstantNull %v4uint
+ %23 = OpConstantNull %v4uint
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_068641 = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %17 %19
+%textureStore_068641 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %21 %23
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureStore_068641
+ %31 = OpFunctionCall %void %textureStore_068641
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureStore_068641
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_068641
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureStore_068641
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_068641
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/068641.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/068641.wgsl.expected.wgsl
index 1cff6cd..dbb407b 100644
--- a/test/intrinsics/gen/textureStore/068641.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/068641.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_068641();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/0af6b5.wgsl b/test/intrinsics/gen/textureStore/0af6b5.wgsl
index dbcb216..24c67b7 100644
--- a/test/intrinsics/gen/textureStore/0af6b5.wgsl
+++ b/test/intrinsics/gen/textureStore/0af6b5.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_0af6b5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.hlsl
index 6e80c55..45c7624 100644
--- a/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<float4> arg_0 : register(u0, space1);
void textureStore_0af6b5() {
arg_0[int2(0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_0af6b5();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.spvasm
index d651f50..d83c8d9 100644
--- a/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 36
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_0af6b5 "textureStore_0af6b5"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -27,33 +31,43 @@
%7 = OpTypeImage %float 2D 0 0 0 2 R32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %16 = OpConstantNull %v2int
- %v4float = OpTypeVector %float 4
- %18 = OpConstantNull %v4float
+ %20 = OpConstantNull %v2int
+ %21 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_0af6b5 = OpFunction %void None %8
- %11 = OpLabel
- %13 = OpLoad %7 %arg_0
- OpImageWrite %13 %16 %18
+%textureStore_0af6b5 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %7 %arg_0
+ OpImageWrite %17 %20 %11
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
- OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_0af6b5
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %21
+%tint_symbol = OpFunctionParameter %v4float
%24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_0af6b5
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %26 = OpLabel
+ OpStore %tint_pointsize %float_1
%28 = OpFunctionCall %void %textureStore_0af6b5
+ %29 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureStore_0af6b5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_0af6b5
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.wgsl
index dedf0b6..6a1e8dd 100644
--- a/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_0af6b5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/0c3dff.wgsl b/test/intrinsics/gen/textureStore/0c3dff.wgsl
index b6189de..5133f2e 100644
--- a/test/intrinsics/gen/textureStore/0c3dff.wgsl
+++ b/test/intrinsics/gen/textureStore/0c3dff.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_0c3dff();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.hlsl
index dcc9b15..2212b86 100644
--- a/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<uint4> arg_0 : register(u0, space1);
void textureStore_0c3dff() {
arg_0[int2(0, 0)] = uint4(0u, 0u, 0u, 0u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_0c3dff();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.spvasm
index 32263fd..0bc05e8 100644
--- a/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_0c3dff "textureStore_0c3dff"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,33 +32,45 @@
%7 = OpTypeImage %uint 2D 0 0 0 2 Rgba16ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %17 = OpConstantNull %v2int
+ %21 = OpConstantNull %v2int
%v4uint = OpTypeVector %uint 4
- %19 = OpConstantNull %v4uint
+ %23 = OpConstantNull %v4uint
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_0c3dff = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %17 %19
+%textureStore_0c3dff = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %21 %23
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureStore_0c3dff
+ %31 = OpFunctionCall %void %textureStore_0c3dff
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureStore_0c3dff
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_0c3dff
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureStore_0c3dff
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_0c3dff
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.wgsl
index 6420eaf..96e508b 100644
--- a/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_0c3dff();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/102722.wgsl b/test/intrinsics/gen/textureStore/102722.wgsl
index c1c0bf4..37c8455 100644
--- a/test/intrinsics/gen/textureStore/102722.wgsl
+++ b/test/intrinsics/gen/textureStore/102722.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_102722();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/102722.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/102722.wgsl.expected.hlsl
index bfbb63b..b6604d9 100644
--- a/test/intrinsics/gen/textureStore/102722.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/102722.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<uint4> arg_0 : register(u0, space1);
void textureStore_102722() {
arg_0[1] = uint4(0u, 0u, 0u, 0u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_102722();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/102722.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/102722.wgsl.expected.spvasm
index 0406d15..1fc763e 100644
--- a/test/intrinsics/gen/textureStore/102722.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/102722.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_102722 "textureStore_102722"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,32 +33,44 @@
%7 = OpTypeImage %uint 1D 0 0 0 2 R32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v4uint = OpTypeVector %uint 4
- %18 = OpConstantNull %v4uint
+ %22 = OpConstantNull %v4uint
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_102722 = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %int_1 %18
+%textureStore_102722 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %int_1 %22
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_102722
+ %30 = OpFunctionCall %void %textureStore_102722
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_102722
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_102722
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureStore_102722
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_102722
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/102722.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/102722.wgsl.expected.wgsl
index bab8dc4..78bc05d 100644
--- a/test/intrinsics/gen/textureStore/102722.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/102722.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_102722();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/1bbd08.wgsl b/test/intrinsics/gen/textureStore/1bbd08.wgsl
index 5296393..70562e8 100644
--- a/test/intrinsics/gen/textureStore/1bbd08.wgsl
+++ b/test/intrinsics/gen/textureStore/1bbd08.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_1bbd08();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.hlsl
index 561bce9..870bbe9 100644
--- a/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<float4> arg_0 : register(u0, space1);
void textureStore_1bbd08() {
arg_0[int3(0, 0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_1bbd08();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.spvasm
index 9bde491..f177c1b 100644
--- a/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 36
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_1bbd08 "textureStore_1bbd08"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -27,33 +31,43 @@
%7 = OpTypeImage %float 3D 0 0 0 2 Rgba8
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %16 = OpConstantNull %v3int
- %v4float = OpTypeVector %float 4
- %18 = OpConstantNull %v4float
+ %20 = OpConstantNull %v3int
+ %21 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_1bbd08 = OpFunction %void None %8
- %11 = OpLabel
- %13 = OpLoad %7 %arg_0
- OpImageWrite %13 %16 %18
+%textureStore_1bbd08 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %7 %arg_0
+ OpImageWrite %17 %20 %11
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
- OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_1bbd08
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %21
+%tint_symbol = OpFunctionParameter %v4float
%24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_1bbd08
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %26 = OpLabel
+ OpStore %tint_pointsize %float_1
%28 = OpFunctionCall %void %textureStore_1bbd08
+ %29 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureStore_1bbd08
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_1bbd08
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.wgsl
index 0b676c2..d265bc0 100644
--- a/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_1bbd08();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/1c02e7.wgsl b/test/intrinsics/gen/textureStore/1c02e7.wgsl
index 0170e00..134e7f8 100644
--- a/test/intrinsics/gen/textureStore/1c02e7.wgsl
+++ b/test/intrinsics/gen/textureStore/1c02e7.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_1c02e7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.hlsl
index eead151..e0d0308 100644
--- a/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<int4> arg_0 : register(u0, space1);
void textureStore_1c02e7() {
arg_0[int3(0, 0, 1)] = int4(0, 0, 0, 0);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_1c02e7();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.spvasm
index b1fef26..6f3cf7b 100644
--- a/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_1c02e7 "textureStore_1c02e7"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,34 +32,46 @@
%7 = OpTypeImage %int 2D 0 1 0 2 R32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %18 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%v4int = OpTypeVector %int 4
- %20 = OpConstantNull %v4int
+ %24 = OpConstantNull %v4int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_1c02e7 = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %18 %20
+%textureStore_1c02e7 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %22 %24
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureStore_1c02e7
+ %32 = OpFunctionCall %void %textureStore_1c02e7
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureStore_1c02e7
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureStore_1c02e7
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureStore_1c02e7
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureStore_1c02e7
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.wgsl
index 715524f..17368d2 100644
--- a/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_1c02e7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/22d955.wgsl b/test/intrinsics/gen/textureStore/22d955.wgsl
index 815e628..ada2279 100644
--- a/test/intrinsics/gen/textureStore/22d955.wgsl
+++ b/test/intrinsics/gen/textureStore/22d955.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_22d955();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/22d955.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.hlsl
index 20cec38..0d9852c 100644
--- a/test/intrinsics/gen/textureStore/22d955.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<uint4> arg_0 : register(u0, space1);
void textureStore_22d955() {
arg_0[int3(0, 0, 1)] = uint4(0u, 0u, 0u, 0u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_22d955();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/22d955.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.spvasm
index 01dc1cc..bde9762 100644
--- a/test/intrinsics/gen/textureStore/22d955.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_22d955 "textureStore_22d955"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,35 +32,47 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%v4uint = OpTypeVector %uint 4
- %21 = OpConstantNull %v4uint
+ %25 = OpConstantNull %v4uint
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_22d955 = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %19 %21
+%textureStore_22d955 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %23 %25
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureStore_22d955
+ %33 = OpFunctionCall %void %textureStore_22d955
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureStore_22d955
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_22d955
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureStore_22d955
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_22d955
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/22d955.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.wgsl
index 08c8bb1..cb9bde4 100644
--- a/test/intrinsics/gen/textureStore/22d955.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_22d955();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/26bf70.wgsl b/test/intrinsics/gen/textureStore/26bf70.wgsl
index 693d8e8..6f8b38d 100644
--- a/test/intrinsics/gen/textureStore/26bf70.wgsl
+++ b/test/intrinsics/gen/textureStore/26bf70.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_26bf70();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.hlsl
index 8a9bbda..323424c 100644
--- a/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<uint4> arg_0 : register(u0, space1);
void textureStore_26bf70() {
arg_0[int2(0, 0)] = uint4(0u, 0u, 0u, 0u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_26bf70();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.spvasm
index 2a8ef15..ba254cc 100644
--- a/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_26bf70 "textureStore_26bf70"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,33 +32,45 @@
%7 = OpTypeImage %uint 2D 0 0 0 2 Rgba32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %17 = OpConstantNull %v2int
+ %21 = OpConstantNull %v2int
%v4uint = OpTypeVector %uint 4
- %19 = OpConstantNull %v4uint
+ %23 = OpConstantNull %v4uint
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_26bf70 = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %17 %19
+%textureStore_26bf70 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %21 %23
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureStore_26bf70
+ %31 = OpFunctionCall %void %textureStore_26bf70
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureStore_26bf70
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_26bf70
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureStore_26bf70
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_26bf70
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.wgsl
index d1ff649..a2bb93d 100644
--- a/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_26bf70();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/2796b4.wgsl b/test/intrinsics/gen/textureStore/2796b4.wgsl
index 3b2e3b2..627e15f 100644
--- a/test/intrinsics/gen/textureStore/2796b4.wgsl
+++ b/test/intrinsics/gen/textureStore/2796b4.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_2796b4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.hlsl
index 88e1e0f..ead20b9 100644
--- a/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<int4> arg_0 : register(u0, space1);
void textureStore_2796b4() {
arg_0[int3(0, 0, 0)] = int4(0, 0, 0, 0);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_2796b4();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.spvasm
index e26f6b6..3c77ab2 100644
--- a/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_2796b4 "textureStore_2796b4"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,32 +33,44 @@
%7 = OpTypeImage %int 3D 0 0 0 2 Rg32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
- %16 = OpConstantNull %v3int
+ %20 = OpConstantNull %v3int
%v4int = OpTypeVector %int 4
- %18 = OpConstantNull %v4int
+ %22 = OpConstantNull %v4int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_2796b4 = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %16 %18
+%textureStore_2796b4 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %20 %22
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_2796b4
+ %30 = OpFunctionCall %void %textureStore_2796b4
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_2796b4
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_2796b4
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureStore_2796b4
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_2796b4
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.wgsl
index d307706..f541a87 100644
--- a/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_2796b4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/2ac6c7.wgsl b/test/intrinsics/gen/textureStore/2ac6c7.wgsl
index 7a5200f..882b766 100644
--- a/test/intrinsics/gen/textureStore/2ac6c7.wgsl
+++ b/test/intrinsics/gen/textureStore/2ac6c7.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_2ac6c7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.hlsl
index 2e5bd83..0427db5 100644
--- a/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<float4> arg_0 : register(u0, space1);
void textureStore_2ac6c7() {
arg_0[1] = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_2ac6c7();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.spvasm
index 6a05c5c..ae33248 100644
--- a/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 35
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_2ac6c7 "textureStore_2ac6c7"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,32 +32,42 @@
%7 = OpTypeImage %float 1D 0 0 0 2 R32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
- %v4float = OpTypeVector %float 4
- %17 = OpConstantNull %v4float
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_2ac6c7 = OpFunction %void None %8
- %11 = OpLabel
- %13 = OpLoad %7 %arg_0
- OpImageWrite %13 %int_1 %17
+%textureStore_2ac6c7 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %7 %arg_0
+ OpImageWrite %17 %int_1 %11
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
- OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureStore_2ac6c7
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
%23 = OpLabel
- %24 = OpFunctionCall %void %textureStore_2ac6c7
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %25 = OpLabel
+ OpStore %tint_pointsize %float_1
%27 = OpFunctionCall %void %textureStore_2ac6c7
+ %28 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureStore_2ac6c7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_2ac6c7
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.wgsl
index 7d3f57a..6dd1a80 100644
--- a/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_2ac6c7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/2eb2a4.wgsl b/test/intrinsics/gen/textureStore/2eb2a4.wgsl
index 2f4f9d7..18b7284 100644
--- a/test/intrinsics/gen/textureStore/2eb2a4.wgsl
+++ b/test/intrinsics/gen/textureStore/2eb2a4.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_2eb2a4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.hlsl
index 2bfcdeb..b44f1ad 100644
--- a/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<uint4> arg_0 : register(u0, space1);
void textureStore_2eb2a4() {
arg_0[1] = uint4(0u, 0u, 0u, 0u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_2eb2a4();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.spvasm
index fd59253..01255a8 100644
--- a/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_2eb2a4 "textureStore_2eb2a4"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,32 +33,44 @@
%7 = OpTypeImage %uint 1D 0 0 0 2 Rgba16ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v4uint = OpTypeVector %uint 4
- %18 = OpConstantNull %v4uint
+ %22 = OpConstantNull %v4uint
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_2eb2a4 = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %int_1 %18
+%textureStore_2eb2a4 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %int_1 %22
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_2eb2a4
+ %30 = OpFunctionCall %void %textureStore_2eb2a4
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_2eb2a4
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_2eb2a4
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureStore_2eb2a4
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_2eb2a4
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.wgsl
index f62d137..c1d63b6 100644
--- a/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_2eb2a4();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/2ed2a3.wgsl b/test/intrinsics/gen/textureStore/2ed2a3.wgsl
index c710a47..ac2c48e 100644
--- a/test/intrinsics/gen/textureStore/2ed2a3.wgsl
+++ b/test/intrinsics/gen/textureStore/2ed2a3.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_2ed2a3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.hlsl
index 61caf3b..cf0bd1e 100644
--- a/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<float4> arg_0 : register(u0, space1);
void textureStore_2ed2a3() {
arg_0[1] = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_2ed2a3();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.spvasm
index 3c4624c..e517f8c 100644
--- a/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 35
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_2ed2a3 "textureStore_2ed2a3"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,32 +32,42 @@
%7 = OpTypeImage %float 1D 0 0 0 2 Rgba8Snorm
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
- %v4float = OpTypeVector %float 4
- %17 = OpConstantNull %v4float
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_2ed2a3 = OpFunction %void None %8
- %11 = OpLabel
- %13 = OpLoad %7 %arg_0
- OpImageWrite %13 %int_1 %17
+%textureStore_2ed2a3 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %7 %arg_0
+ OpImageWrite %17 %int_1 %11
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
- OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureStore_2ed2a3
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
%23 = OpLabel
- %24 = OpFunctionCall %void %textureStore_2ed2a3
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %25 = OpLabel
+ OpStore %tint_pointsize %float_1
%27 = OpFunctionCall %void %textureStore_2ed2a3
+ %28 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureStore_2ed2a3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_2ed2a3
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.wgsl
index 366b088..adb55f6 100644
--- a/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_2ed2a3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/31745b.wgsl b/test/intrinsics/gen/textureStore/31745b.wgsl
index be9ae40..68d862e 100644
--- a/test/intrinsics/gen/textureStore/31745b.wgsl
+++ b/test/intrinsics/gen/textureStore/31745b.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_31745b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/31745b.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.hlsl
index 2205238..6978776 100644
--- a/test/intrinsics/gen/textureStore/31745b.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<int4> arg_0 : register(u0, space1);
void textureStore_31745b() {
arg_0[int2(0, 0)] = int4(0, 0, 0, 0);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_31745b();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/31745b.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.spvasm
index 101f8dd..d2216e9 100644
--- a/test/intrinsics/gen/textureStore/31745b.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_31745b "textureStore_31745b"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,32 +33,44 @@
%7 = OpTypeImage %int 2D 0 0 0 2 Rg32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
- %16 = OpConstantNull %v2int
+ %20 = OpConstantNull %v2int
%v4int = OpTypeVector %int 4
- %18 = OpConstantNull %v4int
+ %22 = OpConstantNull %v4int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_31745b = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %16 %18
+%textureStore_31745b = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %20 %22
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_31745b
+ %30 = OpFunctionCall %void %textureStore_31745b
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_31745b
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_31745b
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureStore_31745b
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_31745b
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/31745b.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.wgsl
index fc1848f..0349879 100644
--- a/test/intrinsics/gen/textureStore/31745b.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_31745b();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/32f368.wgsl b/test/intrinsics/gen/textureStore/32f368.wgsl
index 82fea17..e4104c3 100644
--- a/test/intrinsics/gen/textureStore/32f368.wgsl
+++ b/test/intrinsics/gen/textureStore/32f368.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_32f368();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/32f368.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.hlsl
index 1b4385dec..f8e9148 100644
--- a/test/intrinsics/gen/textureStore/32f368.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<float4> arg_0 : register(u0, space1);
void textureStore_32f368() {
arg_0[int3(0, 0, 1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_32f368();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/32f368.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.spvasm
index 63c2b1c..9c38831 100644
--- a/test/intrinsics/gen/textureStore/32f368.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_32f368 "textureStore_32f368"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -27,35 +31,45 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %18 = OpConstantComposite %v3int %int_0 %int_0 %int_1
- %v4float = OpTypeVector %float 4
- %20 = OpConstantNull %v4float
+ %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_32f368 = OpFunction %void None %8
- %11 = OpLabel
- %13 = OpLoad %7 %arg_0
- OpImageWrite %13 %18 %20
+%textureStore_32f368 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %7 %arg_0
+ OpImageWrite %17 %22 %11
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
- OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureStore_32f368
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
%26 = OpLabel
- %27 = OpFunctionCall %void %textureStore_32f368
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
%30 = OpFunctionCall %void %textureStore_32f368
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_32f368
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_32f368
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/32f368.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.wgsl
index 43d6af5..c7addc8 100644
--- a/test/intrinsics/gen/textureStore/32f368.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_32f368();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/331aee.wgsl b/test/intrinsics/gen/textureStore/331aee.wgsl
index f4bf4e4..a5934bb 100644
--- a/test/intrinsics/gen/textureStore/331aee.wgsl
+++ b/test/intrinsics/gen/textureStore/331aee.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_331aee();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/331aee.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.hlsl
index ef51064..acb18d1 100644
--- a/test/intrinsics/gen/textureStore/331aee.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<float4> arg_0 : register(u0, space1);
void textureStore_331aee() {
arg_0[int3(0, 0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_331aee();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/331aee.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.spvasm
index 1c6d255..d6ba273 100644
--- a/test/intrinsics/gen/textureStore/331aee.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 36
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_331aee "textureStore_331aee"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -27,33 +31,43 @@
%7 = OpTypeImage %float 3D 0 0 0 2 Rgba32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %16 = OpConstantNull %v3int
- %v4float = OpTypeVector %float 4
- %18 = OpConstantNull %v4float
+ %20 = OpConstantNull %v3int
+ %21 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_331aee = OpFunction %void None %8
- %11 = OpLabel
- %13 = OpLoad %7 %arg_0
- OpImageWrite %13 %16 %18
+%textureStore_331aee = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %7 %arg_0
+ OpImageWrite %17 %20 %11
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
- OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_331aee
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %21
+%tint_symbol = OpFunctionParameter %v4float
%24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_331aee
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %26 = OpLabel
+ OpStore %tint_pointsize %float_1
%28 = OpFunctionCall %void %textureStore_331aee
+ %29 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureStore_331aee
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_331aee
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/331aee.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.wgsl
index d1ed0c6..3d47b38 100644
--- a/test/intrinsics/gen/textureStore/331aee.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_331aee();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/38e8d7.wgsl b/test/intrinsics/gen/textureStore/38e8d7.wgsl
index e6bb103..713b571 100644
--- a/test/intrinsics/gen/textureStore/38e8d7.wgsl
+++ b/test/intrinsics/gen/textureStore/38e8d7.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_38e8d7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.hlsl
index 23abfe3..10ad900 100644
--- a/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<uint4> arg_0 : register(u0, space1);
void textureStore_38e8d7() {
arg_0[int3(0, 0, 1)] = uint4(0u, 0u, 0u, 0u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_38e8d7();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.spvasm
index fd1b989..1a7da57 100644
--- a/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_38e8d7 "textureStore_38e8d7"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,35 +32,47 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 R32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%v4uint = OpTypeVector %uint 4
- %21 = OpConstantNull %v4uint
+ %25 = OpConstantNull %v4uint
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_38e8d7 = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %19 %21
+%textureStore_38e8d7 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %23 %25
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureStore_38e8d7
+ %33 = OpFunctionCall %void %textureStore_38e8d7
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureStore_38e8d7
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_38e8d7
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureStore_38e8d7
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_38e8d7
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.wgsl
index 50a53ca..f87ee3e 100644
--- a/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_38e8d7();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/3a52ac.wgsl b/test/intrinsics/gen/textureStore/3a52ac.wgsl
index c815964..30e16f0 100644
--- a/test/intrinsics/gen/textureStore/3a52ac.wgsl
+++ b/test/intrinsics/gen/textureStore/3a52ac.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_3a52ac();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.hlsl
index 1ccbf60..fa6c84b 100644
--- a/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<int4> arg_0 : register(u0, space1);
void textureStore_3a52ac() {
arg_0[int3(0, 0, 1)] = int4(0, 0, 0, 0);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_3a52ac();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.spvasm
index c033a5b..04f98b5 100644
--- a/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_3a52ac "textureStore_3a52ac"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,34 +32,46 @@
%7 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %18 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%v4int = OpTypeVector %int 4
- %20 = OpConstantNull %v4int
+ %24 = OpConstantNull %v4int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_3a52ac = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %18 %20
+%textureStore_3a52ac = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %22 %24
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureStore_3a52ac
+ %32 = OpFunctionCall %void %textureStore_3a52ac
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureStore_3a52ac
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureStore_3a52ac
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureStore_3a52ac
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureStore_3a52ac
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.wgsl
index 85d39aa..2eadd38 100644
--- a/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_3a52ac();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/3bb7a1.wgsl b/test/intrinsics/gen/textureStore/3bb7a1.wgsl
index 3ee4fd6..ce30a0c 100644
--- a/test/intrinsics/gen/textureStore/3bb7a1.wgsl
+++ b/test/intrinsics/gen/textureStore/3bb7a1.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_3bb7a1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.hlsl
index a8c5ece..1d0803d 100644
--- a/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<float4> arg_0 : register(u0, space1);
void textureStore_3bb7a1() {
arg_0[int3(0, 0, 1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_3bb7a1();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.spvasm
index 312d773..4c4f9d4 100644
--- a/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_3bb7a1 "textureStore_3bb7a1"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -27,35 +31,45 @@
%7 = OpTypeImage %float 2D 0 1 0 2 R32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %18 = OpConstantComposite %v3int %int_0 %int_0 %int_1
- %v4float = OpTypeVector %float 4
- %20 = OpConstantNull %v4float
+ %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_3bb7a1 = OpFunction %void None %8
- %11 = OpLabel
- %13 = OpLoad %7 %arg_0
- OpImageWrite %13 %18 %20
+%textureStore_3bb7a1 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %7 %arg_0
+ OpImageWrite %17 %22 %11
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
- OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureStore_3bb7a1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
%26 = OpLabel
- %27 = OpFunctionCall %void %textureStore_3bb7a1
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
%30 = OpFunctionCall %void %textureStore_3bb7a1
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_3bb7a1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_3bb7a1
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.wgsl
index 87ece03..3171def 100644
--- a/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_3bb7a1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/3bec15.wgsl b/test/intrinsics/gen/textureStore/3bec15.wgsl
index aad435e..3493941 100644
--- a/test/intrinsics/gen/textureStore/3bec15.wgsl
+++ b/test/intrinsics/gen/textureStore/3bec15.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_3bec15();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.hlsl
index cfcedd9..9dc0ea8 100644
--- a/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<uint4> arg_0 : register(u0, space1);
void textureStore_3bec15() {
arg_0[1] = uint4(0u, 0u, 0u, 0u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_3bec15();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.spvasm
index 5a80a9d..fcd3c0c 100644
--- a/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_3bec15 "textureStore_3bec15"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,32 +33,44 @@
%7 = OpTypeImage %uint 1D 0 0 0 2 Rgba8ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v4uint = OpTypeVector %uint 4
- %18 = OpConstantNull %v4uint
+ %22 = OpConstantNull %v4uint
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_3bec15 = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %int_1 %18
+%textureStore_3bec15 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %int_1 %22
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_3bec15
+ %30 = OpFunctionCall %void %textureStore_3bec15
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_3bec15
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_3bec15
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureStore_3bec15
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_3bec15
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.wgsl
index 2cadcbe..be5532b 100644
--- a/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_3bec15();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/441ba8.wgsl b/test/intrinsics/gen/textureStore/441ba8.wgsl
index 5846c1c..212fdf2 100644
--- a/test/intrinsics/gen/textureStore/441ba8.wgsl
+++ b/test/intrinsics/gen/textureStore/441ba8.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_441ba8();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.hlsl
index c980a0e..9065ca8 100644
--- a/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<uint4> arg_0 : register(u0, space1);
void textureStore_441ba8() {
arg_0[int3(0, 0, 0)] = uint4(0u, 0u, 0u, 0u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_441ba8();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.spvasm
index 40cc744..68e35fc 100644
--- a/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_441ba8 "textureStore_441ba8"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,33 +32,45 @@
%7 = OpTypeImage %uint 3D 0 0 0 2 Rgba32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %17 = OpConstantNull %v3int
+ %21 = OpConstantNull %v3int
%v4uint = OpTypeVector %uint 4
- %19 = OpConstantNull %v4uint
+ %23 = OpConstantNull %v4uint
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_441ba8 = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %17 %19
+%textureStore_441ba8 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %21 %23
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureStore_441ba8
+ %31 = OpFunctionCall %void %textureStore_441ba8
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureStore_441ba8
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_441ba8
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureStore_441ba8
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_441ba8
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.wgsl
index ac7be08..6b61a49 100644
--- a/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_441ba8();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/4fc057.wgsl b/test/intrinsics/gen/textureStore/4fc057.wgsl
index cc41511..b7a154f 100644
--- a/test/intrinsics/gen/textureStore/4fc057.wgsl
+++ b/test/intrinsics/gen/textureStore/4fc057.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_4fc057();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.hlsl
index d7021c1..d8ecd13 100644
--- a/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<float4> arg_0 : register(u0, space1);
void textureStore_4fc057() {
arg_0[int3(0, 0, 1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_4fc057();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.spvasm
index 53d44de..bc26ddc 100644
--- a/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_4fc057 "textureStore_4fc057"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -27,35 +31,45 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %18 = OpConstantComposite %v3int %int_0 %int_0 %int_1
- %v4float = OpTypeVector %float 4
- %20 = OpConstantNull %v4float
+ %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_4fc057 = OpFunction %void None %8
- %11 = OpLabel
- %13 = OpLoad %7 %arg_0
- OpImageWrite %13 %18 %20
+%textureStore_4fc057 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %7 %arg_0
+ OpImageWrite %17 %22 %11
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
- OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureStore_4fc057
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
%26 = OpLabel
- %27 = OpFunctionCall %void %textureStore_4fc057
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
%30 = OpFunctionCall %void %textureStore_4fc057
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_4fc057
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_4fc057
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.wgsl
index 1a909f8..4c0fd68 100644
--- a/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_4fc057();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/5a2f8f.wgsl b/test/intrinsics/gen/textureStore/5a2f8f.wgsl
index 063eecc..ae4c491 100644
--- a/test/intrinsics/gen/textureStore/5a2f8f.wgsl
+++ b/test/intrinsics/gen/textureStore/5a2f8f.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_5a2f8f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.hlsl
index 88412b5..498961a 100644
--- a/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<int4> arg_0 : register(u0, space1);
void textureStore_5a2f8f() {
arg_0[1] = int4(0, 0, 0, 0);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_5a2f8f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.spvasm
index 269e38c..fb58460 100644
--- a/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_5a2f8f "textureStore_5a2f8f"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,31 +33,43 @@
%7 = OpTypeImage %int 1D 0 0 0 2 Rgba16i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int_1 = OpConstant %int 1
%v4int = OpTypeVector %int 4
- %17 = OpConstantNull %v4int
+ %21 = OpConstantNull %v4int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_5a2f8f = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %int_1 %17
+%textureStore_5a2f8f = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %int_1 %21
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureStore_5a2f8f
+ %29 = OpFunctionCall %void %textureStore_5a2f8f
+ %30 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureStore_5a2f8f
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureStore_5a2f8f
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureStore_5a2f8f
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureStore_5a2f8f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.wgsl
index 3053085..adeefea 100644
--- a/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_5a2f8f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/60975f.wgsl b/test/intrinsics/gen/textureStore/60975f.wgsl
index 5500737..3aec6444 100644
--- a/test/intrinsics/gen/textureStore/60975f.wgsl
+++ b/test/intrinsics/gen/textureStore/60975f.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_60975f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/60975f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.hlsl
index e26e62a..0dcc532 100644
--- a/test/intrinsics/gen/textureStore/60975f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<float4> arg_0 : register(u0, space1);
void textureStore_60975f() {
arg_0[int3(0, 0, 1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_60975f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/60975f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.spvasm
index 2336b53..c05e714 100644
--- a/test/intrinsics/gen/textureStore/60975f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_60975f "textureStore_60975f"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -27,35 +31,45 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rgba8
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %18 = OpConstantComposite %v3int %int_0 %int_0 %int_1
- %v4float = OpTypeVector %float 4
- %20 = OpConstantNull %v4float
+ %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_60975f = OpFunction %void None %8
- %11 = OpLabel
- %13 = OpLoad %7 %arg_0
- OpImageWrite %13 %18 %20
+%textureStore_60975f = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %7 %arg_0
+ OpImageWrite %17 %22 %11
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
- OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureStore_60975f
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
%26 = OpLabel
- %27 = OpFunctionCall %void %textureStore_60975f
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
%30 = OpFunctionCall %void %textureStore_60975f
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_60975f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_60975f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/60975f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.wgsl
index c7689fc..2391366 100644
--- a/test/intrinsics/gen/textureStore/60975f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_60975f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/682fd6.wgsl b/test/intrinsics/gen/textureStore/682fd6.wgsl
index ec1f1ae..3aae9c4 100644
--- a/test/intrinsics/gen/textureStore/682fd6.wgsl
+++ b/test/intrinsics/gen/textureStore/682fd6.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_682fd6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.hlsl
index 3a8b9d0..0dced90 100644
--- a/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<uint4> arg_0 : register(u0, space1);
void textureStore_682fd6() {
arg_0[int2(0, 0)] = uint4(0u, 0u, 0u, 0u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_682fd6();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.spvasm
index 646031d..6ba0216 100644
--- a/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_682fd6 "textureStore_682fd6"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,33 +33,45 @@
%7 = OpTypeImage %uint 2D 0 0 0 2 Rg32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %17 = OpConstantNull %v2int
+ %21 = OpConstantNull %v2int
%v4uint = OpTypeVector %uint 4
- %19 = OpConstantNull %v4uint
+ %23 = OpConstantNull %v4uint
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_682fd6 = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %17 %19
+%textureStore_682fd6 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %21 %23
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureStore_682fd6
+ %31 = OpFunctionCall %void %textureStore_682fd6
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureStore_682fd6
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_682fd6
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureStore_682fd6
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_682fd6
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.wgsl
index 0bfa046..7dcc695 100644
--- a/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_682fd6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/6b75c3.wgsl b/test/intrinsics/gen/textureStore/6b75c3.wgsl
index 187bba1..84367ba 100644
--- a/test/intrinsics/gen/textureStore/6b75c3.wgsl
+++ b/test/intrinsics/gen/textureStore/6b75c3.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_6b75c3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.hlsl
index 677e584..c561e4c 100644
--- a/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<float4> arg_0 : register(u0, space1);
void textureStore_6b75c3() {
arg_0[1] = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_6b75c3();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.spvasm
index 51ee16a..d373c99 100644
--- a/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 35
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_6b75c3 "textureStore_6b75c3"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,32 +32,42 @@
%7 = OpTypeImage %float 1D 0 0 0 2 Rgba32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
- %v4float = OpTypeVector %float 4
- %17 = OpConstantNull %v4float
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_6b75c3 = OpFunction %void None %8
- %11 = OpLabel
- %13 = OpLoad %7 %arg_0
- OpImageWrite %13 %int_1 %17
+%textureStore_6b75c3 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %7 %arg_0
+ OpImageWrite %17 %int_1 %11
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
- OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureStore_6b75c3
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
%23 = OpLabel
- %24 = OpFunctionCall %void %textureStore_6b75c3
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %25 = OpLabel
+ OpStore %tint_pointsize %float_1
%27 = OpFunctionCall %void %textureStore_6b75c3
+ %28 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureStore_6b75c3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_6b75c3
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.wgsl
index 54e64b0..6ed15c6 100644
--- a/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_6b75c3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/6b80d2.wgsl b/test/intrinsics/gen/textureStore/6b80d2.wgsl
index cfded42..df54e40 100644
--- a/test/intrinsics/gen/textureStore/6b80d2.wgsl
+++ b/test/intrinsics/gen/textureStore/6b80d2.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_6b80d2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.hlsl
index eac402e..57de36d 100644
--- a/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<int4> arg_0 : register(u0, space1);
void textureStore_6b80d2() {
arg_0[1] = int4(0, 0, 0, 0);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_6b80d2();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.spvasm
index 2ec370c..87ed017 100644
--- a/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_6b80d2 "textureStore_6b80d2"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,31 +33,43 @@
%7 = OpTypeImage %int 1D 0 0 0 2 R32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int_1 = OpConstant %int 1
%v4int = OpTypeVector %int 4
- %17 = OpConstantNull %v4int
+ %21 = OpConstantNull %v4int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_6b80d2 = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %int_1 %17
+%textureStore_6b80d2 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %int_1 %21
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureStore_6b80d2
+ %29 = OpFunctionCall %void %textureStore_6b80d2
+ %30 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureStore_6b80d2
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureStore_6b80d2
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureStore_6b80d2
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureStore_6b80d2
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.wgsl
index 6ab7b61..6e06e4f 100644
--- a/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_6b80d2();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/6cff2e.wgsl b/test/intrinsics/gen/textureStore/6cff2e.wgsl
index 987f5fe..cf3b83a 100644
--- a/test/intrinsics/gen/textureStore/6cff2e.wgsl
+++ b/test/intrinsics/gen/textureStore/6cff2e.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_6cff2e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.hlsl
index e149a2a..90f7d83 100644
--- a/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<uint4> arg_0 : register(u0, space1);
void textureStore_6cff2e() {
arg_0[int2(0, 0)] = uint4(0u, 0u, 0u, 0u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_6cff2e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.spvasm
index 83a83e7..30fbe9b 100644
--- a/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_6cff2e "textureStore_6cff2e"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,33 +32,45 @@
%7 = OpTypeImage %uint 2D 0 0 0 2 R32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %17 = OpConstantNull %v2int
+ %21 = OpConstantNull %v2int
%v4uint = OpTypeVector %uint 4
- %19 = OpConstantNull %v4uint
+ %23 = OpConstantNull %v4uint
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_6cff2e = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %17 %19
+%textureStore_6cff2e = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %21 %23
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureStore_6cff2e
+ %31 = OpFunctionCall %void %textureStore_6cff2e
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureStore_6cff2e
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_6cff2e
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureStore_6cff2e
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_6cff2e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.wgsl
index 85ea47f9..900cfea 100644
--- a/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_6cff2e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/6da692.wgsl b/test/intrinsics/gen/textureStore/6da692.wgsl
index e811e01..36f45e7 100644
--- a/test/intrinsics/gen/textureStore/6da692.wgsl
+++ b/test/intrinsics/gen/textureStore/6da692.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_6da692();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/6da692.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.hlsl
index 716225b..19a1b5f 100644
--- a/test/intrinsics/gen/textureStore/6da692.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<uint4> arg_0 : register(u0, space1);
void textureStore_6da692() {
arg_0[int3(0, 0, 1)] = uint4(0u, 0u, 0u, 0u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_6da692();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/6da692.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.spvasm
index 6f6bf71..6fd25b4 100644
--- a/test/intrinsics/gen/textureStore/6da692.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_6da692 "textureStore_6da692"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,35 +32,47 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%v4uint = OpTypeVector %uint 4
- %21 = OpConstantNull %v4uint
+ %25 = OpConstantNull %v4uint
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_6da692 = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %19 %21
+%textureStore_6da692 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %23 %25
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureStore_6da692
+ %33 = OpFunctionCall %void %textureStore_6da692
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureStore_6da692
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_6da692
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureStore_6da692
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_6da692
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/6da692.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.wgsl
index da17065..eec8577 100644
--- a/test/intrinsics/gen/textureStore/6da692.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_6da692();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/731349.wgsl b/test/intrinsics/gen/textureStore/731349.wgsl
index ad47ce9..1cf802a 100644
--- a/test/intrinsics/gen/textureStore/731349.wgsl
+++ b/test/intrinsics/gen/textureStore/731349.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_731349();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/731349.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/731349.wgsl.expected.hlsl
index c6530ca..3a80494 100644
--- a/test/intrinsics/gen/textureStore/731349.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/731349.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<float4> arg_0 : register(u0, space1);
void textureStore_731349() {
arg_0[int2(0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_731349();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/731349.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/731349.wgsl.expected.spvasm
index 577af62..58b625f 100644
--- a/test/intrinsics/gen/textureStore/731349.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/731349.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 36
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_731349 "textureStore_731349"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -27,33 +31,43 @@
%7 = OpTypeImage %float 2D 0 0 0 2 Rgba8
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %16 = OpConstantNull %v2int
- %v4float = OpTypeVector %float 4
- %18 = OpConstantNull %v4float
+ %20 = OpConstantNull %v2int
+ %21 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_731349 = OpFunction %void None %8
- %11 = OpLabel
- %13 = OpLoad %7 %arg_0
- OpImageWrite %13 %16 %18
+%textureStore_731349 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %7 %arg_0
+ OpImageWrite %17 %20 %11
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
- OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_731349
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %21
+%tint_symbol = OpFunctionParameter %v4float
%24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_731349
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %26 = OpLabel
+ OpStore %tint_pointsize %float_1
%28 = OpFunctionCall %void %textureStore_731349
+ %29 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureStore_731349
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_731349
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/731349.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/731349.wgsl.expected.wgsl
index 5b527d8..3dc131c 100644
--- a/test/intrinsics/gen/textureStore/731349.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/731349.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_731349();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/752da6.wgsl b/test/intrinsics/gen/textureStore/752da6.wgsl
index 4424bb3..8f50b09 100644
--- a/test/intrinsics/gen/textureStore/752da6.wgsl
+++ b/test/intrinsics/gen/textureStore/752da6.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_752da6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/752da6.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.hlsl
index 60c15a1..3ab3bcc 100644
--- a/test/intrinsics/gen/textureStore/752da6.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<int4> arg_0 : register(u0, space1);
void textureStore_752da6() {
arg_0[int2(0, 0)] = int4(0, 0, 0, 0);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_752da6();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/752da6.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.spvasm
index 4219376..6aa38f4 100644
--- a/test/intrinsics/gen/textureStore/752da6.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_752da6 "textureStore_752da6"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,32 +32,44 @@
%7 = OpTypeImage %int 2D 0 0 0 2 Rgba32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
- %16 = OpConstantNull %v2int
+ %20 = OpConstantNull %v2int
%v4int = OpTypeVector %int 4
- %18 = OpConstantNull %v4int
+ %22 = OpConstantNull %v4int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_752da6 = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %16 %18
+%textureStore_752da6 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %20 %22
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_752da6
+ %30 = OpFunctionCall %void %textureStore_752da6
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_752da6
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_752da6
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureStore_752da6
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_752da6
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/752da6.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.wgsl
index 2348d36..8f5dfb6 100644
--- a/test/intrinsics/gen/textureStore/752da6.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_752da6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/77c0ae.wgsl b/test/intrinsics/gen/textureStore/77c0ae.wgsl
index bce5f33..ef9f8ed 100644
--- a/test/intrinsics/gen/textureStore/77c0ae.wgsl
+++ b/test/intrinsics/gen/textureStore/77c0ae.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_77c0ae();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.hlsl
index 9705f28..29ed738 100644
--- a/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<uint4> arg_0 : register(u0, space1);
void textureStore_77c0ae() {
arg_0[int2(0, 0)] = uint4(0u, 0u, 0u, 0u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_77c0ae();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.spvasm
index 7434c65..22b93d4 100644
--- a/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_77c0ae "textureStore_77c0ae"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,33 +32,45 @@
%7 = OpTypeImage %uint 2D 0 0 0 2 Rgba8ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %17 = OpConstantNull %v2int
+ %21 = OpConstantNull %v2int
%v4uint = OpTypeVector %uint 4
- %19 = OpConstantNull %v4uint
+ %23 = OpConstantNull %v4uint
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_77c0ae = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %17 %19
+%textureStore_77c0ae = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %21 %23
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureStore_77c0ae
+ %31 = OpFunctionCall %void %textureStore_77c0ae
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureStore_77c0ae
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_77c0ae
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureStore_77c0ae
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_77c0ae
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.wgsl
index 8ff941a..434cae5 100644
--- a/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_77c0ae();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/7cec8d.wgsl b/test/intrinsics/gen/textureStore/7cec8d.wgsl
index 7bf0a3b..4399d59 100644
--- a/test/intrinsics/gen/textureStore/7cec8d.wgsl
+++ b/test/intrinsics/gen/textureStore/7cec8d.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_7cec8d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.hlsl
index 2068667..51ffaac 100644
--- a/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<int4> arg_0 : register(u0, space1);
void textureStore_7cec8d() {
arg_0[int3(0, 0, 1)] = int4(0, 0, 0, 0);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_7cec8d();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.spvasm
index 359d905..47d10a8 100644
--- a/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_7cec8d "textureStore_7cec8d"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,34 +32,46 @@
%7 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %18 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%v4int = OpTypeVector %int 4
- %20 = OpConstantNull %v4int
+ %24 = OpConstantNull %v4int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_7cec8d = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %18 %20
+%textureStore_7cec8d = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %22 %24
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureStore_7cec8d
+ %32 = OpFunctionCall %void %textureStore_7cec8d
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureStore_7cec8d
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureStore_7cec8d
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureStore_7cec8d
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureStore_7cec8d
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.wgsl
index 3ba2f7f..420fd1c 100644
--- a/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_7cec8d();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/7f7fae.wgsl b/test/intrinsics/gen/textureStore/7f7fae.wgsl
index 203a4a5..de0b3e9 100644
--- a/test/intrinsics/gen/textureStore/7f7fae.wgsl
+++ b/test/intrinsics/gen/textureStore/7f7fae.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_7f7fae();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.hlsl
index 0242359..1da528f 100644
--- a/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<float4> arg_0 : register(u0, space1);
void textureStore_7f7fae() {
arg_0[1] = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_7f7fae();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.spvasm
index 6adb368..d8b70fe 100644
--- a/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 35
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_7f7fae "textureStore_7f7fae"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,32 +32,42 @@
%7 = OpTypeImage %float 1D 0 0 0 2 Rgba8
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
- %v4float = OpTypeVector %float 4
- %17 = OpConstantNull %v4float
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_7f7fae = OpFunction %void None %8
- %11 = OpLabel
- %13 = OpLoad %7 %arg_0
- OpImageWrite %13 %int_1 %17
+%textureStore_7f7fae = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %7 %arg_0
+ OpImageWrite %17 %int_1 %11
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
- OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureStore_7f7fae
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
%23 = OpLabel
- %24 = OpFunctionCall %void %textureStore_7f7fae
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %25 = OpLabel
+ OpStore %tint_pointsize %float_1
%27 = OpFunctionCall %void %textureStore_7f7fae
+ %28 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureStore_7f7fae
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_7f7fae
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.wgsl
index e8ec3ee..d0bd9f3 100644
--- a/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_7f7fae();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/804942.wgsl b/test/intrinsics/gen/textureStore/804942.wgsl
index a27738f..44ae89d 100644
--- a/test/intrinsics/gen/textureStore/804942.wgsl
+++ b/test/intrinsics/gen/textureStore/804942.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_804942();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/804942.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/804942.wgsl.expected.hlsl
index 226ade1..b835e33 100644
--- a/test/intrinsics/gen/textureStore/804942.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/804942.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<int4> arg_0 : register(u0, space1);
void textureStore_804942() {
arg_0[int2(0, 0)] = int4(0, 0, 0, 0);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_804942();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/804942.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/804942.wgsl.expected.spvasm
index 2a1b747..f7b77bb 100644
--- a/test/intrinsics/gen/textureStore/804942.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/804942.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_804942 "textureStore_804942"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,32 +32,44 @@
%7 = OpTypeImage %int 2D 0 0 0 2 R32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
- %16 = OpConstantNull %v2int
+ %20 = OpConstantNull %v2int
%v4int = OpTypeVector %int 4
- %18 = OpConstantNull %v4int
+ %22 = OpConstantNull %v4int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_804942 = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %16 %18
+%textureStore_804942 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %20 %22
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_804942
+ %30 = OpFunctionCall %void %textureStore_804942
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_804942
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_804942
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureStore_804942
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_804942
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/804942.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/804942.wgsl.expected.wgsl
index ed39788..3306d47 100644
--- a/test/intrinsics/gen/textureStore/804942.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/804942.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_804942();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/805dae.wgsl b/test/intrinsics/gen/textureStore/805dae.wgsl
index 427a6a2..45c740a 100644
--- a/test/intrinsics/gen/textureStore/805dae.wgsl
+++ b/test/intrinsics/gen/textureStore/805dae.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_805dae();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/805dae.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.hlsl
index 1556ee1..fee8e1b 100644
--- a/test/intrinsics/gen/textureStore/805dae.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<float4> arg_0 : register(u0, space1);
void textureStore_805dae() {
arg_0[int2(0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_805dae();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/805dae.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.spvasm
index bdb0957..6a2d386 100644
--- a/test/intrinsics/gen/textureStore/805dae.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 36
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_805dae "textureStore_805dae"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -27,33 +31,43 @@
%7 = OpTypeImage %float 2D 0 0 0 2 Rgba8Snorm
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %16 = OpConstantNull %v2int
- %v4float = OpTypeVector %float 4
- %18 = OpConstantNull %v4float
+ %20 = OpConstantNull %v2int
+ %21 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_805dae = OpFunction %void None %8
- %11 = OpLabel
- %13 = OpLoad %7 %arg_0
- OpImageWrite %13 %16 %18
+%textureStore_805dae = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %7 %arg_0
+ OpImageWrite %17 %20 %11
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
- OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_805dae
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %21
+%tint_symbol = OpFunctionParameter %v4float
%24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_805dae
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %26 = OpLabel
+ OpStore %tint_pointsize %float_1
%28 = OpFunctionCall %void %textureStore_805dae
+ %29 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureStore_805dae
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_805dae
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/805dae.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.wgsl
index 8fd5751..2e0e003 100644
--- a/test/intrinsics/gen/textureStore/805dae.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_805dae();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/83bcc1.wgsl b/test/intrinsics/gen/textureStore/83bcc1.wgsl
index c951df7..a8951d1 100644
--- a/test/intrinsics/gen/textureStore/83bcc1.wgsl
+++ b/test/intrinsics/gen/textureStore/83bcc1.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_83bcc1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.hlsl
index c03732f..bb4b8eb 100644
--- a/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<uint4> arg_0 : register(u0, space1);
void textureStore_83bcc1() {
arg_0[1] = uint4(0u, 0u, 0u, 0u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_83bcc1();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.spvasm
index ddd4726..7165fd8 100644
--- a/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_83bcc1 "textureStore_83bcc1"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,32 +34,44 @@
%7 = OpTypeImage %uint 1D 0 0 0 2 Rg32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v4uint = OpTypeVector %uint 4
- %18 = OpConstantNull %v4uint
+ %22 = OpConstantNull %v4uint
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_83bcc1 = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %int_1 %18
+%textureStore_83bcc1 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %int_1 %22
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_83bcc1
+ %30 = OpFunctionCall %void %textureStore_83bcc1
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_83bcc1
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_83bcc1
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureStore_83bcc1
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_83bcc1
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.wgsl
index 6a2ee41..7659600 100644
--- a/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_83bcc1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/872747.wgsl b/test/intrinsics/gen/textureStore/872747.wgsl
index f379316..840b126 100644
--- a/test/intrinsics/gen/textureStore/872747.wgsl
+++ b/test/intrinsics/gen/textureStore/872747.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_872747();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/872747.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/872747.wgsl.expected.hlsl
index 26076b1f..e00dfbd 100644
--- a/test/intrinsics/gen/textureStore/872747.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/872747.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<float4> arg_0 : register(u0, space1);
void textureStore_872747() {
arg_0[1] = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_872747();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/872747.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/872747.wgsl.expected.spvasm
index 1a704f6..a6fa3f3 100644
--- a/test/intrinsics/gen/textureStore/872747.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/872747.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 35
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_872747 "textureStore_872747"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,32 +33,42 @@
%7 = OpTypeImage %float 1D 0 0 0 2 Rg32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
- %v4float = OpTypeVector %float 4
- %17 = OpConstantNull %v4float
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_872747 = OpFunction %void None %8
- %11 = OpLabel
- %13 = OpLoad %7 %arg_0
- OpImageWrite %13 %int_1 %17
+%textureStore_872747 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %7 %arg_0
+ OpImageWrite %17 %int_1 %11
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
- OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureStore_872747
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
%23 = OpLabel
- %24 = OpFunctionCall %void %textureStore_872747
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %25 = OpLabel
+ OpStore %tint_pointsize %float_1
%27 = OpFunctionCall %void %textureStore_872747
+ %28 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureStore_872747
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_872747
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/872747.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/872747.wgsl.expected.wgsl
index ff7a941..084d473 100644
--- a/test/intrinsics/gen/textureStore/872747.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/872747.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_872747();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/8e0479.wgsl b/test/intrinsics/gen/textureStore/8e0479.wgsl
index 9420a69..75dce21 100644
--- a/test/intrinsics/gen/textureStore/8e0479.wgsl
+++ b/test/intrinsics/gen/textureStore/8e0479.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_8e0479();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.hlsl
index b9dc391..ca6ebdc 100644
--- a/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<uint4> arg_0 : register(u0, space1);
void textureStore_8e0479() {
arg_0[int3(0, 0, 1)] = uint4(0u, 0u, 0u, 0u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_8e0479();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.spvasm
index b8b2544..5db1630 100644
--- a/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_8e0479 "textureStore_8e0479"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,35 +32,47 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%v4uint = OpTypeVector %uint 4
- %21 = OpConstantNull %v4uint
+ %25 = OpConstantNull %v4uint
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_8e0479 = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %19 %21
+%textureStore_8e0479 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %23 %25
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureStore_8e0479
+ %33 = OpFunctionCall %void %textureStore_8e0479
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureStore_8e0479
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_8e0479
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureStore_8e0479
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_8e0479
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.wgsl
index 5dcee17..f390e47 100644
--- a/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_8e0479();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/8f71a1.wgsl b/test/intrinsics/gen/textureStore/8f71a1.wgsl
index 268f13b..1b56276 100644
--- a/test/intrinsics/gen/textureStore/8f71a1.wgsl
+++ b/test/intrinsics/gen/textureStore/8f71a1.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_8f71a1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.hlsl
index 1a241c9..614cc38 100644
--- a/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<int4> arg_0 : register(u0, space1);
void textureStore_8f71a1() {
arg_0[int3(0, 0, 0)] = int4(0, 0, 0, 0);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_8f71a1();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.spvasm
index 1cf5015..4380aac 100644
--- a/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_8f71a1 "textureStore_8f71a1"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,32 +32,44 @@
%7 = OpTypeImage %int 3D 0 0 0 2 Rgba16i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
- %16 = OpConstantNull %v3int
+ %20 = OpConstantNull %v3int
%v4int = OpTypeVector %int 4
- %18 = OpConstantNull %v4int
+ %22 = OpConstantNull %v4int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_8f71a1 = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %16 %18
+%textureStore_8f71a1 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %20 %22
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_8f71a1
+ %30 = OpFunctionCall %void %textureStore_8f71a1
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_8f71a1
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_8f71a1
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureStore_8f71a1
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_8f71a1
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.wgsl
index 1f64e85..a6df58a 100644
--- a/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_8f71a1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/969534.wgsl b/test/intrinsics/gen/textureStore/969534.wgsl
index f80fdf4..158f0b5 100644
--- a/test/intrinsics/gen/textureStore/969534.wgsl
+++ b/test/intrinsics/gen/textureStore/969534.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_969534();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/969534.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/969534.wgsl.expected.hlsl
index 974bcd9..9b94d3f 100644
--- a/test/intrinsics/gen/textureStore/969534.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/969534.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<int4> arg_0 : register(u0, space1);
void textureStore_969534() {
arg_0[1] = int4(0, 0, 0, 0);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_969534();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/969534.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/969534.wgsl.expected.spvasm
index 0d2b25b..bd8a1cc 100644
--- a/test/intrinsics/gen/textureStore/969534.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/969534.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_969534 "textureStore_969534"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,31 +33,43 @@
%7 = OpTypeImage %int 1D 0 0 0 2 Rgba32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int_1 = OpConstant %int 1
%v4int = OpTypeVector %int 4
- %17 = OpConstantNull %v4int
+ %21 = OpConstantNull %v4int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_969534 = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %int_1 %17
+%textureStore_969534 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %int_1 %21
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureStore_969534
+ %29 = OpFunctionCall %void %textureStore_969534
+ %30 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureStore_969534
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureStore_969534
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureStore_969534
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureStore_969534
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/969534.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/969534.wgsl.expected.wgsl
index 53e571f..bda2165 100644
--- a/test/intrinsics/gen/textureStore/969534.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/969534.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_969534();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/9a3ecc.wgsl b/test/intrinsics/gen/textureStore/9a3ecc.wgsl
index 3ba13a4..0d73175 100644
--- a/test/intrinsics/gen/textureStore/9a3ecc.wgsl
+++ b/test/intrinsics/gen/textureStore/9a3ecc.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_9a3ecc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.hlsl
index 7252b71..2d6881c 100644
--- a/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<int4> arg_0 : register(u0, space1);
void textureStore_9a3ecc() {
arg_0[int3(0, 0, 0)] = int4(0, 0, 0, 0);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_9a3ecc();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.spvasm
index 16257e8..65be593 100644
--- a/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_9a3ecc "textureStore_9a3ecc"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,32 +32,44 @@
%7 = OpTypeImage %int 3D 0 0 0 2 Rgba32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
- %16 = OpConstantNull %v3int
+ %20 = OpConstantNull %v3int
%v4int = OpTypeVector %int 4
- %18 = OpConstantNull %v4int
+ %22 = OpConstantNull %v4int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_9a3ecc = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %16 %18
+%textureStore_9a3ecc = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %20 %22
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_9a3ecc
+ %30 = OpFunctionCall %void %textureStore_9a3ecc
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_9a3ecc
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_9a3ecc
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureStore_9a3ecc
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_9a3ecc
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.wgsl
index 727c546..1b3385b 100644
--- a/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_9a3ecc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/9d9cd5.wgsl b/test/intrinsics/gen/textureStore/9d9cd5.wgsl
index 4f2a3f3..02eb723 100644
--- a/test/intrinsics/gen/textureStore/9d9cd5.wgsl
+++ b/test/intrinsics/gen/textureStore/9d9cd5.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_9d9cd5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.hlsl
index 8c4350d..43971ad 100644
--- a/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<float4> arg_0 : register(u0, space1);
void textureStore_9d9cd5() {
arg_0[int3(0, 0, 1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_9d9cd5();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.spvasm
index a719ffe..52c2c66 100644
--- a/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_9d9cd5 "textureStore_9d9cd5"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -27,35 +31,45 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %18 = OpConstantComposite %v3int %int_0 %int_0 %int_1
- %v4float = OpTypeVector %float 4
- %20 = OpConstantNull %v4float
+ %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_9d9cd5 = OpFunction %void None %8
- %11 = OpLabel
- %13 = OpLoad %7 %arg_0
- OpImageWrite %13 %18 %20
+%textureStore_9d9cd5 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %7 %arg_0
+ OpImageWrite %17 %22 %11
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
- OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureStore_9d9cd5
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
%26 = OpLabel
- %27 = OpFunctionCall %void %textureStore_9d9cd5
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
%30 = OpFunctionCall %void %textureStore_9d9cd5
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_9d9cd5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_9d9cd5
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.wgsl
index 6152a0c..ca75315 100644
--- a/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_9d9cd5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/9e3ec5.wgsl b/test/intrinsics/gen/textureStore/9e3ec5.wgsl
index 4e4d687..6a69442 100644
--- a/test/intrinsics/gen/textureStore/9e3ec5.wgsl
+++ b/test/intrinsics/gen/textureStore/9e3ec5.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_9e3ec5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.hlsl
index 99edc0a..310f67b 100644
--- a/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<int4> arg_0 : register(u0, space1);
void textureStore_9e3ec5() {
arg_0[int2(0, 0)] = int4(0, 0, 0, 0);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_9e3ec5();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.spvasm
index d9595b1..660a80b 100644
--- a/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_9e3ec5 "textureStore_9e3ec5"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,32 +32,44 @@
%7 = OpTypeImage %int 2D 0 0 0 2 Rgba16i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
- %16 = OpConstantNull %v2int
+ %20 = OpConstantNull %v2int
%v4int = OpTypeVector %int 4
- %18 = OpConstantNull %v4int
+ %22 = OpConstantNull %v4int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_9e3ec5 = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %16 %18
+%textureStore_9e3ec5 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %20 %22
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_9e3ec5
+ %30 = OpFunctionCall %void %textureStore_9e3ec5
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_9e3ec5
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_9e3ec5
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureStore_9e3ec5
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_9e3ec5
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.wgsl
index c098780..97220bf 100644
--- a/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_9e3ec5();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/ac67aa.wgsl b/test/intrinsics/gen/textureStore/ac67aa.wgsl
index e0a32bd..5e91609 100644
--- a/test/intrinsics/gen/textureStore/ac67aa.wgsl
+++ b/test/intrinsics/gen/textureStore/ac67aa.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_ac67aa();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.hlsl
index f888070..7185f53 100644
--- a/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<uint4> arg_0 : register(u0, space1);
void textureStore_ac67aa() {
arg_0[int3(0, 0, 0)] = uint4(0u, 0u, 0u, 0u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_ac67aa();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.spvasm
index 9df59a8..2df2253 100644
--- a/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_ac67aa "textureStore_ac67aa"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,33 +33,45 @@
%7 = OpTypeImage %uint 3D 0 0 0 2 Rg32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %17 = OpConstantNull %v3int
+ %21 = OpConstantNull %v3int
%v4uint = OpTypeVector %uint 4
- %19 = OpConstantNull %v4uint
+ %23 = OpConstantNull %v4uint
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_ac67aa = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %17 %19
+%textureStore_ac67aa = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %21 %23
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureStore_ac67aa
+ %31 = OpFunctionCall %void %textureStore_ac67aa
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureStore_ac67aa
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_ac67aa
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureStore_ac67aa
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_ac67aa
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.wgsl
index ebf8cc5..f649c8b 100644
--- a/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_ac67aa();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/b706b1.wgsl b/test/intrinsics/gen/textureStore/b706b1.wgsl
index 59b894f..b95081a 100644
--- a/test/intrinsics/gen/textureStore/b706b1.wgsl
+++ b/test/intrinsics/gen/textureStore/b706b1.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_b706b1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.hlsl
index 6c9a134..5ec0692 100644
--- a/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<int4> arg_0 : register(u0, space1);
void textureStore_b706b1() {
arg_0[int3(0, 0, 0)] = int4(0, 0, 0, 0);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_b706b1();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.spvasm
index b46f7cb..e8ce299 100644
--- a/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_b706b1 "textureStore_b706b1"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,32 +32,44 @@
%7 = OpTypeImage %int 3D 0 0 0 2 Rgba8i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
- %16 = OpConstantNull %v3int
+ %20 = OpConstantNull %v3int
%v4int = OpTypeVector %int 4
- %18 = OpConstantNull %v4int
+ %22 = OpConstantNull %v4int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_b706b1 = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %16 %18
+%textureStore_b706b1 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %20 %22
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_b706b1
+ %30 = OpFunctionCall %void %textureStore_b706b1
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_b706b1
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_b706b1
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureStore_b706b1
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_b706b1
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.wgsl
index 6f717da..d5a48e5 100644
--- a/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_b706b1();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/bbcb7f.wgsl b/test/intrinsics/gen/textureStore/bbcb7f.wgsl
index e7b41fb..efad163 100644
--- a/test/intrinsics/gen/textureStore/bbcb7f.wgsl
+++ b/test/intrinsics/gen/textureStore/bbcb7f.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_bbcb7f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.hlsl
index df0868c..95ca423 100644
--- a/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<int4> arg_0 : register(u0, space1);
void textureStore_bbcb7f() {
arg_0[int2(0, 0)] = int4(0, 0, 0, 0);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_bbcb7f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.spvasm
index 56000e5..488c2b5 100644
--- a/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_bbcb7f "textureStore_bbcb7f"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,32 +32,44 @@
%7 = OpTypeImage %int 2D 0 0 0 2 Rgba8i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v2int = OpTypeVector %int 2
- %16 = OpConstantNull %v2int
+ %20 = OpConstantNull %v2int
%v4int = OpTypeVector %int 4
- %18 = OpConstantNull %v4int
+ %22 = OpConstantNull %v4int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_bbcb7f = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %16 %18
+%textureStore_bbcb7f = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %20 %22
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_bbcb7f
+ %30 = OpFunctionCall %void %textureStore_bbcb7f
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_bbcb7f
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_bbcb7f
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureStore_bbcb7f
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_bbcb7f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.wgsl
index af697b0..4c83b97 100644
--- a/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_bbcb7f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/be6e30.wgsl b/test/intrinsics/gen/textureStore/be6e30.wgsl
index 6e1aeb9..c642eed 100644
--- a/test/intrinsics/gen/textureStore/be6e30.wgsl
+++ b/test/intrinsics/gen/textureStore/be6e30.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_be6e30();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.hlsl
index 4918e06..33fc182 100644
--- a/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2D<float4> arg_0 : register(u0, space1);
void textureStore_be6e30() {
arg_0[int2(0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_be6e30();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.spvasm
index ecf44b0..0ad6a57 100644
--- a/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 36
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_be6e30 "textureStore_be6e30"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -27,33 +31,43 @@
%7 = OpTypeImage %float 2D 0 0 0 2 Rgba16f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v2int = OpTypeVector %int 2
- %16 = OpConstantNull %v2int
- %v4float = OpTypeVector %float 4
- %18 = OpConstantNull %v4float
+ %20 = OpConstantNull %v2int
+ %21 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_be6e30 = OpFunction %void None %8
- %11 = OpLabel
- %13 = OpLoad %7 %arg_0
- OpImageWrite %13 %16 %18
+%textureStore_be6e30 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %7 %arg_0
+ OpImageWrite %17 %20 %11
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
- OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_be6e30
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %21
+%tint_symbol = OpFunctionParameter %v4float
%24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_be6e30
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %26 = OpLabel
+ OpStore %tint_pointsize %float_1
%28 = OpFunctionCall %void %textureStore_be6e30
+ %29 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureStore_be6e30
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_be6e30
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.wgsl
index 1bd8d78..cf60e0d 100644
--- a/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_be6e30();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/bf775c.wgsl b/test/intrinsics/gen/textureStore/bf775c.wgsl
index 62c7939..8314743 100644
--- a/test/intrinsics/gen/textureStore/bf775c.wgsl
+++ b/test/intrinsics/gen/textureStore/bf775c.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_bf775c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.hlsl
index 09c1673..5714afa 100644
--- a/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<int4> arg_0 : register(u0, space1);
void textureStore_bf775c() {
arg_0[1] = int4(0, 0, 0, 0);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_bf775c();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.spvasm
index 8c196e4..ad9491a 100644
--- a/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_bf775c "textureStore_bf775c"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,31 +33,43 @@
%7 = OpTypeImage %int 1D 0 0 0 2 Rgba8i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int_1 = OpConstant %int 1
%v4int = OpTypeVector %int 4
- %17 = OpConstantNull %v4int
+ %21 = OpConstantNull %v4int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_bf775c = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %int_1 %17
+%textureStore_bf775c = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %int_1 %21
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureStore_bf775c
+ %29 = OpFunctionCall %void %textureStore_bf775c
+ %30 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureStore_bf775c
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureStore_bf775c
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureStore_bf775c
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureStore_bf775c
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.wgsl
index cc479d1..08ff4cb 100644
--- a/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_bf775c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/c5af1e.wgsl b/test/intrinsics/gen/textureStore/c5af1e.wgsl
index 3cb1ba0..53fa500 100644
--- a/test/intrinsics/gen/textureStore/c5af1e.wgsl
+++ b/test/intrinsics/gen/textureStore/c5af1e.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_c5af1e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.hlsl
index fb29261..2f08e13 100644
--- a/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<float4> arg_0 : register(u0, space1);
void textureStore_c5af1e() {
arg_0[int3(0, 0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_c5af1e();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.spvasm
index fbd7f69..88bfeb1 100644
--- a/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 36
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_c5af1e "textureStore_c5af1e"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -27,33 +31,43 @@
%7 = OpTypeImage %float 3D 0 0 0 2 Rgba16f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %16 = OpConstantNull %v3int
- %v4float = OpTypeVector %float 4
- %18 = OpConstantNull %v4float
+ %20 = OpConstantNull %v3int
+ %21 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_c5af1e = OpFunction %void None %8
- %11 = OpLabel
- %13 = OpLoad %7 %arg_0
- OpImageWrite %13 %16 %18
+%textureStore_c5af1e = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %7 %arg_0
+ OpImageWrite %17 %20 %11
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
- OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_c5af1e
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %21
+%tint_symbol = OpFunctionParameter %v4float
%24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_c5af1e
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %26 = OpLabel
+ OpStore %tint_pointsize %float_1
%28 = OpFunctionCall %void %textureStore_c5af1e
+ %29 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureStore_c5af1e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_c5af1e
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.wgsl
index b973b75..671eef0 100644
--- a/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_c5af1e();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/c863be.wgsl b/test/intrinsics/gen/textureStore/c863be.wgsl
index e4607bb..2dfd759 100644
--- a/test/intrinsics/gen/textureStore/c863be.wgsl
+++ b/test/intrinsics/gen/textureStore/c863be.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_c863be();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/c863be.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.hlsl
index 1301b87..e330dce 100644
--- a/test/intrinsics/gen/textureStore/c863be.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<float4> arg_0 : register(u0, space1);
void textureStore_c863be() {
arg_0[int3(0, 0, 1)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_c863be();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/c863be.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.spvasm
index 2efc16e..e93580e 100644
--- a/test/intrinsics/gen/textureStore/c863be.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_c863be "textureStore_c863be"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,35 +32,45 @@
%7 = OpTypeImage %float 2D 0 1 0 2 Rg32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %18 = OpConstantComposite %v3int %int_0 %int_0 %int_1
- %v4float = OpTypeVector %float 4
- %20 = OpConstantNull %v4float
+ %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_c863be = OpFunction %void None %8
- %11 = OpLabel
- %13 = OpLoad %7 %arg_0
- OpImageWrite %13 %18 %20
+%textureStore_c863be = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %7 %arg_0
+ OpImageWrite %17 %22 %11
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %22 = OpLabel
- OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureStore_c863be
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
%26 = OpLabel
- %27 = OpFunctionCall %void %textureStore_c863be
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %29 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ OpStore %tint_pointsize %float_1
%30 = OpFunctionCall %void %textureStore_c863be
+ %31 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_c863be
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_c863be
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/c863be.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.wgsl
index 849df74..f5d4ab3 100644
--- a/test/intrinsics/gen/textureStore/c863be.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_c863be();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/d73b5c.wgsl b/test/intrinsics/gen/textureStore/d73b5c.wgsl
index a290200..04f8476 100644
--- a/test/intrinsics/gen/textureStore/d73b5c.wgsl
+++ b/test/intrinsics/gen/textureStore/d73b5c.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_d73b5c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.hlsl
index a550f78..bddb309 100644
--- a/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<int4> arg_0 : register(u0, space1);
void textureStore_d73b5c() {
arg_0[1] = int4(0, 0, 0, 0);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_d73b5c();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.spvasm
index 9bd7a5c..d9b7315 100644
--- a/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.spvasm
@@ -1,20 +1,23 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 37
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_d73b5c "textureStore_d73b5c"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -22,6 +25,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -30,31 +34,43 @@
%7 = OpTypeImage %int 1D 0 0 0 2 Rg32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int_1 = OpConstant %int 1
%v4int = OpTypeVector %int 4
- %17 = OpConstantNull %v4int
+ %21 = OpConstantNull %v4int
+ %22 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_d73b5c = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %int_1 %17
+%textureStore_d73b5c = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %int_1 %21
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %19 = OpLabel
+%tint_symbol_2 = OpFunction %void None %22
+%tint_symbol = OpFunctionParameter %v4float
+ %25 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureStore_d73b5c
+ %29 = OpFunctionCall %void %textureStore_d73b5c
+ %30 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %23 = OpLabel
- %24 = OpFunctionCall %void %textureStore_d73b5c
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureStore_d73b5c
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureStore_d73b5c
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureStore_d73b5c
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.wgsl
index 1966313..13b3190 100644
--- a/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_d73b5c();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/dd7d81.wgsl b/test/intrinsics/gen/textureStore/dd7d81.wgsl
index e4ee1e4..4b89356 100644
--- a/test/intrinsics/gen/textureStore/dd7d81.wgsl
+++ b/test/intrinsics/gen/textureStore/dd7d81.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_dd7d81();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.hlsl
index b47a495..bb35e13 100644
--- a/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<float4> arg_0 : register(u0, space1);
void textureStore_dd7d81() {
arg_0[int3(0, 0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_dd7d81();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.spvasm
index c3658e7..7dacd3f 100644
--- a/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 36
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_dd7d81 "textureStore_dd7d81"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -27,33 +31,43 @@
%7 = OpTypeImage %float 3D 0 0 0 2 Rgba8Snorm
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %16 = OpConstantNull %v3int
- %v4float = OpTypeVector %float 4
- %18 = OpConstantNull %v4float
+ %20 = OpConstantNull %v3int
+ %21 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_dd7d81 = OpFunction %void None %8
- %11 = OpLabel
- %13 = OpLoad %7 %arg_0
- OpImageWrite %13 %16 %18
+%textureStore_dd7d81 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %7 %arg_0
+ OpImageWrite %17 %20 %11
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
- OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_dd7d81
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %21
+%tint_symbol = OpFunctionParameter %v4float
%24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_dd7d81
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %26 = OpLabel
+ OpStore %tint_pointsize %float_1
%28 = OpFunctionCall %void %textureStore_dd7d81
+ %29 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureStore_dd7d81
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_dd7d81
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.wgsl
index 7f448d4..487e054 100644
--- a/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_dd7d81();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/dde364.wgsl b/test/intrinsics/gen/textureStore/dde364.wgsl
index 39d1eda..2351bf9 100644
--- a/test/intrinsics/gen/textureStore/dde364.wgsl
+++ b/test/intrinsics/gen/textureStore/dde364.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_dde364();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/dde364.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.hlsl
index cd99618..6f41e23 100644
--- a/test/intrinsics/gen/textureStore/dde364.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<uint4> arg_0 : register(u0, space1);
void textureStore_dde364() {
arg_0[int3(0, 0, 1)] = uint4(0u, 0u, 0u, 0u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_dde364();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/dde364.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.spvasm
index 847c8f1..918c322 100644
--- a/test/intrinsics/gen/textureStore/dde364.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_dde364 "textureStore_dde364"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,35 +33,47 @@
%7 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %19 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %23 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%v4uint = OpTypeVector %uint 4
- %21 = OpConstantNull %v4uint
+ %25 = OpConstantNull %v4uint
+ %26 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_dde364 = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %19 %21
+%textureStore_dde364 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %23 %25
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %23 = OpLabel
+%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol = OpFunctionParameter %v4float
+ %29 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
OpStore %tint_pointsize %float_1
- %25 = OpFunctionCall %void %textureStore_dde364
+ %33 = OpFunctionCall %void %textureStore_dde364
+ %34 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureStore_dde364
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_dde364
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureStore_dde364
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureStore_dde364
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/dde364.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.wgsl
index d03b488..ed94049 100644
--- a/test/intrinsics/gen/textureStore/dde364.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_dde364();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/e885e8.wgsl b/test/intrinsics/gen/textureStore/e885e8.wgsl
index 013bd3a..333af95 100644
--- a/test/intrinsics/gen/textureStore/e885e8.wgsl
+++ b/test/intrinsics/gen/textureStore/e885e8.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_e885e8();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.hlsl
index 110b1fd..8aa9d4c 100644
--- a/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<float4> arg_0 : register(u0, space1);
void textureStore_e885e8() {
arg_0[1] = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_e885e8();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.spvasm
index 0f1837d..db9ea1d 100644
--- a/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 28
+; Bound: 35
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_e885e8 "textureStore_e885e8"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,32 +32,42 @@
%7 = OpTypeImage %float 1D 0 0 0 2 Rgba16f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
- %v4float = OpTypeVector %float 4
- %17 = OpConstantNull %v4float
+ %20 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_e885e8 = OpFunction %void None %8
- %11 = OpLabel
- %13 = OpLoad %7 %arg_0
- OpImageWrite %13 %int_1 %17
+%textureStore_e885e8 = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %7 %arg_0
+ OpImageWrite %17 %int_1 %11
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %19 = OpLabel
- OpStore %tint_pointsize %float_1
- %21 = OpFunctionCall %void %textureStore_e885e8
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %20
+%tint_symbol = OpFunctionParameter %v4float
%23 = OpLabel
- %24 = OpFunctionCall %void %textureStore_e885e8
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %26 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %25 = OpLabel
+ OpStore %tint_pointsize %float_1
%27 = OpFunctionCall %void %textureStore_e885e8
+ %28 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureStore_e885e8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_e885e8
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.wgsl
index e4feafb..53888d3 100644
--- a/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_e885e8();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/eb702f.wgsl b/test/intrinsics/gen/textureStore/eb702f.wgsl
index 040b104..ab19ba0 100644
--- a/test/intrinsics/gen/textureStore/eb702f.wgsl
+++ b/test/intrinsics/gen/textureStore/eb702f.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_eb702f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.hlsl
index f2f1217..a65d22b 100644
--- a/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<float4> arg_0 : register(u0, space1);
void textureStore_eb702f() {
arg_0[int3(0, 0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_eb702f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.spvasm
index 805163c..a33b490 100644
--- a/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 36
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_eb702f "textureStore_eb702f"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -27,33 +31,43 @@
%7 = OpTypeImage %float 3D 0 0 0 2 R32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %16 = OpConstantNull %v3int
- %v4float = OpTypeVector %float 4
- %18 = OpConstantNull %v4float
+ %20 = OpConstantNull %v3int
+ %21 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_eb702f = OpFunction %void None %8
- %11 = OpLabel
- %13 = OpLoad %7 %arg_0
- OpImageWrite %13 %16 %18
+%textureStore_eb702f = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %7 %arg_0
+ OpImageWrite %17 %20 %11
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
- OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_eb702f
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %21
+%tint_symbol = OpFunctionParameter %v4float
%24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_eb702f
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %26 = OpLabel
+ OpStore %tint_pointsize %float_1
%28 = OpFunctionCall %void %textureStore_eb702f
+ %29 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureStore_eb702f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_eb702f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.wgsl
index de86b76..5cf2b13 100644
--- a/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_eb702f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/eb78b9.wgsl b/test/intrinsics/gen/textureStore/eb78b9.wgsl
index 4aa20046..c19b499 100644
--- a/test/intrinsics/gen/textureStore/eb78b9.wgsl
+++ b/test/intrinsics/gen/textureStore/eb78b9.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_eb78b9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.hlsl
index 8a2ccfd..859588a 100644
--- a/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<int4> arg_0 : register(u0, space1);
void textureStore_eb78b9() {
arg_0[int3(0, 0, 0)] = int4(0, 0, 0, 0);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_eb78b9();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.spvasm
index 2ff5b98..fec7f88 100644
--- a/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_eb78b9 "textureStore_eb78b9"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,32 +32,44 @@
%7 = OpTypeImage %int 3D 0 0 0 2 R32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
- %16 = OpConstantNull %v3int
+ %20 = OpConstantNull %v3int
%v4int = OpTypeVector %int 4
- %18 = OpConstantNull %v4int
+ %22 = OpConstantNull %v4int
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_eb78b9 = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %16 %18
+%textureStore_eb78b9 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %20 %22
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_eb78b9
+ %30 = OpFunctionCall %void %textureStore_eb78b9
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_eb78b9
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_eb78b9
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureStore_eb78b9
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_eb78b9
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.wgsl
index eb76666..31287b9 100644
--- a/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_eb78b9();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/ee6acc.wgsl b/test/intrinsics/gen/textureStore/ee6acc.wgsl
index a1a7801..223158c 100644
--- a/test/intrinsics/gen/textureStore/ee6acc.wgsl
+++ b/test/intrinsics/gen/textureStore/ee6acc.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_ee6acc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.hlsl
index a321851..2560aac 100644
--- a/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<float4> arg_0 : register(u0, space1);
void textureStore_ee6acc() {
arg_0[int3(0, 0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_ee6acc();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.spvasm
index f11aa5c..5a8e520 100644
--- a/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 36
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_ee6acc "textureStore_ee6acc"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,33 +32,43 @@
%7 = OpTypeImage %float 3D 0 0 0 2 Rg32f
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %11 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11
%void = OpTypeVoid
- %8 = OpTypeFunction %void
+ %12 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %16 = OpConstantNull %v3int
- %v4float = OpTypeVector %float 4
- %18 = OpConstantNull %v4float
+ %20 = OpConstantNull %v3int
+ %21 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_ee6acc = OpFunction %void None %8
- %11 = OpLabel
- %13 = OpLoad %7 %arg_0
- OpImageWrite %13 %16 %18
+%textureStore_ee6acc = OpFunction %void None %12
+ %15 = OpLabel
+ %17 = OpLoad %7 %arg_0
+ OpImageWrite %17 %20 %11
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %8
- %20 = OpLabel
- OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_ee6acc
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %8
+%tint_symbol_2 = OpFunction %void None %21
+%tint_symbol = OpFunctionParameter %v4float
%24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_ee6acc
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %8
- %27 = OpLabel
+%vertex_main = OpFunction %void None %12
+ %26 = OpLabel
+ OpStore %tint_pointsize %float_1
%28 = OpFunctionCall %void %textureStore_ee6acc
+ %29 = OpFunctionCall %void %tint_symbol_2 %11
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureStore_ee6acc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_ee6acc
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.wgsl
index 3530be4..c68cc91 100644
--- a/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_ee6acc();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/ef9f2f.wgsl b/test/intrinsics/gen/textureStore/ef9f2f.wgsl
index 541ee39..e637049 100644
--- a/test/intrinsics/gen/textureStore/ef9f2f.wgsl
+++ b/test/intrinsics/gen/textureStore/ef9f2f.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_ef9f2f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.hlsl
index 18e4e26..68cadd9 100644
--- a/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<uint4> arg_0 : register(u0, space1);
void textureStore_ef9f2f() {
arg_0[int3(0, 0, 0)] = uint4(0u, 0u, 0u, 0u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_ef9f2f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.spvasm
index 3d68722..0d35fe8 100644
--- a/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_ef9f2f "textureStore_ef9f2f"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,33 +32,45 @@
%7 = OpTypeImage %uint 3D 0 0 0 2 R32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %17 = OpConstantNull %v3int
+ %21 = OpConstantNull %v3int
%v4uint = OpTypeVector %uint 4
- %19 = OpConstantNull %v4uint
+ %23 = OpConstantNull %v4uint
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_ef9f2f = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %17 %19
+%textureStore_ef9f2f = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %21 %23
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureStore_ef9f2f
+ %31 = OpFunctionCall %void %textureStore_ef9f2f
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureStore_ef9f2f
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_ef9f2f
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureStore_ef9f2f
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_ef9f2f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.wgsl
index f2f20c1..e8bf5e0 100644
--- a/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_ef9f2f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/f8dead.wgsl b/test/intrinsics/gen/textureStore/f8dead.wgsl
index dd8a4fb..6c316b6 100644
--- a/test/intrinsics/gen/textureStore/f8dead.wgsl
+++ b/test/intrinsics/gen/textureStore/f8dead.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_f8dead();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.hlsl
index e6687d3..dc3b5d8 100644
--- a/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture3D<uint4> arg_0 : register(u0, space1);
void textureStore_f8dead() {
arg_0[int3(0, 0, 0)] = uint4(0u, 0u, 0u, 0u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_f8dead();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.spvasm
index f421043..382a8c1 100644
--- a/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 30
+; Bound: 39
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_f8dead "textureStore_f8dead"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,33 +32,45 @@
%7 = OpTypeImage %uint 3D 0 0 0 2 Rgba8ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%v3int = OpTypeVector %int 3
- %17 = OpConstantNull %v3int
+ %21 = OpConstantNull %v3int
%v4uint = OpTypeVector %uint 4
- %19 = OpConstantNull %v4uint
+ %23 = OpConstantNull %v4uint
+ %24 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_f8dead = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %17 %19
+%textureStore_f8dead = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %21 %23
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %21 = OpLabel
+%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol = OpFunctionParameter %v4float
+ %27 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
OpStore %tint_pointsize %float_1
- %23 = OpFunctionCall %void %textureStore_f8dead
+ %31 = OpFunctionCall %void %textureStore_f8dead
+ %32 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureStore_f8dead
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureStore_f8dead
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureStore_f8dead
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureStore_f8dead
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.wgsl
index 184af58..8f23e0c 100644
--- a/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_f8dead();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/f9be83.wgsl b/test/intrinsics/gen/textureStore/f9be83.wgsl
index 07e21f9..9ecba96 100644
--- a/test/intrinsics/gen/textureStore/f9be83.wgsl
+++ b/test/intrinsics/gen/textureStore/f9be83.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_f9be83();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.hlsl
index f4b305b..b671f34 100644
--- a/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<int4> arg_0 : register(u0, space1);
void textureStore_f9be83() {
arg_0[int3(0, 0, 1)] = int4(0, 0, 0, 0);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_f9be83();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.spvasm
index 08795cd..af3adfc 100644
--- a/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpCapability StorageImageExtendedFormats
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_f9be83 "textureStore_f9be83"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,34 +33,46 @@
%7 = OpTypeImage %int 2D 0 1 0 2 Rg32i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %18 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%v4int = OpTypeVector %int 4
- %20 = OpConstantNull %v4int
+ %24 = OpConstantNull %v4int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_f9be83 = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %18 %20
+%textureStore_f9be83 = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %22 %24
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureStore_f9be83
+ %32 = OpFunctionCall %void %textureStore_f9be83
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureStore_f9be83
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureStore_f9be83
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureStore_f9be83
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureStore_f9be83
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.wgsl
index bdc6309..efbe0fe 100644
--- a/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_f9be83();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/fb9a8f.wgsl b/test/intrinsics/gen/textureStore/fb9a8f.wgsl
index 13a6929..68e71bb 100644
--- a/test/intrinsics/gen/textureStore/fb9a8f.wgsl
+++ b/test/intrinsics/gen/textureStore/fb9a8f.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_fb9a8f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.hlsl
index 605ed73..b2a2834 100644
--- a/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture1D<uint4> arg_0 : register(u0, space1);
void textureStore_fb9a8f() {
arg_0[1] = uint4(0u, 0u, 0u, 0u);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_fb9a8f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.spvasm
index 32c9ecb..414eb1c 100644
--- a/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.spvasm
@@ -1,19 +1,22 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 29
+; Bound: 38
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_fb9a8f "textureStore_fb9a8f"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -21,6 +24,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -29,32 +33,44 @@
%7 = OpTypeImage %uint 1D 0 0 0 2 Rgba32ui
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v4uint = OpTypeVector %uint 4
- %18 = OpConstantNull %v4uint
+ %22 = OpConstantNull %v4uint
+ %23 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_fb9a8f = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %int_1 %18
+%textureStore_fb9a8f = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %int_1 %22
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %20 = OpLabel
+%tint_symbol_2 = OpFunction %void None %23
+%tint_symbol = OpFunctionParameter %v4float
+ %26 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
OpStore %tint_pointsize %float_1
- %22 = OpFunctionCall %void %textureStore_fb9a8f
+ %30 = OpFunctionCall %void %textureStore_fb9a8f
+ %31 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureStore_fb9a8f
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureStore_fb9a8f
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureStore_fb9a8f
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureStore_fb9a8f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.wgsl
index f22a569..78ac35d 100644
--- a/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_fb9a8f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/fbf53f.wgsl b/test/intrinsics/gen/textureStore/fbf53f.wgsl
index eac93e4..a5d4ca6 100644
--- a/test/intrinsics/gen/textureStore/fbf53f.wgsl
+++ b/test/intrinsics/gen/textureStore/fbf53f.wgsl
@@ -28,8 +28,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_fbf53f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.hlsl
index 174ca73..32afd0d 100644
--- a/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
RWTexture2DArray<int4> arg_0 : register(u0, space1);
void textureStore_fbf53f() {
arg_0[int3(0, 0, 1)] = int4(0, 0, 0, 0);
}
-void vertex_main() {
+tint_symbol vertex_main() {
textureStore_fbf53f();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.spvasm
index 7f56ec3..3ac4b4d 100644
--- a/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.spvasm
@@ -1,18 +1,21 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 40
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
OpName %arg_0 "arg_0"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %textureStore_fbf53f "textureStore_fbf53f"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
@@ -20,6 +23,7 @@
OpDecorate %arg_0 NonReadable
OpDecorate %arg_0 DescriptorSet 1
OpDecorate %arg_0 Binding 0
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
@@ -28,34 +32,46 @@
%7 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
%arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %12 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
%void = OpTypeVoid
- %9 = OpTypeFunction %void
+ %13 = OpTypeFunction %void
%v3int = OpTypeVector %int 3
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
- %18 = OpConstantComposite %v3int %int_0 %int_0 %int_1
+ %22 = OpConstantComposite %v3int %int_0 %int_0 %int_1
%v4int = OpTypeVector %int 4
- %20 = OpConstantNull %v4int
+ %24 = OpConstantNull %v4int
+ %25 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%textureStore_fbf53f = OpFunction %void None %9
- %12 = OpLabel
- %14 = OpLoad %7 %arg_0
- OpImageWrite %14 %18 %20
+%textureStore_fbf53f = OpFunction %void None %13
+ %16 = OpLabel
+ %18 = OpLoad %7 %arg_0
+ OpImageWrite %18 %22 %24
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %9
- %22 = OpLabel
+%tint_symbol_2 = OpFunction %void None %25
+%tint_symbol = OpFunctionParameter %v4float
+ %28 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
OpStore %tint_pointsize %float_1
- %24 = OpFunctionCall %void %textureStore_fbf53f
+ %32 = OpFunctionCall %void %textureStore_fbf53f
+ %33 = OpFunctionCall %void %tint_symbol_2 %12
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureStore_fbf53f
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureStore_fbf53f
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureStore_fbf53f
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureStore_fbf53f
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.wgsl
index b19b0a4..18f0471 100644
--- a/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.wgsl
@@ -5,8 +5,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
textureStore_fbf53f();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/trunc/562d05.wgsl b/test/intrinsics/gen/trunc/562d05.wgsl
index 3358cff..63a94b6 100644
--- a/test/intrinsics/gen/trunc/562d05.wgsl
+++ b/test/intrinsics/gen/trunc/562d05.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
trunc_562d05();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/trunc/562d05.wgsl.expected.hlsl b/test/intrinsics/gen/trunc/562d05.wgsl.expected.hlsl
index e1bad91..f96d4c8 100644
--- a/test/intrinsics/gen/trunc/562d05.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/trunc/562d05.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void trunc_562d05() {
float3 res = trunc(float3(0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
trunc_562d05();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/trunc/562d05.wgsl.expected.msl b/test/intrinsics/gen/trunc/562d05.wgsl.expected.msl
index 5ed7816..061a926 100644
--- a/test/intrinsics/gen/trunc/562d05.wgsl.expected.msl
+++ b/test/intrinsics/gen/trunc/562d05.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void trunc_562d05() {
float3 res = trunc(float3());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
trunc_562d05();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/trunc/562d05.wgsl.expected.spvasm b/test/intrinsics/gen/trunc/562d05.wgsl.expected.spvasm
index ed7d4b7..adf112b 100644
--- a/test/intrinsics/gen/trunc/562d05.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/trunc/562d05.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %trunc_562d05 "trunc_562d05"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %12 = OpConstantNull %v3float
+ %16 = OpConstantNull %v3float
%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%trunc_562d05 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %12
- %9 = OpExtInst %v3float %11 Trunc %12
- OpStore %res %9
+%trunc_562d05 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %16
+ %13 = OpExtInst %v3float %15 Trunc %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %trunc_562d05
+ %26 = OpFunctionCall %void %trunc_562d05
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %trunc_562d05
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %trunc_562d05
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %trunc_562d05
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %trunc_562d05
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/trunc/562d05.wgsl.expected.wgsl b/test/intrinsics/gen/trunc/562d05.wgsl.expected.wgsl
index b1b6347..577f7a6 100644
--- a/test/intrinsics/gen/trunc/562d05.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/trunc/562d05.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
trunc_562d05();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/trunc/e183aa.wgsl b/test/intrinsics/gen/trunc/e183aa.wgsl
index f52677e..eaaac11 100644
--- a/test/intrinsics/gen/trunc/e183aa.wgsl
+++ b/test/intrinsics/gen/trunc/e183aa.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
trunc_e183aa();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.hlsl b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.hlsl
index 8f55919..c8f3256 100644
--- a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void trunc_e183aa() {
float4 res = trunc(float4(0.0f, 0.0f, 0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
trunc_e183aa();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.msl b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.msl
index 7b48026..4844235 100644
--- a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.msl
+++ b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void trunc_e183aa() {
float4 res = trunc(float4());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
trunc_e183aa();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.spvasm b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.spvasm
index 01065e1..fb0d60a 100644
--- a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.spvasm
@@ -1,53 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 32
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %trunc_e183aa "trunc_e183aa"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
- %12 = OpConstantNull %v4float
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%trunc_e183aa = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %12
- %9 = OpExtInst %v4float %11 Trunc %12
- OpStore %res %9
+%trunc_e183aa = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 Trunc %8
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
- OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %trunc_e183aa
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %17
+%tint_symbol = OpFunctionParameter %v4float
%20 = OpLabel
- %21 = OpFunctionCall %void %trunc_e183aa
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ OpStore %tint_pointsize %float_1
%24 = OpFunctionCall %void %trunc_e183aa
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %trunc_e183aa
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %trunc_e183aa
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.wgsl b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.wgsl
index f41ba24..a2a0db1 100644
--- a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
trunc_e183aa();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/trunc/eb83df.wgsl b/test/intrinsics/gen/trunc/eb83df.wgsl
index 3487eb3..640179d 100644
--- a/test/intrinsics/gen/trunc/eb83df.wgsl
+++ b/test/intrinsics/gen/trunc/eb83df.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
trunc_eb83df();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.hlsl b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.hlsl
index 0dc4fc4..d778329 100644
--- a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void trunc_eb83df() {
float res = trunc(1.0f);
}
-void vertex_main() {
+tint_symbol vertex_main() {
trunc_eb83df();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.msl b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.msl
index 803fea7..4e8c7ac 100644
--- a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.msl
+++ b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void trunc_eb83df() {
float res = trunc(1.0f);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
trunc_eb83df();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.spvasm b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.spvasm
index 73577d1..f950d5d 100644
--- a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.spvasm
@@ -1,51 +1,67 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 23
+; Bound: 32
; Schema: 0
OpCapability Shader
- %10 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %trunc_eb83df "trunc_eb83df"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%_ptr_Function_float = OpTypePointer Function %float
-%trunc_eb83df = OpFunction %void None %5
- %8 = OpLabel
+ %18 = OpTypeFunction %void %v4float
+%trunc_eb83df = OpFunction %void None %9
+ %12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %4
- %9 = OpExtInst %float %10 Trunc %float_1
- OpStore %res %9
+ %13 = OpExtInst %float %14 Trunc %float_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %15 = OpLabel
- OpStore %tint_pointsize %float_1
- %16 = OpFunctionCall %void %trunc_eb83df
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %18 = OpLabel
- %19 = OpFunctionCall %void %trunc_eb83df
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %18
+%tint_symbol = OpFunctionParameter %v4float
%21 = OpLabel
- %22 = OpFunctionCall %void %trunc_eb83df
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %23 = OpLabel
+ OpStore %tint_pointsize %float_1
+ %24 = OpFunctionCall %void %trunc_eb83df
+ %25 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %trunc_eb83df
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %trunc_eb83df
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.wgsl b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.wgsl
index ebf5104..2821e14 100644
--- a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
trunc_eb83df();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/trunc/f370d3.wgsl b/test/intrinsics/gen/trunc/f370d3.wgsl
index 0a3c51a..3995e1f 100644
--- a/test/intrinsics/gen/trunc/f370d3.wgsl
+++ b/test/intrinsics/gen/trunc/f370d3.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
trunc_f370d3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.hlsl b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.hlsl
index 92854e2..7e1e532 100644
--- a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.hlsl
@@ -1,10 +1,15 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void trunc_f370d3() {
float2 res = trunc(float2(0.0f, 0.0f));
}
-void vertex_main() {
+tint_symbol vertex_main() {
trunc_f370d3();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.msl b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.msl
index b5ec5fd..2b58e71 100644
--- a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.msl
+++ b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void trunc_f370d3() {
float2 res = trunc(float2());
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
trunc_f370d3();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.spvasm b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.spvasm
index 6269144..7736f48 100644
--- a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.spvasm
@@ -1,53 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 25
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %trunc_f370d3 "trunc_f370d3"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %12 = OpConstantNull %v2float
+ %16 = OpConstantNull %v2float
%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%trunc_f370d3 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %12
- %9 = OpExtInst %v2float %11 Trunc %12
- OpStore %res %9
+%trunc_f370d3 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %16
+ %13 = OpExtInst %v2float %15 Trunc %16
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %16 = OpLabel
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
+ %22 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
OpStore %tint_pointsize %float_1
- %18 = OpFunctionCall %void %trunc_f370d3
+ %26 = OpFunctionCall %void %trunc_f370d3
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %20 = OpLabel
- %21 = OpFunctionCall %void %trunc_f370d3
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %trunc_f370d3
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %23 = OpLabel
- %24 = OpFunctionCall %void %trunc_f370d3
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %trunc_f370d3
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.wgsl b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.wgsl
index 35a6565..7b80337 100644
--- a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
trunc_f370d3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl
index 93e4b1f..bcdd9bd 100644
--- a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl
+++ b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
unpack2x16float_32a5cf();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.hlsl b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.hlsl
index e675e28..ab62075 100644
--- a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.hlsl
@@ -1,11 +1,16 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void unpack2x16float_32a5cf() {
uint tint_tmp = 1u;
float2 res = f16tof32(uint2(tint_tmp & 0xffff, tint_tmp >> 16));
}
-void vertex_main() {
+tint_symbol vertex_main() {
unpack2x16float_32a5cf();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.msl b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.msl
index 8f4f001..210f23e 100644
--- a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.msl
+++ b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void unpack2x16float_32a5cf() {
float2 res = float2(as_type<half2>(1u));
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
unpack2x16float_32a5cf();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.spvasm b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.spvasm
index 0b608ba..f094822 100644
--- a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.spvasm
@@ -1,55 +1,71 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 36
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %unpack2x16float_32a5cf "unpack2x16float_32a5cf"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%_ptr_Function_v2float = OpTypePointer Function %v2float
- %16 = OpConstantNull %v2float
+ %20 = OpConstantNull %v2float
+ %21 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%unpack2x16float_32a5cf = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %16
- %9 = OpExtInst %v2float %11 UnpackHalf2x16 %uint_1
- OpStore %res %9
+%unpack2x16float_32a5cf = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %20
+ %13 = OpExtInst %v2float %15 UnpackHalf2x16 %uint_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %18 = OpLabel
+%tint_symbol_2 = OpFunction %void None %21
+%tint_symbol = OpFunctionParameter %v4float
+ %24 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %26 = OpLabel
OpStore %tint_pointsize %float_1
- %20 = OpFunctionCall %void %unpack2x16float_32a5cf
+ %28 = OpFunctionCall %void %unpack2x16float_32a5cf
+ %29 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %22 = OpLabel
- %23 = OpFunctionCall %void %unpack2x16float_32a5cf
+%fragment_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %unpack2x16float_32a5cf
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %25 = OpLabel
- %26 = OpFunctionCall %void %unpack2x16float_32a5cf
+%compute_main = OpFunction %void None %9
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %unpack2x16float_32a5cf
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.wgsl b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.wgsl
index d310518..ac3033f 100644
--- a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
unpack2x16float_32a5cf();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl
index 5488436..4018203 100644
--- a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl
+++ b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
unpack2x16snorm_b4aea6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.hlsl b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.hlsl
index 9a90dc9..1eb6221 100644
--- a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void unpack2x16snorm_b4aea6() {
int tint_tmp_1 = int(1u);
int2 tint_tmp = int2(tint_tmp_1 << 16, tint_tmp_1) >> 16;
float2 res = clamp(float2(tint_tmp) / 32767.0, -1.0, 1.0);
}
-void vertex_main() {
+tint_symbol vertex_main() {
unpack2x16snorm_b4aea6();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.msl b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.msl
index c315dce..2795c37 100644
--- a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.msl
+++ b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void unpack2x16snorm_b4aea6() {
float2 res = unpack_snorm2x16_to_float(1u);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
unpack2x16snorm_b4aea6();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.spvasm b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.spvasm
index c52f991..9dcabf8 100644
--- a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.spvasm
@@ -1,55 +1,71 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 36
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %unpack2x16snorm_b4aea6 "unpack2x16snorm_b4aea6"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%_ptr_Function_v2float = OpTypePointer Function %v2float
- %16 = OpConstantNull %v2float
+ %20 = OpConstantNull %v2float
+ %21 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%unpack2x16snorm_b4aea6 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %16
- %9 = OpExtInst %v2float %11 UnpackSnorm2x16 %uint_1
- OpStore %res %9
+%unpack2x16snorm_b4aea6 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %20
+ %13 = OpExtInst %v2float %15 UnpackSnorm2x16 %uint_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %18 = OpLabel
+%tint_symbol_2 = OpFunction %void None %21
+%tint_symbol = OpFunctionParameter %v4float
+ %24 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %26 = OpLabel
OpStore %tint_pointsize %float_1
- %20 = OpFunctionCall %void %unpack2x16snorm_b4aea6
+ %28 = OpFunctionCall %void %unpack2x16snorm_b4aea6
+ %29 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %22 = OpLabel
- %23 = OpFunctionCall %void %unpack2x16snorm_b4aea6
+%fragment_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %unpack2x16snorm_b4aea6
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %25 = OpLabel
- %26 = OpFunctionCall %void %unpack2x16snorm_b4aea6
+%compute_main = OpFunction %void None %9
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %unpack2x16snorm_b4aea6
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.wgsl b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.wgsl
index 662770e..149234b 100644
--- a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
unpack2x16snorm_b4aea6();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl
index 4b22886..429164a 100644
--- a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl
+++ b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
unpack2x16unorm_7699c0();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.hlsl b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.hlsl
index cb6aef9..75366ad 100644
--- a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void unpack2x16unorm_7699c0() {
uint tint_tmp_1 = 1u;
uint2 tint_tmp = uint2(tint_tmp_1 & 0xffff, tint_tmp_1 >> 16);
float2 res = float2(tint_tmp) / 65535.0;
}
-void vertex_main() {
+tint_symbol vertex_main() {
unpack2x16unorm_7699c0();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.msl b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.msl
index 9d65266..706b45e 100644
--- a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.msl
+++ b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void unpack2x16unorm_7699c0() {
float2 res = unpack_unorm2x16_to_float(1u);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
unpack2x16unorm_7699c0();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.spvasm b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.spvasm
index 1df109e..e36eed5 100644
--- a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.spvasm
@@ -1,55 +1,71 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 36
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %unpack2x16unorm_7699c0 "unpack2x16unorm_7699c0"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
%void = OpTypeVoid
- %5 = OpTypeFunction %void
+ %9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%_ptr_Function_v2float = OpTypePointer Function %v2float
- %16 = OpConstantNull %v2float
+ %20 = OpConstantNull %v2float
+ %21 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%unpack2x16unorm_7699c0 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %16
- %9 = OpExtInst %v2float %11 UnpackUnorm2x16 %uint_1
- OpStore %res %9
+%unpack2x16unorm_7699c0 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %20
+ %13 = OpExtInst %v2float %15 UnpackUnorm2x16 %uint_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %18 = OpLabel
+%tint_symbol_2 = OpFunction %void None %21
+%tint_symbol = OpFunctionParameter %v4float
+ %24 = OpLabel
+ OpStore %tint_symbol_1 %tint_symbol
+ OpReturn
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %26 = OpLabel
OpStore %tint_pointsize %float_1
- %20 = OpFunctionCall %void %unpack2x16unorm_7699c0
+ %28 = OpFunctionCall %void %unpack2x16unorm_7699c0
+ %29 = OpFunctionCall %void %tint_symbol_2 %8
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %5
- %22 = OpLabel
- %23 = OpFunctionCall %void %unpack2x16unorm_7699c0
+%fragment_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %unpack2x16unorm_7699c0
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %25 = OpLabel
- %26 = OpFunctionCall %void %unpack2x16unorm_7699c0
+%compute_main = OpFunction %void None %9
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %unpack2x16unorm_7699c0
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.wgsl b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.wgsl
index 819996c..547acfe 100644
--- a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
unpack2x16unorm_7699c0();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl
index 9c70342..037cd9e 100644
--- a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl
+++ b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
unpack4x8snorm_523fb3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.hlsl b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.hlsl
index e9009fc..06b04ef 100644
--- a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void unpack4x8snorm_523fb3() {
int tint_tmp_1 = int(1u);
int4 tint_tmp = int4(tint_tmp_1 << 24, tint_tmp_1 << 16, tint_tmp_1 << 8, tint_tmp_1) >> 24;
float4 res = clamp(float4(tint_tmp) / 127.0, -1.0, 1.0);
}
-void vertex_main() {
+tint_symbol vertex_main() {
unpack4x8snorm_523fb3();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.msl b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.msl
index 1912c1a..af4fb45 100644
--- a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.msl
+++ b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void unpack4x8snorm_523fb3() {
float4 res = unpack_snorm4x8_to_float(1u);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
unpack4x8snorm_523fb3();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.spvasm b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.spvasm
index 3fc6309..1b26065 100644
--- a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.spvasm
@@ -1,55 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %unpack4x8snorm_523fb3 "unpack4x8snorm_523fb3"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %16 = OpConstantNull %v4float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%unpack4x8snorm_523fb3 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %16
- %9 = OpExtInst %v4float %11 UnpackSnorm4x8 %uint_1
- OpStore %res %9
+%unpack4x8snorm_523fb3 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 UnpackSnorm4x8 %uint_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %18 = OpLabel
- OpStore %tint_pointsize %float_1
- %20 = OpFunctionCall %void %unpack4x8snorm_523fb3
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
%22 = OpLabel
- %23 = OpFunctionCall %void %unpack4x8snorm_523fb3
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %25 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ OpStore %tint_pointsize %float_1
%26 = OpFunctionCall %void %unpack4x8snorm_523fb3
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %unpack4x8snorm_523fb3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %unpack4x8snorm_523fb3
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.wgsl b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.wgsl
index 6352fdc..82992c2 100644
--- a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
unpack4x8snorm_523fb3();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl
index 6bab108..a322d48 100644
--- a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl
+++ b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl
@@ -27,8 +27,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
unpack4x8unorm_750c74();
+ return vec4<f32>();
}
[[stage(fragment)]]
diff --git a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.hlsl b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.hlsl
index bb43457..277b247 100644
--- a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.hlsl
+++ b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.hlsl
@@ -1,12 +1,17 @@
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
void unpack4x8unorm_750c74() {
uint tint_tmp_1 = 1u;
uint4 tint_tmp = uint4(tint_tmp_1 & 0xff, (tint_tmp_1 >> 8) & 0xff, (tint_tmp_1 >> 16) & 0xff, tint_tmp_1 >> 24);
float4 res = float4(tint_tmp) / 255.0;
}
-void vertex_main() {
+tint_symbol vertex_main() {
unpack4x8unorm_750c74();
- return;
+ const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
+ return tint_symbol_1;
}
void fragment_main() {
diff --git a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.msl b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.msl
index 9b8a802..5c4da0d 100644
--- a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.msl
+++ b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.msl
@@ -1,13 +1,18 @@
#include <metal_stdlib>
using namespace metal;
+struct tint_symbol {
+ float4 value [[position]];
+};
+
void unpack4x8unorm_750c74() {
float4 res = unpack_unorm4x8_to_float(1u);
}
-vertex void vertex_main() {
+vertex tint_symbol vertex_main() {
unpack4x8unorm_750c74();
- return;
+ tint_symbol const tint_symbol_1 = {.value=float4()};
+ return tint_symbol_1;
}
fragment void fragment_main() {
diff --git a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.spvasm b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.spvasm
index 6b420e3..c61f7da 100644
--- a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.spvasm
+++ b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.spvasm
@@ -1,55 +1,69 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 27
+; Bound: 34
; Schema: 0
OpCapability Shader
- %11 = OpExtInstImport "GLSL.std.450"
+ %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize
+ OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
OpEntryPoint Fragment %fragment_main "fragment_main"
OpEntryPoint GLCompute %compute_main "compute_main"
OpExecutionMode %fragment_main OriginUpperLeft
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %tint_pointsize "tint_pointsize"
+ OpName %tint_symbol_1 "tint_symbol_1"
OpName %unpack4x8unorm_750c74 "unpack4x8unorm_750c74"
OpName %res "res"
+ OpName %tint_symbol_2 "tint_symbol_2"
+ OpName %tint_symbol "tint_symbol"
OpName %vertex_main "vertex_main"
OpName %fragment_main "fragment_main"
OpName %compute_main "compute_main"
OpDecorate %tint_pointsize BuiltIn PointSize
+ OpDecorate %tint_symbol_1 BuiltIn Position
%float = OpTypeFloat 32
%_ptr_Output_float = OpTypePointer Output %float
%4 = OpConstantNull %float
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
- %void = OpTypeVoid
- %5 = OpTypeFunction %void
%v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %8 = OpConstantNull %v4float
+%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %16 = OpConstantNull %v4float
+ %19 = OpTypeFunction %void %v4float
%float_1 = OpConstant %float 1
-%unpack4x8unorm_750c74 = OpFunction %void None %5
- %8 = OpLabel
- %res = OpVariable %_ptr_Function_v4float Function %16
- %9 = OpExtInst %v4float %11 UnpackUnorm4x8 %uint_1
- OpStore %res %9
+%unpack4x8unorm_750c74 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %8
+ %13 = OpExtInst %v4float %14 UnpackUnorm4x8 %uint_1
+ OpStore %res %13
OpReturn
OpFunctionEnd
-%vertex_main = OpFunction %void None %5
- %18 = OpLabel
- OpStore %tint_pointsize %float_1
- %20 = OpFunctionCall %void %unpack4x8unorm_750c74
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %5
+%tint_symbol_2 = OpFunction %void None %19
+%tint_symbol = OpFunctionParameter %v4float
%22 = OpLabel
- %23 = OpFunctionCall %void %unpack4x8unorm_750c74
+ OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %5
- %25 = OpLabel
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ OpStore %tint_pointsize %float_1
%26 = OpFunctionCall %void %unpack4x8unorm_750c74
+ %27 = OpFunctionCall %void %tint_symbol_2 %8
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %unpack4x8unorm_750c74
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %unpack4x8unorm_750c74
OpReturn
OpFunctionEnd
diff --git a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.wgsl b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.wgsl
index 53e0972..b41d1ca 100644
--- a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.wgsl
+++ b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.wgsl
@@ -3,8 +3,9 @@
}
[[stage(vertex)]]
-fn vertex_main() {
+fn vertex_main() -> [[builtin(position)]] vec4<f32> {
unpack4x8unorm_750c74();
+ return vec4<f32>();
}
[[stage(fragment)]]