KhronosGroup / KhronosGroup/Vulkan-Docs
Why is the FPRoundingMode decoration limited to 16bit stores with VK_KHR_16bit_storage?
- Dominant language
- JavaScript
- Stars
- 3.3k
- Forks
- 549
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 2
Description
The `SPV_KHR_16bit_storage` spec says:
> A FPRoundingMode decoration can be applied only to:
> a width-only conversion instruction that is used as the object argument of an OpStore storing through a pointer to a 16-bit floating-point object in Uniform, or PushConstant, or Input, or Output Storage Classes.
And as far as I can tell no other extension allows the usage of `FPRoundingMode`.
What is the reason for this limitation? Looking at all opensource mesa drivers which support this extension, the 16bit conversion with a specific rounding mode is not part of the store instruction. Instead it's just another ALU instruction without any special restrictions.
Having support for explicit per instruction rounding modes is useful for D3D emulation, because some d3d fp16 conversions are required to use round towards zero while other instructions generally use round towards nearest even.
Contributor guide
Research direction
Review the cited SPV_KHR_16bit_storage wording and compare it with the reported Mesa driver behavior and D3D emulation requirements. Done means establishing and documenting the rationale for the restriction, or defining a sufficiently precise specification change if the limitation is unintended.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100