Suggestion for next glsl: float2integer convertion with defined rounding behavoir

My current application often has to convert from float to integers, but glsl seems to lack convertion functions with defined rounding behavoirs:

In fact, I’m asking for this ones:
genIType ifloor (genType)
genIType iround (genType)
genIType iceil (genType)

Of course, they could all be implemented by eg
#define iround(x) (ivec(round(x)))
but I guess there is a better way for the gpu to do so.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.