mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[d3d9] Perform tracking for preloaded managed resources
This commit is contained in:
parent
7e72010302
commit
e6ed8dab63
@ -466,11 +466,12 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
void D3D9CommonTexture::PreLoadAll() {
|
void D3D9CommonTexture::PreLoadAll() {
|
||||||
if (IsManaged()) {
|
if (!IsManaged())
|
||||||
auto lock = m_device->LockDevice();
|
return;
|
||||||
|
|
||||||
m_device->UploadManagedTexture(this);
|
auto lock = m_device->LockDevice();
|
||||||
}
|
m_device->UploadManagedTexture(this);
|
||||||
|
m_device->MarkTextureUploaded(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -481,6 +482,9 @@ namespace dxvk {
|
|||||||
if (GetNeedsUpload(Subresource)) {
|
if (GetNeedsUpload(Subresource)) {
|
||||||
m_device->FlushImage(this, Subresource);
|
m_device->FlushImage(this, Subresource);
|
||||||
SetNeedsUpload(Subresource, false);
|
SetNeedsUpload(Subresource, false);
|
||||||
|
|
||||||
|
if (!NeedsAnyUpload())
|
||||||
|
m_device->MarkTextureUploaded(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4891,12 +4891,11 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
void D3D9DeviceEx::UploadManagedTexture(D3D9CommonTexture* pResource) {
|
void D3D9DeviceEx::UploadManagedTexture(D3D9CommonTexture* pResource) {
|
||||||
for (uint32_t i = 0; i < pResource->GetUploadBitmask().dwordCount(); i++) {
|
for (uint32_t subresource = 0; subresource < pResource->CountSubresources(); subresource++) {
|
||||||
for (uint32_t subresources = pResource->GetUploadBitmask().dword(i); subresources; subresources &= subresources - 1) {
|
if (!pResource->GetNeedsUpload(subresource))
|
||||||
uint32_t subresource = i * 32 + bit::tzcnt(subresources);
|
continue;
|
||||||
|
|
||||||
this->FlushImage(pResource, subresource);
|
this->FlushImage(pResource, subresource);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pResource->ClearNeedsUpload();
|
pResource->ClearNeedsUpload();
|
||||||
@ -4958,6 +4957,18 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void D3D9DeviceEx::MarkTextureUploaded(D3D9CommonTexture* pResource) {
|
||||||
|
for (uint32_t tex = m_activeTextures; tex; tex &= tex - 1) {
|
||||||
|
// Guaranteed to not be nullptr...
|
||||||
|
const uint32_t i = bit::tzcnt(tex);
|
||||||
|
auto texInfo = GetCommonTexture(m_state.textures[i]);
|
||||||
|
|
||||||
|
if (texInfo == pResource)
|
||||||
|
m_activeTexturesToUpload &= ~(1 << i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template <bool Points>
|
template <bool Points>
|
||||||
void D3D9DeviceEx::UpdatePointMode() {
|
void D3D9DeviceEx::UpdatePointMode() {
|
||||||
if constexpr (!Points) {
|
if constexpr (!Points) {
|
||||||
|
@ -758,6 +758,8 @@ namespace dxvk {
|
|||||||
|
|
||||||
void MarkTextureMipsUnDirty(D3D9CommonTexture* pResource);
|
void MarkTextureMipsUnDirty(D3D9CommonTexture* pResource);
|
||||||
|
|
||||||
|
void MarkTextureUploaded(D3D9CommonTexture* pResource);
|
||||||
|
|
||||||
template <bool Points>
|
template <bool Points>
|
||||||
void UpdatePointMode();
|
void UpdatePointMode();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user