From 6162950d9012833ef5d4f96b99c67a46bf97ce6d Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 19 Jul 2021 14:47:34 -0700 Subject: Enable swiftshader in linux CI builds (#1909) --- tools/render-test/render-test-main.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (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 d71628fd0..96cc94aa3 100644 --- a/tools/render-test/render-test-main.cpp +++ b/tools/render-test/render-test-main.cpp @@ -22,7 +22,6 @@ #include "window.h" #include "../../source/core/slang-test-tool-util.h" - #define ENABLE_RENDERDOC_INTEGRATION 0 #if ENABLE_RENDERDOC_INTEGRATION @@ -1120,6 +1119,23 @@ static void renderDocBeginFrame(){} static void renderDocEndFrame(){} #endif +class StdWritersDebugCallback : public gfx::IDebugCallback +{ +public: + Slang::StdWriters* writers; + virtual SLANG_NO_THROW void SLANG_MCALL handleMessage( + gfx::DebugMessageType type, + gfx::DebugMessageSource source, + const char* message) override + { + SLANG_UNUSED(source); + if (type == gfx::DebugMessageType::Error) + { + writers->getOut().print("%s\n", message); + } + } +}; + static SlangResult _innerMain(Slang::StdWriters* stdWriters, SlangSession* session, int argcIn, const char*const* argvIn) { using namespace renderer_test; @@ -1245,6 +1261,9 @@ static SlangResult _innerMain(Slang::StdWriters* stdWriters, SlangSession* sessi #ifdef _DEBUG gfxEnableDebugLayer(); #endif + StdWritersDebugCallback debugCallback; + debugCallback.writers = stdWriters; + gfxSetDebugCallback(&debugCallback); // Use the profile name set on options if set input.profile = options.profileName.getLength() ? options.profileName : input.profile; -- cgit v1.2.3