From: Olivier Galibert Date: Mon, 30 Apr 2012 11:19:01 +0000 (+0200) Subject: glsl: Scaffolding for ARB_shader_bit_encoding. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=199771bc325900eb1d3acc7fa03808894a94fdb2;p=mesa.git glsl: Scaffolding for ARB_shader_bit_encoding. That adds support for activating the extension. It doesn't actually *do* anything yet, of course. Signed-off-by: Olivier Galibert Reviewed-by: Kenneth Graunke --- diff --git a/src/glsl/builtins/tools/generate_builtins.py b/src/glsl/builtins/tools/generate_builtins.py index eada4a65681..86660a9362c 100755 --- a/src/glsl/builtins/tools/generate_builtins.py +++ b/src/glsl/builtins/tools/generate_builtins.py @@ -186,6 +186,7 @@ read_builtins(GLenum target, const char *protos, const char **functions, unsigne st->ARB_texture_rectangle_enable = true; st->EXT_texture_array_enable = true; st->OES_EGL_image_external_enable = true; + st->ARB_shader_bit_encoding_enable = true; _mesa_glsl_initialize_types(st); sh->ir = new(sh) exec_list; diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y index 47ba54ddfbb..9e8f9b2d653 100644 --- a/src/glsl/glcpp/glcpp-parse.y +++ b/src/glsl/glcpp/glcpp-parse.y @@ -1141,6 +1141,9 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api) if (extensions->OES_EGL_image_external) add_builtin_define(parser, "GL_OES_EGL_image_external", 1); + + if (extensions->ARB_shader_bit_encoding) + add_builtin_define(parser, "GL_ARB_shader_bit_encoding", 1); } language_version = 110; diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp index 46f21dd076c..02c3986169c 100644 --- a/src/glsl/glsl_parser_extras.cpp +++ b/src/glsl/glsl_parser_extras.cpp @@ -295,6 +295,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = { EXT(AMD_shader_stencil_export, false, false, true, true, false, ARB_shader_stencil_export), EXT(OES_texture_3D, true, false, true, false, true, EXT_texture3D), EXT(OES_EGL_image_external, true, false, true, false, true, OES_EGL_image_external), + EXT(ARB_shader_bit_encoding, true, true, true, true, false, ARB_shader_bit_encoding), }; #undef EXT diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h index 1a909c68b7f..246fc8141db 100644 --- a/src/glsl/glsl_parser_extras.h +++ b/src/glsl/glsl_parser_extras.h @@ -205,6 +205,8 @@ struct _mesa_glsl_parse_state { bool OES_texture_3D_warn; bool OES_EGL_image_external_enable; bool OES_EGL_image_external_warn; + bool ARB_shader_bit_encoding_enable; + bool ARB_shader_bit_encoding_warn; /*@}*/ /** Extensions supported by the OpenGL implementation. */ diff --git a/src/glsl/standalone_scaffolding.cpp b/src/glsl/standalone_scaffolding.cpp index f15f2d882de..679714e384a 100644 --- a/src/glsl/standalone_scaffolding.cpp +++ b/src/glsl/standalone_scaffolding.cpp @@ -79,6 +79,7 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api) ctx->Extensions.NV_texture_rectangle = true; ctx->Extensions.EXT_texture3D = true; ctx->Extensions.OES_EGL_image_external = true; + ctx->Extensions.ARB_shader_bit_encoding = true; ctx->Const.GLSLVersion = 120; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index cd76eeb3d8a..2688f7acedc 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -112,6 +112,7 @@ static const struct extension extension_table[] = { { "GL_ARB_robustness", o(dummy_true), GL, 2010 }, { "GL_ARB_sampler_objects", o(ARB_sampler_objects), GL, 2009 }, { "GL_ARB_seamless_cube_map", o(ARB_seamless_cube_map), GL, 2009 }, + { "GL_ARB_shader_bit_encoding", o(ARB_shader_bit_encoding), GL, 2010 }, { "GL_ARB_shader_objects", o(ARB_shader_objects), GL, 2002 }, { "GL_ARB_shader_stencil_export", o(ARB_shader_stencil_export), GL, 2009 }, { "GL_ARB_shader_texture_lod", o(ARB_shader_texture_lod), GL, 2009 }, diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 3a8cac9c5a1..ea40ffc9c06 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2895,6 +2895,7 @@ struct gl_extensions GLboolean ARB_point_sprite; GLboolean ARB_sampler_objects; GLboolean ARB_seamless_cube_map; + GLboolean ARB_shader_bit_encoding; GLboolean ARB_shader_objects; GLboolean ARB_shader_stencil_export; GLboolean ARB_shader_texture_lod; diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index 90afecb5d8b..efaaf58de88 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -171,6 +171,7 @@ compute_version(struct gl_context *ctx) ctx->Extensions.ARB_instanced_arrays && ctx->Extensions.ARB_occlusion_query2 && ctx->Extensions.ARB_sampler_objects && + ctx->Extensions.ARB_shader_bit_encoding && ctx->Extensions.ARB_texture_rgb10_a2ui && ctx->Extensions.ARB_timer_query && ctx->Extensions.ARB_vertex_type_2_10_10_10_rev &&