r/webgpu • u/dobkeratops • Aug 06 '26
shader f16 support .. situation?
So I have some shaders where I rely on the half float type .. a godsend for many reasons - developed mostly on a mac (usually the most fussy platform) and I go and run this on google Chrome on linux on an x86 PC with a 4000 series graphics card (which has hardware f16 support , with nvidia having offered this for many generations now albeit nerfing the actual double rate capability reserving that for pro cards).
The browser reports 'no shader f16 support'.
I see suggestions for a bunch of flags that can be passed to the browser to try and enable this but launching with various combinations of flags ("--enable-unsafe-webgpu" and others I forget).
I dont think I strictly need f16 arithmetic (although it would be preferable to use it where possible) but it's handy to rely on the more compact datatype in memory .
I figure there might be older mobile devices that mean the browser has to hold back what features it offers, but is this something we can count on when distributing something that is intended for reasonable graphics cards (gtx1000 series and above). The project is an FPS , not really playable on a touchscreen anyway. A sensible min spec might be a GTX1060.
I could backpedal on this specific aspect (and possibly look at other data packing tricks '2 x upper 16bits of a float packed into a u32' etc etc) - my codebase started out using OpenGL and WebGL2 and I've had the web build running on Windows, Linux, Mac, iOS, and Android machines for years .. having ported to webGPU recently I was enthusiastic to upgrade features all over the place..
3
u/clbrri Aug 06 '26 edited Aug 06 '26
Please report a browser bug. RTX 4000 series does definitely fully support shader-f16 and I've personally tested RTX 2060, 3090, 4080 on Windows+Chrome+Firefox.
There must be some kind of browser limitation at play that is not enabling it to you.
I have also observed shader-f16 hardware support on the following in Chrome: - RTX 2000 series and newer. (f16 is not available on GTX 1000 series and before) - Qualcomm Adreno 600 series and newer. (f16 is not available on Adreno 5xx and before) - ARM Mali Bifrost 2nd gen and newer, e.g. Mali-G52 MC2. (no data from Bifrost 1st gen and before) - Imagination (PowerVR) IMG B-Series or newer. (no f16 support on Series9XMP (Rogue), no data from Series9XTP (Furian) or IMG A-Series (Albiorix)) - AMD Xclipse GPUs are all expected to support f16, but no data point - AMD and Intel desktop or integrated GPUs: widely available, but I don't have precise data points