mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-18 20:52:10 +01:00
[dxvk] Fix unbound vertex buffer handling
Bit of a brain fart there; we can't just change the meaning of bindingMask since it indirectly affetcs binding strides.
This commit is contained in:
parent
fb70de8852
commit
8029712aa4
@ -3679,10 +3679,10 @@ namespace dxvk {
|
||||
|
||||
// Set buffer handles and offsets for active bindings
|
||||
uint32_t bindingMask = 0;
|
||||
uint32_t bindingDead = 0;
|
||||
|
||||
for (uint32_t i = 0; i < m_state.gp.state.ilBindingCount; i++) {
|
||||
uint32_t binding = m_state.gp.state.ilBindings[i].binding;
|
||||
bindingMask |= 1u << binding;
|
||||
|
||||
if (likely(m_state.vi.vertexBuffers[binding].defined())) {
|
||||
auto vbo = m_state.vi.vertexBuffers[binding].getDescriptor();
|
||||
@ -3690,20 +3690,24 @@ namespace dxvk {
|
||||
buffers[binding] = vbo.buffer.buffer;
|
||||
offsets[binding] = vbo.buffer.offset;
|
||||
|
||||
bindingMask |= 1u << binding;
|
||||
m_cmd->trackResource(m_state.vi.vertexBuffers[binding].buffer());
|
||||
} else {
|
||||
buffers[binding] = m_device->dummyBufferHandle();
|
||||
offsets[binding] = 0;
|
||||
|
||||
bindingDead |= 1u << binding;
|
||||
}
|
||||
}
|
||||
|
||||
// Adjust stride of inactive bindings if needed
|
||||
if (m_state.vi.bindingMask != bindingMask) {
|
||||
if (unlikely(m_state.vi.bindingMask != bindingMask)) {
|
||||
m_flags.set(DxvkContextFlag::GpDirtyPipelineState);
|
||||
m_state.vi.bindingMask = bindingMask;
|
||||
}
|
||||
|
||||
// Actually bind all the vertex buffers
|
||||
// Actually bind all the vertex buffers.
|
||||
bindingMask |= bindingDead;
|
||||
uint32_t bindingIndex = 0;
|
||||
|
||||
while (bindingMask) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user