microsoft / angle

ANGLE: OpenGL ES to DirectX translation
Other
615 stars 166 forks source link

Hololens feature request : mediump => min16float where available #77

Closed mlfarrell closed 5 years ago

mlfarrell commented 8 years ago

We'll eventually want to access min16float to provide necessary performance on hololens hardware

austinkinross commented 8 years ago

Hi, thanks for the request.

I personally don't have access to a HoloLens device. Could you confirm that HoloLens hardware supports min16float? This can be checked by calling ID3D11Device::CheckFeatureSupport with D3D11_FEATURE_SHADER_MIN_PRECISION_SUPPORT. Alternatively @MikeRiches may know.

Note that when a driver (or the underlying hardware) doesn't support min16float then you can still use min16float in your HLSL code. You just won't receive any performance gain on these devices, since the D3D runtime will automatically convert your 16-bit float usage to 32-bit for you.

Thanks!

mlfarrell commented 8 years ago

It should, I'm seeing it here: https://developer.microsoft.com/en-us/windows/holographic/performance_recommendations_for_unity

I'll confirm later when I get a chance.

MikeRiches commented 8 years ago

Yes, the HoloLens device does support min16float. We recommend using it for everything except the view/projection matrix, where additional precision is required.

mlfarrell commented 8 years ago

Thanks Mike.

So is min16float exposed via ms-holo angle branch currently? I didn't see it. (but I didn't look close enough I suppose)

MikeRiches commented 8 years ago

That I don’t know. @austinkinross might know more about if/how the minimum precision types in GLSL are mapped to HLSL by ANGLE.

austinkinross commented 8 years ago

ANGLE doesn't currently support min16float in any branch. We have considered implementing it in the past (pre-HoloLens) for the potential performance win, and we'll certainly keep this open for future consideration.

Aside from the cost of implementing this feature, it would be expensive to regression-test it. If a contribution to the master ANGLE branch accidentally makes one shader operation be 32-bit instead of 16-bit then it will cause a chain reaction in the shader that will make other operations 32-bit too. The shader will still compile and run, but the shader will just be a bit slower than it was before on certain hardware... :-)

mlfarrell commented 8 years ago

One could assume the risk of the regression maybe by optionally enabling it aka #extension ANGLE_MIN16_SUPPORT : enable

austinkinross commented 5 years ago

Hi everyone, thank you for the suggestion. If you are still interested in this then please consider suggesting it over on the master ANGLE mailing list: https://groups.google.com/forum/#!forum/angleproject

Thanks Austin