فهرست منبع

GL: Added workaround options for issue #1105.

Branimir Karadžić 8 سال پیش
والد
کامیت
6aae4e6962
1فایلهای تغییر یافته به همراه16 افزوده شده و 1 حذف شده
  1. 16 1
      src/renderer_gl.cpp

+ 16 - 1
src/renderer_gl.cpp

@@ -1412,6 +1412,16 @@ namespace bgfx { namespace gl
 		{ "Intel",                        BGFX_PCI_ID_INTEL  },
 	};
 
+	struct Workaround
+	{
+		void reset()
+		{
+			m_detachShader = true;
+		}
+
+		bool m_detachShader;
+	};
+
 	struct RendererContextGL : public RendererContextI
 	{
 		RendererContextGL()
@@ -1482,6 +1492,8 @@ namespace bgfx { namespace gl
 				}
 			}
 
+			m_workaround.reset();
+
 			GLint numCmpFormats = 0;
 			GL_CHECK(glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCmpFormats) );
 			BX_TRACE("GL_NUM_COMPRESSED_TEXTURE_FORMATS %d", numCmpFormats);
@@ -3520,6 +3532,8 @@ namespace bgfx { namespace gl
 		const char* m_version;
 		const char* m_glslVersion;
 
+		Workaround m_workaround;
+
 		GLuint m_currentFbo;
 
 		VR m_ovr;
@@ -4018,7 +4032,8 @@ namespace bgfx { namespace gl
 
 		init();
 
-		if (!cached)
+		if (!cached
+		&&  s_renderGL->m_workaround.m_detachShader)
 		{
 			// Must be after init, otherwise init might fail to lookup shader
 			// info (NVIDIA Tegra 3 OpenGL ES 2.0 14.01003).