tests: Add a test for sm1 inter-stage interface matching.

This commit is contained in:
Elizabeth Figura 2024-10-05 11:45:25 -05:00 committed by Henri Verbeet
parent e452519dcb
commit 212333bfa6
Notes: Henri Verbeet 2024-10-28 18:11:45 +01:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1216
3 changed files with 64 additions and 0 deletions

View File

@ -225,6 +225,7 @@ vkd3d_shader_tests = \
tests/hlsl/single-numeric-initializer.shader_test \ tests/hlsl/single-numeric-initializer.shader_test \
tests/hlsl/sm1-const-allocation.shader_test \ tests/hlsl/sm1-const-allocation.shader_test \
tests/hlsl/sm1-const-folding.shader_test \ tests/hlsl/sm1-const-folding.shader_test \
tests/hlsl/sm1-interstage-interface.shader_test \
tests/hlsl/sm6-ternary.shader_test \ tests/hlsl/sm6-ternary.shader_test \
tests/hlsl/sm6-uav-rwtexture.shader_test \ tests/hlsl/sm6-uav-rwtexture.shader_test \
tests/hlsl/smoothstep.shader_test \ tests/hlsl/smoothstep.shader_test \

View File

@ -0,0 +1,61 @@
[require]
shader model < 4.0
[input layout]
0 r32g32-float POSITION
0 r32g32-float TEXCOORD 0
0 r32-float COLOR 1
0 r32-float COLOR 0
1 r32-float TEXCOORD 2
1 r32-float TEXCOORD 3
[vb 0]
-1.0 -1.0 3.0 5.0 0.5 0.7
-1.0 1.0 3.0 5.0 0.5 0.7
1.0 -1.0 3.0 5.0 0.5 0.7
1.0 1.0 3.0 5.0 0.5 0.7
[vb 1]
2.0 6.0
2.0 6.0
2.0 6.0
2.0 6.0
[vertex shader]
struct vertex
{
float4 position : POSITION;
float2 t0 : TEXCOORD0;
float t2 : TEXCOORD2;
float t3 : TEXCOORD3;
float c0 : COLOR0;
float c1 : COLOR1;
};
void main(in vertex vin, out vertex vout)
{
vout = vin;
}
[pixel shader]
struct vertex
{
float t3 : TEXCOORD3;
float c1 : COLOR1;
float2 t0 : TEXCOORD0;
float c0 : COLOR0;
};
void main(struct vertex i, out float4 o : SV_Target)
{
o.x = i.t0.y + i.t3;
o.y = i.c1;
o.z = i.c0;
o.w = i.t0.x;
}
[test]
draw triangle strip 4
probe (0,0) rgba(11.0, 0.5, 0.7, 3.0)

View File

@ -293,6 +293,8 @@ static D3DDECLTYPE vertex_decl_type_from_format(DXGI_FORMAT format)
static D3DDECLUSAGE vertex_decl_usage_from_name(const char *name) static D3DDECLUSAGE vertex_decl_usage_from_name(const char *name)
{ {
if (!strcasecmp(name, "color"))
return D3DDECLUSAGE_COLOR;
if (!strcasecmp(name, "position") || !strcasecmp(name, "sv_position")) if (!strcasecmp(name, "position") || !strcasecmp(name, "sv_position"))
return D3DDECLUSAGE_POSITION; return D3DDECLUSAGE_POSITION;
if (!strcasecmp(name, "psize")) if (!strcasecmp(name, "psize"))