mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
GLES: Added workaround for broken emulator.
This commit is contained in:
parent
91c87e2149
commit
0cb21b8b83
1 changed files with 29 additions and 17 deletions
|
@ -1027,8 +1027,10 @@ namespace bgfx { namespace gl
|
|||
GLuint id;
|
||||
GL_CHECK(glGenTextures(1, &id) );
|
||||
GL_CHECK(glBindTexture(GL_TEXTURE_2D, id) );
|
||||
GL_CHECK(glTexStorage2D(GL_TEXTURE_2D, 1, s_imageFormat[_format], 16, 16) );
|
||||
|
||||
glTexStorage2D(GL_TEXTURE_2D, 1, s_imageFormat[_format], 16, 16);
|
||||
GLenum err = glGetError();
|
||||
if (0 == err)
|
||||
{
|
||||
glBindImageTexture(0
|
||||
, id
|
||||
, 0
|
||||
|
@ -1037,7 +1039,8 @@ namespace bgfx { namespace gl
|
|||
, GL_READ_WRITE
|
||||
, s_imageFormat[_format]
|
||||
);
|
||||
GLenum err = glGetError();
|
||||
err = glGetError();
|
||||
}
|
||||
|
||||
GL_CHECK(glDeleteTextures(1, &id) );
|
||||
|
||||
|
@ -1237,6 +1240,15 @@ namespace bgfx { namespace gl
|
|||
^ (uint64_t(getGLStringHash(GL_VERSION ) )<<16)
|
||||
;
|
||||
|
||||
if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 31)
|
||||
&& 0 == strcmp(m_vendor, "Imagination Technologies")
|
||||
&& NULL != strstr(m_version, "(SDK 3.5@3510720)") )
|
||||
{
|
||||
// Skip initializing extensions that are broken in emulator.
|
||||
s_extension[Extension::ARB_program_interface_query ].m_initialize =
|
||||
s_extension[Extension::ARB_shader_storage_buffer_object].m_initialize = false;
|
||||
}
|
||||
|
||||
if (BX_ENABLED(BGFX_CONFIG_RENDERER_USE_EXTENSIONS) )
|
||||
{
|
||||
const char* extensions = (const char*)glGetString(GL_EXTENSIONS);
|
||||
|
@ -3213,10 +3225,10 @@ namespace bgfx { namespace gl
|
|||
GL_CHECK(glBindFragDataLocation(m_id, 0, "bgfx_FragColor") );
|
||||
#endif // BGFX_CONFIG_RENDERER_OPENGL >= 31
|
||||
|
||||
bool piqSupported = BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 31) || (true
|
||||
&& s_extension[Extension::ARB_program_interface_query].m_supported
|
||||
bool piqSupported = true
|
||||
&& s_extension[Extension::ARB_program_interface_query ].m_supported
|
||||
&& s_extension[Extension::ARB_shader_storage_buffer_object].m_supported
|
||||
);
|
||||
;
|
||||
|
||||
if (piqSupported)
|
||||
{
|
||||
|
@ -5149,7 +5161,7 @@ namespace bgfx { namespace gl
|
|||
uintptr_t args = compute.m_startIndirect * BGFX_CONFIG_DRAW_INDIRECT_STRIDE;
|
||||
for (uint32_t ii = 0; ii < numDrawIndirect; ++ii)
|
||||
{
|
||||
GL_CHECK(glDispatchComputeIndirect(args) );
|
||||
GL_CHECK(glDispatchComputeIndirect((GLintptr)args) );
|
||||
args += BGFX_CONFIG_DRAW_INDIRECT_STRIDE;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue