1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 11:52:12 +01:00

[d3d11] Fix IAGetIndexBuffer with optimized index buffers

This commit is contained in:
Philip Rebohle 2021-02-26 02:38:26 +01:00
parent 5ac9c45f65
commit d118d35820
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -1740,8 +1740,12 @@ namespace dxvk {
if (pFormat != nullptr)
*pFormat = m_state.ia.indexBuffer.format;
if (pOffset != nullptr)
*pOffset = m_state.ia.indexBuffer.offset;
if (pOffset != nullptr) {
uint32_t shift = m_state.ia.indexBuffer.format == DXGI_FORMAT_R16_UINT ? 1 : 2;
*pOffset = m_state.ia.indexBuffer.optimized
? m_state.ia.indexBuffer.firstIndex << shift
: m_state.ia.indexBuffer.offset;
}
}