Improve detection of EXT_gpu_shader4 (#2572)

This extension is used to detect support for gl_InstanceID and gl_VertexID. However, in more recent
versions of OpenGL, this is built-in functionality. On my system, it does not list that extension,
even though it supports those features, but BGFX was not detecting that.

Updated detection to look for GL>=3.1.

Note 1: even with this change, you do need to compile BGFX with the appropriate
BGFX_CONFIG_RENDERER_OPENGL value (>=31). The default of 21 is not high enough.

Note 2: Even with all of the above, you will likely hit issues with duplicate '#version' lines in
the generated shader code. For that, see issue #xxxx.

fixes issue #2570
This commit is contained in:
jwdevel 2021-08-07 18:02:08 -07:00 committed by GitHub
parent 39b018b3f7
commit 59a73fe9d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -794,7 +794,7 @@ namespace bgfx { namespace gl
{ "EXT_framebuffer_blit", BGFX_CONFIG_RENDERER_OPENGL >= 30, true }, { "EXT_framebuffer_blit", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
{ "EXT_framebuffer_object", BGFX_CONFIG_RENDERER_OPENGL >= 30, true }, { "EXT_framebuffer_object", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
{ "EXT_framebuffer_sRGB", BGFX_CONFIG_RENDERER_OPENGL >= 30, true }, { "EXT_framebuffer_sRGB", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
{ "EXT_gpu_shader4", false, true }, { "EXT_gpu_shader4", BGFX_CONFIG_RENDERER_OPENGL >= 31, true },
{ "EXT_multi_draw_indirect", false, true }, // GLES3.1 extension. { "EXT_multi_draw_indirect", false, true }, // GLES3.1 extension.
{ "EXT_occlusion_query_boolean", false, true }, // GLES2 extension. { "EXT_occlusion_query_boolean", false, true }, // GLES2 extension.
{ "EXT_packed_float", BGFX_CONFIG_RENDERER_OPENGL >= 33, true }, { "EXT_packed_float", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },