vkd3d-shader/hlsl: Make input semantics on structs cascade down onto the fields.

This commit is contained in:
Francisco Casas
2025-06-17 20:16:37 -04:00
committed by Henri Verbeet
parent 7e9834ee36
commit a9a5c77222
Notes: Henri Verbeet 2025-07-21 12:34:54 +02:00
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1595
2 changed files with 32 additions and 23 deletions

View File

@@ -25,7 +25,7 @@ float4 main(float4 pos : sv_position, float4 res : RESULT) : sv_target
0.0 1.0 2.0 2.1
0.0 1.0 2.0 2.1
[vertex shader todo]
[vertex shader]
struct apple
{
float aa; // Ends up as CASCADE0
@@ -41,7 +41,7 @@ float4 main(float4 position : position, struct apple ap : CASCADE, out float4 re
[test]
clear rtv 0 0.0 0.0 0.0 0.0
todo(sm<6) draw triangle strip 4
draw triangle strip 4
probe (0, 0) f32(0.0, 1.0, 2.0, 2.1)
@@ -60,7 +60,7 @@ probe (0, 0) f32(0.0, 1.0, 2.0, 2.1)
0.0 1.0 2.0 3.0 4.0 5.0 5.1
0.0 1.0 2.0 3.0 4.0 5.0 5.1
[vertex shader todo]
[vertex shader]
struct apple
{
float aa; // Ends up as CASCADE0
@@ -76,7 +76,7 @@ float4 main(float4 position : position, struct apple ap : CASCADE, out float4 re
[test]
clear rtv 0 0.0 0.0 0.0 0.0
todo(sm<6) draw triangle strip 4
draw triangle strip 4
probe (0, 0) f32(0.0, 3.0, 5.0, 5.1)
@@ -94,7 +94,7 @@ probe (0, 0) f32(0.0, 3.0, 5.0, 5.1)
0.0 0.1 1.0 2.0 2.1 3.0 3.1
% Test nested structs.
[vertex shader todo]
[vertex shader]
struct apple
{
float aa; // Gets CASCADE1
@@ -116,7 +116,7 @@ float4 main(float4 position : position, struct banana ba : CASCADE, out float4 r
[test]
clear rtv 0 0.0 0.0 0.0 0.0
todo(sm<6) draw triangle strip 4
draw triangle strip 4
probe (0, 0) f32(0.1, 2.0, 2.1, 3.1)
@@ -136,7 +136,7 @@ probe (0, 0) f32(0.1, 2.0, 2.1, 3.1)
0.0 1.0 2.0 2.1 3.0 4.0 4.1 5.0
% Test nested struct array.
[vertex shader todo]
[vertex shader]
struct apple
{
float aa;
@@ -158,7 +158,7 @@ float4 main(float4 position : position, struct banana ba : CASCADE, out float4 r
[test]
clear rtv 0 0.0 0.0 0.0 0.0
todo draw triangle strip 4
todo(sm>=6) draw triangle strip 4
probe (0, 0) f32(1.0, 4.0, 4.1, 5.0)
@@ -178,7 +178,7 @@ probe (0, 0) f32(1.0, 4.0, 4.1, 5.0)
0.0 1.0 1.1 2.0 3.0 3.1 4.0 5.0 5.1
% Test array. The semantic indexes of each array element don't overlap.
[vertex shader todo]
[vertex shader]
struct apple
{
float aa;
@@ -193,7 +193,7 @@ float4 main(float4 position : position, struct apple ap[3] : CASCADE, out float4
[test]
clear rtv 0 0.0 0.0 0.0 0.0
todo draw triangle strip 4
todo(sm>=6) draw triangle strip 4
probe (0, 0) f32(0.0, 3.0, 3.1, 4.0)
@@ -209,7 +209,7 @@ probe (0, 0) f32(0.0, 3.0, 3.1, 4.0)
0.0 1.0 1.1
% Test for overriding.
[vertex shader todo]
[vertex shader]
struct apple
{
float aa;
@@ -224,8 +224,8 @@ float4 main(float4 position : position, struct apple ap : CASCADE, out float4 re
[test]
clear rtv 0 0.0 0.0 0.0 0.0
todo(sm<6) draw triangle strip 4
probe (0, 0) f32(0.0, 1.0, 1.1, 0.0)
draw triangle strip 4
todo(opengl) probe (0, 0) f32(0.0, 1.0, 1.1, 0.0)
[input layout]
@@ -241,7 +241,7 @@ probe (0, 0) f32(0.0, 1.0, 1.1, 0.0)
0.0 1.0 2.0
% The outermost semantic overrides all others.
[vertex shader todo]
[vertex shader]
struct apple
{
float aa : INPLACE; // Gets CASCADE1
@@ -262,5 +262,5 @@ float4 main(float4 position : position, struct banana ba : CASCADE, out float4 r
[test]
clear rtv 0 0.0 0.0 0.0 0.0
todo(sm<6) draw triangle strip 4
draw triangle strip 4
probe (0, 0) f32(0.0, 1.0, 2.0, 0.0)