From 6b03b345eb64e15e577bc8b2cf04b314a4c70537 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 17 Oct 2016 13:55:27 -0700 Subject: glsl: Add "built-in" function for 64-bit integer sign() 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 Reviewed-by: Matt Turner --- src/compiler/glsl/glcpp/glcpp-parse.y | 1 + 1 file changed, 1 insertion(+) (limited to 'src/compiler/glsl/glcpp/glcpp-parse.y') diff --git a/src/compiler/glsl/glcpp/glcpp-parse.y b/src/compiler/glsl/glcpp/glcpp-parse.y index ee553773670..39a7a89258f 100644 --- a/src/compiler/glsl/glcpp/glcpp-parse.y +++ b/src/compiler/glsl/glcpp/glcpp-parse.y @@ -2343,6 +2343,7 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio * those functions so that they can be tested. */ if (parser->extension_list->MESA_shader_integer_functions) { + add_builtin_define(parser, "__have_builtin_builtin_sign64", 1); add_builtin_define(parser, "__have_builtin_builtin_umul64", 1); } } -- cgit v1.2.3