More strict compute shader test;

Some hardware supports ARB_compute_shader but not 4.3, causing
shader compilation failures because currently we switch to GLSL 430
if compute shaders are detected.

Instead, just detect GL 4.3 instead of looking for the compute shader
extension.  This means that compute shaders will sometimes be
unavailable even when they're supported.

It would be possible to improve this by modifying the way shaders
are compiled.  Maybe the highest supported GLSL version should be used,
but this makes shader authoring somewhat more difficult.
This commit is contained in:
bjorn 2020-09-24 05:29:35 -07:00
parent 48a347ad01
commit 61abb6f02b
1 changed files with 1 additions and 1 deletions

View File

@ -1250,7 +1250,7 @@ void lovrGpuInit(void* (*getProcAddress)(const char*), bool debug) {
glDebugMessageCallback(onMessage, NULL);
}
state.features.astc = GLAD_GL_ES_VERSION_3_2;
state.features.compute = GLAD_GL_ES_VERSION_3_1 || GLAD_GL_ARB_compute_shader;
state.features.compute = GLAD_GL_ES_VERSION_3_1 || (GLVersion.major > 4 || (GLVersion.major >= 4 && GLVersion.minor >= 3));
state.features.dxt = GLAD_GL_EXT_texture_compression_s3tc;
state.features.instancedStereo = GLAD_GL_ARB_viewport_array && GLAD_GL_AMD_vertex_shader_viewport_index && GLAD_GL_ARB_fragment_layer_viewport;
state.features.multiview = GLAD_GL_ES_VERSION_3_0 && GLAD_GL_OVR_multiview2 && GLAD_GL_OVR_multiview_multisampled_render_to_texture;