X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fcompiler%2Fglsl%2Fglsl_parser_extras.h;h=dad73e924d81ef969ea1878140843b256b5c6964;hb=c81fbb42d94293e78e9c767bb00ad22855f9e0b0;hp=66ed2fa64b4e3536bd64d8102ce7e142f4e26a94;hpb=de2727925a5b69e7c7fa1fee3c7e7ad0cbabcb02;p=mesa.git diff --git a/src/compiler/glsl/glsl_parser_extras.h b/src/compiler/glsl/glsl_parser_extras.h index 66ed2fa64b4..dad73e924d8 100644 --- a/src/compiler/glsl/glsl_parser_extras.h +++ b/src/compiler/glsl/glsl_parser_extras.h @@ -21,7 +21,6 @@ * DEALINGS IN THE SOFTWARE. */ -#pragma once #ifndef GLSL_PARSER_EXTRAS_H #define GLSL_PARSER_EXTRAS_H @@ -34,6 +33,11 @@ #include #include "glsl_symbol_table.h" +/* THIS is a macro defined somewhere deep in the Windows MSVC header files. + * Undefine it here to avoid collision with the lexer's THIS token. + */ +#undef THIS + struct gl_context; struct glsl_switch_state { @@ -137,7 +141,8 @@ struct _mesa_glsl_parse_state { bool check_bitwise_operations_allowed(YYLTYPE *locp) { - return check_version(130, 300, locp, "bit-wise operations are forbidden"); + return EXT_gpu_shader4_enable || + check_version(130, 300, locp, "bit-wise operations are forbidden"); } bool check_explicit_attrib_stream_allowed(YYLTYPE *locp) @@ -252,7 +257,8 @@ struct _mesa_glsl_parse_state { bool has_int64() const { - return ARB_gpu_shader_int64_enable; + return ARB_gpu_shader_int64_enable || + AMD_gpu_shader_int64_enable; } bool has_420pack() const @@ -318,8 +324,7 @@ struct _mesa_glsl_parse_state { bool has_framebuffer_fetch() const { return EXT_shader_framebuffer_fetch_enable || - MESA_shader_framebuffer_fetch_enable || - MESA_shader_framebuffer_fetch_non_coherent_enable; + EXT_shader_framebuffer_fetch_non_coherent_enable; } bool has_texture_cube_map_array() const @@ -335,6 +340,29 @@ struct _mesa_glsl_parse_state { return ARB_shader_image_load_store_enable || is_version(420, 310); } + bool has_bindless() const + { + return ARB_bindless_texture_enable; + } + + bool has_image_load_formatted() const + { + return EXT_shader_image_load_formatted_enable; + } + + bool has_implicit_conversions() const + { + return EXT_shader_implicit_conversions_enable || is_version(120, 0); + } + + bool has_implicit_uint_to_int_conversion() const + { + return ARB_gpu_shader5_enable || + MESA_shader_integer_functions_enable || + EXT_shader_implicit_conversions_enable || + is_version(400, 0); + } + void process_version_directive(YYLTYPE *locp, int version, const char *ident); @@ -350,7 +378,7 @@ struct _mesa_glsl_parse_state { unsigned ver; uint8_t gl_ver; bool es; - } supported_versions[16]; + } supported_versions[17]; bool es_shader; bool compat_shader; @@ -423,6 +451,22 @@ struct _mesa_glsl_parse_state { */ bool cs_input_local_size_variable_specified; + /** + * Arrangement of invocations used to calculate derivatives in a compute + * shader. From NV_compute_shader_derivatives. + */ + enum gl_derivative_group cs_derivative_group; + + /** + * True if a shader declare bindless_sampler/bindless_image, and + * respectively bound_sampler/bound_image at global scope as specified by + * ARB_bindless_texture. + */ + bool bindless_sampler_specified; + bool bindless_image_specified; + bool bound_sampler_specified; + bool bound_image_specified; + /** * Output layout qualifiers from GLSL 1.50 (geometry shader controls), * and GLSL 4.00 (tessellation control shader). @@ -475,6 +519,7 @@ struct _mesa_glsl_parse_state { unsigned MaxVertexOutputComponents; unsigned MaxGeometryInputComponents; unsigned MaxGeometryOutputComponents; + unsigned MaxGeometryShaderInvocations; unsigned MaxFragmentInputComponents; unsigned MaxGeometryTextureImageUnits; unsigned MaxGeometryOutputVertices; @@ -581,6 +626,13 @@ struct _mesa_glsl_parse_state { char *info_log; + /** + * Are warnings enabled? + * + * Emission of warngins is controlled by '#pragma warning(...)'. + */ + bool warnings_enabled; + /** * \name Enable bits for GLSL extensions */ @@ -593,6 +645,10 @@ struct _mesa_glsl_parse_state { bool ARB_ES3_2_compatibility_warn; bool ARB_arrays_of_arrays_enable; bool ARB_arrays_of_arrays_warn; + bool ARB_bindless_texture_enable; + bool ARB_bindless_texture_warn; + bool ARB_compatibility_enable; + bool ARB_compatibility_warn; bool ARB_compute_shader_enable; bool ARB_compute_shader_warn; bool ARB_compute_variable_group_size_enable; @@ -617,6 +673,8 @@ struct _mesa_glsl_parse_state { bool ARB_fragment_coord_conventions_warn; bool ARB_fragment_layer_viewport_enable; bool ARB_fragment_layer_viewport_warn; + bool ARB_fragment_shader_interlock_enable; + bool ARB_fragment_shader_interlock_warn; bool ARB_gpu_shader5_enable; bool ARB_gpu_shader5_warn; bool ARB_gpu_shader_fp64_enable; @@ -633,6 +691,8 @@ struct _mesa_glsl_parse_state { bool ARB_shader_atomic_counter_ops_warn; bool ARB_shader_atomic_counters_enable; bool ARB_shader_atomic_counters_warn; + bool ARB_shader_ballot_enable; + bool ARB_shader_ballot_warn; bool ARB_shader_bit_encoding_enable; bool ARB_shader_bit_encoding_warn; bool ARB_shader_clock_enable; @@ -693,6 +753,8 @@ struct _mesa_glsl_parse_state { */ bool OES_EGL_image_external_enable; bool OES_EGL_image_external_warn; + bool OES_EGL_image_external_essl3_enable; + bool OES_EGL_image_external_essl3_warn; bool OES_geometry_point_size_enable; bool OES_geometry_point_size_warn; bool OES_geometry_shader_enable; @@ -730,10 +792,14 @@ struct _mesa_glsl_parse_state { */ bool AMD_conservative_depth_enable; bool AMD_conservative_depth_warn; + bool AMD_gpu_shader_int64_enable; + bool AMD_gpu_shader_int64_warn; bool AMD_shader_stencil_export_enable; bool AMD_shader_stencil_export_warn; bool AMD_shader_trinary_minmax_enable; bool AMD_shader_trinary_minmax_warn; + bool AMD_texture_texture4_enable; + bool AMD_texture_texture4_warn; bool AMD_vertex_shader_layer_enable; bool AMD_vertex_shader_layer_warn; bool AMD_vertex_shader_viewport_index_enable; @@ -752,6 +818,8 @@ struct _mesa_glsl_parse_state { bool EXT_geometry_point_size_warn; bool EXT_geometry_shader_enable; bool EXT_geometry_shader_warn; + bool EXT_gpu_shader4_enable; + bool EXT_gpu_shader4_warn; bool EXT_gpu_shader5_enable; bool EXT_gpu_shader5_warn; bool EXT_primitive_bounding_box_enable; @@ -760,6 +828,12 @@ struct _mesa_glsl_parse_state { bool EXT_separate_shader_objects_warn; bool EXT_shader_framebuffer_fetch_enable; bool EXT_shader_framebuffer_fetch_warn; + bool EXT_shader_framebuffer_fetch_non_coherent_enable; + bool EXT_shader_framebuffer_fetch_non_coherent_warn; + bool EXT_shader_image_load_formatted_enable; + bool EXT_shader_image_load_formatted_warn; + bool EXT_shader_implicit_conversions_enable; + bool EXT_shader_implicit_conversions_warn; bool EXT_shader_integer_mix_enable; bool EXT_shader_integer_mix_warn; bool EXT_shader_io_blocks_enable; @@ -776,16 +850,22 @@ struct _mesa_glsl_parse_state { bool EXT_texture_buffer_warn; bool EXT_texture_cube_map_array_enable; bool EXT_texture_cube_map_array_warn; + bool EXT_texture_query_lod_enable; + bool EXT_texture_query_lod_warn; bool INTEL_conservative_rasterization_enable; bool INTEL_conservative_rasterization_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 INTEL_shader_atomic_float_minmax_enable; + bool INTEL_shader_atomic_float_minmax_warn; bool MESA_shader_integer_functions_enable; bool MESA_shader_integer_functions_warn; + bool NV_compute_shader_derivatives_enable; + bool NV_compute_shader_derivatives_warn; + bool NV_fragment_shader_interlock_enable; + bool NV_fragment_shader_interlock_warn; bool NV_image_formats_enable; bool NV_image_formats_warn; + bool NV_shader_atomic_float_enable; + bool NV_shader_atomic_float_warn; /*@}*/ /** Extensions supported by the OpenGL implementation. */ @@ -809,6 +889,11 @@ struct _mesa_glsl_parse_state { bool fs_post_depth_coverage; + bool fs_pixel_interlock_ordered; + bool fs_pixel_interlock_unordered; + bool fs_sample_interlock_ordered; + bool fs_sample_interlock_unordered; + unsigned fs_blend_support; /** @@ -824,6 +909,8 @@ struct _mesa_glsl_parse_state { unsigned atomic_counter_offsets[MAX_COMBINED_ATOMIC_BUFFERS]; bool allow_extension_directive_midshader; + bool allow_builtin_variable_redeclaration; + bool allow_layout_qualifier_on_function_parameter; /** * Known subroutine type declarations. @@ -913,6 +1000,7 @@ extern "C" { #endif struct glcpp_parser; +struct _mesa_glsl_parse_state; typedef void (*glcpp_extension_iterator)( struct _mesa_glsl_parse_state *state, @@ -926,9 +1014,16 @@ extern int glcpp_preprocess(void *ctx, const char **shader, char **info_log, struct _mesa_glsl_parse_state *state, struct gl_context *gl_ctx); +extern void _mesa_init_shader_compiler_types(void); +extern void _mesa_destroy_shader_compiler_types(void); extern void _mesa_destroy_shader_compiler(void); extern void _mesa_destroy_shader_compiler_caches(void); +extern void +_mesa_glsl_copy_symbols_from_table(struct exec_list *shader_ir, + struct glsl_symbol_table *src, + struct glsl_symbol_table *dest); + #ifdef __cplusplus } #endif