mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-05 01:24:14 +01:00
[d3d9] Disable locking non-dynamic default textures
This commit is contained in:
parent
d771f7cf8f
commit
9c22a58543
@ -4239,6 +4239,15 @@ namespace dxvk {
|
||||
|
||||
auto& desc = *(pResource->Desc());
|
||||
|
||||
// MSDN:
|
||||
// Textures placed in the D3DPOOL_DEFAULT pool cannot be locked
|
||||
// unless they are dynamic textures or they are private, FOURCC, driver formats.
|
||||
// Also note that - unlike textures - swap chain back buffers, render targets [..] can be locked
|
||||
if (unlikely(desc.Pool == D3DPOOL_DEFAULT
|
||||
&& !(desc.Usage & (D3DUSAGE_DYNAMIC | D3DUSAGE_RENDERTARGET | D3DUSAGE_DEPTHSTENCIL))
|
||||
&& !IsFourCCFormat(desc.Format)))
|
||||
return D3DERR_INVALIDCALL;
|
||||
|
||||
auto& formatMapping = pResource->GetFormatMapping();
|
||||
|
||||
const DxvkFormatInfo* formatInfo = formatMapping.IsValid()
|
||||
|
@ -219,4 +219,9 @@ namespace dxvk {
|
||||
bool m_d32supportFinal;
|
||||
};
|
||||
|
||||
inline bool IsFourCCFormat(D3D9Format format) {
|
||||
// BINARYBUFFER is the largest non-fourcc format
|
||||
return format > D3D9Format::BINARYBUFFER;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user