diff options
| author | Jay Kwak <82421531+jkwak-work@users.noreply.github.com> | 2025-08-26 14:38:57 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-26 21:38:57 +0000 |
| commit | 1681bc67fbae57b54b66c5dcfcbf315d1efa831b (patch) | |
| tree | e4c1ed8d99000732debc960cec49460fa2c4dbde /tools/gfx-unit-test/link-time-type-layout.cpp | |
| parent | 4e9ee1dc80ce353640c1e2134249a1f93da9229a (diff) | |
Fail slang-test when VVL printed errors (#8280)
fixes https://github.com/shader-slang/slang/issues/8271
This PR does the following,
- Fail slang-test when there are VVL error messages.
- VVL error for `gfx-unit-test-tool/` were not captured properly by the
debug callback.
- Set an environment variable,
`VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, for CI and
VisualStudio project setup.
- Ignores VVL error about NullHandle is used for the acceleration
structure; a fix is at ToT of VVL and not available from release build
yet.
- Fix VVL error complaining about the varying inputs are not provided
for the tests, `gfx-unit-test-tool/linkTimeTypeLayout.internal` and
`gfx-unit-test-tool/linkTimeTypeLayoutNested.internal`.
---------
Co-authored-by: slangbot <ellieh+slangbot@nvidia.com>
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Diffstat (limited to 'tools/gfx-unit-test/link-time-type-layout.cpp')
| -rw-r--r-- | tools/gfx-unit-test/link-time-type-layout.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/tools/gfx-unit-test/link-time-type-layout.cpp b/tools/gfx-unit-test/link-time-type-layout.cpp index c5c044acd..3493ea82d 100644 --- a/tools/gfx-unit-test/link-time-type-layout.cpp +++ b/tools/gfx-unit-test/link-time-type-layout.cpp @@ -43,7 +43,7 @@ static Slang::Result loadSpirvProgram( export public struct S : IFoo { public float4 getFoo() { return this.foo; } - float4 foo; + float4 foo : POSITION; } )"; @@ -213,10 +213,23 @@ void linkTimeTypeLayoutImpl(rhi::IDevice* device, UnitTestContext* context) validateStructSLayout(context, slangReflection); // Create a graphics pipeline to verify SPIRV code generation works + InputElementDesc inputElements[] = { + {"POSITION", 0, Format::RGBA32Float, 0, 0}, // S struct as POSITION semantic (float4) + }; + VertexStreamDesc vertexStreams[] = { + {16, InputSlotClass::PerVertex, 0}, // sizeof(float4) + }; + InputLayoutDesc inputLayoutDesc = {}; + inputLayoutDesc.inputElementCount = SLANG_COUNT_OF(inputElements); + inputLayoutDesc.inputElements = inputElements; + inputLayoutDesc.vertexStreamCount = SLANG_COUNT_OF(vertexStreams); + inputLayoutDesc.vertexStreams = vertexStreams; + auto inputLayout = device->createInputLayout(inputLayoutDesc); + SLANG_CHECK(inputLayout != nullptr); + RenderPipelineDesc pipelineDesc = {}; pipelineDesc.program = shaderProgram.get(); - - // We need to set up a minimal pipeline state for a vertex shader + pipelineDesc.inputLayout = inputLayout; pipelineDesc.primitiveTopology = PrimitiveTopology::TriangleList; ComPtr<IRenderPipeline> pipelineState; |
