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:
parent
3dbd9d8659
commit
934caa3fd7
@ -1213,6 +1213,9 @@ namespace dxvk {
|
|||||||
BindVertexBuffer(StartSlot + i, newBuffer, pOffsets[i], pStrides[i]);
|
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::PixelShader)].uavCount = D3D11_1_UAV_SLOT_COUNT;
|
||||||
result.stages[uint32_t(DxbcProgramType::ComputeShader)].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;
|
result.soCount = D3D11_SO_BUFFER_SLOT_COUNT;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -4070,7 +4073,7 @@ namespace dxvk {
|
|||||||
m_state.ia.indexBuffer.offset,
|
m_state.ia.indexBuffer.offset,
|
||||||
m_state.ia.indexBuffer.format);
|
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,
|
BindVertexBuffer(i,
|
||||||
m_state.ia.vertexBuffers[i].buffer.ptr(),
|
m_state.ia.vertexBuffers[i].buffer.ptr(),
|
||||||
m_state.ia.vertexBuffers[i].offset,
|
m_state.ia.vertexBuffers[i].offset,
|
||||||
|
@ -160,12 +160,14 @@ namespace dxvk {
|
|||||||
std::array<D3D11VertexBufferBinding, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT> vertexBuffers = { };
|
std::array<D3D11VertexBufferBinding, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT> vertexBuffers = { };
|
||||||
D3D11IndexBufferBinding indexBuffer = { };
|
D3D11IndexBufferBinding indexBuffer = { };
|
||||||
|
|
||||||
|
uint32_t maxVbCount = 0;
|
||||||
|
|
||||||
void reset() {
|
void reset() {
|
||||||
inputLayout = nullptr;
|
inputLayout = nullptr;
|
||||||
|
|
||||||
primitiveTopology = D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED;
|
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();
|
vertexBuffers[i] = D3D11VertexBufferBinding();
|
||||||
|
|
||||||
indexBuffer = D3D11IndexBufferBinding();
|
indexBuffer = D3D11IndexBufferBinding();
|
||||||
|
Loading…
Reference in New Issue
Block a user