3 ms·
Right, the desktop GPUs have support for float64, but it's not exposed in HLSL/GLSL to the best of my knowledge. "precision highp float" in GLSL will get you 32
by Jasper_ 7y ago
Right, the desktop GPUs have support for float64, but it's not exposed in HLSL/GLSL to the best of my knowledge. "precision highp float" in GLSL will get you 32-bit on all vendors AFAIK, you have to use OpenCL/CUDA for 64-bit floats, but it's way slower and actually sometimes emulated.
None of the mobile GPU vendors (Apple, ARM Mali, Qualcomm, PVR, BroadCom) support it. You can see that here, where the only vendors supporting shaderFloat64 in Vulkan are desktop GPUs. http://vulkan.gpuinfo.org/listdevicescoverage.php?feature=shaderFloat64&platform=android http://vulkan.gpuinfo.org/listdevicescoverage.php?feature=sh...
- pcwalton 7y agoGLSL has 64-bit values with "double" and "dvecN" since 4.0 [1] or with ARB_gpu_shader_fp64 [2]. I don't know if anyone actually uses them, though :) [1]: https://www.khronos.org/opengl/wiki/Data_Type_(GLSL)#Scalars https://www.khronos.org/opengl/wiki/Data_Type_(GLSL)#Scalars [2]: https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_gpu_shader_fp64.txt https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_g...
- yoden 7y ago64 bit support has been around on the desktop for a decade at this point (Through OpenGL4 / GL_ARB_gpu_shader_fp64 / cl_khr_fp64). Unfortunately it is not exposed in Firefox or Chrome, even if the underlying hardware supports it. I think this is creating a chicken and egg problem - if WebGL were to actually support the capabilities of the underlying hardware, maybe there would be more interest in deploying 64-bit extensions on other platforms like mobile. Even emulated support would be a win, compared to having every developer emulate fp64/i64 themselves in GLSL. So I am also disappointed in this proposal's failure to mention 64-bit support, even as an extension. At least they're reserving the keywords, I guess.
- klodolph 7y agoDesktop GPUs commonly have support for float64, and it's accessible in GLSL (how else would you use it?) and presumably HLSL. The data types are prefixed with "d", so you have vec4 for float[4], and dvec4 for double[4].
- atq2119 7y agofp64 is exposed in GLSL at least, but on desktop GPUs it's typically 16x (AMD) or 32x (Nvidia) slower than fp32. Add that fact that mobile GPUs and some Intel GPUs don't support it in hardware at all, it makes a lot of sense to leave fp64 out of WebGPU.