mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-31 14:52:11 +01:00
[d3d11] Add more rigid validation for buffer creation
Fixes several wine test failures.
This commit is contained in:
parent
762df0bedf
commit
3a39027987
@ -189,17 +189,31 @@ namespace dxvk {
|
||||
// We don't support tiled resources
|
||||
if (pDesc->MiscFlags & (D3D11_RESOURCE_MISC_TILE_POOL | D3D11_RESOURCE_MISC_TILED))
|
||||
return E_INVALIDARG;
|
||||
|
||||
// Constant buffer size must be a multiple of 16
|
||||
if ((pDesc->BindFlags & D3D11_BIND_CONSTANT_BUFFER)
|
||||
&& (pDesc->ByteWidth & 0xF))
|
||||
return E_INVALIDARG;
|
||||
|
||||
// Basic validation for structured buffers
|
||||
if ((pDesc->MiscFlags & D3D11_RESOURCE_MISC_BUFFER_STRUCTURED)
|
||||
&& ((pDesc->StructureByteStride == 0)
|
||||
&& ((pDesc->MiscFlags & D3D11_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS)
|
||||
|| (pDesc->StructureByteStride == 0)
|
||||
|| (pDesc->StructureByteStride & 0x3)))
|
||||
return E_INVALIDARG;
|
||||
|
||||
// Basic validation for raw buffers
|
||||
if ((pDesc->MiscFlags & D3D11_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS)
|
||||
&& (!(pDesc->BindFlags & (D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_UNORDERED_ACCESS))))
|
||||
return E_INVALIDARG;
|
||||
|
||||
// Mip generation obviously doesn't work for buffers
|
||||
if (pDesc->MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS)
|
||||
return E_INVALIDARG;
|
||||
|
||||
if (!(pDesc->MiscFlags & D3D11_RESOURCE_MISC_BUFFER_STRUCTURED))
|
||||
pDesc->StructureByteStride = 0;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user