From c43f6fa55aca23365c86c6ec1737d42be74d9d3e Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 7 Jan 2025 22:26:31 -0800 Subject: Lower varying parameters as pointers instead of SSA values. (#5919) * Add executable test on matrix-typed vertex input. * Fix emit logic of matrix layout qualifier. * Pass fragment shader varying input by constref to allow EvaluateAttributeAtCentroid etc. to be implemented correctly. --- tools/render-test/render-test-main.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'tools/render-test/render-test-main.cpp') diff --git a/tools/render-test/render-test-main.cpp b/tools/render-test/render-test-main.cpp index 5907be66d..b1f957551 100644 --- a/tools/render-test/render-test-main.cpp +++ b/tools/render-test/render-test-main.cpp @@ -45,12 +45,16 @@ struct Vertex float position[3]; float color[3]; float uv[2]; + float customData0[4]; + float customData1[4]; + float customData2[4]; + float customData3[4]; }; static const Vertex kVertexData[] = { - {{0, 0, 0.5}, {1, 0, 0}, {0, 0}}, - {{0, 1, 0.5}, {0, 0, 1}, {1, 0}}, - {{1, 0, 0.5}, {0, 1, 0}, {1, 1}}, + {{0, 0, 0.5}, {1, 0, 0}, {0, 0}, {1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 14, 15, 16}}, + {{0, 1, 0.5}, {0, 0, 1}, {1, 0}, {1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 14, 15, 16}}, + {{1, 0, 0.5}, {0, 1, 0}, {1, 1}, {1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 14, 15, 16}}, }; static const int kVertexCount = SLANG_COUNT_OF(kVertexData); @@ -614,6 +618,10 @@ SlangResult RenderTestApp::initialize( {"A", 0, Format::R32G32B32_FLOAT, offsetof(Vertex, position)}, {"A", 1, Format::R32G32B32_FLOAT, offsetof(Vertex, color)}, {"A", 2, Format::R32G32_FLOAT, offsetof(Vertex, uv)}, + {"A", 3, Format::R32G32B32A32_FLOAT, offsetof(Vertex, customData0)}, + {"A", 4, Format::R32G32B32A32_FLOAT, offsetof(Vertex, customData1)}, + {"A", 5, Format::R32G32B32A32_FLOAT, offsetof(Vertex, customData2)}, + {"A", 6, Format::R32G32B32A32_FLOAT, offsetof(Vertex, customData3)}, }; ComPtr inputLayout; -- cgit v1.2.3