mesa: Add PrimitiveRestartFixedIndex to gl_constants

This is a fine-grained subset of the NV_primitive_restart extension that
only uses the fixed indices provided by GLES 3.0. There’s no public
extension to advertise this behaviour so the bool is added to
gl_constants instead of gl_extensions.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed by: Erik Faye-Lund <erik.faye-lund@collabora.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5559>
This commit is contained in:
Neil Roberts
2020-06-18 15:48:12 +02:00
committed by Marge Bot
parent bb5fc90135
commit 1fc346d2be
4 changed files with 16 additions and 2 deletions

View File

@@ -1132,6 +1132,9 @@ void st_init_extensions(struct pipe_screen *screen,
consts->AllowGLSLCrossStageInterpolationMismatch = options->allow_glsl_cross_stage_interpolation_mismatch;
consts->PrimitiveRestartFixedIndex =
screen->get_param(screen, PIPE_CAP_PRIMITIVE_RESTART_FIXED_INDEX);
/* Technically we are turning on the EXT_gpu_shader5 extension,
* ARB_gpu_shader5 does not exist in GLES, but this flag is what
* switches on EXT_gpu_shader5:
@@ -1505,7 +1508,8 @@ void st_init_extensions(struct pipe_screen *screen,
*/
if (GLSLVersion >= 130 &&
extensions->ARB_uniform_buffer_object &&
extensions->NV_primitive_restart &&
(extensions->NV_primitive_restart ||
consts->PrimitiveRestartFixedIndex) &&
screen->get_shader_param(screen, PIPE_SHADER_VERTEX,
PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS) >= 16 &&
/* Requirements for ETC2 emulation. */