mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-05 01:24:14 +01:00
[d3d9] Track bound RTs
This also improves active RT hazard tracking by also accounting for NULL
This commit is contained in:
parent
e0f9ebf695
commit
072d3a039e
@ -1255,6 +1255,7 @@ namespace dxvk {
|
||||
|
||||
m_state.renderTargets[RenderTargetIndex] = rt;
|
||||
|
||||
UpdateBoundRTs(RenderTargetIndex);
|
||||
UpdateActiveRTs(RenderTargetIndex);
|
||||
|
||||
uint32_t originalAlphaSwizzleRTs = m_alphaSwizzleRTs;
|
||||
@ -5000,12 +5001,23 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
inline void D3D9DeviceEx::UpdateBoundRTs(uint32_t index) {
|
||||
const uint32_t bit = 1 << index;
|
||||
|
||||
m_boundRTs &= ~bit;
|
||||
|
||||
if (m_state.renderTargets[index] != nullptr &&
|
||||
!m_state.renderTargets[index]->IsNull())
|
||||
m_boundRTs |= bit;
|
||||
}
|
||||
|
||||
|
||||
inline void D3D9DeviceEx::UpdateActiveRTs(uint32_t index) {
|
||||
const uint32_t bit = 1 << index;
|
||||
|
||||
m_activeRTs &= ~bit;
|
||||
|
||||
if (m_state.renderTargets[index] != nullptr &&
|
||||
if ((m_boundRTs & bit) != 0 &&
|
||||
m_state.renderTargets[index]->GetBaseTexture() != nullptr &&
|
||||
m_state.renderStates[ColorWriteIndex(index)])
|
||||
m_activeRTs |= bit;
|
||||
|
@ -738,6 +738,8 @@ namespace dxvk {
|
||||
|
||||
void Flush();
|
||||
|
||||
void UpdateBoundRTs(uint32_t index);
|
||||
|
||||
void UpdateActiveRTs(uint32_t index);
|
||||
|
||||
void UpdateActiveTextures(uint32_t index, DWORD combinedUsage);
|
||||
@ -1050,6 +1052,7 @@ namespace dxvk {
|
||||
uint32_t m_activeTextures = 0;
|
||||
uint32_t m_activeTexturesToUpload = 0;
|
||||
uint32_t m_activeTexturesToGen = 0;
|
||||
uint32_t m_boundRTs = 0;
|
||||
|
||||
uint32_t m_fetch4Enabled = 0;
|
||||
uint32_t m_fetch4 = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user