Quellcode durchsuchen

Fixes #2000. Restored old behavior of handling shaders with "#version 430" in them.

Алексей Тулинов vor 6 Jahren
Ursprung
Commit
ac9c330100
1 geänderte Dateien mit 3 neuen und 2 gelöschten Zeilen
  1. 3 2
      src/renderer_gl.cpp

+ 3 - 2
src/renderer_gl.cpp

@@ -5375,7 +5375,8 @@ namespace bgfx { namespace gl
 
 
 		if (0 != m_id)
 		if (0 != m_id)
 		{
 		{
-			if (GL_COMPUTE_SHADER != m_type)
+			if (GL_COMPUTE_SHADER != m_type
+			&&  0 != bx::strCmp(code, "#version 430", 12) ) // #2000
 			{
 			{
 				int32_t tempLen = code.getLength() + (4<<10);
 				int32_t tempLen = code.getLength() + (4<<10);
 				char* temp = (char*)alloca(tempLen);
 				char* temp = (char*)alloca(tempLen);
@@ -5873,7 +5874,7 @@ namespace bgfx { namespace gl
 
 
 				code.set(temp);
 				code.set(temp);
 			}
 			}
-			else // GL_COMPUTE_SHADER
+			else if (GL_COMPUTE_SHADER == m_type)
 			{
 			{
 				int32_t codeLen = (int32_t)bx::strLen(code);
 				int32_t codeLen = (int32_t)bx::strLen(code);
 				int32_t tempLen = codeLen + (4<<10);
 				int32_t tempLen = codeLen + (4<<10);