#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.
-
Näytä tämä ketju
-
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.
2 vastausta 0 uudelleentwiittausta 0 tykkäystäNäytä tämä ketju -
Vastauksena käyttäjälle @tloch14
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
1 vastaus 0 uudelleentwiittausta 0 tykkäystä -
Vastauksena käyttäjälle @scottmichaud
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 …
1 vastaus 0 uudelleentwiittausta 1 tykkäys -
Vastauksena käyttäjälle @tloch14
??? Guess I've been over-typing, then. Huh.
1 vastaus 0 uudelleentwiittausta 0 tykkäystä
Given the habit of typing f for c/c++, I'd bet most devs are in the habit of doing it for glsl as well and don't even think about it.
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.