From b9b398d038b524f15a86ff27cd6888d54e8754e0 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 22 Sep 2021 10:06:59 -0700 Subject: Add gfx unit testing framework. (#1943) * Add gfx unit testing framework. * Fix compilation error. * Reset gfxDebugCallback after render_test. * Pass enabledApi flags through. * Fix for code review suggestions. Co-authored-by: Yong He --- tools/render-test/render-test-main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (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 271356cc3..7c65da5e7 100644 --- a/tools/render-test/render-test-main.cpp +++ b/tools/render-test/render-test-main.cpp @@ -1264,6 +1264,13 @@ static SlangResult _innerMain(Slang::StdWriters* stdWriters, SlangSession* sessi StdWritersDebugCallback debugCallback; debugCallback.writers = stdWriters; gfxSetDebugCallback(&debugCallback); + struct ResetDebugCallbackRAII + { + ~ResetDebugCallbackRAII() + { + gfxSetDebugCallback(nullptr); + } + } resetDebugCallbackRAII; // Use the profile name set on options if set input.profile = options.profileName.getLength() ? options.profileName : input.profile; -- cgit v1.2.3