vkd3d: Reject 0 sample count textures in d3d12_resource_validate_desc().

Buffers with 0 sample counts were already rejected here.

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Conor McCarthy
2021-10-15 01:37:40 +02:00
committed by Alexandre Julliard
parent a36dfef004
commit a86a681912
2 changed files with 7 additions and 3 deletions

View File

@@ -1681,6 +1681,12 @@ HRESULT d3d12_resource_validate_desc(const D3D12_RESOURCE_DESC *desc, struct d3d
/* Fall through. */
case D3D12_RESOURCE_DIMENSION_TEXTURE2D:
case D3D12_RESOURCE_DIMENSION_TEXTURE3D:
if (!desc->SampleDesc.Count)
{
WARN("Invalid sample count 0.\n");
return E_INVALIDARG;
}
if (!(format = vkd3d_format_from_d3d12_resource_desc(device, desc, 0)))
{
WARN("Invalid format %#x.\n", desc->Format);