vkd3d: Validate presence of flag ALLOW_RENDER_TARGET or ALLOW_DEPTH_STENCIL for multisampled resources.

This commit is contained in:
Conor McCarthy
2024-04-09 17:17:58 +10:00
committed by Alexandre Julliard
parent e46de1daa2
commit 78301d7202
Notes: Alexandre Julliard 2024-04-11 17:04:33 -05:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/772
2 changed files with 7 additions and 3 deletions

View File

@@ -1893,6 +1893,13 @@ HRESULT d3d12_resource_validate_desc(const D3D12_RESOURCE_DESC1 *desc, struct d3
WARN("Invalid sample count 0.\n");
return E_INVALIDARG;
}
if (desc->SampleDesc.Count > 1
&& !(desc->Flags & (D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET | D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL)))
{
WARN("Sample count %u invalid without ALLOW_RENDER_TARGET or ALLOW_DEPTH_STENCIL.\n",
desc->SampleDesc.Count);
return E_INVALIDARG;
}
if (!(format = vkd3d_format_from_d3d12_resource_desc(device, desc, 0)))
{