d3d12: Handle format support queries for shader images

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>
This commit is contained in:
Jesse Natalie 2021-12-28 16:28:05 -08:00 committed by Marge Bot
parent 951f6f2dba
commit 9b62f88cf8
1 changed files with 8 additions and 0 deletions

View File

@ -547,6 +547,11 @@ d3d12_is_format_supported(struct pipe_screen *pscreen,
!(fmt_info.Support1 & D3D12_FORMAT_SUPPORT1_BLENDABLE))
return false;
if (bind & PIPE_BIND_SHADER_IMAGE &&
(fmt_info.Support2 & (D3D12_FORMAT_SUPPORT2_UAV_TYPED_LOAD | D3D12_FORMAT_SUPPORT2_UAV_TYPED_STORE)) !=
(D3D12_FORMAT_SUPPORT2_UAV_TYPED_LOAD | D3D12_FORMAT_SUPPORT2_UAV_TYPED_STORE))
return false;
D3D12_FEATURE_DATA_FORMAT_SUPPORT fmt_info_sv;
if (util_format_is_depth_or_stencil(format)) {
fmt_info_sv.Format = d3d12_get_resource_srv_format(format, target);
@ -576,6 +581,9 @@ d3d12_is_format_supported(struct pipe_screen *pscreen,
if (!util_is_power_of_two_nonzero(sample_count))
return false;
if (bind & PIPE_BIND_SHADER_IMAGE)
return false;
D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS ms_info = {};
ms_info.Format = dxgi_format;
ms_info.SampleCount = sample_count;