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

[d3d11] Simplify BindIndexBuffer code

This commit is contained in:
Philip Rebohle 2019-07-17 14:41:00 +02:00
parent 63fe899bdc
commit 3f30fbd098
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -3247,17 +3247,9 @@ namespace dxvk {
D3D11Buffer* pBuffer,
UINT Offset,
DXGI_FORMAT Format) {
// As in Vulkan, the index format can be either a 32-bit
// or 16-bit unsigned integer, no other formats are allowed.
VkIndexType indexType = VK_INDEX_TYPE_UINT32;
if (pBuffer != nullptr) {
switch (Format) {
case DXGI_FORMAT_R16_UINT: indexType = VK_INDEX_TYPE_UINT16; break;
case DXGI_FORMAT_R32_UINT: indexType = VK_INDEX_TYPE_UINT32; break;
default: Logger::err(str::format("D3D11: Invalid index format: ", Format));
}
}
VkIndexType indexType = Format == DXGI_FORMAT_R16_UINT
? VK_INDEX_TYPE_UINT16
: VK_INDEX_TYPE_UINT32;
EmitCs([
cBufferSlice = pBuffer != nullptr ? pBuffer->GetBufferSlice(Offset) : DxvkBufferSlice(),