[hlsl] Invert 'w' component of fragment position
D3D semantics for SV_Position do not match WGSL's, so we need to
invert the 'w' component at the start of the shader.
Fixed: tint:2089
Change-Id: I89ebf1909203f4c15d581a79b651093f93ffe704
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/166580
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: David Neto <dneto@google.com>
diff --git a/src/dawn/tests/end2end/ShaderTests.cpp b/src/dawn/tests/end2end/ShaderTests.cpp
index be84d41..4035668 100644
--- a/src/dawn/tests/end2end/ShaderTests.cpp
+++ b/src/dawn/tests/end2end/ShaderTests.cpp
@@ -2217,6 +2217,58 @@
device.CreateRenderPipeline(&desc);
}
+// Test that the `w` component of fragment builtin position behaves correctly.
+TEST_P(ShaderTests, FragmentPositionW) {
+ wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
+@vertex fn main(@builtin(vertex_index) vertex_index : u32) -> @builtin(position) vec4f {
+ let pos = array(
+ vec4f(-1.0, -1.0, 0.0, 2.0),
+ vec4f(-0.5, 0.0, 0.0, 2.0),
+ vec4f( 0.0, -1.0, 0.0, 2.0),
+
+ vec4f( 0.0, -1.0, 0.0, 4.0),
+ vec4f( 0.5, 0.0, 0.0, 4.0),
+ vec4f( 1.0, -1.0, 0.0, 4.0),
+
+ vec4f(-0.5, 0.0, 0.0, 8.0),
+ vec4f( 0.0, 1.0, 0.0, 8.0),
+ vec4f( 0.5, 0.0, 0.0, 8.0),
+ )[vertex_index];
+
+ return vec4(pos.xy * pos.w, 0.0, pos.w);
+})");
+
+ wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
+@fragment fn main(@builtin(position) position : vec4f) -> @location(0) vec4f {
+ return vec4f(position.w, 0.0, 1.0, 1.0);
+})");
+
+ utils::BasicRenderPass renderPass = utils::CreateBasicRenderPass(device, 64, 64);
+
+ utils::ComboRenderPipelineDescriptor descriptor;
+ descriptor.vertex.module = vsModule;
+ descriptor.cFragment.module = fsModule;
+ descriptor.primitive.topology = wgpu::PrimitiveTopology::TriangleList;
+ descriptor.cTargets[0].format = renderPass.colorFormat;
+
+ wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&descriptor);
+
+ wgpu::CommandEncoder encoder = device.CreateCommandEncoder();
+ wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderPass.renderPassInfo);
+ pass.SetPipeline(pipeline);
+ pass.Draw(9);
+ pass.End();
+ wgpu::CommandBuffer commands = encoder.Finish();
+ queue.Submit(1, &commands);
+
+ EXPECT_PIXEL_RGBA8_BETWEEN(utils::RGBA8(126, 0, 255, 255), utils::RGBA8(129, 0, 255, 255),
+ renderPass.color, 16, 48);
+ EXPECT_PIXEL_RGBA8_BETWEEN(utils::RGBA8(62, 0, 255, 255), utils::RGBA8(65, 0, 255, 255),
+ renderPass.color, 48, 48);
+ EXPECT_PIXEL_RGBA8_BETWEEN(utils::RGBA8(30, 0, 255, 255), utils::RGBA8(33, 0, 255, 255),
+ renderPass.color, 32, 16);
+}
+
DAWN_INSTANTIATE_TEST(ShaderTests,
D3D11Backend(),
D3D12Backend(),
diff --git a/src/tint/lang/hlsl/writer/ast_printer/function_test.cc b/src/tint/lang/hlsl/writer/ast_printer/function_test.cc
index 723d48c..6158a91 100644
--- a/src/tint/lang/hlsl/writer/ast_printer/function_test.cc
+++ b/src/tint/lang/hlsl/writer/ast_printer/function_test.cc
@@ -197,7 +197,7 @@
}
tint_symbol_2 frag_main(tint_symbol_1 tint_symbol) {
- const float inner_result = frag_main_inner(tint_symbol.coord);
+ const float inner_result = frag_main_inner(float4(tint_symbol.coord.xyz, (1.0f / tint_symbol.coord.w)));
tint_symbol_2 wrapper_result = (tint_symbol_2)0;
wrapper_result.value = inner_result;
return wrapper_result;
@@ -282,7 +282,7 @@
}
void frag_main(tint_symbol_2 tint_symbol_1) {
- const Interface tint_symbol_4 = {tint_symbol_1.pos, tint_symbol_1.col1, tint_symbol_1.col2};
+ const Interface tint_symbol_4 = {float4(tint_symbol_1.pos.xyz, (1.0f / tint_symbol_1.pos.w)), tint_symbol_1.col1, tint_symbol_1.col2};
frag_main_inner(tint_symbol_4);
return;
}
diff --git a/src/tint/lang/wgsl/ast/transform/canonicalize_entry_point_io.cc b/src/tint/lang/wgsl/ast/transform/canonicalize_entry_point_io.cc
index ad22d6c..e0ec04a 100644
--- a/src/tint/lang/wgsl/ast/transform/canonicalize_entry_point_io.cc
+++ b/src/tint/lang/wgsl/ast/transform/canonicalize_entry_point_io.cc
@@ -354,7 +354,18 @@
: b.Symbols().New(name);
wrapper_struct_param_members.Push({b.Member(symbol, ast_type, std::move(attrs)),
location, /* index */ std::nullopt, color});
- return b.MemberAccessor(InputStructSymbol(), symbol);
+ const Expression* expr = b.MemberAccessor(InputStructSymbol(), symbol);
+
+ // If this is a fragment position builtin and we're targeting D3D, we need to invert the
+ // 'w' component of the vector.
+ if (cfg.shader_style == ShaderStyle::kHlsl &&
+ builtin_attr == core::BuiltinValue::kPosition) {
+ auto* xyz = b.MemberAccessor(expr, "xyz");
+ auto* w = b.MemberAccessor(b.MemberAccessor(InputStructSymbol(), symbol), "w");
+ expr = b.Call<vec4<f32>>(xyz, b.Div(1_a, w));
+ }
+
+ return expr;
}
}
diff --git a/src/tint/lang/wgsl/ast/transform/canonicalize_entry_point_io_test.cc b/src/tint/lang/wgsl/ast/transform/canonicalize_entry_point_io_test.cc
index f30d07f..468bb82 100644
--- a/src/tint/lang/wgsl/ast/transform/canonicalize_entry_point_io_test.cc
+++ b/src/tint/lang/wgsl/ast/transform/canonicalize_entry_point_io_test.cc
@@ -184,7 +184,7 @@
@fragment
fn frag_main(tint_symbol : tint_symbol_1) {
- frag_main_inner(tint_symbol.loc1, tint_symbol.loc2, tint_symbol.coord, tint_symbol.color);
+ frag_main_inner(tint_symbol.loc1, tint_symbol.loc2, vec4<f32>(tint_symbol.coord.xyz, (1 / tint_symbol.coord.w)), tint_symbol.color);
}
)";
@@ -634,7 +634,7 @@
@fragment
fn frag_main(tint_symbol : tint_symbol_1) {
- frag_main_inner(tint_symbol.loc0, FragLocations(tint_symbol.loc1, tint_symbol.loc2), FragBuiltins(tint_symbol.coord), FragColors(tint_symbol.col3, tint_symbol.col1, tint_symbol.col2));
+ frag_main_inner(tint_symbol.loc0, FragLocations(tint_symbol.loc1, tint_symbol.loc2), FragBuiltins(vec4<f32>(tint_symbol.coord.xyz, (1 / tint_symbol.coord.w))), FragColors(tint_symbol.col3, tint_symbol.col1, tint_symbol.col2));
}
)";
@@ -697,7 +697,7 @@
@fragment
fn frag_main(tint_symbol : tint_symbol_1) {
- frag_main_inner(tint_symbol.loc0, FragLocations(tint_symbol.loc1, tint_symbol.loc2), FragBuiltins(tint_symbol.coord), FragColors(tint_symbol.col3, tint_symbol.col1, tint_symbol.col2));
+ frag_main_inner(tint_symbol.loc0, FragLocations(tint_symbol.loc1, tint_symbol.loc2), FragBuiltins(vec4<f32>(tint_symbol.coord.xyz, (1 / tint_symbol.coord.w))), FragColors(tint_symbol.col3, tint_symbol.col1, tint_symbol.col2));
}
struct FragBuiltins {
@@ -2519,7 +2519,7 @@
@fragment
fn frag_main(tint_symbol : tint_symbol_1) -> tint_symbol_2 {
- let inner_result = frag_main_inner(FragmentInput(tint_symbol.value, tint_symbol.coord, tint_symbol.loc0));
+ let inner_result = frag_main_inner(FragmentInput(tint_symbol.value, vec4<f32>(tint_symbol.coord.xyz, (1 / tint_symbol.coord.w)), tint_symbol.loc0));
var wrapper_result : tint_symbol_2;
wrapper_result.value = inner_result.value;
return wrapper_result;
@@ -2572,7 +2572,7 @@
@fragment
fn frag_main(tint_symbol : tint_symbol_1) -> tint_symbol_2 {
- let inner_result = frag_main_inner(FragmentInput(tint_symbol.value, tint_symbol.coord, tint_symbol.loc0));
+ let inner_result = frag_main_inner(FragmentInput(tint_symbol.value, vec4<f32>(tint_symbol.coord.xyz, (1 / tint_symbol.coord.w)), tint_symbol.loc0));
var wrapper_result : tint_symbol_2;
wrapper_result.value = inner_result.value;
return wrapper_result;
@@ -2693,7 +2693,7 @@
@fragment
fn frag_main(tint_symbol_1 : tint_symbol_2) {
- frag_main_inner(tint_symbol_1.ff, tint_symbol_1.c, FragmentInputExtra(tint_symbol_1.d, tint_symbol_1.pos, tint_symbol_1.a), tint_symbol_1.b);
+ frag_main_inner(tint_symbol_1.ff, tint_symbol_1.c, FragmentInputExtra(tint_symbol_1.d, vec4<f32>(tint_symbol_1.pos.xyz, (1 / tint_symbol_1.pos.w)), tint_symbol_1.a), tint_symbol_1.b);
}
)";
@@ -2783,7 +2783,7 @@
@fragment
fn frag_main(tint_symbol_1 : tint_symbol_2) {
- frag_main_inner(tint_symbol_1.ff, tint_symbol_1.c, FragmentInputExtra(tint_symbol_1.d, tint_symbol_1.pos, tint_symbol_1.a), tint_symbol_1.b);
+ frag_main_inner(tint_symbol_1.ff, tint_symbol_1.c, FragmentInputExtra(tint_symbol_1.d, vec4<f32>(tint_symbol_1.pos.xyz, (1 / tint_symbol_1.pos.w)), tint_symbol_1.a), tint_symbol_1.b);
}
struct VertexOutput {
diff --git a/test/tint/bug/tint/1046.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/1046.wgsl.expected.dxc.hlsl
index a8768c5..52ec54a 100644
--- a/test/tint/bug/tint/1046.wgsl.expected.dxc.hlsl
+++ b/test/tint/bug/tint/1046.wgsl.expected.dxc.hlsl
@@ -55,7 +55,7 @@
}
tint_symbol_2 main(tint_symbol_1 tint_symbol) {
- const FragmentInput tint_symbol_3 = {tint_symbol.position, tint_symbol.view_position, tint_symbol.normal, tint_symbol.uv, tint_symbol.color};
+ const FragmentInput tint_symbol_3 = {float4(tint_symbol.position.xyz, (1.0f / tint_symbol.position.w)), tint_symbol.view_position, tint_symbol.normal, tint_symbol.uv, tint_symbol.color};
const FragmentOutput inner_result = main_inner(tint_symbol_3);
tint_symbol_2 wrapper_result = (tint_symbol_2)0;
wrapper_result.color = inner_result.color;
diff --git a/test/tint/bug/tint/1046.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/1046.wgsl.expected.fxc.hlsl
index a8768c5..52ec54a 100644
--- a/test/tint/bug/tint/1046.wgsl.expected.fxc.hlsl
+++ b/test/tint/bug/tint/1046.wgsl.expected.fxc.hlsl
@@ -55,7 +55,7 @@
}
tint_symbol_2 main(tint_symbol_1 tint_symbol) {
- const FragmentInput tint_symbol_3 = {tint_symbol.position, tint_symbol.view_position, tint_symbol.normal, tint_symbol.uv, tint_symbol.color};
+ const FragmentInput tint_symbol_3 = {float4(tint_symbol.position.xyz, (1.0f / tint_symbol.position.w)), tint_symbol.view_position, tint_symbol.normal, tint_symbol.uv, tint_symbol.color};
const FragmentOutput inner_result = main_inner(tint_symbol_3);
tint_symbol_2 wrapper_result = (tint_symbol_2)0;
wrapper_result.color = inner_result.color;
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin.wgsl.expected.dxc.hlsl
index 56c7995..245e8fc 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin.wgsl.expected.dxc.hlsl
@@ -44,6 +44,6 @@
}
void f(tint_symbol_1 tint_symbol) {
- f_inner_1(tint_symbol.pos);
+ f_inner_1(float4(tint_symbol.pos.xyz, (1.0f / tint_symbol.pos.w)));
return;
}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin.wgsl.expected.fxc.hlsl
index 56c7995..245e8fc 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin.wgsl.expected.fxc.hlsl
@@ -44,6 +44,6 @@
}
void f(tint_symbol_1 tint_symbol) {
- f_inner_1(tint_symbol.pos);
+ f_inner_1(float4(tint_symbol.pos.xyz, (1.0f / tint_symbol.pos.w)));
return;
}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location.wgsl.expected.dxc.hlsl
index d986eee..4bdabf7 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location.wgsl.expected.dxc.hlsl
@@ -45,6 +45,6 @@
}
void f(tint_symbol_1 tint_symbol) {
- f_inner_1(tint_symbol.pos, tint_symbol.uv);
+ f_inner_1(float4(tint_symbol.pos.xyz, (1.0f / tint_symbol.pos.w)), tint_symbol.uv);
return;
}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location.wgsl.expected.fxc.hlsl
index d986eee..4bdabf7 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location.wgsl.expected.fxc.hlsl
@@ -45,6 +45,6 @@
}
void f(tint_symbol_1 tint_symbol) {
- f_inner_1(tint_symbol.pos, tint_symbol.uv);
+ f_inner_1(float4(tint_symbol.pos.xyz, (1.0f / tint_symbol.pos.w)), tint_symbol.uv);
return;
}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location_in_struct.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location_in_struct.wgsl.expected.dxc.hlsl
index 701785f..f5e121c 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location_in_struct.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location_in_struct.wgsl.expected.dxc.hlsl
@@ -49,6 +49,6 @@
void f(tint_symbol_2 tint_symbol_1) {
const In tint_symbol_3 = {tint_symbol_1.uv};
- f_inner_1(tint_symbol_1.pos, tint_symbol_3);
+ f_inner_1(float4(tint_symbol_1.pos.xyz, (1.0f / tint_symbol_1.pos.w)), tint_symbol_3);
return;
}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location_in_struct.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location_in_struct.wgsl.expected.fxc.hlsl
index 701785f..f5e121c 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location_in_struct.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_and_location_in_struct.wgsl.expected.fxc.hlsl
@@ -49,6 +49,6 @@
void f(tint_symbol_2 tint_symbol_1) {
const In tint_symbol_3 = {tint_symbol_1.uv};
- f_inner_1(tint_symbol_1.pos, tint_symbol_3);
+ f_inner_1(float4(tint_symbol_1.pos.xyz, (1.0f / tint_symbol_1.pos.w)), tint_symbol_3);
return;
}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct.wgsl.expected.dxc.hlsl
index 62cb156..f73fd4b 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct.wgsl.expected.dxc.hlsl
@@ -47,7 +47,7 @@
}
void f(tint_symbol_2 tint_symbol_1) {
- const In tint_symbol_3 = {tint_symbol_1.pos};
+ const In tint_symbol_3 = {float4(tint_symbol_1.pos.xyz, (1.0f / tint_symbol_1.pos.w))};
f_inner_1(tint_symbol_3);
return;
}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct.wgsl.expected.fxc.hlsl
index 62cb156..f73fd4b 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct.wgsl.expected.fxc.hlsl
@@ -47,7 +47,7 @@
}
void f(tint_symbol_2 tint_symbol_1) {
- const In tint_symbol_3 = {tint_symbol_1.pos};
+ const In tint_symbol_3 = {float4(tint_symbol_1.pos.xyz, (1.0f / tint_symbol_1.pos.w))};
f_inner_1(tint_symbol_3);
return;
}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location.wgsl.expected.dxc.hlsl
index 88be5b9..947fcae 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location.wgsl.expected.dxc.hlsl
@@ -48,7 +48,7 @@
}
void f(tint_symbol_2 tint_symbol_1) {
- const In tint_symbol_3 = {tint_symbol_1.pos};
+ const In tint_symbol_3 = {float4(tint_symbol_1.pos.xyz, (1.0f / tint_symbol_1.pos.w))};
f_inner_1(tint_symbol_3, tint_symbol_1.uv);
return;
}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location.wgsl.expected.fxc.hlsl
index 88be5b9..947fcae 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location.wgsl.expected.fxc.hlsl
@@ -48,7 +48,7 @@
}
void f(tint_symbol_2 tint_symbol_1) {
- const In tint_symbol_3 = {tint_symbol_1.pos};
+ const In tint_symbol_3 = {float4(tint_symbol_1.pos.xyz, (1.0f / tint_symbol_1.pos.w))};
f_inner_1(tint_symbol_3, tint_symbol_1.uv);
return;
}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location_in_struct.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location_in_struct.wgsl.expected.dxc.hlsl
index 41f762c..2e04023 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location_in_struct.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location_in_struct.wgsl.expected.dxc.hlsl
@@ -49,7 +49,7 @@
}
void f(tint_symbol_2 tint_symbol_1) {
- const In tint_symbol_3 = {tint_symbol_1.pos, tint_symbol_1.uv};
+ const In tint_symbol_3 = {float4(tint_symbol_1.pos.xyz, (1.0f / tint_symbol_1.pos.w)), tint_symbol_1.uv};
f_inner_1(tint_symbol_3);
return;
}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location_in_struct.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location_in_struct.wgsl.expected.fxc.hlsl
index 41f762c..2e04023 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location_in_struct.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/builtin_in_struct_and_location_in_struct.wgsl.expected.fxc.hlsl
@@ -49,7 +49,7 @@
}
void f(tint_symbol_2 tint_symbol_1) {
- const In tint_symbol_3 = {tint_symbol_1.pos, tint_symbol_1.uv};
+ const In tint_symbol_3 = {float4(tint_symbol_1.pos.xyz, (1.0f / tint_symbol_1.pos.w)), tint_symbol_1.uv};
f_inner_1(tint_symbol_3);
return;
}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin.wgsl.expected.dxc.hlsl
index 4f8b552..daed6ec 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin.wgsl.expected.dxc.hlsl
@@ -44,6 +44,6 @@
}
void f(tint_symbol_1 tint_symbol) {
- f_inner_1(tint_symbol.pos);
+ f_inner_1(float4(tint_symbol.pos.xyz, (1.0f / tint_symbol.pos.w)));
return;
}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin.wgsl.expected.fxc.hlsl
index 4f8b552..daed6ec 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin.wgsl.expected.fxc.hlsl
@@ -44,6 +44,6 @@
}
void f(tint_symbol_1 tint_symbol) {
- f_inner_1(tint_symbol.pos);
+ f_inner_1(float4(tint_symbol.pos.xyz, (1.0f / tint_symbol.pos.w)));
return;
}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin_in_struct.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin_in_struct.wgsl.expected.dxc.hlsl
index babb753..efec0a5 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin_in_struct.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin_in_struct.wgsl.expected.dxc.hlsl
@@ -47,7 +47,7 @@
}
void f(tint_symbol_2 tint_symbol_1) {
- const In tint_symbol_3 = {tint_symbol_1.pos};
+ const In tint_symbol_3 = {float4(tint_symbol_1.pos.xyz, (1.0f / tint_symbol_1.pos.w))};
f_inner_1(tint_symbol_3);
return;
}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin_in_struct.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin_in_struct.wgsl.expected.fxc.hlsl
index babb753..efec0a5 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin_in_struct.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/invariant_builtin_in_struct.wgsl.expected.fxc.hlsl
@@ -47,7 +47,7 @@
}
void f(tint_symbol_2 tint_symbol_1) {
- const In tint_symbol_3 = {tint_symbol_1.pos};
+ const In tint_symbol_3 = {float4(tint_symbol_1.pos.xyz, (1.0f / tint_symbol_1.pos.w))};
f_inner_1(tint_symbol_3);
return;
}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/location.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/location.wgsl.expected.dxc.hlsl
index 8e5ee97..bfabb4b 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/location.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/location.wgsl.expected.dxc.hlsl
@@ -46,6 +46,6 @@
}
void f(tint_symbol_1 tint_symbol) {
- f_inner_1(tint_symbol.a, tint_symbol.b, tint_symbol.my_pos);
+ f_inner_1(tint_symbol.a, tint_symbol.b, float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
return;
}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/location.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/location.wgsl.expected.fxc.hlsl
index 8e5ee97..bfabb4b 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/location.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/location.wgsl.expected.fxc.hlsl
@@ -46,6 +46,6 @@
}
void f(tint_symbol_1 tint_symbol) {
- f_inner_1(tint_symbol.a, tint_symbol.b, tint_symbol.my_pos);
+ f_inner_1(tint_symbol.a, tint_symbol.b, float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
return;
}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/location_in_struct.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/location_in_struct.wgsl.expected.dxc.hlsl
index ab6814e..218c324 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/location_in_struct.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/location_in_struct.wgsl.expected.dxc.hlsl
@@ -51,6 +51,6 @@
void f(tint_symbol_2 tint_symbol_1) {
const In tint_symbol_3 = {tint_symbol_1.a, tint_symbol_1.b};
- f_inner_1(tint_symbol_3, tint_symbol_1.my_pos);
+ f_inner_1(tint_symbol_3, float4(tint_symbol_1.my_pos.xyz, (1.0f / tint_symbol_1.my_pos.w)));
return;
}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/additional_params/location_in_struct.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/additional_params/location_in_struct.wgsl.expected.fxc.hlsl
index ab6814e..218c324 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/additional_params/location_in_struct.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/additional_params/location_in_struct.wgsl.expected.fxc.hlsl
@@ -51,6 +51,6 @@
void f(tint_symbol_2 tint_symbol_1) {
const In tint_symbol_3 = {tint_symbol_1.a, tint_symbol_1.b};
- f_inner_1(tint_symbol_3, tint_symbol_1.my_pos);
+ f_inner_1(tint_symbol_3, float4(tint_symbol_1.my_pos.xyz, (1.0f / tint_symbol_1.my_pos.w)));
return;
}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/multiple_attachments.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/multiple_attachments.wgsl.expected.dxc.hlsl
index 741f9c1..92144f5 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/multiple_attachments.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/multiple_attachments.wgsl.expected.dxc.hlsl
@@ -59,7 +59,7 @@
}
tint_symbol_2 f(tint_symbol_1 tint_symbol) {
- const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ const f_res inner_result = f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
tint_symbol_2 wrapper_result = (tint_symbol_2)0;
wrapper_result.output_0 = inner_result.output_0;
wrapper_result.output_1 = inner_result.output_1;
diff --git a/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/multiple_attachments.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/multiple_attachments.wgsl.expected.fxc.hlsl
index 741f9c1..92144f5 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/multiple_attachments.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/multiple_attachments.wgsl.expected.fxc.hlsl
@@ -59,7 +59,7 @@
}
tint_symbol_2 f(tint_symbol_1 tint_symbol) {
- const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ const f_res inner_result = f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
tint_symbol_2 wrapper_result = (tint_symbol_2)0;
wrapper_result.output_0 = inner_result.output_0;
wrapper_result.output_1 = inner_result.output_1;
diff --git a/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/single_attachment.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/single_attachment.wgsl.expected.dxc.hlsl
index 9d0fe08..6e84d23 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/single_attachment.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/single_attachment.wgsl.expected.dxc.hlsl
@@ -51,7 +51,7 @@
}
tint_symbol_2 f(tint_symbol_1 tint_symbol) {
- const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ const f_res inner_result = f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
tint_symbol_2 wrapper_result = (tint_symbol_2)0;
wrapper_result.output_0 = inner_result.output_0;
wrapper_result.output_1 = inner_result.output_1;
diff --git a/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/single_attachment.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/single_attachment.wgsl.expected.fxc.hlsl
index 9d0fe08..6e84d23 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/single_attachment.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/multiple_outputs/single_attachment.wgsl.expected.fxc.hlsl
@@ -51,7 +51,7 @@
}
tint_symbol_2 f(tint_symbol_1 tint_symbol) {
- const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ const f_res inner_result = f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
tint_symbol_2 wrapper_result = (tint_symbol_2)0;
wrapper_result.output_0 = inner_result.output_0;
wrapper_result.output_1 = inner_result.output_1;
diff --git a/test/tint/extensions/pixel_local/entry_point_use/one_output/multiple_attachments.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/one_output/multiple_attachments.wgsl.expected.dxc.hlsl
index 522659b..34d8dea 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/one_output/multiple_attachments.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/one_output/multiple_attachments.wgsl.expected.dxc.hlsl
@@ -49,7 +49,7 @@
}
tint_symbol_2 f(tint_symbol_1 tint_symbol) {
- const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ const f_res inner_result = f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
tint_symbol_2 wrapper_result = (tint_symbol_2)0;
wrapper_result.output_0 = inner_result.output_0;
return wrapper_result;
diff --git a/test/tint/extensions/pixel_local/entry_point_use/one_output/multiple_attachments.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/one_output/multiple_attachments.wgsl.expected.fxc.hlsl
index 522659b..34d8dea 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/one_output/multiple_attachments.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/one_output/multiple_attachments.wgsl.expected.fxc.hlsl
@@ -49,7 +49,7 @@
}
tint_symbol_2 f(tint_symbol_1 tint_symbol) {
- const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ const f_res inner_result = f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
tint_symbol_2 wrapper_result = (tint_symbol_2)0;
wrapper_result.output_0 = inner_result.output_0;
return wrapper_result;
diff --git a/test/tint/extensions/pixel_local/entry_point_use/one_output/single_attachment.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/one_output/single_attachment.wgsl.expected.dxc.hlsl
index 13ab144..68e173b 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/one_output/single_attachment.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/one_output/single_attachment.wgsl.expected.dxc.hlsl
@@ -41,7 +41,7 @@
}
tint_symbol_2 f(tint_symbol_1 tint_symbol) {
- const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ const f_res inner_result = f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
tint_symbol_2 wrapper_result = (tint_symbol_2)0;
wrapper_result.output_0 = inner_result.output_0;
return wrapper_result;
diff --git a/test/tint/extensions/pixel_local/entry_point_use/one_output/single_attachment.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/one_output/single_attachment.wgsl.expected.fxc.hlsl
index 13ab144..68e173b 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/one_output/single_attachment.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/one_output/single_attachment.wgsl.expected.fxc.hlsl
@@ -41,7 +41,7 @@
}
tint_symbol_2 f(tint_symbol_1 tint_symbol) {
- const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ const f_res inner_result = f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
tint_symbol_2 wrapper_result = (tint_symbol_2)0;
wrapper_result.output_0 = inner_result.output_0;
return wrapper_result;
diff --git a/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/multiple_attachments.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/multiple_attachments.wgsl.expected.dxc.hlsl
index 36dcaa2..ad48f97 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/multiple_attachments.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/multiple_attachments.wgsl.expected.dxc.hlsl
@@ -40,6 +40,6 @@
}
void f(tint_symbol_1 tint_symbol) {
- f_inner_1(tint_symbol.my_pos);
+ f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
return;
}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/multiple_attachments.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/multiple_attachments.wgsl.expected.fxc.hlsl
index 36dcaa2..ad48f97 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/multiple_attachments.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/multiple_attachments.wgsl.expected.fxc.hlsl
@@ -40,6 +40,6 @@
}
void f(tint_symbol_1 tint_symbol) {
- f_inner_1(tint_symbol.my_pos);
+ f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
return;
}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/single_attachment.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/single_attachment.wgsl.expected.dxc.hlsl
index 78fee6c..bb794b1 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/single_attachment.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/single_attachment.wgsl.expected.dxc.hlsl
@@ -32,6 +32,6 @@
}
void f(tint_symbol_1 tint_symbol) {
- f_inner_1(tint_symbol.my_pos);
+ f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
return;
}
diff --git a/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/single_attachment.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/single_attachment.wgsl.expected.fxc.hlsl
index 78fee6c..bb794b1 100644
--- a/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/single_attachment.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/entry_point_use/zero_outputs/single_attachment.wgsl.expected.fxc.hlsl
@@ -32,6 +32,6 @@
}
void f(tint_symbol_1 tint_symbol) {
- f_inner_1(tint_symbol.my_pos);
+ f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
return;
}
diff --git a/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/multiple_attachments.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/multiple_attachments.wgsl.expected.dxc.hlsl
index c708cd5..e8859da 100644
--- a/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/multiple_attachments.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/multiple_attachments.wgsl.expected.dxc.hlsl
@@ -73,7 +73,7 @@
}
tint_symbol_2 f(tint_symbol_1 tint_symbol) {
- const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ const f_res inner_result = f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
tint_symbol_2 wrapper_result = (tint_symbol_2)0;
wrapper_result.output_0 = inner_result.output_0;
wrapper_result.output_1 = inner_result.output_1;
diff --git a/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/multiple_attachments.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/multiple_attachments.wgsl.expected.fxc.hlsl
index c708cd5..e8859da 100644
--- a/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/multiple_attachments.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/multiple_attachments.wgsl.expected.fxc.hlsl
@@ -73,7 +73,7 @@
}
tint_symbol_2 f(tint_symbol_1 tint_symbol) {
- const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ const f_res inner_result = f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
tint_symbol_2 wrapper_result = (tint_symbol_2)0;
wrapper_result.output_0 = inner_result.output_0;
wrapper_result.output_1 = inner_result.output_1;
diff --git a/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/single_attachment.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/single_attachment.wgsl.expected.dxc.hlsl
index d7212f49..757edf4 100644
--- a/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/single_attachment.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/single_attachment.wgsl.expected.dxc.hlsl
@@ -65,7 +65,7 @@
}
tint_symbol_2 f(tint_symbol_1 tint_symbol) {
- const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ const f_res inner_result = f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
tint_symbol_2 wrapper_result = (tint_symbol_2)0;
wrapper_result.output_0 = inner_result.output_0;
wrapper_result.output_1 = inner_result.output_1;
diff --git a/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/single_attachment.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/single_attachment.wgsl.expected.fxc.hlsl
index d7212f49..757edf4 100644
--- a/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/single_attachment.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/indirect_use/multiple_outputs/single_attachment.wgsl.expected.fxc.hlsl
@@ -65,7 +65,7 @@
}
tint_symbol_2 f(tint_symbol_1 tint_symbol) {
- const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ const f_res inner_result = f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
tint_symbol_2 wrapper_result = (tint_symbol_2)0;
wrapper_result.output_0 = inner_result.output_0;
wrapper_result.output_1 = inner_result.output_1;
diff --git a/test/tint/extensions/pixel_local/indirect_use/one_output/multiple_attachments.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/indirect_use/one_output/multiple_attachments.wgsl.expected.dxc.hlsl
index 2eb9951..423b084 100644
--- a/test/tint/extensions/pixel_local/indirect_use/one_output/multiple_attachments.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/indirect_use/one_output/multiple_attachments.wgsl.expected.dxc.hlsl
@@ -63,7 +63,7 @@
}
tint_symbol_2 f(tint_symbol_1 tint_symbol) {
- const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ const f_res inner_result = f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
tint_symbol_2 wrapper_result = (tint_symbol_2)0;
wrapper_result.output_0 = inner_result.output_0;
return wrapper_result;
diff --git a/test/tint/extensions/pixel_local/indirect_use/one_output/multiple_attachments.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/indirect_use/one_output/multiple_attachments.wgsl.expected.fxc.hlsl
index 2eb9951..423b084 100644
--- a/test/tint/extensions/pixel_local/indirect_use/one_output/multiple_attachments.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/indirect_use/one_output/multiple_attachments.wgsl.expected.fxc.hlsl
@@ -63,7 +63,7 @@
}
tint_symbol_2 f(tint_symbol_1 tint_symbol) {
- const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ const f_res inner_result = f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
tint_symbol_2 wrapper_result = (tint_symbol_2)0;
wrapper_result.output_0 = inner_result.output_0;
return wrapper_result;
diff --git a/test/tint/extensions/pixel_local/indirect_use/one_output/single_attachment.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/indirect_use/one_output/single_attachment.wgsl.expected.dxc.hlsl
index c32702b..dd13915 100644
--- a/test/tint/extensions/pixel_local/indirect_use/one_output/single_attachment.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/indirect_use/one_output/single_attachment.wgsl.expected.dxc.hlsl
@@ -55,7 +55,7 @@
}
tint_symbol_2 f(tint_symbol_1 tint_symbol) {
- const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ const f_res inner_result = f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
tint_symbol_2 wrapper_result = (tint_symbol_2)0;
wrapper_result.output_0 = inner_result.output_0;
return wrapper_result;
diff --git a/test/tint/extensions/pixel_local/indirect_use/one_output/single_attachment.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/indirect_use/one_output/single_attachment.wgsl.expected.fxc.hlsl
index c32702b..dd13915 100644
--- a/test/tint/extensions/pixel_local/indirect_use/one_output/single_attachment.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/indirect_use/one_output/single_attachment.wgsl.expected.fxc.hlsl
@@ -55,7 +55,7 @@
}
tint_symbol_2 f(tint_symbol_1 tint_symbol) {
- const f_res inner_result = f_inner_1(tint_symbol.my_pos);
+ const f_res inner_result = f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
tint_symbol_2 wrapper_result = (tint_symbol_2)0;
wrapper_result.output_0 = inner_result.output_0;
return wrapper_result;
diff --git a/test/tint/extensions/pixel_local/indirect_use/zero_outputs/multiple_attachments.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/indirect_use/zero_outputs/multiple_attachments.wgsl.expected.dxc.hlsl
index 2d76369..a8e51e0 100644
--- a/test/tint/extensions/pixel_local/indirect_use/zero_outputs/multiple_attachments.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/indirect_use/zero_outputs/multiple_attachments.wgsl.expected.dxc.hlsl
@@ -54,6 +54,6 @@
}
void f(tint_symbol_1 tint_symbol) {
- f_inner_1(tint_symbol.my_pos);
+ f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
return;
}
diff --git a/test/tint/extensions/pixel_local/indirect_use/zero_outputs/multiple_attachments.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/indirect_use/zero_outputs/multiple_attachments.wgsl.expected.fxc.hlsl
index 2d76369..a8e51e0 100644
--- a/test/tint/extensions/pixel_local/indirect_use/zero_outputs/multiple_attachments.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/indirect_use/zero_outputs/multiple_attachments.wgsl.expected.fxc.hlsl
@@ -54,6 +54,6 @@
}
void f(tint_symbol_1 tint_symbol) {
- f_inner_1(tint_symbol.my_pos);
+ f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
return;
}
diff --git a/test/tint/extensions/pixel_local/indirect_use/zero_outputs/single_attachment.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/indirect_use/zero_outputs/single_attachment.wgsl.expected.dxc.hlsl
index fb53644..2dc5ab2 100644
--- a/test/tint/extensions/pixel_local/indirect_use/zero_outputs/single_attachment.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/indirect_use/zero_outputs/single_attachment.wgsl.expected.dxc.hlsl
@@ -46,6 +46,6 @@
}
void f(tint_symbol_1 tint_symbol) {
- f_inner_1(tint_symbol.my_pos);
+ f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
return;
}
diff --git a/test/tint/extensions/pixel_local/indirect_use/zero_outputs/single_attachment.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/indirect_use/zero_outputs/single_attachment.wgsl.expected.fxc.hlsl
index fb53644..2dc5ab2 100644
--- a/test/tint/extensions/pixel_local/indirect_use/zero_outputs/single_attachment.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/indirect_use/zero_outputs/single_attachment.wgsl.expected.fxc.hlsl
@@ -46,6 +46,6 @@
}
void f(tint_symbol_1 tint_symbol) {
- f_inner_1(tint_symbol.my_pos);
+ f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
return;
}
diff --git a/test/tint/extensions/pixel_local/ptr/local.wgsl.expected.dxc.hlsl b/test/tint/extensions/pixel_local/ptr/local.wgsl.expected.dxc.hlsl
index 3bf6703..fcac83b 100644
--- a/test/tint/extensions/pixel_local/ptr/local.wgsl.expected.dxc.hlsl
+++ b/test/tint/extensions/pixel_local/ptr/local.wgsl.expected.dxc.hlsl
@@ -32,6 +32,6 @@
}
void f(tint_symbol_1 tint_symbol) {
- f_inner_1(tint_symbol.my_pos);
+ f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
return;
}
diff --git a/test/tint/extensions/pixel_local/ptr/local.wgsl.expected.fxc.hlsl b/test/tint/extensions/pixel_local/ptr/local.wgsl.expected.fxc.hlsl
index 3bf6703..fcac83b 100644
--- a/test/tint/extensions/pixel_local/ptr/local.wgsl.expected.fxc.hlsl
+++ b/test/tint/extensions/pixel_local/ptr/local.wgsl.expected.fxc.hlsl
@@ -32,6 +32,6 @@
}
void f(tint_symbol_1 tint_symbol) {
- f_inner_1(tint_symbol.my_pos);
+ f_inner_1(float4(tint_symbol.my_pos.xyz, (1.0f / tint_symbol.my_pos.w)));
return;
}
diff --git a/test/tint/types/functions/shader_io/fragment_input_builtins.wgsl.expected.dxc.hlsl b/test/tint/types/functions/shader_io/fragment_input_builtins.wgsl.expected.dxc.hlsl
index cc5f201..3631210 100644
--- a/test/tint/types/functions/shader_io/fragment_input_builtins.wgsl.expected.dxc.hlsl
+++ b/test/tint/types/functions/shader_io/fragment_input_builtins.wgsl.expected.dxc.hlsl
@@ -13,6 +13,6 @@
}
void main(tint_symbol_1 tint_symbol) {
- main_inner(tint_symbol.position, tint_symbol.front_facing, tint_symbol.sample_index, tint_symbol.sample_mask);
+ main_inner(float4(tint_symbol.position.xyz, (1.0f / tint_symbol.position.w)), tint_symbol.front_facing, tint_symbol.sample_index, tint_symbol.sample_mask);
return;
}
diff --git a/test/tint/types/functions/shader_io/fragment_input_builtins.wgsl.expected.fxc.hlsl b/test/tint/types/functions/shader_io/fragment_input_builtins.wgsl.expected.fxc.hlsl
index cc5f201..3631210 100644
--- a/test/tint/types/functions/shader_io/fragment_input_builtins.wgsl.expected.fxc.hlsl
+++ b/test/tint/types/functions/shader_io/fragment_input_builtins.wgsl.expected.fxc.hlsl
@@ -13,6 +13,6 @@
}
void main(tint_symbol_1 tint_symbol) {
- main_inner(tint_symbol.position, tint_symbol.front_facing, tint_symbol.sample_index, tint_symbol.sample_mask);
+ main_inner(float4(tint_symbol.position.xyz, (1.0f / tint_symbol.position.w)), tint_symbol.front_facing, tint_symbol.sample_index, tint_symbol.sample_mask);
return;
}
diff --git a/test/tint/types/functions/shader_io/fragment_input_builtins_struct.wgsl.expected.dxc.hlsl b/test/tint/types/functions/shader_io/fragment_input_builtins_struct.wgsl.expected.dxc.hlsl
index 6f38a1f..b879c8f 100644
--- a/test/tint/types/functions/shader_io/fragment_input_builtins_struct.wgsl.expected.dxc.hlsl
+++ b/test/tint/types/functions/shader_io/fragment_input_builtins_struct.wgsl.expected.dxc.hlsl
@@ -19,7 +19,7 @@
}
void main(tint_symbol_1 tint_symbol) {
- const FragmentInputs tint_symbol_2 = {tint_symbol.position, tint_symbol.front_facing, tint_symbol.sample_index, tint_symbol.sample_mask};
+ const FragmentInputs tint_symbol_2 = {float4(tint_symbol.position.xyz, (1.0f / tint_symbol.position.w)), tint_symbol.front_facing, tint_symbol.sample_index, tint_symbol.sample_mask};
main_inner(tint_symbol_2);
return;
}
diff --git a/test/tint/types/functions/shader_io/fragment_input_builtins_struct.wgsl.expected.fxc.hlsl b/test/tint/types/functions/shader_io/fragment_input_builtins_struct.wgsl.expected.fxc.hlsl
index 6f38a1f..b879c8f 100644
--- a/test/tint/types/functions/shader_io/fragment_input_builtins_struct.wgsl.expected.fxc.hlsl
+++ b/test/tint/types/functions/shader_io/fragment_input_builtins_struct.wgsl.expected.fxc.hlsl
@@ -19,7 +19,7 @@
}
void main(tint_symbol_1 tint_symbol) {
- const FragmentInputs tint_symbol_2 = {tint_symbol.position, tint_symbol.front_facing, tint_symbol.sample_index, tint_symbol.sample_mask};
+ const FragmentInputs tint_symbol_2 = {float4(tint_symbol.position.xyz, (1.0f / tint_symbol.position.w)), tint_symbol.front_facing, tint_symbol.sample_index, tint_symbol.sample_mask};
main_inner(tint_symbol_2);
return;
}
diff --git a/test/tint/types/functions/shader_io/fragment_input_mixed.wgsl.expected.dxc.hlsl b/test/tint/types/functions/shader_io/fragment_input_mixed.wgsl.expected.dxc.hlsl
index 1d9d587..325b786 100644
--- a/test/tint/types/functions/shader_io/fragment_input_mixed.wgsl.expected.dxc.hlsl
+++ b/test/tint/types/functions/shader_io/fragment_input_mixed.wgsl.expected.dxc.hlsl
@@ -29,7 +29,7 @@
}
void main(tint_symbol_1 tint_symbol) {
- const FragmentInputs0 tint_symbol_2 = {tint_symbol.position, tint_symbol.loc0};
+ const FragmentInputs0 tint_symbol_2 = {float4(tint_symbol.position.xyz, (1.0f / tint_symbol.position.w)), tint_symbol.loc0};
const FragmentInputs1 tint_symbol_3 = {tint_symbol.loc3, tint_symbol.sample_mask};
main_inner(tint_symbol_2, tint_symbol.front_facing, tint_symbol.loc1, tint_symbol.sample_index, tint_symbol_3, tint_symbol.loc2);
return;
diff --git a/test/tint/types/functions/shader_io/fragment_input_mixed.wgsl.expected.fxc.hlsl b/test/tint/types/functions/shader_io/fragment_input_mixed.wgsl.expected.fxc.hlsl
index 1d9d587..325b786 100644
--- a/test/tint/types/functions/shader_io/fragment_input_mixed.wgsl.expected.fxc.hlsl
+++ b/test/tint/types/functions/shader_io/fragment_input_mixed.wgsl.expected.fxc.hlsl
@@ -29,7 +29,7 @@
}
void main(tint_symbol_1 tint_symbol) {
- const FragmentInputs0 tint_symbol_2 = {tint_symbol.position, tint_symbol.loc0};
+ const FragmentInputs0 tint_symbol_2 = {float4(tint_symbol.position.xyz, (1.0f / tint_symbol.position.w)), tint_symbol.loc0};
const FragmentInputs1 tint_symbol_3 = {tint_symbol.loc3, tint_symbol.sample_mask};
main_inner(tint_symbol_2, tint_symbol.front_facing, tint_symbol.loc1, tint_symbol.sample_index, tint_symbol_3, tint_symbol.loc2);
return;
diff --git a/test/tint/types/functions/shader_io/fragment_input_mixed_f16.wgsl.expected.dxc.hlsl b/test/tint/types/functions/shader_io/fragment_input_mixed_f16.wgsl.expected.dxc.hlsl
index f8de307..cb9d49a 100644
--- a/test/tint/types/functions/shader_io/fragment_input_mixed_f16.wgsl.expected.dxc.hlsl
+++ b/test/tint/types/functions/shader_io/fragment_input_mixed_f16.wgsl.expected.dxc.hlsl
@@ -34,7 +34,7 @@
}
void main(tint_symbol_1 tint_symbol) {
- const FragmentInputs0 tint_symbol_2 = {tint_symbol.position, tint_symbol.loc0};
+ const FragmentInputs0 tint_symbol_2 = {float4(tint_symbol.position.xyz, (1.0f / tint_symbol.position.w)), tint_symbol.loc0};
const FragmentInputs1 tint_symbol_3 = {tint_symbol.loc3, tint_symbol.loc5, tint_symbol.sample_mask};
main_inner(tint_symbol_2, tint_symbol.front_facing, tint_symbol.loc1, tint_symbol.sample_index, tint_symbol_3, tint_symbol.loc2, tint_symbol.loc4);
return;
diff --git a/test/tint/types/functions/shader_io/interpolate_integers.wgsl.expected.dxc.hlsl b/test/tint/types/functions/shader_io/interpolate_integers.wgsl.expected.dxc.hlsl
index 02c4f17..ef17951 100644
--- a/test/tint/types/functions/shader_io/interpolate_integers.wgsl.expected.dxc.hlsl
+++ b/test/tint/types/functions/shader_io/interpolate_integers.wgsl.expected.dxc.hlsl
@@ -45,7 +45,7 @@
}
tint_symbol_3 frag_main(tint_symbol_2 tint_symbol_1) {
- const Interface tint_symbol_5 = {tint_symbol_1.i, tint_symbol_1.u, tint_symbol_1.vi, tint_symbol_1.vu, tint_symbol_1.pos};
+ const Interface tint_symbol_5 = {tint_symbol_1.i, tint_symbol_1.u, tint_symbol_1.vi, tint_symbol_1.vu, float4(tint_symbol_1.pos.xyz, (1.0f / tint_symbol_1.pos.w))};
const int inner_result_1 = frag_main_inner(tint_symbol_5);
tint_symbol_3 wrapper_result_1 = (tint_symbol_3)0;
wrapper_result_1.value = inner_result_1;
diff --git a/test/tint/types/functions/shader_io/interpolate_integers.wgsl.expected.fxc.hlsl b/test/tint/types/functions/shader_io/interpolate_integers.wgsl.expected.fxc.hlsl
index 02c4f17..ef17951 100644
--- a/test/tint/types/functions/shader_io/interpolate_integers.wgsl.expected.fxc.hlsl
+++ b/test/tint/types/functions/shader_io/interpolate_integers.wgsl.expected.fxc.hlsl
@@ -45,7 +45,7 @@
}
tint_symbol_3 frag_main(tint_symbol_2 tint_symbol_1) {
- const Interface tint_symbol_5 = {tint_symbol_1.i, tint_symbol_1.u, tint_symbol_1.vi, tint_symbol_1.vu, tint_symbol_1.pos};
+ const Interface tint_symbol_5 = {tint_symbol_1.i, tint_symbol_1.u, tint_symbol_1.vi, tint_symbol_1.vu, float4(tint_symbol_1.pos.xyz, (1.0f / tint_symbol_1.pos.w))};
const int inner_result_1 = frag_main_inner(tint_symbol_5);
tint_symbol_3 wrapper_result_1 = (tint_symbol_3)0;
wrapper_result_1.value = inner_result_1;
diff --git a/test/tint/types/functions/shader_io/shared_struct_different_stages.wgsl.expected.dxc.hlsl b/test/tint/types/functions/shader_io/shared_struct_different_stages.wgsl.expected.dxc.hlsl
index d3fa32c..ca5dbf6 100644
--- a/test/tint/types/functions/shader_io/shared_struct_different_stages.wgsl.expected.dxc.hlsl
+++ b/test/tint/types/functions/shader_io/shared_struct_different_stages.wgsl.expected.dxc.hlsl
@@ -35,7 +35,7 @@
}
void frag_main(tint_symbol_2 tint_symbol_1) {
- const Interface tint_symbol_4 = {tint_symbol_1.col1, tint_symbol_1.col2, tint_symbol_1.pos};
+ const Interface tint_symbol_4 = {tint_symbol_1.col1, tint_symbol_1.col2, float4(tint_symbol_1.pos.xyz, (1.0f / tint_symbol_1.pos.w))};
frag_main_inner(tint_symbol_4);
return;
}
diff --git a/test/tint/types/functions/shader_io/shared_struct_different_stages.wgsl.expected.fxc.hlsl b/test/tint/types/functions/shader_io/shared_struct_different_stages.wgsl.expected.fxc.hlsl
index d3fa32c..ca5dbf6 100644
--- a/test/tint/types/functions/shader_io/shared_struct_different_stages.wgsl.expected.fxc.hlsl
+++ b/test/tint/types/functions/shader_io/shared_struct_different_stages.wgsl.expected.fxc.hlsl
@@ -35,7 +35,7 @@
}
void frag_main(tint_symbol_2 tint_symbol_1) {
- const Interface tint_symbol_4 = {tint_symbol_1.col1, tint_symbol_1.col2, tint_symbol_1.pos};
+ const Interface tint_symbol_4 = {tint_symbol_1.col1, tint_symbol_1.col2, float4(tint_symbol_1.pos.xyz, (1.0f / tint_symbol_1.pos.w))};
frag_main_inner(tint_symbol_4);
return;
}
diff --git a/test/tint/types/functions/shader_io/shared_struct_different_stages_f16.wgsl.expected.dxc.hlsl b/test/tint/types/functions/shader_io/shared_struct_different_stages_f16.wgsl.expected.dxc.hlsl
index a05bfee..e5ba250 100644
--- a/test/tint/types/functions/shader_io/shared_struct_different_stages_f16.wgsl.expected.dxc.hlsl
+++ b/test/tint/types/functions/shader_io/shared_struct_different_stages_f16.wgsl.expected.dxc.hlsl
@@ -35,7 +35,7 @@
}
void frag_main(tint_symbol_2 tint_symbol_1) {
- const Interface tint_symbol_4 = {tint_symbol_1.col1, tint_symbol_1.col2, tint_symbol_1.pos};
+ const Interface tint_symbol_4 = {tint_symbol_1.col1, tint_symbol_1.col2, float4(tint_symbol_1.pos.xyz, (1.0f / tint_symbol_1.pos.w))};
frag_main_inner(tint_symbol_4);
return;
}
diff --git a/test/tint/types/functions/shader_io/shared_struct_storage_buffer.wgsl.expected.dxc.hlsl b/test/tint/types/functions/shader_io/shared_struct_storage_buffer.wgsl.expected.dxc.hlsl
index 2a0cc45..52427a5 100644
--- a/test/tint/types/functions/shader_io/shared_struct_storage_buffer.wgsl.expected.dxc.hlsl
+++ b/test/tint/types/functions/shader_io/shared_struct_storage_buffer.wgsl.expected.dxc.hlsl
@@ -26,7 +26,7 @@
}
void frag_main(tint_symbol_1 tint_symbol) {
- const S tint_symbol_2 = {tint_symbol.f, tint_symbol.u, tint_symbol.v};
+ const S tint_symbol_2 = {tint_symbol.f, tint_symbol.u, float4(tint_symbol.v.xyz, (1.0f / tint_symbol.v.w))};
frag_main_inner(tint_symbol_2);
return;
}
diff --git a/test/tint/types/functions/shader_io/shared_struct_storage_buffer.wgsl.expected.fxc.hlsl b/test/tint/types/functions/shader_io/shared_struct_storage_buffer.wgsl.expected.fxc.hlsl
index 2a0cc45..52427a5 100644
--- a/test/tint/types/functions/shader_io/shared_struct_storage_buffer.wgsl.expected.fxc.hlsl
+++ b/test/tint/types/functions/shader_io/shared_struct_storage_buffer.wgsl.expected.fxc.hlsl
@@ -26,7 +26,7 @@
}
void frag_main(tint_symbol_1 tint_symbol) {
- const S tint_symbol_2 = {tint_symbol.f, tint_symbol.u, tint_symbol.v};
+ const S tint_symbol_2 = {tint_symbol.f, tint_symbol.u, float4(tint_symbol.v.xyz, (1.0f / tint_symbol.v.w))};
frag_main_inner(tint_symbol_2);
return;
}
diff --git a/test/tint/types/functions/shader_io/shared_struct_storage_buffer_f16.wgsl.expected.dxc.hlsl b/test/tint/types/functions/shader_io/shared_struct_storage_buffer_f16.wgsl.expected.dxc.hlsl
index e9a2fa4..655283b 100644
--- a/test/tint/types/functions/shader_io/shared_struct_storage_buffer_f16.wgsl.expected.dxc.hlsl
+++ b/test/tint/types/functions/shader_io/shared_struct_storage_buffer_f16.wgsl.expected.dxc.hlsl
@@ -34,7 +34,7 @@
}
void frag_main(tint_symbol_1 tint_symbol) {
- const S tint_symbol_2 = {tint_symbol.f, tint_symbol.u, tint_symbol.v, tint_symbol.x, tint_symbol.y};
+ const S tint_symbol_2 = {tint_symbol.f, tint_symbol.u, float4(tint_symbol.v.xyz, (1.0f / tint_symbol.v.w)), tint_symbol.x, tint_symbol.y};
frag_main_inner(tint_symbol_2);
return;
}