News for hackers. Stuff that matters.
Re:WebGPU Shading Language by Jasper_ on Tuesday March 10, 2020 @11:58AM (#22536558)
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=sh...

Re:WebGPU Shading Language by yoden on Tuesday March 10, 2020 @01:19PM (#22537358)
64 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.

Re:WebGPU Shading Language by pcwalton on Tuesday March 10, 2020 @01:10PM (#22537279)
GLSL 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

[2]: https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_g...

Re:WebGPU Shading Language by klodolph on Tuesday March 10, 2020 @05:11PM (#22539750)
Desktop 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].

Re:WebGPU Shading Language by atq2119 on Tuesday March 10, 2020 @06:00PM (#22540251)
fp64 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.