libs/vkd3d: Implement d3d12_command_list_IASetIndexBuffer().

This commit is contained in:
Henri Verbeet 2016-11-02 19:18:30 +01:00
parent 2213e126cf
commit 9bb9e63f23
2 changed files with 25 additions and 1 deletions

View File

@ -47,6 +47,9 @@ typedef enum DXGI_FORMAT
DXGI_FORMAT_D32_FLOAT = 0x28, DXGI_FORMAT_D32_FLOAT = 0x28,
DXGI_FORMAT_R32_FLOAT = 0x29, DXGI_FORMAT_R32_FLOAT = 0x29,
DXGI_FORMAT_R32_UINT = 0x2a,
DXGI_FORMAT_R16_UINT = 0x39,
DXGI_FORMAT_B8G8R8A8_UNORM = 0x57, DXGI_FORMAT_B8G8R8A8_UNORM = 0x57,
DXGI_FORMAT_B8G8R8X8_UNORM = 0x58, DXGI_FORMAT_B8G8R8X8_UNORM = 0x58,

View File

@ -2102,7 +2102,28 @@ static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRootUnorderedAccessV
static void STDMETHODCALLTYPE d3d12_command_list_IASetIndexBuffer(ID3D12GraphicsCommandList *iface, static void STDMETHODCALLTYPE d3d12_command_list_IASetIndexBuffer(ID3D12GraphicsCommandList *iface,
const D3D12_INDEX_BUFFER_VIEW *view) const D3D12_INDEX_BUFFER_VIEW *view)
{ {
FIXME("iface %p, view %p stub!\n", iface, view); struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList(iface);
const struct vkd3d_vk_device_procs *vk_procs;
enum VkIndexType index_type;
TRACE("iface %p, view %p.\n", iface, view);
vk_procs = &list->device->vk_procs;
switch (view->Format)
{
case DXGI_FORMAT_R16_UINT:
index_type = VK_INDEX_TYPE_UINT16;
break;
case DXGI_FORMAT_R32_UINT:
index_type = VK_INDEX_TYPE_UINT32;
break;
default:
FIXME("Unhandled format %#x.\n", view->Format);
return;
}
VK_CALL(vkCmdBindIndexBuffer(list->vk_command_buffer, (VkBuffer)view->BufferLocation, 0, index_type));
} }
static void STDMETHODCALLTYPE d3d12_command_list_IASetVertexBuffers(ID3D12GraphicsCommandList *iface, static void STDMETHODCALLTYPE d3d12_command_list_IASetVertexBuffers(ID3D12GraphicsCommandList *iface,