From e483cb9a3add01dc552bd2a42763aff4be5808fc Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Sun, 12 Jun 2016 18:56:43 -0400 Subject: glsl: reuse main extension table to appropriately restrict extensions 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.) We can also now use this logic to generate #define's for all supported extensions automatically, removing the duplicate (and often inaccurate) list in glcpp. The effect of this change should be nil in most cases. However in some situations, extensions like GL_ARB_gpu_shader5 which were formerly available in compat contexts on the GLSL side of things will now become inaccessible. This regresses two ES CTS tests: ES3-CTS.shaders.shader_integer_mix.define ES31-CTS.shader_integer_mix.define however that is due to them using #version 100 instead of 300 es. As the extension is only defined for ES3, I believe this is the correct behavior. Signed-off-by: Ilia Mirkin Reviewed-by: Eric Engestrom (v2) v2 -> v3: integrate glcpp defines into the same mechanism --- src/mesa/main/extensions.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa/main/extensions.h') diff --git a/src/mesa/main/extensions.h b/src/mesa/main/extensions.h index 43ef6aa6451..efef1be4751 100644 --- a/src/mesa/main/extensions.h +++ b/src/mesa/main/extensions.h @@ -89,6 +89,7 @@ enum { #define EXT(name_str, ...) MESA_EXTENSION_##name_str, #include "extensions_table.h" #undef EXT +MESA_EXTENSION_COUNT }; -- cgit v1.2.3