#Vulkan twitter: spirv-cross is generating these really long literals for floats. My original glsl is "1.6" and >glslang>spirv-cross gives me "1.60000002384185791015625".
Seems sub-optimal. Filesize, shader parsing time, etc.
Should I actually be concerned about this? Is there a way to stop it? I don't want to set some global precision, for risk of truncating something like pi where I want it.
-
-
I don't know much about the situation, like whether it matters, but GLSL's 32-bit float literals end in f (like C). ex: 1.6f
-
You only need to use f or F if there is no decimal. 0f is a float. 0 is an int. 0.0 is a float. 0.0lf (long float) is a double (in glsl 4+). https://www.khronos.org/opengl/wiki/Data_Type_(GLSL)#Literals …
- Näytä vastaukset
Uusi keskustelu -
-
-
I would recommend filing a bug, spirv-cross maintainers have been very responsive. And I’d love to see this one fixed too :)
Kiitos. Käytämme tätä aikajanasi parantamiseen. KumoaKumoa
-
Lataaminen näyttää kestävän hetken.
Twitter saattaa olla ruuhkautunut tai ongelma on muuten hetkellinen. Yritä uudelleen tai käy Twitterin tilasivulla saadaksesi lisätietoja.