vkd3d: Avoid invalidating graphics pipeline and framebuffer.

Do not invalidate the current graphics pipeline and the current
framebuffer when a compute pipeline is bound.

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 2018-08-15 13:57:58 +02:00 committed by Alexandre Julliard
parent b500207b79
commit 35748f9228
2 changed files with 11 additions and 3 deletions

View File

@ -2839,15 +2839,18 @@ static void STDMETHODCALLTYPE d3d12_command_list_SetPipelineState(ID3D12Graphics
TRACE("iface %p, pipeline_state %p.\n", iface, pipeline_state);
list->state = state;
d3d12_command_list_invalidate_current_framebuffer(list);
d3d12_command_list_invalidate_current_pipeline(list);
d3d12_command_list_invalidate_bindings(list, state);
if (state && state->vk_bind_point == VK_PIPELINE_BIND_POINT_COMPUTE)
if (d3d12_pipeline_state_is_compute(state))
{
const struct vkd3d_vk_device_procs *vk_procs = &list->device->vk_procs;
VK_CALL(vkCmdBindPipeline(list->vk_command_buffer, state->vk_bind_point, state->u.compute.vk_pipeline));
}
else
{
d3d12_command_list_invalidate_current_framebuffer(list);
d3d12_command_list_invalidate_current_pipeline(list);
}
}
static void STDMETHODCALLTYPE d3d12_command_list_ResourceBarrier(ID3D12GraphicsCommandList *iface,

View File

@ -516,6 +516,11 @@ struct d3d12_pipeline_state
struct d3d12_device *device;
};
static inline bool d3d12_pipeline_state_is_compute(const struct d3d12_pipeline_state *state)
{
return state && state->vk_bind_point == VK_PIPELINE_BIND_POINT_COMPUTE;
}
HRESULT d3d12_pipeline_state_create_compute(struct d3d12_device *device,
const D3D12_COMPUTE_PIPELINE_STATE_DESC *desc, struct d3d12_pipeline_state **state) DECLSPEC_HIDDEN;
HRESULT d3d12_pipeline_state_create_graphics(struct d3d12_device *device,