tests/hlsl: Test clip distance semantic indexes above the 0-1 range.

This commit is contained in:
Francisco Casas
2025-10-30 14:49:07 -03:00
committed by Henri Verbeet
parent 583016e550
commit e23b3c84f6
Notes: Henri Verbeet 2025-11-25 20:40:54 +01:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1816

View File

@@ -185,6 +185,56 @@ probe rtv 0 (480, 120) f32(0.0, 0.0, 0.0, 1.0)
probe rtv 0 (480, 240) f32(0.0, 0.0, 0.0, 1.0)
probe rtv 0 (480, 360) f32(0.0, 0.0, 0.0, 1.0)
[vertex shader fail(sm<6)]
struct vertex_data
{
float4 position : SV_POSITION; // o0.xyzw
float3 clipA : SV_CLIPDISTANCE2; // o1.xyz
float2 clipB : SV_CLIPDISTANCE1; // o2.xy
float cull : SV_CULLDISTANCE; // o1.w
float clipC : SV_CLIPDISTANCE0; // o2.z
};
void main(float4 position : POSITION, out vertex_data vertex)
{
vertex.position = position;
vertex.clipA = float3(10, 20, 30);
vertex.clipB = float2(40, 50);
vertex.cull = 1.0;
vertex.clipC = -position.x; // Removes all pixels on the right side of the render target.
}
[pixel shader fail(sm<6)]
struct vertex_data
{
float4 position : SV_POSITION; // v0.xyzw
float3 clipA : SV_CLIPDISTANCE2; // v1.xyz
float2 clipB : SV_CLIPDISTANCE1; // v2.xy
float cull : SV_CULLDISTANCE; // v1.w
float clipC : SV_CLIPDISTANCE0; // v2.z
};
float4 main(struct vertex_data vertex) : SV_Target
{
return float4(vertex.clipA.z, vertex.clipB.y, vertex.cull, round(10000 * vertex.clipC));
}
[test]
clear rtv 0 0.0 0.0 0.0 1.0
todo draw triangle list 27
probe rtv 0 (160, 120) f32(30.0, 50.0, 1.0, 4984)
probe rtv 0 (160, 240) f32(30.0, 50.0, 1.0, 4984)
probe rtv 0 (160, 360) f32(30.0, 50.0, 1.0, 4984)
probe rtv 0 (319, 120) f32(30.0, 50.0, 1.0, 16)
probe rtv 0 (319, 240) f32(30.0, 50.0, 1.0, 16)
probe rtv 0 (319, 360) f32(30.0, 50.0, 1.0, 16)
probe rtv 0 (320, 120) f32(0.0, 0.0, 0.0, 1.0)
probe rtv 0 (320, 240) f32(0.0, 0.0, 0.0, 1.0)
probe rtv 0 (320, 360) f32(0.0, 0.0, 0.0, 1.0)
probe rtv 0 (480, 120) f32(0.0, 0.0, 0.0, 1.0)
probe rtv 0 (480, 240) f32(0.0, 0.0, 0.0, 1.0)
probe rtv 0 (480, 360) f32(0.0, 0.0, 0.0, 1.0)
[require]
shader model >= 4.0