1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-29 19:24:10 +01:00

[dxvk] Added support for vertex index types

This commit is contained in:
Philip Rebohle 2017-12-07 14:01:17 +01:00
parent be7a70a307
commit a901a85401
3 changed files with 12 additions and 4 deletions

View File

@ -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());
}

View File

@ -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

View File

@ -38,6 +38,8 @@ namespace dxvk {
struct DxvkVertexInputState {
DxvkBufferBinding indexBuffer;
VkIndexType indexType = VK_INDEX_TYPE_UINT32;
std::array<DxvkBufferBinding,
DxvkLimits::MaxNumVertexBindings> vertexBuffers;
std::array<uint32_t,