Bug 106528 - radv doesn't support VK_FORMAT_D24_UNORM_S8_UINT
Summary: radv doesn't support VK_FORMAT_D24_UNORM_S8_UINT
Status: RESOLVED WONTFIX
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Vulkan/radeon (show other bugs)
Version: git
Hardware: All Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-15 14:05 UTC by Józef Kucia
Modified: 2018-06-08 20:11 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Test case (55.79 KB, text/x-csrc)
2018-05-15 14:05 UTC, Józef Kucia
Details

Description Józef Kucia 2018-05-15 14:05:38 UTC
Created attachment 139576 [details]
Test case

The attached test succeeds on Anvil. Also, other depth formats work fine on radv.
Comment 1 Samuel Pitoiset 2018-05-15 14:20:44 UTC
Does it work with RADV_DEBUG=nohiz ?
Comment 2 Alex Smith 2018-05-15 15:05:03 UTC
D24 isn't even supported on RADV:

FORMAT_D24_UNORM_S8_UINT:
        linearTiling   FormatFeatureFlags:
                None
        optimalTiling  FormatFeatureFlags:
                None
        bufferFeatures FormatFeatureFlags:
                None
Comment 3 Józef Kucia 2018-05-15 15:20:26 UTC
(In reply to Alex Smith from comment #2)
> D24 isn't even supported on RADV:
> 
> FORMAT_D24_UNORM_S8_UINT:
>         linearTiling   FormatFeatureFlags:
>                 None
>         optimalTiling  FormatFeatureFlags:
>                 None
>         bufferFeatures FormatFeatureFlags:
>                 None

Thanks. Could D24_UNORM_S8_UINT support be added to RADV?
Comment 4 Samuel Pitoiset 2018-05-15 15:23:41 UTC
Oh my bad, I misread D24_UNORM_S8_UINT vs D32_SFLOAT_S8_UINT. :) Yeah, that could be supported.
Comment 5 Józef Kucia 2018-05-15 15:32:30 UTC
FWIW, VK_FORMAT_D24_UNORM_S8_UINT is already handled in various functions in src/amd/vulkan/radv_formats.c. It confused me, and I assumed that the format is supported.
Comment 6 Samuel Pitoiset 2018-06-08 16:26:01 UTC
We won't add support for VK_FORMAT_D24_UNORM_S8_UINT for the following reasons:

- TC-compatible HTILE isn't supported (requires decompression passes)
- it consumes as much as VRAM as the 32bit format
- RadeonSI internally uses the 32bit format
- AMDVLK doesn't support it
- it's not required by the spec.

AFAIK, this is a win on NVIDIA but not on AMD hardware.

Please, use VK_FORMAT_D32_UNORM_S8_UINT instead.

Thanks!
Comment 7 Roland Scheidegger 2018-06-08 20:11:28 UTC
FWIW (not talking specifically about vulkan here) not supporting d24unorm may not be much of a problem for ordinary apps as you can use d32f instead and adapt your code to it. But if you're translating from some other APIs and you have to emulate it, it's not actually all that easy to emulate faithfully if you have no idea what the app is actually doing, since depth bias works a bit differently for unorm vs float formats. As far as I know the only way to emulate this somewhat accurately (of course the results still won't be 100% identical due to different precision) is to apply the depth bias (the constant part, not the slope scale part) in the fragment shader manually, which is of course rather a pain and probably quite suboptimal from a performance point of view (even if the hw actually might allow configuring how depth bias works independently from the actual format, but if it isn't exposed that doesn't help).


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.