Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/doitsujin/dxvk.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Ashton <joshua@froggi.es>2020-06-06 23:59:25 +0300
committerJoshua Ashton <joshua@froggi.es>2020-06-07 00:01:24 +0300
commit64a3411704aa3a02e22b06d7934d3dfc66add78c (patch)
tree6663479d7b988e62c062794530e7730270813bf8
parent6e4bc81bb6c5a7437b0032ddad02a89d329d1de9 (diff)
[d3d9] Perform tracking for preloaded managed resourcesd3d9-preload
-rw-r--r--src/d3d9/d3d9_common_texture.cpp4
-rw-r--r--src/d3d9/d3d9_device.cpp12
-rw-r--r--src/d3d9/d3d9_device.h2
3 files changed, 18 insertions, 0 deletions
diff --git a/src/d3d9/d3d9_common_texture.cpp b/src/d3d9/d3d9_common_texture.cpp
index b8eff840..497e7856 100644
--- a/src/d3d9/d3d9_common_texture.cpp
+++ b/src/d3d9/d3d9_common_texture.cpp
@@ -470,6 +470,7 @@ namespace dxvk {
auto lock = m_device->LockDevice();
m_device->UploadManagedTexture(this);
+ m_device->MarkTextureUploaded(this);
}
}
@@ -481,6 +482,9 @@ namespace dxvk {
if (GetNeedsUpload(Subresource)) {
m_device->FlushImage(this, Subresource);
SetNeedsUpload(Subresource, false);
+
+ if (!NeedsAnyUpload())
+ m_device->MarkTextureUploaded(this);
}
}
}
diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp
index 307f65bd..fa670740 100644
--- a/src/d3d9/d3d9_device.cpp
+++ b/src/d3d9/d3d9_device.cpp
@@ -4958,6 +4958,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>
void D3D9DeviceEx::UpdatePointMode() {
if constexpr (!Points) {
diff --git a/src/d3d9/d3d9_device.h b/src/d3d9/d3d9_device.h
index 6f00b503..adb84724 100644
--- a/src/d3d9/d3d9_device.h
+++ b/src/d3d9/d3d9_device.h
@@ -758,6 +758,8 @@ namespace dxvk {
void MarkTextureMipsUnDirty(D3D9CommonTexture* pResource);
+ void MarkTextureUploaded(D3D9CommonTexture* pResource);
+
template <bool Points>
void UpdatePointMode();