From 9e57039fce4040c8bfadaa73bf449c005912a83e Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Tue, 23 Apr 2024 20:46:45 +1000 Subject: [PATCH] vkd3d-shader/dxil: Handle SV_ClipDistance and SV_CullDistance. --- libs/vkd3d-shader/dxil.c | 2 ++ tests/hlsl/clip-distance.shader_test | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index fab0bde7..605e9753 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -8455,6 +8455,8 @@ static const enum vkd3d_shader_sysval_semantic sysval_semantic_table[] = [SEMANTIC_KIND_VERTEXID] = VKD3D_SHADER_SV_VERTEX_ID, [SEMANTIC_KIND_INSTANCEID] = VKD3D_SHADER_SV_INSTANCE_ID, [SEMANTIC_KIND_POSITION] = VKD3D_SHADER_SV_POSITION, + [SEMANTIC_KIND_CLIPDISTANCE] = VKD3D_SHADER_SV_CLIP_DISTANCE, + [SEMANTIC_KIND_CULLDISTANCE] = VKD3D_SHADER_SV_CULL_DISTANCE, [SEMANTIC_KIND_PRIMITIVEID] = VKD3D_SHADER_SV_PRIMITIVE_ID, [SEMANTIC_KIND_ISFRONTFACE] = VKD3D_SHADER_SV_IS_FRONT_FACE, [SEMANTIC_KIND_COVERAGE] = VKD3D_SHADER_SV_COVERAGE, diff --git a/tests/hlsl/clip-distance.shader_test b/tests/hlsl/clip-distance.shader_test index f4767aab..ffb36173 100644 --- a/tests/hlsl/clip-distance.shader_test +++ b/tests/hlsl/clip-distance.shader_test @@ -48,7 +48,7 @@ float4 main(const in float4 position : SV_Position) : SV_Target [test] clear rtv 0 1.0 1.0 1.0 1.0 -todo draw triangle strip 4 +todo(sm<6) draw triangle strip 4 probe all rgba (0.0, 1.0, 0.0, 1.0) [vb 1] @@ -59,7 +59,7 @@ probe all rgba (0.0, 1.0, 0.0, 1.0) [test] clear rtv 0 1.0 1.0 1.0 1.0 -todo draw triangle strip 4 +todo(sm<6) draw triangle strip 4 probe all rgba (0.0, 1.0, 0.0, 1.0) [vb 1] @@ -70,7 +70,7 @@ probe all rgba (0.0, 1.0, 0.0, 1.0) [test] clear rtv 0 1.0 1.0 1.0 1.0 -todo draw triangle strip 4 +todo(sm<6) draw triangle strip 4 probe all rgba (1.0, 1.0, 1.0, 1.0) [vb 1] @@ -81,7 +81,7 @@ probe all rgba (1.0, 1.0, 1.0, 1.0) [test] clear rtv 0 1.0 1.0 1.0 1.0 -todo draw triangle strip 4 +todo(sm<6) draw triangle strip 4 probe rtv 0 (160, 240) rgba (0.0, 1.0, 0.0, 1.0) probe rtv 0 (480, 240) rgba (1.0, 1.0, 1.0, 1.0) @@ -93,6 +93,6 @@ probe rtv 0 (480, 240) rgba (1.0, 1.0, 1.0, 1.0) [test] clear rtv 0 1.0 1.0 1.0 1.0 -todo draw triangle strip 4 +todo(sm<6) draw triangle strip 4 probe rtv 0 (320, 120) rgba (0.0, 1.0, 0.0, 1.0) probe rtv 0 (320, 360) rgba (1.0, 1.0, 1.0, 1.0)