glsl: move some uniform linking code to new link_assign_uniform_storage()
[mesa.git] / src / compiler / glsl / glsl_parser_extras.h
index f9c1ffca842387938c2b09b58f75a5b550ddeb69..f4050e37de1196ca3572b2b0006e961b0bc21d94 100644 (file)
@@ -267,19 +267,35 @@ struct _mesa_glsl_parse_state {
 
    bool has_shader_io_blocks() const
    {
+      /* The OES_geometry_shader_specification says:
+       *
+       *    "If the OES_geometry_shader extension is enabled, the
+       *     OES_shader_io_blocks extension is also implicitly enabled."
+       *
+       * The OES_tessellation_shader extension has similar wording.
+       */
       return OES_shader_io_blocks_enable ||
              EXT_shader_io_blocks_enable ||
+             OES_geometry_shader_enable ||
+             EXT_geometry_shader_enable ||
+             OES_tessellation_shader_enable ||
+             EXT_tessellation_shader_enable ||
+
              is_version(150, 320);
    }
 
    bool has_geometry_shader() const
    {
-      return OES_geometry_shader_enable || is_version(150, 320);
+      return OES_geometry_shader_enable || EXT_geometry_shader_enable ||
+             is_version(150, 320);
    }
 
    bool has_tessellation_shader() const
    {
-      return ARB_tessellation_shader_enable || is_version(400, 0);
+      return ARB_tessellation_shader_enable ||
+             OES_tessellation_shader_enable ||
+             EXT_tessellation_shader_enable ||
+             is_version(400, 320);
    }
 
    bool has_clip_distance() const
@@ -294,6 +310,21 @@ struct _mesa_glsl_parse_state {
              is_version(450, 0);
    }
 
+   bool has_framebuffer_fetch() const
+   {
+      return EXT_shader_framebuffer_fetch_enable ||
+             MESA_shader_framebuffer_fetch_enable ||
+             MESA_shader_framebuffer_fetch_non_coherent_enable;
+   }
+
+   bool has_texture_cube_map_array() const
+   {
+      return ARB_texture_cube_map_array_enable ||
+             EXT_texture_cube_map_array_enable ||
+             OES_texture_cube_map_array_enable ||
+             is_version(400, 320);
+   }
+
    void process_version_directive(YYLTYPE *locp, int version,
                                   const char *ident);
 
@@ -601,6 +632,8 @@ struct _mesa_glsl_parse_state {
    bool ARB_shader_texture_image_samples_warn;
    bool ARB_shader_texture_lod_enable;
    bool ARB_shader_texture_lod_warn;
+   bool ARB_shader_viewport_layer_array_enable;
+   bool ARB_shader_viewport_layer_array_warn;
    bool ARB_shading_language_420pack_enable;
    bool ARB_shading_language_420pack_warn;
    bool ARB_shading_language_packing_enable;
@@ -628,6 +661,8 @@ struct _mesa_glsl_parse_state {
 
    /* KHR extensions go here, sorted alphabetically.
     */
+   bool KHR_blend_equation_advanced_enable;
+   bool KHR_blend_equation_advanced_warn;
 
    /* OES extensions go here, sorted alphabetically.
     */
@@ -639,6 +674,8 @@ struct _mesa_glsl_parse_state {
    bool OES_geometry_shader_warn;
    bool OES_gpu_shader5_enable;
    bool OES_gpu_shader5_warn;
+   bool OES_primitive_bounding_box_enable;
+   bool OES_primitive_bounding_box_warn;
    bool OES_sample_variables_enable;
    bool OES_sample_variables_warn;
    bool OES_shader_image_atomic_enable;
@@ -649,12 +686,20 @@ struct _mesa_glsl_parse_state {
    bool OES_shader_multisample_interpolation_warn;
    bool OES_standard_derivatives_enable;
    bool OES_standard_derivatives_warn;
+   bool OES_tessellation_point_size_enable;
+   bool OES_tessellation_point_size_warn;
+   bool OES_tessellation_shader_enable;
+   bool OES_tessellation_shader_warn;
    bool OES_texture_3D_enable;
    bool OES_texture_3D_warn;
    bool OES_texture_buffer_enable;
    bool OES_texture_buffer_warn;
+   bool OES_texture_cube_map_array_enable;
+   bool OES_texture_cube_map_array_warn;
    bool OES_texture_storage_multisample_2d_array_enable;
    bool OES_texture_storage_multisample_2d_array_warn;
+   bool OES_viewport_array_enable;
+   bool OES_viewport_array_warn;
 
    /* All other extensions go here, sorted alphabetically.
     */
@@ -668,26 +713,46 @@ struct _mesa_glsl_parse_state {
    bool AMD_vertex_shader_layer_warn;
    bool AMD_vertex_shader_viewport_index_enable;
    bool AMD_vertex_shader_viewport_index_warn;
+   bool ANDROID_extension_pack_es31a_enable;
+   bool ANDROID_extension_pack_es31a_warn;
    bool EXT_blend_func_extended_enable;
    bool EXT_blend_func_extended_warn;
    bool EXT_clip_cull_distance_enable;
    bool EXT_clip_cull_distance_warn;
    bool EXT_draw_buffers_enable;
    bool EXT_draw_buffers_warn;
+   bool EXT_geometry_point_size_enable;
+   bool EXT_geometry_point_size_warn;
+   bool EXT_geometry_shader_enable;
+   bool EXT_geometry_shader_warn;
    bool EXT_gpu_shader5_enable;
    bool EXT_gpu_shader5_warn;
+   bool EXT_primitive_bounding_box_enable;
+   bool EXT_primitive_bounding_box_warn;
    bool EXT_separate_shader_objects_enable;
    bool EXT_separate_shader_objects_warn;
+   bool EXT_shader_framebuffer_fetch_enable;
+   bool EXT_shader_framebuffer_fetch_warn;
    bool EXT_shader_integer_mix_enable;
    bool EXT_shader_integer_mix_warn;
    bool EXT_shader_io_blocks_enable;
    bool EXT_shader_io_blocks_warn;
    bool EXT_shader_samples_identical_enable;
    bool EXT_shader_samples_identical_warn;
+   bool EXT_tessellation_point_size_enable;
+   bool EXT_tessellation_point_size_warn;
+   bool EXT_tessellation_shader_enable;
+   bool EXT_tessellation_shader_warn;
    bool EXT_texture_array_enable;
    bool EXT_texture_array_warn;
    bool EXT_texture_buffer_enable;
    bool EXT_texture_buffer_warn;
+   bool EXT_texture_cube_map_array_enable;
+   bool EXT_texture_cube_map_array_warn;
+   bool MESA_shader_framebuffer_fetch_enable;
+   bool MESA_shader_framebuffer_fetch_warn;
+   bool MESA_shader_framebuffer_fetch_non_coherent_enable;
+   bool MESA_shader_framebuffer_fetch_non_coherent_warn;
    bool MESA_shader_integer_functions_enable;
    bool MESA_shader_integer_functions_warn;
    /*@}*/
@@ -709,6 +774,8 @@ struct _mesa_glsl_parse_state {
 
    bool fs_early_fragment_tests;
 
+   unsigned fs_blend_support;
+
    /**
     * For tessellation control shaders, size of the most recently seen output
     * declaration that was a sized array, or 0 if no sized output array