diff options
| author | Gangzheng Tong <tonggangzheng@gmail.com> | 2025-05-16 14:51:46 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-16 16:51:46 -0500 |
| commit | 8f20632a0ba45c3bfada293842e55129949a2ae9 (patch) | |
| tree | 1c725aa8595780f067f5ad8cf60d6334bd9a1797 /tools/gfx-unit-test | |
| parent | da951e06e7eb8ad1b9c91d6176be8165ea4f2b45 (diff) | |
Enable Windows full debug testsuite in CI (#7085)
* Unify Debug Layer Control Logic and Add Disable Option for Debug Builds
This PR refactors and unifies the debug layer control logic in slang-test.
A new `-disable-debug-layers` option is introduced, allowing debug builds to skip enabling the validation (debug) layer.
This is currently needed to ensure stability in the debug test suite.
Previously, different toggles such as ENABLE_VALIDATION_LAYER, ENABLE_DEBUG_LAYER, and debugLayerEnabled were used inconsistently across different components of slang-test. This PR standardizes the logic by using a single variable, debugLayerEnabled, to control the enabling/disabling of the debug layer internally.
Notes:
By default, the debug/validation layer is enabled in debug builds and is not supported in release builds of slang-test.
Fixes: #7132
* Disable spirv-opt for the DebugFunctionDefinition issue
* Run debug build only in GCP machines
* Fix VUID-vkCmdPipelineBarrier-pBufferMemoryBarriers-02818
dstAcessMask can't include VK_ACCESS_TRANSFER_READ_BIT when stage mask
has VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR
* Set failed retry limit to 32
---------
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')
7 files changed, 7 insertions, 7 deletions
diff --git a/tools/gfx-unit-test/buffer-barrier-test.cpp b/tools/gfx-unit-test/buffer-barrier-test.cpp index 2d53ac13f..b128448d2 100644 --- a/tools/gfx-unit-test/buffer-barrier-test.cpp +++ b/tools/gfx-unit-test/buffer-barrier-test.cpp @@ -146,6 +146,7 @@ void barrierTestImpl(IDevice* device, UnitTestContext* context) void barrierTestAPI(UnitTestContext* context, Slang::RenderApiFlag::Enum api) { + gfxEnableDebugLayer(context->enableDebugLayers); if ((api & context->enabledApis) == 0) { SLANG_IGNORE_TEST diff --git a/tools/gfx-unit-test/existing-device-handle-test.cpp b/tools/gfx-unit-test/existing-device-handle-test.cpp index 8b7a84ec2..5605bf8a5 100644 --- a/tools/gfx-unit-test/existing-device-handle-test.cpp +++ b/tools/gfx-unit-test/existing-device-handle-test.cpp @@ -83,6 +83,7 @@ void existingDeviceHandleTestImpl(IDevice* device, UnitTestContext* context) void existingDeviceHandleTestAPI(UnitTestContext* context, Slang::RenderApiFlag::Enum api) { + gfxEnableDebugLayer(context->enableDebugLayers); if ((api & context->enabledApis) == 0) { SLANG_IGNORE_TEST; diff --git a/tools/gfx-unit-test/get-buffer-resource-handle-test.cpp b/tools/gfx-unit-test/get-buffer-resource-handle-test.cpp index 97bb413fd..102986616 100644 --- a/tools/gfx-unit-test/get-buffer-resource-handle-test.cpp +++ b/tools/gfx-unit-test/get-buffer-resource-handle-test.cpp @@ -53,6 +53,7 @@ void getBufferResourceHandleTestImpl(IDevice* device, UnitTestContext* context) void getBufferResourceHandleTestAPI(UnitTestContext* context, Slang::RenderApiFlag::Enum api) { + gfxEnableDebugLayer(context->enableDebugLayers); if ((api & context->enabledApis) == 0) { SLANG_IGNORE_TEST; diff --git a/tools/gfx-unit-test/get-cmd-buffer-handle-test.cpp b/tools/gfx-unit-test/get-cmd-buffer-handle-test.cpp index b1e7ebc04..5c734f966 100644 --- a/tools/gfx-unit-test/get-cmd-buffer-handle-test.cpp +++ b/tools/gfx-unit-test/get-cmd-buffer-handle-test.cpp @@ -49,6 +49,7 @@ void getBufferHandleTestImpl(IDevice* device, UnitTestContext* context) void getBufferHandleTestAPI(UnitTestContext* context, Slang::RenderApiFlag::Enum api) { + gfxEnableDebugLayer(context->enableDebugLayers); if ((api & context->enabledApis) == 0) { SLANG_IGNORE_TEST; diff --git a/tools/gfx-unit-test/get-cmd-queue-handle-test.cpp b/tools/gfx-unit-test/get-cmd-queue-handle-test.cpp index 5e72c41d9..82561f4a2 100644 --- a/tools/gfx-unit-test/get-cmd-queue-handle-test.cpp +++ b/tools/gfx-unit-test/get-cmd-queue-handle-test.cpp @@ -38,6 +38,7 @@ void getQueueHandleTestImpl(IDevice* device, UnitTestContext* context) void getQueueHandleTestAPI(UnitTestContext* context, Slang::RenderApiFlag::Enum api) { + gfxEnableDebugLayer(context->enableDebugLayers); if ((api & context->enabledApis) == 0) { SLANG_IGNORE_TEST; diff --git a/tools/gfx-unit-test/get-texture-resource-handle-test.cpp b/tools/gfx-unit-test/get-texture-resource-handle-test.cpp index 4a7412ddc..1900b482e 100644 --- a/tools/gfx-unit-test/get-texture-resource-handle-test.cpp +++ b/tools/gfx-unit-test/get-texture-resource-handle-test.cpp @@ -50,6 +50,7 @@ void getTextureResourceHandleTestImpl(IDevice* device, UnitTestContext* context) void getTextureResourceHandleTestAPI(UnitTestContext* context, Slang::RenderApiFlag::Enum api) { + gfxEnableDebugLayer(context->enableDebugLayers); if ((api & context->enabledApis) == 0) { SLANG_IGNORE_TEST; diff --git a/tools/gfx-unit-test/gfx-test-util.cpp b/tools/gfx-unit-test/gfx-test-util.cpp index d7cfa0f65..bd1b2a891 100644 --- a/tools/gfx-unit-test/gfx-test-util.cpp +++ b/tools/gfx-unit-test/gfx-test-util.cpp @@ -323,13 +323,7 @@ Slang::ComPtr<gfx::IDevice> createTestingDevice( void* extDescPtrs[2] = {&extDesc, &slangExtDesc}; deviceDesc.extendedDescs = extDescPtrs; - // TODO: We should also set the debug callback - // (And in general reduce the differences (and duplication) between - // here and render-test-main.cpp) -#ifdef _DEBUG - gfx::gfxEnableDebugLayer(); -#endif - + gfx::gfxEnableDebugLayer(context->enableDebugLayers); auto createDeviceResult = gfxCreateDevice(&deviceDesc, device.writeRef()); if (SLANG_FAILED(createDeviceResult)) { |
