1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-12 22:08:59 +01:00

[d3d11] Track highest bound vertex buffer

This commit is contained in:
Philip Rebohle 2022-08-04 18:11:19 +02:00
parent 3dbd9d8659
commit 934caa3fd7
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 8 additions and 3 deletions

View File

@ -1213,6 +1213,9 @@ namespace dxvk {
BindVertexBuffer(StartSlot + i, newBuffer, pOffsets[i], pStrides[i]);
}
}
m_state.ia.maxVbCount = std::clamp(StartSlot + NumBuffers,
m_state.ia.maxVbCount, uint32_t(m_state.ia.vertexBuffers.size()));
}
@ -3795,7 +3798,7 @@ namespace dxvk {
result.stages[uint32_t(DxbcProgramType::PixelShader)].uavCount = D3D11_1_UAV_SLOT_COUNT;
result.stages[uint32_t(DxbcProgramType::ComputeShader)].uavCount = D3D11_1_UAV_SLOT_COUNT;
result.vbCount = D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT;
result.vbCount = m_state.ia.maxVbCount;
result.soCount = D3D11_SO_BUFFER_SLOT_COUNT;
return result;
}
@ -4070,7 +4073,7 @@ namespace dxvk {
m_state.ia.indexBuffer.offset,
m_state.ia.indexBuffer.format);
for (uint32_t i = 0; i < m_state.ia.vertexBuffers.size(); i++) {
for (uint32_t i = 0; i < m_state.ia.maxVbCount; i++) {
BindVertexBuffer(i,
m_state.ia.vertexBuffers[i].buffer.ptr(),
m_state.ia.vertexBuffers[i].offset,

View File

@ -160,12 +160,14 @@ namespace dxvk {
std::array<D3D11VertexBufferBinding, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT> vertexBuffers = { };
D3D11IndexBufferBinding indexBuffer = { };
uint32_t maxVbCount = 0;
void reset() {
inputLayout = nullptr;
primitiveTopology = D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED;
for (uint32_t i = 0; i < vertexBuffers.size(); i++)
for (uint32_t i = 0; i < maxVbCount; i++)
vertexBuffers[i] = D3D11VertexBufferBinding();
indexBuffer = D3D11IndexBufferBinding();