How to use min-precision in d3d9

133 views Asked by At

I want to know how to use min-precision in d3d9. DX11 spec describes that min-precision enumeration is added into d3d9. However, When I write a pixel shader with min16float keyword and translate it with fxc.exe, it fails and reports "ps_3_0 doesnot support min-precision". So how can I use min-precision in d3d9?

1

There are 1 answers

1
Chuck Walbourn On

TL;DR: For pixel shader 3.0, use half instead of min16float.

The DirectX 11 minimum shader precision feature is supported for Direct3D Hardware Feature Level 9.x devices. On Feature level 9.x, the VS and PS can have different precisions which is what is expressed in the AllOtherShaderStagesMinPrecision.AllOtherShaderStagesMinPrecision field.

Direct3D 9 shader model 2.0 only required 24 bits of precision for pixel shaders, and supported 16 bits when using half or _pp types. The DirectX 11 shader precision feature support for the 9.x feature level profiles make use of this.

See Microsoft Docs.