GL: Added workaround options for issue #1105.

This commit is contained in:
Branimir Karadžić
2017-04-06 22:15:58 -07:00
parent e2efaf56de
commit 6aae4e6962

View File

@@ -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).