1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-20 19:54:19 +01:00

[d3d9] Update device tracking when manually autogenning mips

Avoids some needless generations potentially.
This commit is contained in:
Joshua Ashton 2020-05-26 18:48:42 +01:00
parent e57aea5749
commit 6c030afc95
3 changed files with 19 additions and 3 deletions

View File

@ -4206,8 +4206,6 @@ namespace dxvk {
] (DxvkContext* ctx) {
ctx->generateMipmaps(cImageView);
});
pResource->SetNeedsMipGen(false);
}
@ -4896,12 +4894,13 @@ namespace dxvk {
auto texInfo = GetCommonTexture(m_state.textures[bit::tzcnt(tex)]);
this->GenerateMips(texInfo);
texInfo->SetNeedsMipGen(false);
}
m_activeTexturesToGen &= ~mask;
}
void D3D9DeviceEx::MarkTextureMipsDirty(D3D9CommonTexture* pResource) {
pResource->SetNeedsMipGen(true);
@ -4919,6 +4918,20 @@ namespace dxvk {
}
void D3D9DeviceEx::MarkTextureMipsUnDirty(D3D9CommonTexture* pResource) {
pResource->SetNeedsMipGen(false);
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_activeTexturesToGen &= 1 << i;
}
}
template <bool Points>
void D3D9DeviceEx::UpdatePointMode() {
if constexpr (!Points) {

View File

@ -754,6 +754,8 @@ namespace dxvk {
void MarkTextureMipsDirty(D3D9CommonTexture* pResource);
void MarkTextureMipsUnDirty(D3D9CommonTexture* pResource);
template <bool Points>
void UpdatePointMode();

View File

@ -87,6 +87,7 @@ namespace dxvk {
if (!m_texture.NeedsMipGen())
return;
this->m_parent->MarkTextureMipsUnDirty(&m_texture);
this->m_parent->GenerateMips(&m_texture);
}