diff options
author | Rob Clark <[email protected]> | 2019-03-21 08:56:17 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2019-03-22 16:39:13 -0400 |
commit | de481947d975496b274cf0e0300383d932dcaea5 (patch) | |
tree | 9b82f59fdfa2f3f4b5985b24803e79851ead52f8 /src | |
parent | 93c81ca336f64c45e43f0c40cb5c5f9084745233 (diff) |
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 <[email protected]>
Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/auxiliary/util/u_screen.c | 4 | ||||
-rw-r--r-- | src/gallium/docs/source/screen.rst | 9 | ||||
-rw-r--r-- | src/gallium/include/pipe/p_defines.h | 1 |
3 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_screen.c b/src/gallium/auxiliary/util/u_screen.c index b902c083ad4..9f0be8060ee 100644 --- a/src/gallium/auxiliary/util/u_screen.c +++ b/src/gallium/auxiliary/util/u_screen.c @@ -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: diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst index 60ba9bcbde0..a4d6a9557c0 100644 --- a/src/gallium/docs/source/screen.rst +++ b/src/gallium/docs/source/screen.rst @@ -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 diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index ebc44d7a75e..3dbdea035e4 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -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, |