[Mesa-dev] [PATCH v2] glsl: reuse main extension table to appropriate restrict extensions

Eric Engestrom eric.engestrom at imgtec.com
Tue Jun 14 16:19:05 UTC 2016


On Mon, Jun 13, 2016 at 11:43:57PM -0400, Ilia Mirkin wrote:
> Previously we were only restricting based on ES/non-ES-ness and whether
> the overall enable bit had been flipped on. However we have been adding
> more fine-grained restrictions, such as based on compat profiles, as
> well as specific ES versions. Most of the time this doesn't matter, but
> it can create awkward situations and duplication of logic.
> 
> Here we separate the main extension table into a separate object file,
> linked to the glsl compiler, which makes use of it with a custom
> function which takes the ES-ness of the shader into account (thus
> allowing desktop shaders to properly use ES extensions that would
> otherwise have been disallowed.)
> 
> The effect of this change should be nil in most cases.
> 
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
> 
> v1 -> v2:
>  - use a final enum to obtain number of extensions
>  - move calculation of the gl version to be once per shader, for better reuse
>  - bake GL version into the "supported_versions" struct
>  - while we're at it, fix supported_versions size, it was off by 1 since ES 3.20
>    "support" was added.
> 

Looks all good to me :)
Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>


More information about the mesa-dev mailing list