mesa: Add ARB_shader_precision infrastructure
authorMicah Fedke <micah.fedke@collabora.co.uk>
Wed, 31 Dec 2014 20:16:52 +0000 (14:16 -0600)
committerChris Forbes <chrisf@ijw.co.nz>
Mon, 19 Jan 2015 03:33:21 +0000 (16:33 +1300)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
src/glsl/glcpp/glcpp-parse.y
src/glsl/glsl_parser_extras.cpp
src/glsl/glsl_parser_extras.h
src/mapi/glapi/gen/gl_API.xml
src/mesa/main/extensions.c
src/mesa/main/mtypes.h

index 9e705ef074107fccb24df3949bd5a07db21e7903..e5bebe58e3a58534de07572a0acbfc967fdc9387 100644 (file)
@@ -2474,6 +2474,9 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio
 
               if (extensions->ARB_derivative_control)
                  add_builtin_define(parser, "GL_ARB_derivative_control", 1);
+
+              if (extensions->ARB_shader_precision)
+                 add_builtin_define(parser, "GL_ARB_shader_precision", 1);
           }
        }
 
index 6d18cd493cc8a6c27979d1827c72f295b9751a67..ccdf03198a249a927d5450f28f3c4f13d3e6c4d5 100644 (file)
@@ -532,6 +532,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
    EXT(ARB_shader_atomic_counters,     true,  false,     ARB_shader_atomic_counters),
    EXT(ARB_shader_bit_encoding,        true,  false,     ARB_shader_bit_encoding),
    EXT(ARB_shader_image_load_store,    true,  false,     ARB_shader_image_load_store),
+   EXT(ARB_shader_precision,           true,  false,     ARB_shader_precision),
    EXT(ARB_shader_stencil_export,      true,  false,     ARB_shader_stencil_export),
    EXT(ARB_shader_texture_lod,         true,  false,     ARB_shader_texture_lod),
    EXT(ARB_shading_language_420pack,   true,  false,     ARB_shading_language_420pack),
index 4887672233be755ee8af52e88bad81956974e208..843fdae11579899bcf1138eed7728002f2aa2685 100644 (file)
@@ -424,6 +424,8 @@ struct _mesa_glsl_parse_state {
    bool ARB_shader_bit_encoding_warn;
    bool ARB_shader_image_load_store_enable;
    bool ARB_shader_image_load_store_warn;
+   bool ARB_shader_precision_enable;
+   bool ARB_shader_precision_warn;
    bool ARB_shader_stencil_export_enable;
    bool ARB_shader_stencil_export_warn;
    bool ARB_shader_texture_lod_enable;
index 2d6bed206386c36aefa722267af5c50283c1d2d6..e3cbab35a6914d713da0aca409bc640e0fed36a9 100644 (file)
 
 <xi:include href="ARB_separate_shader_objects.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
 
-<!-- ARB extensions #98...#108 -->
+<category name="GL_ARB_shader_precision" number="98">
+      <!-- No new functions, types, enums. -->
+</category>
+
+<!-- ARB extensions #99...#108 -->
 
 <xi:include href="ARB_ES2_compatibility.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
 
index e5bac7f894aa42bfe2abe9208dc567a97f2cef00..16f12418ee91146d632a399d669cd81e22da1855 100644 (file)
@@ -148,6 +148,7 @@ static const struct extension extension_table[] = {
    { "GL_ARB_shader_bit_encoding",                 o(ARB_shader_bit_encoding),                 GL,             2010 },
    { "GL_ARB_shader_image_load_store",             o(ARB_shader_image_load_store),             GL,             2011 },
    { "GL_ARB_shader_objects",                      o(dummy_true),                              GL,             2002 },
+   { "GL_ARB_shader_precision",                    o(ARB_shader_precision),                    GL,             2010 },
    { "GL_ARB_shader_stencil_export",               o(ARB_shader_stencil_export),               GL,             2009 },
    { "GL_ARB_shader_texture_lod",                  o(ARB_shader_texture_lod),                  GL,             2009 },
    { "GL_ARB_shading_language_100",                o(dummy_true),                              GLL,            2003 },
index b95dfb9f7b7a352f56453fd4a23157989f77bf32..4c83379e3275660c25805851928157e9faf7cb5c 100644 (file)
@@ -3757,6 +3757,7 @@ struct gl_extensions
    GLboolean ARB_shader_atomic_counters;
    GLboolean ARB_shader_bit_encoding;
    GLboolean ARB_shader_image_load_store;
+   GLboolean ARB_shader_precision;
    GLboolean ARB_shader_stencil_export;
    GLboolean ARB_shader_texture_lod;
    GLboolean ARB_shading_language_packing;