1
0
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:
WinterSnowfall 2024-10-11 23:46:29 +03:00 committed by Philip Rebohle
parent a323abe085
commit 63d9affdcb
2 changed files with 10 additions and 4 deletions

View File

@ -182,7 +182,13 @@ namespace dxvk {
constexpr DWORD incompatibleUsages = D3DUSAGE_RENDERTARGET | D3DUSAGE_DEPTHSTENCIL;
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

View File

@ -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;