From a9edce59eac3577b312e1f58f39391478955a3e5 Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Wed, 12 Nov 2025 04:07:20 +1300 Subject: [PATCH] New D3D11/D3D12 shader linkage tests for float3 packing/not packing Packing float with a float3 float TEXCOORD0 int TEXCOORD1 float3 COLOR Packing float with a float3[1] float TEXCOORD0 int TEXCOORD1 float3[1] COLOR Not packing float with a float3[2] float TEXCOORD0 int TEXCOORD1 float3[2] COLOR --- .../demos/d3d11/d3d11_shader_linkage_zoo.cpp | 15 +++++++++++++ .../demos/d3d12/d3d12_shader_linkage_zoo.cpp | 21 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/util/test/demos/d3d11/d3d11_shader_linkage_zoo.cpp b/util/test/demos/d3d11/d3d11_shader_linkage_zoo.cpp index 9f07ade39..7bcdf1007 100644 --- a/util/test/demos/d3d11/d3d11_shader_linkage_zoo.cpp +++ b/util/test/demos/d3d11/d3d11_shader_linkage_zoo.cpp @@ -341,6 +341,21 @@ float4 main(v2f IN) : SV_Target0 tests.push_back(BuildTestCase({{true, VarType::Float, 1, 0, "TEXCOORD0", true}, {false, VarType::UInt, 1, 0, "TEXCOORD1", true}})); + // Packing float with a float3 + tests.push_back(BuildTestCase({{false, VarType::Float, 1, 0, "TEXCOORD0", true}, + {true, VarType::UInt, 1, 0, "TEXCOORD1", true}, + {false, VarType::Float, 3, 0, "COLOR", true}})); + + // Packing float with a float3[1] + tests.push_back(BuildTestCase({{false, VarType::Float, 1, 0, "TEXCOORD0", true}, + {true, VarType::UInt, 1, 0, "TEXCOORD1", true}, + {false, VarType::Float, 3, 1, "COLOR", true}})); + + // Not packing float with a float3[2] + tests.push_back(BuildTestCase({{false, VarType::Float, 1, 0, "TEXCOORD0", true}, + {true, VarType::UInt, 1, 0, "TEXCOORD1", true}, + {false, VarType::Float, 3, 2, "COLOR", true}})); + // Bespoke tests for broken scenarios discovered through bug reports: // These semantics live in v1.xy, v2.x, and v3.xyz due to each being an array. If any of them diff --git a/util/test/demos/d3d12/d3d12_shader_linkage_zoo.cpp b/util/test/demos/d3d12/d3d12_shader_linkage_zoo.cpp index 77b9cca36..757754c18 100644 --- a/util/test/demos/d3d12/d3d12_shader_linkage_zoo.cpp +++ b/util/test/demos/d3d12/d3d12_shader_linkage_zoo.cpp @@ -380,6 +380,27 @@ float4 main(v2f IN) : SV_Target0 {false, VarType::UInt, 1, 0, "TEXCOORD1", true}}, sm6)); + // Packing float with a float3 + psos.push_back(BuildPSO(sig, + {{false, VarType::Float, 1, 0, "TEXCOORD0", true}, + {true, VarType::UInt, 1, 0, "TEXCOORD1", true}, + {false, VarType::Float, 3, 0, "COLOR0", true}}, + sm6)); + + // Packing float with a float3[1] + psos.push_back(BuildPSO(sig, + {{false, VarType::Float, 1, 0, "TEXCOORD0", true}, + {true, VarType::UInt, 1, 0, "TEXCOORD1", true}, + {false, VarType::Float, 3, 1, "COLOR0", true}}, + sm6)); + + // Not packing float with a float3[2] + psos.push_back(BuildPSO(sig, + {{false, VarType::Float, 1, 0, "TEXCOORD0", true}, + {true, VarType::UInt, 1, 0, "TEXCOORD1", true}, + {false, VarType::Float, 3, 2, "COLOR0", true}}, + sm6)); + // Bespoke tests for broken scenarios discovered through bug reports: // These semantics live in v1.xy, v2.x, and v3.xyz due to each being an array. If any of them