Selaa lähdekoodia

Fix error line searching for HLSL compiled with debug info. (#1414)

divinon 7 vuotta sitten
vanhempi
sitoutus
218c9e5ea1
1 muutettua tiedostoa jossa 10 lisäystä ja 1 poistoa
  1. 10 1
      tools/shaderc/shaderc_hlsl.cpp

+ 10 - 1
tools/shaderc/shaderc_hlsl.cpp

@@ -624,8 +624,17 @@ namespace bgfx { namespace hlsl
 			int32_t start  = 0;
 			int32_t start  = 0;
 			int32_t end    = INT32_MAX;
 			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
 			bool found = false
-				|| 2 == sscanf(log, "(%u,%u):",  &line, &column)
+				|| 2 == sscanf(log, "(%u,%u",  &line, &column)
 				|| 2 == sscanf(log, " :%u:%u: ", &line, &column)
 				|| 2 == sscanf(log, " :%u:%u: ", &line, &column)
 				;
 				;