From: Marek Olšák Date: Mon, 6 Aug 2018 04:56:35 +0000 (-0400) Subject: mesa: expose AMD_gpu_shader_int64 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b3c17330e631695b5e5dc209ba9ea1a528618c97;p=mesa.git mesa: expose AMD_gpu_shader_int64 because the closed driver exposes it. It's equivalent to ARB_gpu_shader_int64. In this patch, I did everything the same as we do for ARB_gpu_shader_int64. Reviewed-by: Ian Romanick --- diff --git a/docs/relnotes/18.3.0.html b/docs/relnotes/18.3.0.html index ac2cc1e893b..840a336d41a 100644 --- a/docs/relnotes/18.3.0.html +++ b/docs/relnotes/18.3.0.html @@ -52,6 +52,7 @@ Note: some of the new features are only available with certain drivers. diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp index 2a3138ad0a5..b6018806865 100644 --- a/src/compiler/glsl/builtin_functions.cpp +++ b/src/compiler/glsl/builtin_functions.cpp @@ -535,7 +535,8 @@ static bool shader_clock_int64(const _mesa_glsl_parse_state *state) { return state->ARB_shader_clock_enable && - state->ARB_gpu_shader_int64_enable; + (state->ARB_gpu_shader_int64_enable || + state->AMD_gpu_shader_int64_enable); } static bool diff --git a/src/compiler/glsl/builtin_types.cpp b/src/compiler/glsl/builtin_types.cpp index 7a01cb48bc8..d2bcdd68138 100644 --- a/src/compiler/glsl/builtin_types.cpp +++ b/src/compiler/glsl/builtin_types.cpp @@ -411,7 +411,8 @@ _mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state) add_type(symbols, glsl_type::dmat4x3_type); } - if (state->ARB_gpu_shader_int64_enable) { + if (state->ARB_gpu_shader_int64_enable || + state->AMD_gpu_shader_int64_enable) { add_type(symbols, glsl_type::int64_t_type); add_type(symbols, glsl_type::i64vec2_type); add_type(symbols, glsl_type::i64vec3_type); diff --git a/src/compiler/glsl/glsl_lexer.ll b/src/compiler/glsl/glsl_lexer.ll index 1cd11d5c7c7..0a2bba6d38f 100644 --- a/src/compiler/glsl/glsl_lexer.ll +++ b/src/compiler/glsl/glsl_lexer.ll @@ -664,15 +664,15 @@ sample KEYWORD_WITH_ALT(400, 300, 400, 320, yyextra->ARB_gpu_shader5_enable || subroutine KEYWORD_WITH_ALT(400, 300, 400, 0, yyextra->ARB_shader_subroutine_enable, SUBROUTINE); /* Additional words for ARB_gpu_shader_int64 */ -int64_t TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable, glsl_type::int64_t_type); -i64vec2 TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable, glsl_type::i64vec2_type); -i64vec3 TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable, glsl_type::i64vec3_type); -i64vec4 TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable, glsl_type::i64vec4_type); - -uint64_t TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable, glsl_type::uint64_t_type); -u64vec2 TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable, glsl_type::u64vec2_type); -u64vec3 TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable, glsl_type::u64vec3_type); -u64vec4 TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable, glsl_type::u64vec4_type); +int64_t TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable || yyextra->AMD_gpu_shader_int64_enable, glsl_type::int64_t_type); +i64vec2 TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable || yyextra->AMD_gpu_shader_int64_enable, glsl_type::i64vec2_type); +i64vec3 TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable || yyextra->AMD_gpu_shader_int64_enable, glsl_type::i64vec3_type); +i64vec4 TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable || yyextra->AMD_gpu_shader_int64_enable, glsl_type::i64vec4_type); + +uint64_t TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable || yyextra->AMD_gpu_shader_int64_enable, glsl_type::uint64_t_type); +u64vec2 TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable || yyextra->AMD_gpu_shader_int64_enable, glsl_type::u64vec2_type); +u64vec3 TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable || yyextra->AMD_gpu_shader_int64_enable, glsl_type::u64vec3_type); +u64vec4 TYPE_WITH_ALT(0, 0, 0, 0, yyextra->ARB_gpu_shader_int64_enable || yyextra->AMD_gpu_shader_int64_enable, glsl_type::u64vec4_type); [_a-zA-Z][_a-zA-Z0-9]* { struct _mesa_glsl_parse_state *state = yyextra; diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp index 6c98290292a..0a7d0d78b14 100644 --- a/src/compiler/glsl/glsl_parser_extras.cpp +++ b/src/compiler/glsl/glsl_parser_extras.cpp @@ -699,6 +699,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = { /* All other extensions go here, sorted alphabetically. */ EXT(AMD_conservative_depth), + EXT(AMD_gpu_shader_int64), EXT(AMD_shader_stencil_export), EXT(AMD_shader_trinary_minmax), EXT(AMD_vertex_shader_layer), diff --git a/src/compiler/glsl/glsl_parser_extras.h b/src/compiler/glsl/glsl_parser_extras.h index c80db42ea9b..2c8353214aa 100644 --- a/src/compiler/glsl/glsl_parser_extras.h +++ b/src/compiler/glsl/glsl_parser_extras.h @@ -256,7 +256,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 @@ -759,6 +760,8 @@ 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; diff --git a/src/mapi/glapi/gen/AMD_gpu_shader_int64.xml b/src/mapi/glapi/gen/AMD_gpu_shader_int64.xml new file mode 100644 index 00000000000..42eb750d110 --- /dev/null +++ b/src/mapi/glapi/gen/AMD_gpu_shader_int64.xml @@ -0,0 +1,239 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml index 95680f1d466..a45fdc5ed98 100644 --- a/src/mapi/glapi/gen/gl_API.xml +++ b/src/mapi/glapi/gen/gl_API.xml @@ -12957,6 +12957,8 @@ + + diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h index 19a421fc952..b338963ba48 100644 --- a/src/mesa/main/extensions_table.h +++ b/src/mesa/main/extensions_table.h @@ -11,6 +11,7 @@ EXT(3DFX_texture_compression_FXT1 , TDFX_texture_compression_FXT1 EXT(AMD_conservative_depth , ARB_conservative_depth , GLL, GLC, x , x , 2009) EXT(AMD_draw_buffers_blend , ARB_draw_buffers_blend , GLL, GLC, x , x , 2009) EXT(AMD_framebuffer_multisample_advanced , AMD_framebuffer_multisample_advanced , GLL, GLC, x , ES2, 2018) +EXT(AMD_gpu_shader_int64 , ARB_gpu_shader_int64 , x , GLC, x , x , 2015) EXT(AMD_performance_monitor , AMD_performance_monitor , GLL, GLC, x , ES2, 2007) EXT(AMD_pinned_memory , AMD_pinned_memory , GLL, GLC, x , x , 2013) EXT(AMD_seamless_cubemap_per_texture , AMD_seamless_cubemap_per_texture , GLL, GLC, x , x , 2009)