summaryrefslogtreecommitdiffstats
path: root/tools/render-test
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-07-19 14:47:34 -0700
committerGitHub <noreply@github.com>2021-07-19 14:47:34 -0700
commit6162950d9012833ef5d4f96b99c67a46bf97ce6d (patch)
tree5eaca94218168560f7e7bf94ead208c24fa34485 /tools/render-test
parentb00e2dc8e777a481f79c5c4fea4d1d0481fc445e (diff)
Enable swiftshader in linux CI builds (#1909)
Diffstat (limited to 'tools/render-test')
-rw-r--r--tools/render-test/render-test-main.cpp21
1 files changed, 20 insertions, 1 deletions
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;