From 271ae7165915cf9910e2de0224159ea0fdd8ce72 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Mon, 3 Apr 2023 11:46:03 +0800 Subject: Fix several silently failing tests (#2767) * Add missing expected.txt for test * Diagnostics -> StdWriters in render test * Allow specifying several test prefixes to run `slang-test -- tests/foo tests/bar` * Squash warnings in some tests * Enable gfx debug layer in gfx test util Makes this issue present consistently: https://github.com/shader-slang/slang/issues/2766 * Allow DebugDevice to return interfaces instantiated by the debugged object * Check that we actaully have a shader cache for shader cache tests --------- Co-authored-by: Yong He --- tools/gfx-unit-test/gfx-test-util.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tools/gfx-unit-test/gfx-test-util.cpp') diff --git a/tools/gfx-unit-test/gfx-test-util.cpp b/tools/gfx-unit-test/gfx-test-util.cpp index 5cbb30e71..fcebdda9f 100644 --- a/tools/gfx-unit-test/gfx-test-util.cpp +++ b/tools/gfx-unit-test/gfx-test-util.cpp @@ -239,6 +239,13 @@ namespace gfx_test void* extDescPtr = &extDesc; deviceDesc.extendedDescs = &extDescPtr; + // 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 + auto createDeviceResult = gfxCreateDevice(&deviceDesc, device.writeRef()); if (SLANG_FAILED(createDeviceResult)) { -- cgit v1.2.3