diff --git a/tests/hlsl/entry-point-semantics.shader_test b/tests/hlsl/entry-point-semantics.shader_test index d177b037..b87dca4d 100644 --- a/tests/hlsl/entry-point-semantics.shader_test +++ b/tests/hlsl/entry-point-semantics.shader_test @@ -2,9 +2,10 @@ % definition and its declarations. [vertex shader] -void main(out float tex : texcoord, inout float4 pos : sv_position) +void main(float4 pos : position, out float tex : texcoord, out float4 out_pos : sv_position) { tex = 0.2; + out_pos = pos; } [pixel shader fail] @@ -53,12 +54,13 @@ probe (0, 0) rgba (0.2, 0.2, 0.2, 0.2) [vertex shader] -void main(out float4 tex[4] : texcoord, inout float4 pos : sv_position) +void main(float4 pos : position, out float4 tex[4] : texcoord, out float4 out_pos : sv_position) { tex[0] = float4(10.0, 11.0, 12.0, 13.0); tex[1] = float4(20.0, 21.0, 22.0, 23.0); tex[2] = float4(30.0, 31.0, 32.0, 33.0); tex[3] = float4(40.0, 41.0, 42.0, 43.0); + out_pos = pos; } @@ -196,10 +198,11 @@ struct apple float4 tex[2] : TEXCOORD0; }; -void main(out apple apl, inout float4 pos : sv_position) +void main(float4 pos : position, out apple apl, out float4 out_pos : sv_position) { apl.tex[0] = float4(1, 2, 3, 4); apl.tex[1] = float4(10, 20, 30, 40); + out_pos = pos; } [pixel shader] @@ -220,10 +223,11 @@ struct apple float2 tex : TEXCOORD0; }; -void main(out apple apls[2], inout float4 pos : sv_position) +void main(float4 pos : position, out apple apls[2], out float4 out_pos : sv_position) { apls[0].tex = float2(1, 2); apls[1].tex = float2(3, 4); + out_pos = pos; } @@ -233,29 +237,32 @@ struct apple float2 f : SEMANTIC; }; -void main(out apple a, out apple b, inout float4 pos : sv_position) +void main(float4 pos : position, out apple a, out apple b, out float4 out_pos : sv_position) { a.f = float2(1, 2); b.f = float2(3, 4); + out_pos = pos; } % Semantic names are case-insensitive. [vertex shader fail] -void main(out float2 a : sem0, out float2 b : SEM, inout float4 pos : sv_position) +void main(float4 pos : position, out float2 a : sem0, out float2 b : SEM, out float4 out_pos : sv_position) { a = float2(1, 2); b = float2(3, 4); + out_pos = pos; } [vertex shader] -void main(out float4 tex[4] : texcoord, inout float4 pos : sv_position) +void main(float4 pos : position, out float4 tex[4] : texcoord, out float4 out_pos : sv_position) { tex[0] = float4(10.0, 11.0, 12.0, 13.0); tex[1] = float4(20.0, 21.0, 22.0, 23.0); tex[2] = float4(30.0, 31.0, 32.0, 33.0); tex[3] = float4(40.0, 41.0, 42.0, 43.0); + out_pos = pos; } diff --git a/tests/hlsl/for.shader_test b/tests/hlsl/for.shader_test index 1392118b..9407c81b 100644 --- a/tests/hlsl/for.shader_test +++ b/tests/hlsl/for.shader_test @@ -1,7 +1,8 @@ [vertex shader] -void main(out float tex : texcoord, inout float4 pos : sv_position) +void main(float4 pos : position, out float tex : texcoord, out float4 out_pos : sv_position) { tex = pos.x; + out_pos = pos; } [pixel shader] diff --git a/tests/hlsl/sample-bias.shader_test b/tests/hlsl/sample-bias.shader_test index e56945d0..5b7067b5 100644 --- a/tests/hlsl/sample-bias.shader_test +++ b/tests/hlsl/sample-bias.shader_test @@ -12,9 +12,10 @@ levels 2 0.0 0.0 1.0 0.0 [vertex shader] -void main(out float2 tex : texcoord, inout float4 pos : sv_position) +void main(float4 pos : position, out float2 tex : texcoord, out float4 out_pos : sv_position) { tex = pos.xy; + out_pos = pos; } [pixel shader] diff --git a/tests/hlsl/struct-semantics.shader_test b/tests/hlsl/struct-semantics.shader_test index 43b07bb8..c88006eb 100644 --- a/tests/hlsl/struct-semantics.shader_test +++ b/tests/hlsl/struct-semantics.shader_test @@ -1,6 +1,6 @@ [input layout] 0 r32g32b32a32 float texcoord -0 r32g32 float sv_position +0 r32g32 float position [vertex buffer 0] 0.0 1.0 0.0 1.0 -2.0 -2.0 @@ -10,7 +10,16 @@ [vertex shader] -struct vertex +struct in_vertex +{ + struct + { + float4 texcoord : texcoord; + float4 pos : position; + } m; +}; + +struct out_vertex { struct { @@ -19,8 +28,10 @@ struct vertex } m; }; -void main(inout struct vertex v) +void main(struct in_vertex i, out struct out_vertex o) { + o.m.pos = i.m.pos; + o.m.texcoord = i.m.texcoord; } [pixel shader] diff --git a/tests/hlsl/trigonometry.shader_test b/tests/hlsl/trigonometry.shader_test index f52d01de..85988119 100644 --- a/tests/hlsl/trigonometry.shader_test +++ b/tests/hlsl/trigonometry.shader_test @@ -1,7 +1,8 @@ [vertex shader] -void main(out float tex : texcoord, inout float4 pos : sv_position) +void main(float4 pos : position, out float tex : texcoord, out float4 out_pos : sv_position) { tex = (pos.x + 1) * 320; + out_pos = pos; } [pixel shader] diff --git a/tests/shader_runner.c b/tests/shader_runner.c index 4847ec75..9b373e01 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -579,8 +579,9 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) }; static const char vs_source[] = - "void main(inout float4 position : sv_position)\n" + "float4 main(float4 pos : position) : sv_position\n" "{\n" + " return pos;\n" "}"; if (!shader_runner_get_resource(runner, RESOURCE_TYPE_RENDER_TARGET, 0)) @@ -601,7 +602,7 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) vkd3d_array_reserve((void **)&runner->input_elements, &runner->input_element_capacity, 1, sizeof(*runner->input_elements)); element = &runner->input_elements[0]; - element->name = strdup("sv_position"); + element->name = strdup("position"); element->slot = 0; element->format = DXGI_FORMAT_R32G32_FLOAT; element->texel_size = sizeof(*quad);