From 218c9e5ea1f0dadc5d1f185be2d8069e81f9992f Mon Sep 17 00:00:00 2001 From: divinon <40340235+divinon@users.noreply.github.com> Date: Mon, 18 Jun 2018 21:51:32 +0200 Subject: [PATCH] Fix error line searching for HLSL compiled with debug info. (#1414) --- tools/shaderc/shaderc_hlsl.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/shaderc/shaderc_hlsl.cpp b/tools/shaderc/shaderc_hlsl.cpp index 543333781..48d89b7d5 100644 --- a/tools/shaderc/shaderc_hlsl.cpp +++ b/tools/shaderc/shaderc_hlsl.cpp @@ -624,8 +624,17 @@ namespace bgfx { namespace hlsl int32_t start = 0; int32_t end = INT32_MAX; + if (!hlslfp.empty()) + { + const char* logfp = bx::strFind(log, hlslfp.c_str()); + if (NULL != logfp) + { + log = logfp + hlslfp.length(); + } + } + bool found = false - || 2 == sscanf(log, "(%u,%u):", &line, &column) + || 2 == sscanf(log, "(%u,%u", &line, &column) || 2 == sscanf(log, " :%u:%u: ", &line, &column) ;