nir: fix interger divide by zero crash during constant folding
From the GLSL 4.60 spec Section 5.9 (Expressions):
"Dividing by zero does not cause an exception but does result in
an unspecified value."
Fixes: 89285e4d47
"nir: add new constant folding infrastructure"
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105271
This commit is contained in:
parent
086c88551d
commit
0c1f37cc2d
|
@ -404,8 +404,8 @@ binop("umul_high", tuint32, commutative,
|
|||
"(uint32_t)(((uint64_t) src0 * (uint64_t) src1) >> 32)")
|
||||
|
||||
binop("fdiv", tfloat, "", "src0 / src1")
|
||||
binop("idiv", tint, "", "src0 / src1")
|
||||
binop("udiv", tuint, "", "src0 / src1")
|
||||
binop("idiv", tint, "", "src1 == 0 ? 0 : (src0 / src1)")
|
||||
binop("udiv", tuint, "", "src1 == 0 ? 0 : (src0 / src1)")
|
||||
|
||||
# returns a boolean representing the carry resulting from the addition of
|
||||
# the two unsigned arguments.
|
||||
|
|
Loading…
Reference in New Issue