diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index 9455898c..3d57545b 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -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, diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index 8efb9304..59741684 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -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,