diff options
author | Ian Romanick <[email protected]> | 2016-10-18 16:46:35 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2017-01-20 15:41:23 -0800 |
commit | 695b04f7eb24bff108e8d85c476adb5cf9de6f2d (patch) | |
tree | cdb68980096ab9f21fba88aa3018ac9a1f26de45 /src/compiler/glsl/glcpp | |
parent | 82c31f3eb957a0089773db47a4aca8bf3eb4a29e (diff) |
glsl: Add "built-in" functions to do 64%64 => 64 modulus
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!
v2: Use function inlining.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/compiler/glsl/glcpp')
-rw-r--r-- | src/compiler/glsl/glcpp/glcpp-parse.y | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/compiler/glsl/glcpp/glcpp-parse.y b/src/compiler/glsl/glcpp/glcpp-parse.y index d801cf8a9d7..e113253061f 100644 --- a/src/compiler/glsl/glcpp/glcpp-parse.y +++ b/src/compiler/glsl/glcpp/glcpp-parse.y @@ -2346,7 +2346,9 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio add_builtin_define(parser, "__have_builtin_builtin_sign64", 1); add_builtin_define(parser, "__have_builtin_builtin_umul64", 1); add_builtin_define(parser, "__have_builtin_builtin_udiv64", 1); + add_builtin_define(parser, "__have_builtin_builtin_umod64", 1); add_builtin_define(parser, "__have_builtin_builtin_idiv64", 1); + add_builtin_define(parser, "__have_builtin_builtin_imod64", 1); } } |