mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-01 08:52:11 +01:00
[d3d9] Add volume texture creation and locking validations
This commit is contained in:
parent
a323abe085
commit
63d9affdcb
@ -183,6 +183,12 @@ namespace dxvk {
|
||||
if (pDesc->Pool != D3DPOOL_DEFAULT && (pDesc->Usage & incompatibleUsages))
|
||||
return D3DERR_INVALIDCALL;
|
||||
|
||||
// Volume textures in D3DPOOL_SCRATCH must not have DYNAMIC usage
|
||||
if (ResourceType == D3DRTYPE_VOLUMETEXTURE
|
||||
&& pDesc->Pool == D3DPOOL_SCRATCH
|
||||
&& (pDesc->Usage & D3DUSAGE_DYNAMIC))
|
||||
return D3DERR_INVALIDCALL;
|
||||
|
||||
// Use the maximum possible mip level count if the supplied
|
||||
// mip level count is either unspecified (0) or invalid
|
||||
const uint32_t maxMipLevelCount = pDesc->MultiSample <= D3DMULTISAMPLE_NONMASKABLE
|
||||
|
@ -687,10 +687,10 @@ namespace dxvk {
|
||||
desc.IsAttachmentOnly = FALSE;
|
||||
// Docs:
|
||||
// Textures placed in the D3DPOOL_DEFAULT pool cannot be locked
|
||||
// unless they are dynamic textures or they are private, FOURCC, driver formats.
|
||||
// unless they are dynamic textures. Volume textures do not
|
||||
// exempt private, FOURCC, driver formats from these checks.
|
||||
desc.IsLockable = Pool != D3DPOOL_DEFAULT
|
||||
|| (Usage & D3DUSAGE_DYNAMIC)
|
||||
|| IsVendorFormat(EnumerateFormat(Format));
|
||||
|| (Usage & D3DUSAGE_DYNAMIC);
|
||||
|
||||
if (FAILED(D3D9CommonTexture::NormalizeTextureProperties(this, D3DRTYPE_VOLUMETEXTURE, &desc)))
|
||||
return D3DERR_INVALIDCALL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user