From 3f30fbd098f0031fbeeef55b45bb6d52ee20b991 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Wed, 17 Jul 2019 14:41:00 +0200 Subject: [PATCH] [d3d11] Simplify BindIndexBuffer code --- src/d3d11/d3d11_context.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/d3d11/d3d11_context.cpp b/src/d3d11/d3d11_context.cpp index 464881e0..bb5b501d 100644 --- a/src/d3d11/d3d11_context.cpp +++ b/src/d3d11/d3d11_context.cpp @@ -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(),