Просмотр исходного кода

When shader compilation fails, display the shader name

BearishSun 8 лет назад
Родитель
Сommit
e608321633
1 измененных файлов с 5 добавлено и 4 удалено
  1. 5 4
      Source/BansheeEngine/Source/BsBuiltinResourcesHelper.cpp

+ 5 - 4
Source/BansheeEngine/Source/BsBuiltinResourcesHelper.cpp

@@ -562,12 +562,13 @@ namespace bs
 					program->blockUntilCoreInitialized();
 					program->blockUntilCoreInitialized();
 					if(!program->isCompiled())
 					if(!program->isCompiled())
 					{
 					{
+						String errMsg = "Error occured while compiling a shader \"" + toString(shader->getName()) 
+							+ "\". Error message: " + program->getCompileErrorMessage();
+
 #if BS_DEBUG_MODE
 #if BS_DEBUG_MODE
-						BS_EXCEPT(InvalidStateException, "Error occured while compiling a shader. Error message: " + 
-							program->getCompileErrorMessage());
+						BS_EXCEPT(InvalidStateException, errMsg);
 #else
 #else
-						LOGERR("Error occured while compiling a shader. Error message: " +
-							program->getCompileErrorMessage())
+						LOGERR(errMsg)
 #endif
 #endif
 						return false;
 						return false;
 					}
 					}