gallium: add PIPE_CAP_ESSL_FEATURE_LEVEL

Adds a new cap to allow drivers to expose higher shading language
versions in GLES contexts, to avoid having to report an artificially
low version for the benefit of GL contexts.

The motivation is to expose EXT_gpu_shader5 even though a driver may
not support all the features needed for the corresponding GL extension
(ARB_gpu_shader5).

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
This commit is contained in:
Rob Clark 2019-03-21 08:56:17 -04:00
parent 93c81ca336
commit de481947d9
3 changed files with 14 additions and 0 deletions

View file

@ -107,6 +107,10 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen,
/* Minimum GLSL level implemented by gallium drivers. */
return 120;
case PIPE_CAP_ESSL_FEATURE_LEVEL:
/* Tell state-tracker to fallback to PIPE_CAP_GLSL_FEATURE_LEVEL */
return 0;
case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
case PIPE_CAP_USER_VERTEX_BUFFERS:
case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY:

View file

@ -105,6 +105,15 @@ The integer capabilities:
The only legacy features that Gallium drivers must implement are
the legacy shader inputs and outputs (colors, texcoords, fog, clipvertex,
edgeflag).
* ``PIPE_CAP_ESSL_FEATURE_LEVEL``: An optional cap to allow drivers to
report a higher GLSL version for GLES contexts. This is useful when a
driver does not support all the required features for a higher GL version,
but does support the required features for a higher GLES version. A driver
is allowed to return ``0`` in which case ``PIPE_CAP_GLSL_FEATURE_LEVEL`` is
used.
Note that simply returning the same value as the GLSL feature level cap is
incorrect. For example, GLSL version 3.30 does not require ``ARB_gpu_shader5``,
but ESSL version 3.20 es does require ``EXT_gpu_shader5``
* ``PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION``: Whether quads adhere to
the flatshade_first setting in ``pipe_rasterizer_state``.
* ``PIPE_CAP_USER_VERTEX_BUFFERS``: Whether the driver supports user vertex

View file

@ -718,6 +718,7 @@ enum pipe_cap
PIPE_CAP_VERTEX_COLOR_CLAMPED,
PIPE_CAP_GLSL_FEATURE_LEVEL,
PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY,
PIPE_CAP_ESSL_FEATURE_LEVEL,
PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION,
PIPE_CAP_USER_VERTEX_BUFFERS,
PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY,