diff options
author | Ian Romanick <[email protected]> | 2016-10-14 18:11:51 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2017-01-20 15:41:23 -0800 |
commit | 330fc2413c61f0bd9c7bb9f3a0ecd91b09de267a (patch) | |
tree | 9f6fa4014c98f04b40539b268a7be7a34c1b56a1 /src/compiler/glsl/builtin_functions.cpp | |
parent | aa38bf1e593eba3e65c4e10154410158d6d263c5 (diff) |
glsl: Add "built-in" functions to do 64x64 => 64 multiplication
These functions are directly available in shaders. A #define is added
to detect the presence. This allows these functions to be tested using
piglit regardless of whether the driver uses them for lowering. The
GLSL spec says that functions and macros beginning with __ are reserved
for use by the implementation... hey, that's us!
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/compiler/glsl/builtin_functions.cpp')
-rw-r--r-- | src/compiler/glsl/builtin_functions.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp index 307cc58a6ea..a043c9d4dc8 100644 --- a/src/compiler/glsl/builtin_functions.cpp +++ b/src/compiler/glsl/builtin_functions.cpp @@ -576,6 +576,11 @@ vote(const _mesa_glsl_parse_state *state) return state->ARB_shader_group_vote_enable; } +static bool +integer_functions_supported(const _mesa_glsl_parse_state *state) +{ + return state->extensions->MESA_shader_integer_functions; +} /** @} */ /******************************************************************************/ @@ -3094,6 +3099,10 @@ builtin_builder::create_builtins() add_function("allInvocationsARB", _vote(ir_unop_vote_all), NULL); add_function("allInvocationsEqualARB", _vote(ir_unop_vote_eq), NULL); + add_function("__builtin_umul64", + generate_ir::umul64(mem_ctx, integer_functions_supported), + NULL); + #undef F #undef FI #undef FIUD_VEC |