Textures in 16 bit integer format are sometimes used for displacement, bump and normal maps and can be exported by tools like Substance Painter. Without this patch, Cycles would promote those textures to single precision floating point, causing them to take up twice as much memory as needed.
Nice Work, gread to see this being implemented, I was missing that in my 2016 GSoC, when I added half float support.
Quickly scanning through the code, I couldn't find obvious errors. :)
Why to add spaces around operators few functions above and not add them in the new code?
Inconsistent spaces around operator in new code.
Why this functions are returning false?
Single argument constructors are to be marked as explicit.
Space around operators.
It is 2018.
Text editors trying to be smart...
Good question. I just did the same for uint16_t that you did for uchar and half: https://developer.blender.org/rC69b50f6f8405bf008040bf51de9173d9638328e6
I guess uchar and uint16_t should always return true, as they have no representation for infinite. I'd handle that in a separate commit though. Should this change cause problems, it'll make finding it via git bisect much easier.