vkd3d: Do not crash on NULL views in IASetIndexBuffers().

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2019-03-07 11:01:14 +01:00 committed by Alexandre Julliard
parent a844d8f0a8
commit d0f8443ac5
2 changed files with 7 additions and 0 deletions

View File

@ -3583,6 +3583,12 @@ static void STDMETHODCALLTYPE d3d12_command_list_IASetIndexBuffer(ID3D12Graphics
TRACE("iface %p, view %p.\n", iface, view);
if (!view)
{
WARN("Ignoring NULL index buffer view.\n");
return;
}
vk_procs = &list->device->vk_procs;
switch (view->Format)

View File

@ -4492,6 +4492,7 @@ static void test_draw_indexed_instanced(void)
ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature);
ID3D12GraphicsCommandList_SetPipelineState(command_list, context.pipeline_state);
ID3D12GraphicsCommandList_IASetPrimitiveTopology(command_list, D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
ID3D12GraphicsCommandList_IASetIndexBuffer(command_list, NULL);
ID3D12GraphicsCommandList_IASetIndexBuffer(command_list, &ibv);
ID3D12GraphicsCommandList_RSSetViewports(command_list, 1, &context.viewport);
ID3D12GraphicsCommandList_RSSetScissorRects(command_list, 1, &context.scissor_rect);