dzn: Fix clear bind flag logic

This is the patch I had meant to merge

Fixes: 8b79e6fb ("dzn: No need to add another bind flag for clears if one is already present")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20361>
This commit is contained in:
Jesse Natalie 2023-01-13 12:39:22 -08:00 committed by Marge Bot
parent 5949521508
commit f1faf30a5f

View file

@ -240,16 +240,16 @@ dzn_image_create(struct dzn_device *device,
* destination. Both operations require the RT or DS cap flags.
*/
if ((image->vk.usage & VK_IMAGE_USAGE_TRANSFER_DST_BIT) &&
image->vk.tiling == VK_IMAGE_TILING_OPTIMAL &&
(image->desc.Flags & (D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET |
D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL)) == D3D12_RESOURCE_FLAG_NONE) {
image->vk.tiling == VK_IMAGE_TILING_OPTIMAL) {
D3D12_FEATURE_DATA_FORMAT_SUPPORT dfmt_info =
dzn_physical_device_get_format_support(pdev, pCreateInfo->format);
if (dfmt_info.Support1 & D3D12_FORMAT_SUPPORT1_RENDER_TARGET) {
image->desc.Flags |= D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET;
image->valid_access |= D3D12_BARRIER_ACCESS_RENDER_TARGET;
} else if (dfmt_info.Support1 & D3D12_FORMAT_SUPPORT1_DEPTH_STENCIL) {
} else if ((dfmt_info.Support1 & D3D12_FORMAT_SUPPORT1_DEPTH_STENCIL) &&
(image->desc.Flags & (D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET |
D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS)) == D3D12_RESOURCE_FLAG_NONE) {
image->desc.Flags |= D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL;
image->valid_access |= D3D12_BARRIER_ACCESS_DEPTH_STENCIL_WRITE;
} else if (dfmt_info.Support1 & D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW) {