vkback: depth in D16_UNORM_S8_UINT targets is finer than the console's 16 bits on a device without the format (NVIDIA) #210

Closed
opened 2026-12-02 12:55:24 +00:00 by github-bot · 1 comment
Owner

@⁠360900 on GitHub · 2026-12-02 12:52 UTC · original

With #170, D32_SFLOAT_S8_UINT stands in for D16_UNORM_S8_UINT (DXGI 118 to 120) where the device has none, by default: no accurate path exists there (rule 29). Log line: "vkback: D32_SFLOAT_S8_UINT stands in for D16_UNORM_S8_UINT".

The depth bias keeps the console's unit. Stored depth is not rounded to 16 bits, so a depth test between surfaces closer than 2^-16 and a shader's read of the target can differ from the console. 2 such images in the world on an RTX 5080; the effect on the picture is not measured.

An accurate path would round depth to 16 bits in every pixel shader that draws into such a target, at the cost of the early depth test there.

**@⁠360900** on GitHub · 2026-12-02 12:52 UTC · [original](https://github.com/vktory6/VKtory/issues/210) With #170, D32_SFLOAT_S8_UINT stands in for D16_UNORM_S8_UINT (DXGI 118 to 120) where the device has none, by default: no accurate path exists there (rule 29). Log line: "vkback: D32_SFLOAT_S8_UINT stands in for D16_UNORM_S8_UINT". The depth bias keeps the console's unit. Stored depth is not rounded to 16 bits, so a depth test between surfaces closer than 2^-16 and a shader's read of the target can differ from the console. 2 such images in the world on an RTX 5080; the effect on the picture is not measured. An accurate path would round depth to 16 bits in every pixel shader that draws into such a target, at the cost of the early depth test there.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 12:55:24 +00:00
Author
Owner

@⁠vktory6 on GitHub · 2026-12-02 16:01 UTC · original

Thanks for documenting your own PR's cost. It's a TASKS item now, "Depth finer than the console where D16_UNORM_S8_UINT is missing", at ultra-low priority: more precision than the console never blocks a merge. The review of #170 noticed that the tiled-lighting target's twin also becomes R32_SFLOAT, so values written through its UAV aren't quantised either; that's in the item too: github.com/vktory6/VKtory@dcb33f3. Closing here, the task tracks it.

**@⁠vktory6** on GitHub · 2026-12-02 16:01 UTC · [original](https://github.com/vktory6/VKtory/issues/210#issuecomment-7351330025) Thanks for documenting your own PR's cost. It's a TASKS item now, "Depth finer than the console where D16_UNORM_S8_UINT is missing", at ultra-low priority: more precision than the console never blocks a merge. The review of #170 noticed that the tiled-lighting target's twin also becomes R32_SFLOAT, so values written through its UAV aren't quantised either; that's in the item too: https://github.com/vktory6/VKtory/commit/dcb33f3. Closing here, the task tracks it.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/vktory6--VKtory#210
No description provided.