diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index 67f2eb88..c4bc95e9 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -54,9 +54,13 @@ namespace dxvk { void DxvkContext::bindIndexBuffer( - const DxvkBufferBinding& buffer) { - if (m_state.vi.indexBuffer != buffer) { + const DxvkBufferBinding& buffer, + VkIndexType indexType) { + if (m_state.vi.indexBuffer != buffer + || m_state.vi.indexType != indexType) { m_state.vi.indexBuffer = buffer; + m_state.vi.indexType = indexType; + m_flags.set(DxvkContextFlag::GpDirtyIndexBuffer); } } @@ -547,7 +551,7 @@ namespace dxvk { m_cmd->cmdBindIndexBuffer( m_state.vi.indexBuffer.bufferHandle(), m_state.vi.indexBuffer.bufferOffset(), - VK_INDEX_TYPE_UINT32); + m_state.vi.indexType); m_cmd->trackResource( m_state.vi.indexBuffer.resource()); } diff --git a/src/dxvk/dxvk_context.h b/src/dxvk/dxvk_context.h index d40c49c6..db5bcb57 100644 --- a/src/dxvk/dxvk_context.h +++ b/src/dxvk/dxvk_context.h @@ -60,9 +60,11 @@ namespace dxvk { * The index buffer will be used when * issuing \c drawIndexed commands. * \param [in] buffer New index buffer + * \param [in] indexType Index type */ void bindIndexBuffer( - const DxvkBufferBinding& buffer); + const DxvkBufferBinding& buffer, + VkIndexType indexType); /** * \brief Binds buffer as a shader resource diff --git a/src/dxvk/dxvk_context_state.h b/src/dxvk/dxvk_context_state.h index 4b91f8c3..e493c535 100644 --- a/src/dxvk/dxvk_context_state.h +++ b/src/dxvk/dxvk_context_state.h @@ -38,6 +38,8 @@ namespace dxvk { struct DxvkVertexInputState { DxvkBufferBinding indexBuffer; + VkIndexType indexType = VK_INDEX_TYPE_UINT32; + std::array vertexBuffers; std::array