mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-22 16:54:27 +01:00
[d3d9] Don't clear mipGenBit if texture is bound as attachment
This commit is contained in:
parent
5ff365b9f1
commit
5890eae32f
@ -6158,11 +6158,13 @@ namespace dxvk {
|
|||||||
// Guaranteed to not be nullptr...
|
// Guaranteed to not be nullptr...
|
||||||
auto texInfo = GetCommonTexture(m_state.textures[texIdx]);
|
auto texInfo = GetCommonTexture(m_state.textures[texIdx]);
|
||||||
|
|
||||||
if (texInfo->NeedsMipGen()) {
|
if (likely(texInfo->NeedsMipGen())) {
|
||||||
this->EmitGenerateMips(texInfo);
|
this->EmitGenerateMips(texInfo);
|
||||||
|
if (likely(!IsTextureBoundAsAttachment(texInfo))) {
|
||||||
texInfo->SetNeedsMipGen(false);
|
texInfo->SetNeedsMipGen(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_activeTexturesToGen &= ~mask;
|
m_activeTexturesToGen &= ~mask;
|
||||||
}
|
}
|
||||||
@ -6185,16 +6187,20 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
void D3D9DeviceEx::MarkTextureMipsUnDirty(D3D9CommonTexture* pResource) {
|
void D3D9DeviceEx::MarkTextureMipsUnDirty(D3D9CommonTexture* pResource) {
|
||||||
|
if (likely(!IsTextureBoundAsAttachment(pResource))) {
|
||||||
|
// We need to keep the texture marked as needing mipmap generation because we don't set that when rendering.
|
||||||
pResource->SetNeedsMipGen(false);
|
pResource->SetNeedsMipGen(false);
|
||||||
|
|
||||||
for (uint32_t i : bit::BitMask(m_activeTextures)) {
|
for (uint32_t i : bit::BitMask(m_activeTextures)) {
|
||||||
// Guaranteed to not be nullptr...
|
// Guaranteed to not be nullptr...
|
||||||
auto texInfo = GetCommonTexture(m_state.textures[i]);
|
auto texInfo = GetCommonTexture(m_state.textures[i]);
|
||||||
|
|
||||||
if (texInfo == pResource)
|
if (unlikely(texInfo == pResource)) {
|
||||||
m_activeTexturesToGen &= ~(1 << i);
|
m_activeTexturesToGen &= ~(1 << i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void D3D9DeviceEx::MarkTextureUploaded(D3D9CommonTexture* pResource) {
|
void D3D9DeviceEx::MarkTextureUploaded(D3D9CommonTexture* pResource) {
|
||||||
|
@ -1299,6 +1299,23 @@ namespace dxvk {
|
|||||||
m_mostRecentlyUsedSwapchain = m_implicitSwapchain.ptr();
|
m_mostRecentlyUsedSwapchain = m_implicitSwapchain.ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsTextureBoundAsAttachment(const D3D9CommonTexture* pTexture) const {
|
||||||
|
if (unlikely(pTexture->IsRenderTarget())) {
|
||||||
|
for (uint32_t i : bit::BitMask(m_boundRTs)) {
|
||||||
|
auto texInfo = m_state.renderTargets[i]->GetCommonTexture();
|
||||||
|
if (unlikely(texInfo == pTexture)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (unlikely(pTexture->IsDepthStencil() && m_state.depthStencil != nullptr)) {
|
||||||
|
auto texInfo = m_state.depthStencil->GetCommonTexture();
|
||||||
|
if (unlikely(texInfo == pTexture)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
Com<D3D9InterfaceEx> m_parent;
|
Com<D3D9InterfaceEx> m_parent;
|
||||||
D3DDEVTYPE m_deviceType;
|
D3DDEVTYPE m_deviceType;
|
||||||
HWND m_window;
|
HWND m_window;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user