OSDN Git Service

glsl: Allow implicit int -> uint conversions for the % operator.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 12 Nov 2015 21:02:05 +0000 (13:02 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 14 Nov 2015 00:09:58 +0000 (16:09 -0800)
commit511de1a80cedc0add386dad79cce56dd68d2f611
treed95816e408fc226f705d7a6b65891532487add11
parenta4ba476c30ebcb99694c6167ac9b8af9414cb656
glsl: Allow implicit int -> uint conversions for the % operator.

GLSL 4.00 and GL_ARB_gpu_shader5 introduced a new int -> uint implicit
conversion rule and updated the rules for modulus to use them.  (In
earlier languages, none of the implicit conversion rules did anything
relevant, so there was no point in applying them.)

This allows expressions such as:

   int foo;
   uint bar;
   uint mod = foo % bar;

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/ast_to_hir.cpp