mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-01 16:24:12 +01:00
[d3d9] Only bind textures if they are used by the shader
This commit is contained in:
parent
c0c1565cba
commit
5e48035e99
@ -5847,11 +5847,11 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void D3D9DeviceEx::UndirtyTextures() {
|
void D3D9DeviceEx::UndirtyTextures(uint32_t mask) {
|
||||||
for (uint32_t tex = m_dirtyTextures; tex; tex &= tex - 1)
|
for (uint32_t tex = mask; tex; tex &= tex - 1)
|
||||||
BindTexture(bit::tzcnt(tex));
|
BindTexture(bit::tzcnt(tex));
|
||||||
|
|
||||||
m_dirtyTextures = 0;
|
m_dirtyTextures &= ~mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
void D3D9DeviceEx::MarkTextureBindingDirty(IDirect3DBaseTexture9* texture) {
|
void D3D9DeviceEx::MarkTextureBindingDirty(IDirect3DBaseTexture9* texture) {
|
||||||
@ -5930,8 +5930,9 @@ namespace dxvk {
|
|||||||
if (activeDirtySamplers)
|
if (activeDirtySamplers)
|
||||||
UndirtySamplers(activeDirtySamplers);
|
UndirtySamplers(activeDirtySamplers);
|
||||||
|
|
||||||
if (m_dirtyTextures)
|
const uint32_t activeDirtyTextures = m_dirtyTextures & usedSamplerMask;
|
||||||
UndirtyTextures();
|
if (activeDirtyTextures)
|
||||||
|
UndirtyTextures(activeDirtyTextures);
|
||||||
|
|
||||||
if (m_flags.test(D3D9DeviceFlag::DirtyBlendState))
|
if (m_flags.test(D3D9DeviceFlag::DirtyBlendState))
|
||||||
BindBlendState();
|
BindBlendState();
|
||||||
|
@ -837,7 +837,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
void UndirtySamplers(uint32_t mask);
|
void UndirtySamplers(uint32_t mask);
|
||||||
|
|
||||||
void UndirtyTextures();
|
void UndirtyTextures(uint32_t mask);
|
||||||
|
|
||||||
void MarkTextureBindingDirty(IDirect3DBaseTexture9* texture);
|
void MarkTextureBindingDirty(IDirect3DBaseTexture9* texture);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user