Revert "vkd3d: Support SAMPLE_DESC.Count of 0"

Windows returns E_INVALIDARG in this case.

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
This commit is contained in:
Conor McCarthy 2021-09-18 14:12:31 +10:00 committed by Joshie
parent cf4fb44629
commit d366ba47ac
1 changed files with 3 additions and 4 deletions

View File

@ -56,7 +56,6 @@ VkSampleCountFlagBits vk_samples_from_sample_count(unsigned int sample_count)
{
switch (sample_count)
{
case 0:
case 1:
return VK_SAMPLE_COUNT_1_BIT;
case 2:
@ -308,7 +307,7 @@ static bool vkd3d_resource_can_be_vrs(struct d3d12_device *device,
desc->Format == DXGI_FORMAT_R8_UINT &&
desc->Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE2D &&
desc->MipLevels == 1 &&
desc->SampleDesc.Count <= 1 &&
desc->SampleDesc.Count == 1 &&
desc->SampleDesc.Quality == 0 &&
desc->Layout == D3D12_TEXTURE_LAYOUT_UNKNOWN &&
heap_properties &&
@ -402,7 +401,7 @@ static HRESULT vkd3d_create_image(struct d3d12_device *device,
}
if (desc->Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE2D
&& desc->Width == desc->Height && desc->DepthOrArraySize >= 6
&& desc->SampleDesc.Count <= 1)
&& desc->SampleDesc.Count == 1)
image_info.flags |= VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT;
if (desc->Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D)
image_info.flags |= VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR;
@ -1912,7 +1911,7 @@ static bool d3d12_resource_validate_texture_alignment(const D3D12_RESOURCE_DESC
if (desc->Alignment != D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT
&& desc->Alignment != D3D12_SMALL_RESOURCE_PLACEMENT_ALIGNMENT
&& (desc->SampleDesc.Count <= 1 || desc->Alignment != D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT))
&& (desc->SampleDesc.Count == 1 || desc->Alignment != D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT))
{
WARN("Invalid resource alignment %#"PRIx64".\n", desc->Alignment);
return false;