-
Notifications
You must be signed in to change notification settings - Fork 882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[d3d9] Optimize late buffer uploads with dirty bitmasks #4275
Conversation
0ed6075
to
df1f634
Compare
b08305b
to
0ddfbf4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question, not sure how any of this is really supposed to work though.
dynamicSysmemVBOs &= vbo == nullptr || (vbo->DoPerDrawUpload() || CanOnlySWVP()); | ||
} | ||
const uint32_t usedBuffersMask = (m_state.vertexDecl != nullptr ? m_state.vertexDecl->GetStreamMask() : ~0u) & m_activeVertexBuffers; | ||
bool dynamicSysmemVBOs = usedBuffersMask == m_activeVertexBuffersToUploadPerDraw; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the intention here with the ==
, what if usedBuffersMask
is a superset of m_activeVertexBuffersToUploadPerDraw
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that we change the BaseVertexIndex so it can only work if we copy the data for all bound vertex buffers.
=> all bound buffers that get actually used by the draw need to be part of the bitmask.
If usedBuffersMask
is a superset, we don't copy the data this specific draw needs into a separate buffer and instead bind the buffer directly.
0ddfbf4
to
59a7f70
Compare
... similar to what we're doing for textures.
The same texture could be bound to multiple slots and if the shader doesn't use the lower index texture, we'd never end up uploading it.
59a7f70
to
1767d88
Compare
Based on #4274
Optimizes late buffer uploads (managed or per-draw) similar to how we're doing it for textures.
This avoids having to iterate over all 16 vertex buffers multiple times for every draw.