1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-30 13:24:10 +01:00

[d3d11] Fix CheckMultisampleQualityLevels return code

We're supposed to return E_FAIL for unsupported sample counts,
and not zero-initialize the returned quality level count if the
format is invalid. Fixes wine test failures.
This commit is contained in:
Philip Rebohle 2019-06-14 13:37:01 +02:00
parent 5a66da8ef8
commit c8a429b9e1
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -1131,12 +1131,10 @@ namespace dxvk {
if (!pNumQualityLevels)
return E_INVALIDARG;
*pNumQualityLevels = 0;
// For some reason, we can query DXGI_FORMAT_UNKNOWN
if (Format == DXGI_FORMAT_UNKNOWN) {
*pNumQualityLevels = SampleCount == 1 ? 1 : 0;
return SampleCount ? S_OK : E_INVALIDARG;
return SampleCount ? S_OK : E_FAIL;
}
// All other unknown formats should result in an error return.
@ -1145,12 +1143,16 @@ namespace dxvk {
if (format == VK_FORMAT_UNDEFINED)
return E_INVALIDARG;
// Zero-init now, leave value undefined otherwise.
// This does actually match native D3D11 behaviour.
*pNumQualityLevels = 0;
// Non-power of two sample counts are not supported, but querying
// support for them is legal, so we return zero quality levels.
VkSampleCountFlagBits sampleCountFlag = VK_SAMPLE_COUNT_1_BIT;
if (FAILED(DecodeSampleCount(SampleCount, &sampleCountFlag)))
return SampleCount ? S_OK : E_INVALIDARG;
return SampleCount && SampleCount <= 32 ? S_OK : E_FAIL;
// Check if the device supports the given combination of format
// and sample count. D3D exposes the opaque concept of quality