diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index cc467e4f..375aa63c 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -1295,7 +1295,12 @@ static void STDMETHODCALLTYPE d3d12_command_list_OMSetStencilRef(ID3D12GraphicsC static void STDMETHODCALLTYPE d3d12_command_list_SetPipelineState(ID3D12GraphicsCommandList *iface, ID3D12PipelineState *pipeline_state) { - FIXME("iface %p, pipeline_state %p stub!\n", iface, pipeline_state); + struct d3d12_pipeline_state *state = unsafe_impl_from_ID3D12PipelineState(pipeline_state); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList(iface); + + TRACE("iface %p, pipeline_state %p.\n", iface, pipeline_state); + + list->state = state; } static void STDMETHODCALLTYPE d3d12_command_list_ResourceBarrier(ID3D12GraphicsCommandList *iface, diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index 6a29444a..0b1b55e0 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -331,6 +331,14 @@ static const struct ID3D12PipelineStateVtbl d3d12_pipeline_state_vtbl = d3d12_pipeline_state_GetCachedBlob, }; +struct d3d12_pipeline_state *unsafe_impl_from_ID3D12PipelineState(ID3D12PipelineState *iface) +{ + if (!iface) + return NULL; + assert(iface->lpVtbl == &d3d12_pipeline_state_vtbl); + return impl_from_ID3D12PipelineState(iface); +} + static HRESULT d3d12_pipeline_state_init_compute(struct d3d12_pipeline_state *state, struct d3d12_device *device, const D3D12_COMPUTE_PIPELINE_STATE_DESC *desc) { diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index c17fe7bf..3901fb4a 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -191,6 +191,7 @@ struct d3d12_pipeline_state HRESULT d3d12_pipeline_state_create_compute(struct d3d12_device *device, const D3D12_COMPUTE_PIPELINE_STATE_DESC *desc, struct d3d12_pipeline_state **state) DECLSPEC_HIDDEN; +struct d3d12_pipeline_state *unsafe_impl_from_ID3D12PipelineState(ID3D12PipelineState *iface) DECLSPEC_HIDDEN; /* ID3D12CommandAllocator */ struct d3d12_command_allocator @@ -236,6 +237,8 @@ struct d3d12_command_list unsigned int fb_width; unsigned int fb_height; + struct d3d12_pipeline_state *state; + struct d3d12_command_allocator *allocator; struct d3d12_device *device; };