1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-18 22:54:15 +01:00

[d3d11] Validate bind flags for D3D11_RESOURCE_MISC_GENERATE_MIPS

This commit is contained in:
Philip Rebohle 2019-06-13 02:57:56 +02:00
parent 63d8d9c3db
commit ce03384ba9
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -277,6 +277,11 @@ namespace dxvk {
if (FAILED(DecodeSampleCount(pDesc->SampleDesc.Count, nullptr)))
return E_INVALIDARG;
if ((pDesc->MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS)
&& (pDesc->BindFlags & (D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET))
!= (D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET))
return E_INVALIDARG;
// Use the maximum possible mip level count if the supplied
// mip level count is either unspecified (0) or invalid
const uint32_t maxMipLevelCount = pDesc->SampleDesc.Count <= 1