A stub for ID3D12GraphicsCommandList1::SetViewInstanceMask() is also added to fill out the Vtable. WriteBufferImmediate() is implemented on top of extension VK_AMD_buffer_marker, added in Mesa 19.2.0. It is still not implemented for Nvidia. Doing so using buffer copy commands would be non-trivial.
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- include/vkd3d_d3d12.idl | 27 ++++ libs/vkd3d/command.c | 315 ++++++++++++++++++++++--------------- libs/vkd3d/device.c | 6 +- libs/vkd3d/vkd3d_private.h | 5 +- libs/vkd3d/vulkan_procs.h | 1 + 5 files changed, 226 insertions(+), 128 deletions(-)
diff --git a/include/vkd3d_d3d12.idl b/include/vkd3d_d3d12.idl index ec8b83d..8246424 100644 --- a/include/vkd3d_d3d12.idl +++ b/include/vkd3d_d3d12.idl @@ -1820,6 +1820,19 @@ typedef enum D3D12_PREDICATION_OP D3D12_PREDICATION_OP_NOT_EQUAL_ZERO = 1, } D3D12_PREDICATION_OP;
+typedef struct D3D12_WRITEBUFFERIMMEDIATE_PARAMETER +{ + D3D12_GPU_VIRTUAL_ADDRESS Dest; + UINT32 Value; +} D3D12_WRITEBUFFERIMMEDIATE_PARAMETER; + +typedef enum D3D12_WRITEBUFFERIMMEDIATE_MODE +{ + D3D12_WRITEBUFFERIMMEDIATE_MODE_DEFAULT = 0, + D3D12_WRITEBUFFERIMMEDIATE_MODE_MARKER_IN = 1, + D3D12_WRITEBUFFERIMMEDIATE_MODE_MARKER_OUT = 2, +} D3D12_WRITEBUFFERIMMEDIATE_MODE; + [ uuid(8efb471d-616c-4f49-90f7-127bb763fa51), object, @@ -2000,6 +2013,20 @@ interface ID3D12GraphicsCommandList1 : ID3D12GraphicsCommandList UINT dst_sub_resource_idx, UINT dst_x, UINT dst_y, ID3D12Resource *src_resource, UINT src_sub_resource_idx, D3D12_RECT *src_rect, DXGI_FORMAT format, D3D12_RESOLVE_MODE mode); + + void SetViewInstanceMask(UINT mask); +} + +[ + uuid(38c3e585-ff17-412c-9150-4fc6f9d72a28), + object, + local, + pointer_default(unique) +] +interface ID3D12GraphicsCommandList2 : ID3D12GraphicsCommandList1 +{ + void WriteBufferImmediate(UINT count, const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *params, + const D3D12_WRITEBUFFERIMMEDIATE_MODE *modes); }
typedef enum D3D12_TILE_RANGE_FLAGS diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index 0532ec0..12b773e 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -1807,9 +1807,9 @@ HRESULT d3d12_command_allocator_create(struct d3d12_device *device, }
/* ID3D12CommandList */ -static inline struct d3d12_command_list *impl_from_ID3D12GraphicsCommandList1(ID3D12GraphicsCommandList1 *iface) +static inline struct d3d12_command_list *impl_from_ID3D12GraphicsCommandList2(ID3D12GraphicsCommandList2 *iface) { - return CONTAINING_RECORD(iface, struct d3d12_command_list, ID3D12GraphicsCommandList1_iface); + return CONTAINING_RECORD(iface, struct d3d12_command_list, ID3D12GraphicsCommandList2_iface); }
static void d3d12_command_list_invalidate_current_framebuffer(struct d3d12_command_list *list) @@ -2146,19 +2146,20 @@ static void d3d12_command_list_track_resource_usage(struct d3d12_command_list *l } }
-static HRESULT STDMETHODCALLTYPE d3d12_command_list_QueryInterface(ID3D12GraphicsCommandList1 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_command_list_QueryInterface(ID3D12GraphicsCommandList2 *iface, REFIID iid, void **object) { TRACE("iface %p, iid %s, object %p.\n", iface, debugstr_guid(iid), object);
- if (IsEqualGUID(iid, &IID_ID3D12GraphicsCommandList1) + if (IsEqualGUID(iid, &IID_ID3D12GraphicsCommandList2) + || IsEqualGUID(iid, &IID_ID3D12GraphicsCommandList1) || IsEqualGUID(iid, &IID_ID3D12GraphicsCommandList) || IsEqualGUID(iid, &IID_ID3D12CommandList) || IsEqualGUID(iid, &IID_ID3D12DeviceChild) || IsEqualGUID(iid, &IID_ID3D12Object) || IsEqualGUID(iid, &IID_IUnknown)) { - ID3D12GraphicsCommandList1_AddRef(iface); + ID3D12GraphicsCommandList2_AddRef(iface); *object = iface; return S_OK; } @@ -2169,9 +2170,9 @@ static HRESULT STDMETHODCALLTYPE d3d12_command_list_QueryInterface(ID3D12Graphic return E_NOINTERFACE; }
-static ULONG STDMETHODCALLTYPE d3d12_command_list_AddRef(ID3D12GraphicsCommandList1 *iface) +static ULONG STDMETHODCALLTYPE d3d12_command_list_AddRef(ID3D12GraphicsCommandList2 *iface) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); ULONG refcount = InterlockedIncrement(&list->refcount);
TRACE("%p increasing refcount to %u.\n", list, refcount); @@ -2179,9 +2180,9 @@ static ULONG STDMETHODCALLTYPE d3d12_command_list_AddRef(ID3D12GraphicsCommandLi return refcount; }
-static ULONG STDMETHODCALLTYPE d3d12_command_list_Release(ID3D12GraphicsCommandList1 *iface) +static ULONG STDMETHODCALLTYPE d3d12_command_list_Release(ID3D12GraphicsCommandList2 *iface) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); ULONG refcount = InterlockedDecrement(&list->refcount);
TRACE("%p decreasing refcount to %u.\n", list, refcount); @@ -2204,66 +2205,66 @@ static ULONG STDMETHODCALLTYPE d3d12_command_list_Release(ID3D12GraphicsCommandL return refcount; }
-static HRESULT STDMETHODCALLTYPE d3d12_command_list_GetPrivateData(ID3D12GraphicsCommandList1 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_command_list_GetPrivateData(ID3D12GraphicsCommandList2 *iface, REFGUID guid, UINT *data_size, void *data) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
return vkd3d_get_private_data(&list->private_store, guid, data_size, data); }
-static HRESULT STDMETHODCALLTYPE d3d12_command_list_SetPrivateData(ID3D12GraphicsCommandList1 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_command_list_SetPrivateData(ID3D12GraphicsCommandList2 *iface, REFGUID guid, UINT data_size, const void *data) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
return vkd3d_set_private_data(&list->private_store, guid, data_size, data); }
-static HRESULT STDMETHODCALLTYPE d3d12_command_list_SetPrivateDataInterface(ID3D12GraphicsCommandList1 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_command_list_SetPrivateDataInterface(ID3D12GraphicsCommandList2 *iface, REFGUID guid, const IUnknown *data) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
return vkd3d_set_private_data_interface(&list->private_store, guid, data); }
-static HRESULT STDMETHODCALLTYPE d3d12_command_list_SetName(ID3D12GraphicsCommandList1 *iface, const WCHAR *name) +static HRESULT STDMETHODCALLTYPE d3d12_command_list_SetName(ID3D12GraphicsCommandList2 *iface, const WCHAR *name) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, name %s.\n", iface, debugstr_w(name, list->device->wchar_size));
return name ? S_OK : E_INVALIDARG; }
-static HRESULT STDMETHODCALLTYPE d3d12_command_list_GetDevice(ID3D12GraphicsCommandList1 *iface, REFIID iid, void **device) +static HRESULT STDMETHODCALLTYPE d3d12_command_list_GetDevice(ID3D12GraphicsCommandList2 *iface, REFIID iid, void **device) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, iid %s, device %p.\n", iface, debugstr_guid(iid), device);
return d3d12_device_query_interface(list->device, iid, device); }
-static D3D12_COMMAND_LIST_TYPE STDMETHODCALLTYPE d3d12_command_list_GetType(ID3D12GraphicsCommandList1 *iface) +static D3D12_COMMAND_LIST_TYPE STDMETHODCALLTYPE d3d12_command_list_GetType(ID3D12GraphicsCommandList2 *iface) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p.\n", iface);
return list->type; }
-static HRESULT STDMETHODCALLTYPE d3d12_command_list_Close(ID3D12GraphicsCommandList1 *iface) +static HRESULT STDMETHODCALLTYPE d3d12_command_list_Close(ID3D12GraphicsCommandList2 *iface) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct vkd3d_vk_device_procs *vk_procs; VkResult vr;
@@ -2307,7 +2308,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_command_list_Close(ID3D12GraphicsCommandL static void d3d12_command_list_reset_state(struct d3d12_command_list *list, ID3D12PipelineState *initial_pipeline_state) { - ID3D12GraphicsCommandList1 *iface = &list->ID3D12GraphicsCommandList1_iface; + ID3D12GraphicsCommandList2 *iface = &list->ID3D12GraphicsCommandList2_iface;
memset(list->strides, 0, sizeof(list->strides)); list->primitive_topology = D3D_PRIMITIVE_TOPOLOGY_POINTLIST; @@ -2337,14 +2338,14 @@ static void d3d12_command_list_reset_state(struct d3d12_command_list *list, memset(list->so_counter_buffers, 0, sizeof(list->so_counter_buffers)); memset(list->so_counter_buffer_offsets, 0, sizeof(list->so_counter_buffer_offsets));
- ID3D12GraphicsCommandList1_SetPipelineState(iface, initial_pipeline_state); + ID3D12GraphicsCommandList2_SetPipelineState(iface, initial_pipeline_state); }
-static HRESULT STDMETHODCALLTYPE d3d12_command_list_Reset(ID3D12GraphicsCommandList1 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_command_list_Reset(ID3D12GraphicsCommandList2 *iface, ID3D12CommandAllocator *allocator, ID3D12PipelineState *initial_pipeline_state) { struct d3d12_command_allocator *allocator_impl = unsafe_impl_from_ID3D12CommandAllocator(allocator); - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); HRESULT hr;
TRACE("iface %p, allocator %p, initial_pipeline_state %p.\n", @@ -2371,7 +2372,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_command_list_Reset(ID3D12GraphicsCommandL return hr; }
-static HRESULT STDMETHODCALLTYPE d3d12_command_list_ClearState(ID3D12GraphicsCommandList1 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_command_list_ClearState(ID3D12GraphicsCommandList2 *iface, ID3D12PipelineState *pipeline_state) { FIXME("iface %p, pipline_state %p stub!\n", iface, pipeline_state); @@ -2949,11 +2950,11 @@ static void d3d12_command_list_check_index_buffer_strip_cut_value(struct d3d12_c } }
-static void STDMETHODCALLTYPE d3d12_command_list_DrawInstanced(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_DrawInstanced(ID3D12GraphicsCommandList2 *iface, UINT vertex_count_per_instance, UINT instance_count, UINT start_vertex_location, UINT start_instance_location) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct vkd3d_vk_device_procs *vk_procs;
TRACE("iface %p, vertex_count_per_instance %u, instance_count %u, " @@ -2973,11 +2974,11 @@ static void STDMETHODCALLTYPE d3d12_command_list_DrawInstanced(ID3D12GraphicsCom instance_count, start_vertex_location, start_instance_location)); }
-static void STDMETHODCALLTYPE d3d12_command_list_DrawIndexedInstanced(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_DrawIndexedInstanced(ID3D12GraphicsCommandList2 *iface, UINT index_count_per_instance, UINT instance_count, UINT start_vertex_location, INT base_vertex_location, UINT start_instance_location) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct vkd3d_vk_device_procs *vk_procs;
TRACE("iface %p, index_count_per_instance %u, instance_count %u, start_vertex_location %u, " @@ -2999,10 +3000,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_DrawIndexedInstanced(ID3D12Grap instance_count, start_vertex_location, base_vertex_location, start_instance_location)); }
-static void STDMETHODCALLTYPE d3d12_command_list_Dispatch(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_Dispatch(ID3D12GraphicsCommandList2 *iface, UINT x, UINT y, UINT z) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct vkd3d_vk_device_procs *vk_procs;
TRACE("iface %p, x %u, y %u, z %u.\n", iface, x, y, z); @@ -3022,10 +3023,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_Dispatch(ID3D12GraphicsCommandL VK_CALL(vkCmdDispatch(list->vk_command_buffer, x, y, z)); }
-static void STDMETHODCALLTYPE d3d12_command_list_CopyBufferRegion(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_CopyBufferRegion(ID3D12GraphicsCommandList2 *iface, ID3D12Resource *dst, UINT64 dst_offset, ID3D12Resource *src, UINT64 src_offset, UINT64 byte_count) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); struct d3d12_resource *dst_resource, *src_resource; const struct vkd3d_vk_device_procs *vk_procs; VkBufferCopy buffer_copy; @@ -3305,11 +3306,11 @@ static bool validate_d3d12_box(const D3D12_BOX *box) && box->back > box->front; }
-static void STDMETHODCALLTYPE d3d12_command_list_CopyTextureRegion(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_CopyTextureRegion(ID3D12GraphicsCommandList2 *iface, const D3D12_TEXTURE_COPY_LOCATION *dst, UINT dst_x, UINT dst_y, UINT dst_z, const D3D12_TEXTURE_COPY_LOCATION *src, const D3D12_BOX *src_box) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); struct d3d12_resource *dst_resource, *src_resource; const struct vkd3d_format *src_format, *dst_format; const struct vkd3d_vk_device_procs *vk_procs; @@ -3440,10 +3441,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_CopyTextureRegion(ID3D12Graphic } }
-static void STDMETHODCALLTYPE d3d12_command_list_CopyResource(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_CopyResource(ID3D12GraphicsCommandList2 *iface, ID3D12Resource *dst, ID3D12Resource *src) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); struct d3d12_resource *dst_resource, *src_resource; const struct vkd3d_format *src_format, *dst_format; const struct vkd3d_vk_device_procs *vk_procs; @@ -3510,7 +3511,7 @@ static void STDMETHODCALLTYPE d3d12_command_list_CopyResource(ID3D12GraphicsComm } }
-static void STDMETHODCALLTYPE d3d12_command_list_CopyTiles(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_CopyTiles(ID3D12GraphicsCommandList2 *iface, ID3D12Resource *tiled_resource, const D3D12_TILED_RESOURCE_COORDINATE *tile_region_start_coordinate, const D3D12_TILE_REGION_SIZE *tile_region_size, ID3D12Resource *buffer, UINT64 buffer_offset, D3D12_TILE_COPY_FLAGS flags) @@ -3521,11 +3522,11 @@ static void STDMETHODCALLTYPE d3d12_command_list_CopyTiles(ID3D12GraphicsCommand buffer, buffer_offset, flags); }
-static void STDMETHODCALLTYPE d3d12_command_list_ResolveSubresource(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_ResolveSubresource(ID3D12GraphicsCommandList2 *iface, ID3D12Resource *dst, UINT dst_sub_resource_idx, ID3D12Resource *src, UINT src_sub_resource_idx, DXGI_FORMAT format) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct vkd3d_format *src_format, *dst_format, *vk_format; struct d3d12_resource *dst_resource, *src_resource; const struct vkd3d_vk_device_procs *vk_procs; @@ -3596,10 +3597,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_ResolveSubresource(ID3D12Graphi VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, &vk_image_resolve)); }
-static void STDMETHODCALLTYPE d3d12_command_list_IASetPrimitiveTopology(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_IASetPrimitiveTopology(ID3D12GraphicsCommandList2 *iface, D3D12_PRIMITIVE_TOPOLOGY topology) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, topology %#x.\n", iface, topology);
@@ -3616,11 +3617,11 @@ static void STDMETHODCALLTYPE d3d12_command_list_IASetPrimitiveTopology(ID3D12Gr d3d12_command_list_invalidate_current_pipeline(list); }
-static void STDMETHODCALLTYPE d3d12_command_list_RSSetViewports(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_RSSetViewports(ID3D12GraphicsCommandList2 *iface, UINT viewport_count, const D3D12_VIEWPORT *viewports) { VkViewport vk_viewports[D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE]; - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct vkd3d_vk_device_procs *vk_procs; unsigned int i;
@@ -3652,10 +3653,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_RSSetViewports(ID3D12GraphicsCo VK_CALL(vkCmdSetViewport(list->vk_command_buffer, 0, viewport_count, vk_viewports)); }
-static void STDMETHODCALLTYPE d3d12_command_list_RSSetScissorRects(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_RSSetScissorRects(ID3D12GraphicsCommandList2 *iface, UINT rect_count, const D3D12_RECT *rects) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); VkRect2D vk_rects[D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE]; const struct vkd3d_vk_device_procs *vk_procs; unsigned int i; @@ -3680,10 +3681,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_RSSetScissorRects(ID3D12Graphic VK_CALL(vkCmdSetScissor(list->vk_command_buffer, 0, rect_count, vk_rects)); }
-static void STDMETHODCALLTYPE d3d12_command_list_OMSetBlendFactor(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_OMSetBlendFactor(ID3D12GraphicsCommandList2 *iface, const FLOAT blend_factor[4]) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct vkd3d_vk_device_procs *vk_procs;
TRACE("iface %p, blend_factor %p.\n", iface, blend_factor); @@ -3692,10 +3693,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_OMSetBlendFactor(ID3D12Graphics VK_CALL(vkCmdSetBlendConstants(list->vk_command_buffer, blend_factor)); }
-static void STDMETHODCALLTYPE d3d12_command_list_OMSetStencilRef(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_OMSetStencilRef(ID3D12GraphicsCommandList2 *iface, UINT stencil_ref) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct vkd3d_vk_device_procs *vk_procs;
TRACE("iface %p, stencil_ref %u.\n", iface, stencil_ref); @@ -3704,11 +3705,11 @@ static void STDMETHODCALLTYPE d3d12_command_list_OMSetStencilRef(ID3D12GraphicsC VK_CALL(vkCmdSetStencilReference(list->vk_command_buffer, VK_STENCIL_FRONT_AND_BACK, stencil_ref)); }
-static void STDMETHODCALLTYPE d3d12_command_list_SetPipelineState(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetPipelineState(ID3D12GraphicsCommandList2 *iface, ID3D12PipelineState *pipeline_state) { struct d3d12_pipeline_state *state = unsafe_impl_from_ID3D12PipelineState(pipeline_state); - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct vkd3d_vk_device_procs *vk_procs;
TRACE("iface %p, pipeline_state %p.\n", iface, pipeline_state); @@ -3770,10 +3771,10 @@ static unsigned int d3d12_find_ds_multiplanar_transition(const D3D12_RESOURCE_BA return 0; }
-static void STDMETHODCALLTYPE d3d12_command_list_ResourceBarrier(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_ResourceBarrier(ID3D12GraphicsCommandList2 *iface, UINT barrier_count, const D3D12_RESOURCE_BARRIER *barriers) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); bool have_aliasing_barriers = false, have_split_barriers = false; const struct vkd3d_vk_device_procs *vk_procs; const struct vkd3d_vulkan_info *vk_info; @@ -4003,13 +4004,13 @@ static void STDMETHODCALLTYPE d3d12_command_list_ResourceBarrier(ID3D12GraphicsC WARN("Issuing split barrier(s) on D3D12_RESOURCE_BARRIER_FLAG_END_ONLY.\n"); }
-static void STDMETHODCALLTYPE d3d12_command_list_ExecuteBundle(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_ExecuteBundle(ID3D12GraphicsCommandList2 *iface, ID3D12GraphicsCommandList *command_list) { FIXME("iface %p, command_list %p stub!\n", iface, command_list); }
-static void STDMETHODCALLTYPE d3d12_command_list_SetDescriptorHeaps(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetDescriptorHeaps(ID3D12GraphicsCommandList2 *iface, UINT heap_count, ID3D12DescriptorHeap *const *heaps) { TRACE("iface %p, heap_count %u, heaps %p.\n", iface, heap_count, heaps); @@ -4034,10 +4035,10 @@ static void d3d12_command_list_set_root_signature(struct d3d12_command_list *lis bindings->push_descriptor_dirty_mask = bindings->push_descriptor_active_mask & root_signature->push_descriptor_mask; }
-static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootSignature(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootSignature(ID3D12GraphicsCommandList2 *iface, ID3D12RootSignature *root_signature) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_signature %p.\n", iface, root_signature);
@@ -4045,10 +4046,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootSignature(ID3D12G unsafe_impl_from_ID3D12RootSignature(root_signature)); }
-static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRootSignature(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRootSignature(ID3D12GraphicsCommandList2 *iface, ID3D12RootSignature *root_signature) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_signature %p.\n", iface, root_signature);
@@ -4070,10 +4071,10 @@ static void d3d12_command_list_set_descriptor_table(struct d3d12_command_list *l bindings->descriptor_table_active_mask |= (uint64_t)1 << index; }
-static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootDescriptorTable(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootDescriptorTable(ID3D12GraphicsCommandList2 *iface, UINT root_parameter_index, D3D12_GPU_DESCRIPTOR_HANDLE base_descriptor) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_parameter_index %u, base_descriptor %#"PRIx64".\n", iface, root_parameter_index, base_descriptor.ptr); @@ -4082,10 +4083,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootDescriptorTable(I root_parameter_index, base_descriptor); }
-static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRootDescriptorTable(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRootDescriptorTable(ID3D12GraphicsCommandList2 *iface, UINT root_parameter_index, D3D12_GPU_DESCRIPTOR_HANDLE base_descriptor) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_parameter_index %u, base_descriptor %#"PRIx64".\n", iface, root_parameter_index, base_descriptor.ptr); @@ -4107,10 +4108,10 @@ static void d3d12_command_list_set_root_constants(struct d3d12_command_list *lis c->stage_flags, c->offset + offset * sizeof(uint32_t), count * sizeof(uint32_t), data)); }
-static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRoot32BitConstant(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRoot32BitConstant(ID3D12GraphicsCommandList2 *iface, UINT root_parameter_index, UINT data, UINT dst_offset) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_parameter_index %u, data 0x%08x, dst_offset %u.\n", iface, root_parameter_index, data, dst_offset); @@ -4119,10 +4120,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRoot32BitConstant(ID3 root_parameter_index, dst_offset, 1, &data); }
-static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRoot32BitConstant(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRoot32BitConstant(ID3D12GraphicsCommandList2 *iface, UINT root_parameter_index, UINT data, UINT dst_offset) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_parameter_index %u, data 0x%08x, dst_offset %u.\n", iface, root_parameter_index, data, dst_offset); @@ -4131,10 +4132,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRoot32BitConstant(ID root_parameter_index, dst_offset, 1, &data); }
-static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRoot32BitConstants(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRoot32BitConstants(ID3D12GraphicsCommandList2 *iface, UINT root_parameter_index, UINT constant_count, const void *data, UINT dst_offset) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_parameter_index %u, constant_count %u, data %p, dst_offset %u.\n", iface, root_parameter_index, constant_count, data, dst_offset); @@ -4143,10 +4144,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRoot32BitConstants(ID root_parameter_index, dst_offset, constant_count, data); }
-static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRoot32BitConstants(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRoot32BitConstants(ID3D12GraphicsCommandList2 *iface, UINT root_parameter_index, UINT constant_count, const void *data, UINT dst_offset) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_parameter_index %u, constant_count %u, data %p, dst_offset %u.\n", iface, root_parameter_index, constant_count, data, dst_offset); @@ -4199,9 +4200,9 @@ static void d3d12_command_list_set_root_cbv(struct d3d12_command_list *list, }
static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootConstantBufferView( - ID3D12GraphicsCommandList1 *iface, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address) + ID3D12GraphicsCommandList2 *iface, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_parameter_index %u, address %#"PRIx64".\n", iface, root_parameter_index, address); @@ -4210,9 +4211,9 @@ static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootConstantBufferVie }
static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRootConstantBufferView( - ID3D12GraphicsCommandList1 *iface, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address) + ID3D12GraphicsCommandList2 *iface, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_parameter_index %u, address %#"PRIx64".\n", iface, root_parameter_index, address); @@ -4271,9 +4272,9 @@ static void d3d12_command_list_set_root_descriptor(struct d3d12_command_list *li }
static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootShaderResourceView( - ID3D12GraphicsCommandList1 *iface, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address) + ID3D12GraphicsCommandList2 *iface, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_parameter_index %u, address %#"PRIx64".\n", iface, root_parameter_index, address); @@ -4283,9 +4284,9 @@ static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootShaderResourceVie }
static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRootShaderResourceView( - ID3D12GraphicsCommandList1 *iface, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address) + ID3D12GraphicsCommandList2 *iface, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_parameter_index %u, address %#"PRIx64".\n", iface, root_parameter_index, address); @@ -4295,9 +4296,9 @@ static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRootShaderResourceVi }
static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootUnorderedAccessView( - ID3D12GraphicsCommandList1 *iface, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address) + ID3D12GraphicsCommandList2 *iface, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_parameter_index %u, address %#"PRIx64".\n", iface, root_parameter_index, address); @@ -4307,9 +4308,9 @@ static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootUnorderedAccessVi }
static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRootUnorderedAccessView( - ID3D12GraphicsCommandList1 *iface, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address) + ID3D12GraphicsCommandList2 *iface, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_parameter_index %u, address %#"PRIx64".\n", iface, root_parameter_index, address); @@ -4318,10 +4319,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRootUnorderedAccessV root_parameter_index, address); }
-static void STDMETHODCALLTYPE d3d12_command_list_IASetIndexBuffer(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_IASetIndexBuffer(ID3D12GraphicsCommandList2 *iface, const D3D12_INDEX_BUFFER_VIEW *view) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct vkd3d_vk_device_procs *vk_procs; struct d3d12_resource *resource; enum VkIndexType index_type; @@ -4356,10 +4357,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_IASetIndexBuffer(ID3D12Graphics view->BufferLocation - resource->gpu_address, index_type)); }
-static void STDMETHODCALLTYPE d3d12_command_list_IASetVertexBuffers(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_IASetVertexBuffers(ID3D12GraphicsCommandList2 *iface, UINT start_slot, UINT view_count, const D3D12_VERTEX_BUFFER_VIEW *views) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct vkd3d_null_resources *null_resources; struct vkd3d_gpu_va_allocator *gpu_va_allocator; VkDeviceSize offsets[ARRAY_SIZE(list->strides)]; @@ -4408,10 +4409,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_IASetVertexBuffers(ID3D12Graphi d3d12_command_list_invalidate_current_pipeline(list); }
-static void STDMETHODCALLTYPE d3d12_command_list_SOSetTargets(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SOSetTargets(ID3D12GraphicsCommandList2 *iface, UINT start_slot, UINT view_count, const D3D12_STREAM_OUTPUT_BUFFER_VIEW *views) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); VkDeviceSize offsets[ARRAY_SIZE(list->so_counter_buffers)]; VkDeviceSize sizes[ARRAY_SIZE(list->so_counter_buffers)]; VkBuffer buffers[ARRAY_SIZE(list->so_counter_buffers)]; @@ -4473,11 +4474,11 @@ static void STDMETHODCALLTYPE d3d12_command_list_SOSetTargets(ID3D12GraphicsComm VK_CALL(vkCmdBindTransformFeedbackBuffersEXT(list->vk_command_buffer, first, count, buffers, offsets, sizes)); }
-static void STDMETHODCALLTYPE d3d12_command_list_OMSetRenderTargets(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_OMSetRenderTargets(ID3D12GraphicsCommandList2 *iface, UINT render_target_descriptor_count, const D3D12_CPU_DESCRIPTOR_HANDLE *render_target_descriptors, BOOL single_descriptor_handle, const D3D12_CPU_DESCRIPTOR_HANDLE *depth_stencil_descriptor) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct d3d12_rtv_desc *rtv_desc; const struct d3d12_dsv_desc *dsv_desc; VkFormat prev_dsv_format; @@ -4678,12 +4679,12 @@ static void d3d12_command_list_clear(struct d3d12_command_list *list, } }
-static void STDMETHODCALLTYPE d3d12_command_list_ClearDepthStencilView(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_ClearDepthStencilView(ID3D12GraphicsCommandList2 *iface, D3D12_CPU_DESCRIPTOR_HANDLE dsv, D3D12_CLEAR_FLAGS flags, float depth, UINT8 stencil, UINT rect_count, const D3D12_RECT *rects) { const union VkClearValue clear_value = {.depthStencil = {depth, stencil}}; - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct d3d12_dsv_desc *dsv_desc = d3d12_dsv_desc_from_cpu_handle(dsv); struct VkAttachmentDescription attachment_desc; struct VkAttachmentReference ds_reference; @@ -4727,10 +4728,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_ClearDepthStencilView(ID3D12Gra &clear_value, rect_count, rects); }
-static void STDMETHODCALLTYPE d3d12_command_list_ClearRenderTargetView(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_ClearRenderTargetView(ID3D12GraphicsCommandList2 *iface, D3D12_CPU_DESCRIPTOR_HANDLE rtv, const FLOAT color[4], UINT rect_count, const D3D12_RECT *rects) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct d3d12_rtv_desc *rtv_desc = d3d12_rtv_desc_from_cpu_handle(rtv); struct VkAttachmentDescription attachment_desc; struct VkAttachmentReference color_reference; @@ -4781,11 +4782,11 @@ static void STDMETHODCALLTYPE d3d12_command_list_ClearRenderTargetView(ID3D12Gra &clear_value, rect_count, rects); }
-static void STDMETHODCALLTYPE d3d12_command_list_ClearUnorderedAccessViewUint(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_ClearUnorderedAccessViewUint(ID3D12GraphicsCommandList2 *iface, D3D12_GPU_DESCRIPTOR_HANDLE gpu_handle, D3D12_CPU_DESCRIPTOR_HANDLE cpu_handle, ID3D12Resource *resource, const UINT values[4], UINT rect_count, const D3D12_RECT *rects) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct vkd3d_vk_device_procs *vk_procs; const struct vkd3d_vulkan_info *vk_info; const struct d3d12_desc *cpu_descriptor; @@ -4878,11 +4879,11 @@ static void STDMETHODCALLTYPE d3d12_command_list_ClearUnorderedAccessViewUint(ID } }
-static void STDMETHODCALLTYPE d3d12_command_list_ClearUnorderedAccessViewFloat(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_ClearUnorderedAccessViewFloat(ID3D12GraphicsCommandList2 *iface, D3D12_GPU_DESCRIPTOR_HANDLE gpu_handle, D3D12_CPU_DESCRIPTOR_HANDLE cpu_handle, ID3D12Resource *resource, const float values[4], UINT rect_count, const D3D12_RECT *rects) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); struct d3d12_resource *resource_impl;
FIXME("iface %p, gpu_handle %#"PRIx64", cpu_handle %lx, resource %p, values %p, rect_count %u, rects %p stub!\n", @@ -4893,16 +4894,16 @@ static void STDMETHODCALLTYPE d3d12_command_list_ClearUnorderedAccessViewFloat(I d3d12_command_list_track_resource_usage(list, resource_impl); }
-static void STDMETHODCALLTYPE d3d12_command_list_DiscardResource(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_DiscardResource(ID3D12GraphicsCommandList2 *iface, ID3D12Resource *resource, const D3D12_DISCARD_REGION *region) { FIXME_ONCE("iface %p, resource %p, region %p stub!\n", iface, resource, region); }
-static void STDMETHODCALLTYPE d3d12_command_list_BeginQuery(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_BeginQuery(ID3D12GraphicsCommandList2 *iface, ID3D12QueryHeap *heap, D3D12_QUERY_TYPE type, UINT index) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); struct d3d12_query_heap *query_heap = unsafe_impl_from_ID3D12QueryHeap(heap); const struct vkd3d_vk_device_procs *vk_procs; VkQueryControlFlags flags = 0; @@ -4929,10 +4930,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_BeginQuery(ID3D12GraphicsComman VK_CALL(vkCmdBeginQuery(list->vk_command_buffer, query_heap->vk_query_pool, index, flags)); }
-static void STDMETHODCALLTYPE d3d12_command_list_EndQuery(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_EndQuery(ID3D12GraphicsCommandList2 *iface, ID3D12QueryHeap *heap, D3D12_QUERY_TYPE type, UINT index) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); struct d3d12_query_heap *query_heap = unsafe_impl_from_ID3D12QueryHeap(heap); const struct vkd3d_vk_device_procs *vk_procs;
@@ -4974,12 +4975,12 @@ static size_t get_query_stride(D3D12_QUERY_TYPE type) return sizeof(uint64_t); }
-static void STDMETHODCALLTYPE d3d12_command_list_ResolveQueryData(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_ResolveQueryData(ID3D12GraphicsCommandList2 *iface, ID3D12QueryHeap *heap, D3D12_QUERY_TYPE type, UINT start_index, UINT query_count, ID3D12Resource *dst_buffer, UINT64 aligned_dst_buffer_offset) { const struct d3d12_query_heap *query_heap = unsafe_impl_from_ID3D12QueryHeap(heap); - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); struct d3d12_resource *buffer = unsafe_impl_from_ID3D12Resource(dst_buffer); const struct vkd3d_vk_device_procs *vk_procs; unsigned int i, first, count; @@ -5055,10 +5056,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_ResolveQueryData(ID3D12Graphics } }
-static void STDMETHODCALLTYPE d3d12_command_list_SetPredication(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetPredication(ID3D12GraphicsCommandList2 *iface, ID3D12Resource *buffer, UINT64 aligned_buffer_offset, D3D12_PREDICATION_OP operation) { - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); struct d3d12_resource *resource = unsafe_impl_from_ID3D12Resource(buffer); const struct vkd3d_vulkan_info *vk_info = &list->device->vk_info; const struct vkd3d_vk_device_procs *vk_procs; @@ -5127,19 +5128,19 @@ static void STDMETHODCALLTYPE d3d12_command_list_SetPredication(ID3D12GraphicsCo } }
-static void STDMETHODCALLTYPE d3d12_command_list_SetMarker(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetMarker(ID3D12GraphicsCommandList2 *iface, UINT metadata, const void *data, UINT size) { FIXME("iface %p, metadata %#x, data %p, size %u stub!\n", iface, metadata, data, size); }
-static void STDMETHODCALLTYPE d3d12_command_list_BeginEvent(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_BeginEvent(ID3D12GraphicsCommandList2 *iface, UINT metadata, const void *data, UINT size) { FIXME("iface %p, metadata %#x, data %p, size %u stub!\n", iface, metadata, data, size); }
-static void STDMETHODCALLTYPE d3d12_command_list_EndEvent(ID3D12GraphicsCommandList1 *iface) +static void STDMETHODCALLTYPE d3d12_command_list_EndEvent(ID3D12GraphicsCommandList2 *iface) { FIXME("iface %p stub!\n", iface); } @@ -5148,14 +5149,14 @@ STATIC_ASSERT(sizeof(VkDispatchIndirectCommand) == sizeof(D3D12_DISPATCH_ARGUMEN STATIC_ASSERT(sizeof(VkDrawIndexedIndirectCommand) == sizeof(D3D12_DRAW_INDEXED_ARGUMENTS)); STATIC_ASSERT(sizeof(VkDrawIndirectCommand) == sizeof(D3D12_DRAW_ARGUMENTS));
-static void STDMETHODCALLTYPE d3d12_command_list_ExecuteIndirect(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_ExecuteIndirect(ID3D12GraphicsCommandList2 *iface, ID3D12CommandSignature *command_signature, UINT max_command_count, ID3D12Resource *arg_buffer, UINT64 arg_buffer_offset, ID3D12Resource *count_buffer, UINT64 count_buffer_offset) { struct d3d12_command_signature *sig_impl = unsafe_impl_from_ID3D12CommandSignature(command_signature); struct d3d12_resource *count_impl = unsafe_impl_from_ID3D12Resource(count_buffer); struct d3d12_resource *arg_impl = unsafe_impl_from_ID3D12Resource(arg_buffer); - struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface); + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const D3D12_COMMAND_SIGNATURE_DESC *signature_desc; const struct vkd3d_vk_device_procs *vk_procs; unsigned int i; @@ -5254,7 +5255,7 @@ static void STDMETHODCALLTYPE d3d12_command_list_ExecuteIndirect(ID3D12GraphicsC } }
-static void STDMETHODCALLTYPE d3d12_command_list_AtomicCopyBufferUINT(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_AtomicCopyBufferUINT(ID3D12GraphicsCommandList2 *iface, ID3D12Resource *dst_buffer, UINT64 dst_offset, ID3D12Resource *src_buffer, UINT64 src_offset, UINT dependent_resource_count, ID3D12Resource * const *dependent_resources, @@ -5267,7 +5268,7 @@ static void STDMETHODCALLTYPE d3d12_command_list_AtomicCopyBufferUINT(ID3D12Grap dependent_resource_count, dependent_resources, dependent_sub_resource_ranges); }
-static void STDMETHODCALLTYPE d3d12_command_list_AtomicCopyBufferUINT64(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_AtomicCopyBufferUINT64(ID3D12GraphicsCommandList2 *iface, ID3D12Resource *dst_buffer, UINT64 dst_offset, ID3D12Resource *src_buffer, UINT64 src_offset, UINT dependent_resource_count, ID3D12Resource * const *dependent_resources, @@ -5280,20 +5281,20 @@ static void STDMETHODCALLTYPE d3d12_command_list_AtomicCopyBufferUINT64(ID3D12Gr dependent_resource_count, dependent_resources, dependent_sub_resource_ranges); }
-static void STDMETHODCALLTYPE d3d12_command_list_OMSetDepthBounds(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_OMSetDepthBounds(ID3D12GraphicsCommandList2 *iface, FLOAT min, FLOAT max) { FIXME("iface %p, min %.8e, max %.8e stub!\n", iface, min, max); }
-static void STDMETHODCALLTYPE d3d12_command_list_SetSamplePositions(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetSamplePositions(ID3D12GraphicsCommandList2 *iface, UINT sample_count, UINT pixel_count, D3D12_SAMPLE_POSITION *sample_positions) { FIXME("iface %p, sample_count %u, pixel_count %u, sample_positions %p stub!\n", iface, sample_count, pixel_count, sample_positions); }
-static void STDMETHODCALLTYPE d3d12_command_list_ResolveSubresourceRegion(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_ResolveSubresourceRegion(ID3D12GraphicsCommandList2 *iface, ID3D12Resource *dst_resource, UINT dst_sub_resource_idx, UINT dst_x, UINT dst_y, ID3D12Resource *src_resource, UINT src_sub_resource_idx, D3D12_RECT *src_rect, DXGI_FORMAT format, D3D12_RESOLVE_MODE mode) @@ -5305,7 +5306,68 @@ static void STDMETHODCALLTYPE d3d12_command_list_ResolveSubresourceRegion(ID3D12 src_resource, src_sub_resource_idx, src_rect, format, mode); }
-static const struct ID3D12GraphicsCommandList1Vtbl d3d12_command_list_vtbl = +static void STDMETHODCALLTYPE d3d12_command_list_SetViewInstanceMask(ID3D12GraphicsCommandList2 *iface, UINT mask) +{ + FIXME("iface %p, mask %u stub!\n", iface, mask); +} + +static void STDMETHODCALLTYPE d3d12_command_list_WriteBufferImmediate(ID3D12GraphicsCommandList2 *iface, + UINT count, const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *params, + const D3D12_WRITEBUFFERIMMEDIATE_MODE *modes) +{ + struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); + const struct vkd3d_vulkan_info *vk_info = &list->device->vk_info; + const struct vkd3d_vk_device_procs *vk_procs; + struct d3d12_resource *resource; + VkPipelineStageFlagBits stage; + UINT i; + + TRACE("iface %p, count %u, params %p, modes %p.\n", iface, count, params, modes); + + if (!vk_info->AMD_buffer_marker) + { + FIXME("No buffer marker extension found. Command not executed.\n"); + return; + } + + vk_procs = &list->device->vk_procs; + stage = VK_PIPELINE_STAGE_TRANSFER_BIT; + + for (i = 0; i < count; ++i) + { + resource = vkd3d_gpu_va_allocator_dereference(&list->device->gpu_va_allocator, params[i].Dest); + + if (!d3d12_resource_is_buffer(resource)) + { + FIXME("Textures are not supported.\n"); + continue; + } + + if (modes) + { + switch(modes[i]) + { + case D3D12_WRITEBUFFERIMMEDIATE_MODE_MARKER_IN: + FIXME("D3D12_WRITEBUFFERIMMEDIATE_MODE_MARKER_IN not supported; using default.\n"); + /* Fall through. */ + case D3D12_WRITEBUFFERIMMEDIATE_MODE_DEFAULT: + stage = VK_PIPELINE_STAGE_TRANSFER_BIT; + break; + case D3D12_WRITEBUFFERIMMEDIATE_MODE_MARKER_OUT: + stage = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT; + break; + default: + d3d12_command_list_mark_as_invalid(list, "Invalid D3D12_WRITEBUFFERIMMEDIATE_MODE 0x%x.\n", modes[i]); + return; + } + } + + VK_CALL(vkCmdWriteBufferMarkerAMD(list->vk_command_buffer, stage, resource->u.vk_buffer, + params[i].Dest - resource->gpu_address, params[i].Value)); + } +} + +static const struct ID3D12GraphicsCommandList2Vtbl d3d12_command_list_vtbl = { /* IUnknown methods */ d3d12_command_list_QueryInterface, @@ -5378,6 +5440,9 @@ static const struct ID3D12GraphicsCommandList1Vtbl d3d12_command_list_vtbl = d3d12_command_list_OMSetDepthBounds, d3d12_command_list_SetSamplePositions, d3d12_command_list_ResolveSubresourceRegion, + d3d12_command_list_SetViewInstanceMask, + /* ID3D12GraphicsCommandList2 methods */ + d3d12_command_list_WriteBufferImmediate, };
static struct d3d12_command_list *unsafe_impl_from_ID3D12CommandList(ID3D12CommandList *iface) @@ -5385,7 +5450,7 @@ static struct d3d12_command_list *unsafe_impl_from_ID3D12CommandList(ID3D12Comma if (!iface) return NULL; assert(iface->lpVtbl == (struct ID3D12CommandListVtbl *)&d3d12_command_list_vtbl); - return CONTAINING_RECORD(iface, struct d3d12_command_list, ID3D12GraphicsCommandList1_iface); + return CONTAINING_RECORD(iface, struct d3d12_command_list, ID3D12GraphicsCommandList2_iface); }
static HRESULT d3d12_command_list_init(struct d3d12_command_list *list, struct d3d12_device *device, @@ -5394,7 +5459,7 @@ static HRESULT d3d12_command_list_init(struct d3d12_command_list *list, struct d { HRESULT hr;
- list->ID3D12GraphicsCommandList1_iface.lpVtbl = &d3d12_command_list_vtbl; + list->ID3D12GraphicsCommandList2_iface.lpVtbl = &d3d12_command_list_vtbl; list->refcount = 1;
list->type = type; diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 13ebc70..996eda0 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -136,6 +136,8 @@ static const struct vkd3d_optional_extension_info optional_device_extensions[] = VK_EXTENSION(EXT_TEXEL_BUFFER_ALIGNMENT, EXT_texel_buffer_alignment), VK_EXTENSION(EXT_TRANSFORM_FEEDBACK, EXT_transform_feedback), VK_EXTENSION(EXT_VERTEX_ATTRIBUTE_DIVISOR, EXT_vertex_attribute_divisor), + /* AMD extensions */ + VK_EXTENSION(AMD_BUFFER_MARKER, AMD_buffer_marker), };
static unsigned int get_spec_version(const VkExtensionProperties *extensions, @@ -2307,8 +2309,8 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandList(ID3D12Device *if initial_pipeline_state, &object))) return hr;
- return return_interface(&object->ID3D12GraphicsCommandList1_iface, - &IID_ID3D12GraphicsCommandList1, riid, command_list); + return return_interface(&object->ID3D12GraphicsCommandList2_iface, + &IID_ID3D12GraphicsCommandList2, riid, command_list); }
/* Direct3D feature levels restrict which formats can be optionally supported. */ diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index 2d62fda..9cab193 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -110,6 +110,9 @@ struct vkd3d_vulkan_info bool EXT_transform_feedback; bool EXT_vertex_attribute_divisor;
+ /* AMD device extensions */ + bool AMD_buffer_marker; + bool rasterization_stream; bool transform_feedback_queries;
@@ -906,7 +909,7 @@ struct vkd3d_pipeline_bindings /* ID3D12CommandList */ struct d3d12_command_list { - ID3D12GraphicsCommandList1 ID3D12GraphicsCommandList1_iface; + ID3D12GraphicsCommandList2 ID3D12GraphicsCommandList2_iface; LONG refcount;
D3D12_COMMAND_LIST_TYPE type; diff --git a/libs/vkd3d/vulkan_procs.h b/libs/vkd3d/vulkan_procs.h index ec29eb4..68fd097 100644 --- a/libs/vkd3d/vulkan_procs.h +++ b/libs/vkd3d/vulkan_procs.h @@ -106,6 +106,7 @@ VK_DEVICE_PFN(vkCmdSetStencilWriteMask) VK_DEVICE_PFN(vkCmdSetViewport) VK_DEVICE_PFN(vkCmdUpdateBuffer) VK_DEVICE_PFN(vkCmdWaitEvents) +VK_DEVICE_PFN(vkCmdWriteBufferMarkerAMD) VK_DEVICE_PFN(vkCmdWriteTimestamp) VK_DEVICE_PFN(vkCreateBuffer) VK_DEVICE_PFN(vkCreateBufferView)
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- tests/d3d12.c | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c index 858cf99..95e3a16 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -32306,6 +32306,99 @@ static void test_bufinfo_instruction(void) destroy_test_context(&context); }
+static void test_write_buffer_immediate(void) +{ + D3D12_WRITEBUFFERIMMEDIATE_PARAMETER params[2]; + ID3D12GraphicsCommandList2 *command_list2; + D3D12_WRITEBUFFERIMMEDIATE_MODE modes[2]; + ID3D12GraphicsCommandList *command_list; + ID3D12CommandAllocator *allocator; + struct resource_readback rb; + ID3D12CommandQueue *queue; + ID3D12Resource *buffer; + ID3D12Device *device; + unsigned int value; + HRESULT hr; + + static const unsigned int data_values[] = {0xdeadbeef, 0xf00baa}; + + hr = D3D12CreateDevice(NULL, D3D_FEATURE_LEVEL_11_0, &IID_ID3D12Device, (void **)&device); + ok(hr == S_OK, "Failed to create device, hr %#x.\n", hr); + + queue = create_command_queue(device, D3D12_COMMAND_LIST_TYPE_DIRECT, D3D12_COMMAND_QUEUE_PRIORITY_NORMAL); + + hr = ID3D12Device_CreateCommandAllocator(device, D3D12_COMMAND_LIST_TYPE_DIRECT, + &IID_ID3D12CommandAllocator, (void **)&allocator); + ok(SUCCEEDED(hr), "Failed to create command allocator, hr %#x.\n", hr); + + hr = ID3D12Device_CreateCommandList(device, 0, D3D12_COMMAND_LIST_TYPE_DIRECT, + allocator, NULL, &IID_ID3D12GraphicsCommandList2, (void **)&command_list); + if (FAILED(hr)) + { + skip("ID3D12GraphicsCommandList2 not implemented.\n"); + goto done; + } + command_list2 = (ID3D12GraphicsCommandList2 *)command_list; + + buffer = create_default_buffer(device, sizeof(data_values), + D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_COPY_DEST); + upload_buffer_data(buffer, 0, sizeof(data_values), data_values, queue, command_list); + reset_command_list(command_list, allocator); + + params[0].Dest = ID3D12Resource_GetGPUVirtualAddress(buffer); + params[0].Value = 0x1020304; + params[1].Dest = params[0].Dest + sizeof(data_values[0]); + params[1].Value = 0xc0d0e0f; + ID3D12GraphicsCommandList2_WriteBufferImmediate(command_list2, ARRAY_SIZE(params), params, NULL); + hr = ID3D12GraphicsCommandList_Close(command_list); + ok(SUCCEEDED(hr), "Failed to close command list, hr %#x.\n", hr); + if (FAILED(hr)) + goto done1; + exec_command_list(queue, command_list); + wait_queue_idle(device, queue); + reset_command_list(command_list, allocator); + + get_buffer_readback_with_command_list(buffer, DXGI_FORMAT_R32_UINT, &rb, queue, command_list); + value = get_readback_uint(&rb, 0, 0, 0); + ok(value == params[0].Value, "Got unexpected readback 0x%#x.\n", value); + value = get_readback_uint(&rb, 1, 0, 0); + ok(value == params[1].Value, "Got unexpected readback 0x%#x.\n", value); + release_resource_readback(&rb); + reset_command_list(command_list, allocator); + + params[0].Value = 0x2030405; + params[1].Value = 0xb0c0d0e; + modes[0] = D3D12_WRITEBUFFERIMMEDIATE_MODE_MARKER_IN; + modes[1] = D3D12_WRITEBUFFERIMMEDIATE_MODE_MARKER_OUT; + ID3D12GraphicsCommandList2_WriteBufferImmediate(command_list2, ARRAY_SIZE(params), params, modes); + hr = ID3D12GraphicsCommandList_Close(command_list); + ok(SUCCEEDED(hr), "Failed to close command list, hr %#x.\n", hr); + exec_command_list(queue, command_list); + wait_queue_idle(device, queue); + reset_command_list(command_list, allocator); + + get_buffer_readback_with_command_list(buffer, DXGI_FORMAT_R32_UINT, &rb, queue, command_list); + value = get_readback_uint(&rb, 0, 0, 0); + ok(value == params[0].Value, "Got unexpected readback 0x%#x.\n", value); + value = get_readback_uint(&rb, 1, 0, 0); + ok(value == params[1].Value, "Got unexpected readback 0x%#x.\n", value); + release_resource_readback(&rb); + reset_command_list(command_list, allocator); + + modes[0] = 0x7FFFFFFF; + ID3D12GraphicsCommandList2_WriteBufferImmediate(command_list2, ARRAY_SIZE(params), params, modes); + hr = ID3D12GraphicsCommandList_Close(command_list); + ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %#x.\n", hr); + +done1: + ID3D12Resource_Release(buffer); + ID3D12GraphicsCommandList2_Release(command_list2); +done: + ID3D12CommandAllocator_Release(allocator); + ID3D12CommandQueue_Release(queue); + ID3D12Device_Release(device); +} + START_TEST(d3d12) { parse_args(argc, argv); @@ -32468,4 +32561,5 @@ START_TEST(d3d12) run_test(test_early_depth_stencil_tests); run_test(test_conditional_rendering); run_test(test_bufinfo_instruction); + run_test(test_write_buffer_immediate); }
Allows memory info to be sent to Wine DXGI.
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- include/vkd3d.h | 14 ++++++++++++++ libs/vkd3d/command.c | 5 +++-- libs/vkd3d/device.c | 32 +++++++++++++++++++++++++++++++- libs/vkd3d/resource.c | 20 ++++++++++++++++++-- libs/vkd3d/vkd3d_private.h | 18 ++++++++++++++++++ 5 files changed, 84 insertions(+), 5 deletions(-)
diff --git a/include/vkd3d.h b/include/vkd3d.h index e2d9ec8..e694253 100644 --- a/include/vkd3d.h +++ b/include/vkd3d.h @@ -48,6 +48,9 @@ enum vkd3d_structure_type VKD3D_STRUCTURE_TYPE_OPTIONAL_DEVICE_EXTENSIONS_INFO, VKD3D_STRUCTURE_TYPE_APPLICATION_INFO,
+ /* 1.3 */ + VKD3D_STRUCTURE_TYPE_OPTIONAL_DEVICE_CALLBACK_INFO, + VKD3D_FORCE_32_BIT_ENUM(VKD3D_STRUCTURE_TYPE), };
@@ -129,6 +132,17 @@ struct vkd3d_optional_device_extensions_info uint32_t extension_count; };
+typedef interface IWineDXGIAdapter IWineDXGIAdapter; + +struct vkd3d_optional_device_callback_info +{ + enum vkd3d_structure_type type; + const void *next; + + void (STDMETHODCALLTYPE *pfn_memory_usage_callback)(IWineDXGIAdapter *adapter, + unsigned int non_local, UINT64 total, UINT64 usage); +}; + /* vkd3d_image_resource_create_info flags */ #define VKD3D_RESOURCE_INITIAL_STATE_TRANSITION 0x00000001 #define VKD3D_RESOURCE_PRESENT_STATE_TRANSITION 0x00000002 diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index 12b773e..f3a09cf 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -1418,6 +1418,7 @@ static void vkd3d_buffer_destroy(struct vkd3d_buffer *buffer, struct d3d12_devic
VK_CALL(vkFreeMemory(device->vk_device, buffer->vk_memory, NULL)); VK_CALL(vkDestroyBuffer(device->vk_device, buffer->vk_buffer, NULL)); + d3d12_device_update_memory_usage(device, buffer->vk_memory_type, -(int64_t)buffer->vk_memory_size); }
static void d3d12_command_allocator_free_resources(struct d3d12_command_allocator *allocator, @@ -3199,8 +3200,8 @@ static HRESULT d3d12_command_list_allocate_transfer_buffer(struct d3d12_command_ if (FAILED(hr = vkd3d_create_buffer(device, &heap_properties, D3D12_HEAP_FLAG_NONE, &buffer_desc, &buffer->vk_buffer))) return hr; - if (FAILED(hr = vkd3d_allocate_buffer_memory(device, buffer->vk_buffer, - &heap_properties, D3D12_HEAP_FLAG_NONE, &buffer->vk_memory, NULL, NULL))) + if (FAILED(hr = vkd3d_allocate_buffer_memory(device, buffer->vk_buffer, &heap_properties, + D3D12_HEAP_FLAG_NONE, &buffer->vk_memory, &buffer->vk_memory_type, &buffer->vk_memory_size))) { VK_CALL(vkDestroyBuffer(device->vk_device, buffer->vk_buffer, NULL)); return hr; diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 996eda0..47c3745 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -1684,6 +1684,20 @@ static HRESULT vkd3d_select_queues(const struct vkd3d_instance *vkd3d_instance, return S_OK; }
+static uint64_t vkd3d_compute_total_device_memory(struct d3d12_device *device, VkMemoryHeapFlags local_flag) +{ + uint64_t total = 0; + uint32_t i; + + for (i = 0; i < device->memory_properties.memoryHeapCount; ++i) + { + const VkMemoryHeap *heap = &device->memory_properties.memoryHeaps[i]; + if ((heap->flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) == local_flag) + total += heap->size; + } + return total; +} + static HRESULT vkd3d_create_vk_device(struct d3d12_device *device, const struct vkd3d_device_create_info *create_info) { @@ -1722,6 +1736,10 @@ static HRESULT vkd3d_create_vk_device(struct d3d12_device *device, device_queue_info.family_index[VKD3D_QUEUE_FAMILY_TRANSFER]);
VK_CALL(vkGetPhysicalDeviceMemoryProperties(physical_device, &device->memory_properties)); + device->memory_total[0] = vkd3d_compute_total_device_memory(device, VK_MEMORY_HEAP_DEVICE_LOCAL_BIT); + device->memory_total[1] = vkd3d_compute_total_device_memory(device, 0); + device->memory_usage[0] = 0; + device->memory_usage[1] = 0;
vkd3d_physical_device_info_init(&physical_device_info, device);
@@ -3370,6 +3388,7 @@ struct d3d12_device *unsafe_impl_from_ID3D12Device(ID3D12Device *iface) static HRESULT d3d12_device_init(struct d3d12_device *device, struct vkd3d_instance *instance, const struct vkd3d_device_create_info *create_info) { + const struct vkd3d_optional_device_callback_info *optional_callback; const struct vkd3d_vk_device_procs *vk_procs; HRESULT hr; size_t i; @@ -3387,6 +3406,17 @@ static HRESULT d3d12_device_init(struct d3d12_device *device,
device->vk_device = VK_NULL_HANDLE;
+ device->parent = create_info->parent; + + device->pfn_memory_usage_callback = NULL; + optional_callback = vkd3d_find_struct(create_info->next, OPTIONAL_DEVICE_CALLBACK_INFO); + if (optional_callback) + { + device->pfn_memory_usage_callback = optional_callback->pfn_memory_usage_callback; + if (device->pfn_memory_usage_callback) + TRACE("Found memory callback function %p.\n", device->pfn_memory_usage_callback); + } + if (FAILED(hr = vkd3d_create_vk_device(device, create_info))) goto out_free_instance;
@@ -3411,7 +3441,7 @@ static HRESULT d3d12_device_init(struct d3d12_device *device, for (i = 0; i < ARRAY_SIZE(device->desc_mutex); ++i) pthread_mutex_init(&device->desc_mutex[i], NULL);
- if ((device->parent = create_info->parent)) + if (device->parent) IUnknown_AddRef(device->parent);
return S_OK; diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index d6e999e..00abc88 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -170,6 +170,7 @@ HRESULT vkd3d_allocate_buffer_memory(struct d3d12_device *device, VkBuffer vk_bu VkMemoryRequirements2 memory_requirements2; VkMemoryRequirements *memory_requirements; VkBufferMemoryRequirementsInfo2 info; + uint32_t type; VkResult vr; HRESULT hr;
@@ -205,7 +206,7 @@ HRESULT vkd3d_allocate_buffer_memory(struct d3d12_device *device, VkBuffer vk_bu }
if (FAILED(hr = vkd3d_allocate_device_memory(device, heap_properties, heap_flags, - memory_requirements, dedicated_allocation, vk_memory, vk_memory_type))) + memory_requirements, dedicated_allocation, vk_memory, &type))) return hr;
if ((vr = VK_CALL(vkBindBufferMemory(device->vk_device, vk_buffer, *vk_memory, 0))) < 0) @@ -215,6 +216,10 @@ HRESULT vkd3d_allocate_buffer_memory(struct d3d12_device *device, VkBuffer vk_bu *vk_memory = VK_NULL_HANDLE; }
+ d3d12_device_update_memory_usage(device, type, memory_requirements->size); + + if (vk_memory_type) + *vk_memory_type = type; if (vk_memory_size) *vk_memory_size = memory_requirements->size;
@@ -232,6 +237,7 @@ static HRESULT vkd3d_allocate_image_memory(struct d3d12_device *device, VkImage VkMemoryRequirements2 memory_requirements2; VkMemoryRequirements *memory_requirements; VkImageMemoryRequirementsInfo2 info; + uint32_t type; VkResult vr; HRESULT hr;
@@ -267,7 +273,7 @@ static HRESULT vkd3d_allocate_image_memory(struct d3d12_device *device, VkImage }
if (FAILED(hr = vkd3d_allocate_device_memory(device, heap_properties, heap_flags, - memory_requirements, dedicated_allocation, vk_memory, vk_memory_type))) + memory_requirements, dedicated_allocation, vk_memory, &type))) return hr;
if ((vr = VK_CALL(vkBindImageMemory(device->vk_device, vk_image, *vk_memory, 0))) < 0) @@ -278,6 +284,10 @@ static HRESULT vkd3d_allocate_image_memory(struct d3d12_device *device, VkImage return hresult_from_vk_result(vr); }
+ d3d12_device_update_memory_usage(device, type, memory_requirements->size); + + if (vk_memory_type) + *vk_memory_type = type; if (vk_memory_size) *vk_memory_size = memory_requirements->size;
@@ -343,7 +353,10 @@ static void d3d12_heap_destroy(struct d3d12_heap *heap) vkd3d_free(heap);
if (device) + { + d3d12_device_update_memory_usage(device, heap->vk_memory_type, -(INT64)heap->desc.SizeInBytes); d3d12_device_release(device); + } }
static ULONG STDMETHODCALLTYPE d3d12_heap_Release(ID3D12Heap *iface) @@ -641,6 +654,9 @@ static HRESULT d3d12_heap_init(struct d3d12_heap *heap, hr = vkd3d_allocate_device_memory(device, &heap->desc.Properties, heap->desc.Flags, &memory_requirements, NULL, &heap->vk_memory, &heap->vk_memory_type); + + if (SUCCEEDED(hr)) + d3d12_device_update_memory_usage(device, heap->vk_memory_type, memory_requirements.size); } if (FAILED(hr)) { diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index 9cab193..10a202b 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -817,6 +817,8 @@ struct vkd3d_buffer { VkBuffer vk_buffer; VkDeviceMemory vk_memory; + VkDeviceSize vk_memory_size; + uint32_t vk_memory_type; };
/* ID3D12CommandAllocator */ @@ -1075,6 +1077,9 @@ struct d3d12_device VkPipelineCache vk_pipeline_cache;
VkPhysicalDeviceMemoryProperties memory_properties; + uint64_t memory_total[2]; + uint64_t memory_usage[2]; + void (STDMETHODCALLTYPE *pfn_memory_usage_callback)(IWineDXGIAdapter *adapter, unsigned int non_local, UINT64 total, UINT64 usage);
D3D12_FEATURE_DATA_D3D12_OPTIONS feature_options;
@@ -1143,6 +1148,19 @@ static inline pthread_mutex_t *d3d12_device_get_descriptor_mutex(struct d3d12_de return &device->desc_mutex[idx & (ARRAY_SIZE(device->desc_mutex) - 1)]; }
+static inline void d3d12_device_update_memory_usage(struct d3d12_device *device, uint32_t vk_memory_type, int64_t change) +{ + unsigned int non_local = !(device->memory_properties.memoryTypes[vk_memory_type].propertyFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); + device->memory_usage[non_local] += change; + if (device->memory_usage[non_local] > device->memory_total[non_local]) + WARN("Current type %u usage estimate 0x%"PRIx64" exceeds 0x%"PRIx64" available.\n", + vk_memory_type, device->memory_usage[non_local], device->memory_total[non_local]); + + if (device->pfn_memory_usage_callback) + device->pfn_memory_usage_callback((IWineDXGIAdapter *)device->parent, non_local, + device->memory_total[non_local], device->memory_usage[non_local]); +} + /* utils */ enum vkd3d_format_type {
On Fri, 8 Nov 2019 at 18:10, Conor McCarthy cmccarthy@codeweavers.com wrote:
@@ -48,6 +48,9 @@ enum vkd3d_structure_type VKD3D_STRUCTURE_TYPE_OPTIONAL_DEVICE_EXTENSIONS_INFO, VKD3D_STRUCTURE_TYPE_APPLICATION_INFO,
- /* 1.3 */
- VKD3D_STRUCTURE_TYPE_OPTIONAL_DEVICE_CALLBACK_INFO,
vkd3d-1.2 is unreleased, so this should be part of 1.2.
+typedef interface IWineDXGIAdapter IWineDXGIAdapter;
+struct vkd3d_optional_device_callback_info +{
- enum vkd3d_structure_type type;
- const void *next;
- void (STDMETHODCALLTYPE *pfn_memory_usage_callback)(IWineDXGIAdapter *adapter,
unsigned int non_local, UINT64 total, UINT64 usage);
+};
Vkd3d shouldn't have Wine specific interfaces. In this specific case, it's of course also entirely unnecessary for this to take a IWineDXGIAdapter.
Hello,
is it really necessary to use the AMD extension here?
Maybe I'm overlooking something, but looking at the MSDN docs, it should be possible to make a vendor-neutral implementation using core Vulkan functionality (vkCmdUpdateBuffer), and to also support the in/out modes via barriers:
VkPipelineStageFlags src_stages = 0;
for (i = 0; i < Count; i++) { if (pParams[i].Mode == MODE_MARKER_IN) src_stages |= TOP_OF_PIPE_BIT; else if (pParams[i].Mode == MODE_MARKER_OUT) src_stages |= BOTTOM_OF_PIPE_BIT; }
if (src_stages) memory_barrier(src_stages, TRANSFER_BIT);
for (i = 0; i < Count; i++) { update_buffer(...)
- Philip
Am 08.11.19 um 15:38 schrieb Conor McCarthy:
A stub for ID3D12GraphicsCommandList1::SetViewInstanceMask() is also added to fill out the Vtable. WriteBufferImmediate() is implemented on top of extension VK_AMD_buffer_marker, added in Mesa 19.2.0. It is still not implemented for Nvidia. Doing so using buffer copy commands would be non-trivial.
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com
include/vkd3d_d3d12.idl | 27 ++++ libs/vkd3d/command.c | 315 ++++++++++++++++++++++--------------- libs/vkd3d/device.c | 6 +- libs/vkd3d/vkd3d_private.h | 5 +- libs/vkd3d/vulkan_procs.h | 1 + 5 files changed, 226 insertions(+), 128 deletions(-)
diff --git a/include/vkd3d_d3d12.idl b/include/vkd3d_d3d12.idl index ec8b83d..8246424 100644 --- a/include/vkd3d_d3d12.idl +++ b/include/vkd3d_d3d12.idl @@ -1820,6 +1820,19 @@ typedef enum D3D12_PREDICATION_OP D3D12_PREDICATION_OP_NOT_EQUAL_ZERO = 1, } D3D12_PREDICATION_OP;
+typedef struct D3D12_WRITEBUFFERIMMEDIATE_PARAMETER +{
- D3D12_GPU_VIRTUAL_ADDRESS Dest;
- UINT32 Value;
+} D3D12_WRITEBUFFERIMMEDIATE_PARAMETER;
+typedef enum D3D12_WRITEBUFFERIMMEDIATE_MODE +{
- D3D12_WRITEBUFFERIMMEDIATE_MODE_DEFAULT = 0,
- D3D12_WRITEBUFFERIMMEDIATE_MODE_MARKER_IN = 1,
- D3D12_WRITEBUFFERIMMEDIATE_MODE_MARKER_OUT = 2,
+} D3D12_WRITEBUFFERIMMEDIATE_MODE;
- [ uuid(8efb471d-616c-4f49-90f7-127bb763fa51), object,
@@ -2000,6 +2013,20 @@ interface ID3D12GraphicsCommandList1 : ID3D12GraphicsCommandList UINT dst_sub_resource_idx, UINT dst_x, UINT dst_y, ID3D12Resource *src_resource, UINT src_sub_resource_idx, D3D12_RECT *src_rect, DXGI_FORMAT format, D3D12_RESOLVE_MODE mode);
- void SetViewInstanceMask(UINT mask);
+}
+[
- uuid(38c3e585-ff17-412c-9150-4fc6f9d72a28),
- object,
- local,
- pointer_default(unique)
+] +interface ID3D12GraphicsCommandList2 : ID3D12GraphicsCommandList1 +{
void WriteBufferImmediate(UINT count, const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *params,
const D3D12_WRITEBUFFERIMMEDIATE_MODE *modes);
}
typedef enum D3D12_TILE_RANGE_FLAGS
diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index 0532ec0..12b773e 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -1807,9 +1807,9 @@ HRESULT d3d12_command_allocator_create(struct d3d12_device *device, }
/* ID3D12CommandList */ -static inline struct d3d12_command_list *impl_from_ID3D12GraphicsCommandList1(ID3D12GraphicsCommandList1 *iface) +static inline struct d3d12_command_list *impl_from_ID3D12GraphicsCommandList2(ID3D12GraphicsCommandList2 *iface) {
- return CONTAINING_RECORD(iface, struct d3d12_command_list, ID3D12GraphicsCommandList1_iface);
return CONTAINING_RECORD(iface, struct d3d12_command_list, ID3D12GraphicsCommandList2_iface); }
static void d3d12_command_list_invalidate_current_framebuffer(struct d3d12_command_list *list)
@@ -2146,19 +2146,20 @@ static void d3d12_command_list_track_resource_usage(struct d3d12_command_list *l } }
-static HRESULT STDMETHODCALLTYPE d3d12_command_list_QueryInterface(ID3D12GraphicsCommandList1 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_command_list_QueryInterface(ID3D12GraphicsCommandList2 *iface, REFIID iid, void **object) { TRACE("iface %p, iid %s, object %p.\n", iface, debugstr_guid(iid), object);
- if (IsEqualGUID(iid, &IID_ID3D12GraphicsCommandList1)
- if (IsEqualGUID(iid, &IID_ID3D12GraphicsCommandList2)
|| IsEqualGUID(iid, &IID_ID3D12GraphicsCommandList1) || IsEqualGUID(iid, &IID_ID3D12GraphicsCommandList) || IsEqualGUID(iid, &IID_ID3D12CommandList) || IsEqualGUID(iid, &IID_ID3D12DeviceChild) || IsEqualGUID(iid, &IID_ID3D12Object) || IsEqualGUID(iid, &IID_IUnknown)) {
ID3D12GraphicsCommandList1_AddRef(iface);
ID3D12GraphicsCommandList2_AddRef(iface); *object = iface; return S_OK; }
@@ -2169,9 +2170,9 @@ static HRESULT STDMETHODCALLTYPE d3d12_command_list_QueryInterface(ID3D12Graphic return E_NOINTERFACE; }
-static ULONG STDMETHODCALLTYPE d3d12_command_list_AddRef(ID3D12GraphicsCommandList1 *iface) +static ULONG STDMETHODCALLTYPE d3d12_command_list_AddRef(ID3D12GraphicsCommandList2 *iface) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); ULONG refcount = InterlockedIncrement(&list->refcount);
TRACE("%p increasing refcount to %u.\n", list, refcount);
@@ -2179,9 +2180,9 @@ static ULONG STDMETHODCALLTYPE d3d12_command_list_AddRef(ID3D12GraphicsCommandLi return refcount; }
-static ULONG STDMETHODCALLTYPE d3d12_command_list_Release(ID3D12GraphicsCommandList1 *iface) +static ULONG STDMETHODCALLTYPE d3d12_command_list_Release(ID3D12GraphicsCommandList2 *iface) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); ULONG refcount = InterlockedDecrement(&list->refcount);
TRACE("%p decreasing refcount to %u.\n", list, refcount);
@@ -2204,66 +2205,66 @@ static ULONG STDMETHODCALLTYPE d3d12_command_list_Release(ID3D12GraphicsCommandL return refcount; }
-static HRESULT STDMETHODCALLTYPE d3d12_command_list_GetPrivateData(ID3D12GraphicsCommandList1 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_command_list_GetPrivateData(ID3D12GraphicsCommandList2 *iface, REFGUID guid, UINT *data_size, void *data) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
return vkd3d_get_private_data(&list->private_store, guid, data_size, data); }
-static HRESULT STDMETHODCALLTYPE d3d12_command_list_SetPrivateData(ID3D12GraphicsCommandList1 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_command_list_SetPrivateData(ID3D12GraphicsCommandList2 *iface, REFGUID guid, UINT data_size, const void *data) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
return vkd3d_set_private_data(&list->private_store, guid, data_size, data); }
-static HRESULT STDMETHODCALLTYPE d3d12_command_list_SetPrivateDataInterface(ID3D12GraphicsCommandList1 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_command_list_SetPrivateDataInterface(ID3D12GraphicsCommandList2 *iface, REFGUID guid, const IUnknown *data) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
return vkd3d_set_private_data_interface(&list->private_store, guid, data); }
-static HRESULT STDMETHODCALLTYPE d3d12_command_list_SetName(ID3D12GraphicsCommandList1 *iface, const WCHAR *name) +static HRESULT STDMETHODCALLTYPE d3d12_command_list_SetName(ID3D12GraphicsCommandList2 *iface, const WCHAR *name) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, name %s.\n", iface, debugstr_w(name, list->device->wchar_size));
return name ? S_OK : E_INVALIDARG; }
-static HRESULT STDMETHODCALLTYPE d3d12_command_list_GetDevice(ID3D12GraphicsCommandList1 *iface, REFIID iid, void **device) +static HRESULT STDMETHODCALLTYPE d3d12_command_list_GetDevice(ID3D12GraphicsCommandList2 *iface, REFIID iid, void **device) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, iid %s, device %p.\n", iface, debugstr_guid(iid), device);
return d3d12_device_query_interface(list->device, iid, device); }
-static D3D12_COMMAND_LIST_TYPE STDMETHODCALLTYPE d3d12_command_list_GetType(ID3D12GraphicsCommandList1 *iface) +static D3D12_COMMAND_LIST_TYPE STDMETHODCALLTYPE d3d12_command_list_GetType(ID3D12GraphicsCommandList2 *iface) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p.\n", iface);
return list->type; }
-static HRESULT STDMETHODCALLTYPE d3d12_command_list_Close(ID3D12GraphicsCommandList1 *iface) +static HRESULT STDMETHODCALLTYPE d3d12_command_list_Close(ID3D12GraphicsCommandList2 *iface) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct vkd3d_vk_device_procs *vk_procs; VkResult vr;
@@ -2307,7 +2308,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_command_list_Close(ID3D12GraphicsCommandL static void d3d12_command_list_reset_state(struct d3d12_command_list *list, ID3D12PipelineState *initial_pipeline_state) {
- ID3D12GraphicsCommandList1 *iface = &list->ID3D12GraphicsCommandList1_iface;
ID3D12GraphicsCommandList2 *iface = &list->ID3D12GraphicsCommandList2_iface;
memset(list->strides, 0, sizeof(list->strides)); list->primitive_topology = D3D_PRIMITIVE_TOPOLOGY_POINTLIST;
@@ -2337,14 +2338,14 @@ static void d3d12_command_list_reset_state(struct d3d12_command_list *list, memset(list->so_counter_buffers, 0, sizeof(list->so_counter_buffers)); memset(list->so_counter_buffer_offsets, 0, sizeof(list->so_counter_buffer_offsets));
- ID3D12GraphicsCommandList1_SetPipelineState(iface, initial_pipeline_state);
- ID3D12GraphicsCommandList2_SetPipelineState(iface, initial_pipeline_state); }
-static HRESULT STDMETHODCALLTYPE d3d12_command_list_Reset(ID3D12GraphicsCommandList1 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_command_list_Reset(ID3D12GraphicsCommandList2 *iface, ID3D12CommandAllocator *allocator, ID3D12PipelineState *initial_pipeline_state) { struct d3d12_command_allocator *allocator_impl = unsafe_impl_from_ID3D12CommandAllocator(allocator);
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); HRESULT hr;
TRACE("iface %p, allocator %p, initial_pipeline_state %p.\n",
@@ -2371,7 +2372,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_command_list_Reset(ID3D12GraphicsCommandL return hr; }
-static HRESULT STDMETHODCALLTYPE d3d12_command_list_ClearState(ID3D12GraphicsCommandList1 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_command_list_ClearState(ID3D12GraphicsCommandList2 *iface, ID3D12PipelineState *pipeline_state) { FIXME("iface %p, pipline_state %p stub!\n", iface, pipeline_state); @@ -2949,11 +2950,11 @@ static void d3d12_command_list_check_index_buffer_strip_cut_value(struct d3d12_c } }
-static void STDMETHODCALLTYPE d3d12_command_list_DrawInstanced(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_DrawInstanced(ID3D12GraphicsCommandList2 *iface, UINT vertex_count_per_instance, UINT instance_count, UINT start_vertex_location, UINT start_instance_location) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct vkd3d_vk_device_procs *vk_procs;
TRACE("iface %p, vertex_count_per_instance %u, instance_count %u, "
@@ -2973,11 +2974,11 @@ static void STDMETHODCALLTYPE d3d12_command_list_DrawInstanced(ID3D12GraphicsCom instance_count, start_vertex_location, start_instance_location)); }
-static void STDMETHODCALLTYPE d3d12_command_list_DrawIndexedInstanced(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_DrawIndexedInstanced(ID3D12GraphicsCommandList2 *iface, UINT index_count_per_instance, UINT instance_count, UINT start_vertex_location, INT base_vertex_location, UINT start_instance_location) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct vkd3d_vk_device_procs *vk_procs;
TRACE("iface %p, index_count_per_instance %u, instance_count %u, start_vertex_location %u, "
@@ -2999,10 +3000,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_DrawIndexedInstanced(ID3D12Grap instance_count, start_vertex_location, base_vertex_location, start_instance_location)); }
-static void STDMETHODCALLTYPE d3d12_command_list_Dispatch(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_Dispatch(ID3D12GraphicsCommandList2 *iface, UINT x, UINT y, UINT z) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct vkd3d_vk_device_procs *vk_procs;
TRACE("iface %p, x %u, y %u, z %u.\n", iface, x, y, z);
@@ -3022,10 +3023,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_Dispatch(ID3D12GraphicsCommandL VK_CALL(vkCmdDispatch(list->vk_command_buffer, x, y, z)); }
-static void STDMETHODCALLTYPE d3d12_command_list_CopyBufferRegion(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_CopyBufferRegion(ID3D12GraphicsCommandList2 *iface, ID3D12Resource *dst, UINT64 dst_offset, ID3D12Resource *src, UINT64 src_offset, UINT64 byte_count) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); struct d3d12_resource *dst_resource, *src_resource; const struct vkd3d_vk_device_procs *vk_procs; VkBufferCopy buffer_copy;
@@ -3305,11 +3306,11 @@ static bool validate_d3d12_box(const D3D12_BOX *box) && box->back > box->front; }
-static void STDMETHODCALLTYPE d3d12_command_list_CopyTextureRegion(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_CopyTextureRegion(ID3D12GraphicsCommandList2 *iface, const D3D12_TEXTURE_COPY_LOCATION *dst, UINT dst_x, UINT dst_y, UINT dst_z, const D3D12_TEXTURE_COPY_LOCATION *src, const D3D12_BOX *src_box) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); struct d3d12_resource *dst_resource, *src_resource; const struct vkd3d_format *src_format, *dst_format; const struct vkd3d_vk_device_procs *vk_procs;
@@ -3440,10 +3441,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_CopyTextureRegion(ID3D12Graphic } }
-static void STDMETHODCALLTYPE d3d12_command_list_CopyResource(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_CopyResource(ID3D12GraphicsCommandList2 *iface, ID3D12Resource *dst, ID3D12Resource *src) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); struct d3d12_resource *dst_resource, *src_resource; const struct vkd3d_format *src_format, *dst_format; const struct vkd3d_vk_device_procs *vk_procs;
@@ -3510,7 +3511,7 @@ static void STDMETHODCALLTYPE d3d12_command_list_CopyResource(ID3D12GraphicsComm } }
-static void STDMETHODCALLTYPE d3d12_command_list_CopyTiles(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_CopyTiles(ID3D12GraphicsCommandList2 *iface, ID3D12Resource *tiled_resource, const D3D12_TILED_RESOURCE_COORDINATE *tile_region_start_coordinate, const D3D12_TILE_REGION_SIZE *tile_region_size, ID3D12Resource *buffer, UINT64 buffer_offset, D3D12_TILE_COPY_FLAGS flags) @@ -3521,11 +3522,11 @@ static void STDMETHODCALLTYPE d3d12_command_list_CopyTiles(ID3D12GraphicsCommand buffer, buffer_offset, flags); }
-static void STDMETHODCALLTYPE d3d12_command_list_ResolveSubresource(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_ResolveSubresource(ID3D12GraphicsCommandList2 *iface, ID3D12Resource *dst, UINT dst_sub_resource_idx, ID3D12Resource *src, UINT src_sub_resource_idx, DXGI_FORMAT format) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct vkd3d_format *src_format, *dst_format, *vk_format; struct d3d12_resource *dst_resource, *src_resource; const struct vkd3d_vk_device_procs *vk_procs;
@@ -3596,10 +3597,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_ResolveSubresource(ID3D12Graphi VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, &vk_image_resolve)); }
-static void STDMETHODCALLTYPE d3d12_command_list_IASetPrimitiveTopology(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_IASetPrimitiveTopology(ID3D12GraphicsCommandList2 *iface, D3D12_PRIMITIVE_TOPOLOGY topology) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, topology %#x.\n", iface, topology);
@@ -3616,11 +3617,11 @@ static void STDMETHODCALLTYPE d3d12_command_list_IASetPrimitiveTopology(ID3D12Gr d3d12_command_list_invalidate_current_pipeline(list); }
-static void STDMETHODCALLTYPE d3d12_command_list_RSSetViewports(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_RSSetViewports(ID3D12GraphicsCommandList2 *iface, UINT viewport_count, const D3D12_VIEWPORT *viewports) { VkViewport vk_viewports[D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE];
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct vkd3d_vk_device_procs *vk_procs; unsigned int i;
@@ -3652,10 +3653,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_RSSetViewports(ID3D12GraphicsCo VK_CALL(vkCmdSetViewport(list->vk_command_buffer, 0, viewport_count, vk_viewports)); }
-static void STDMETHODCALLTYPE d3d12_command_list_RSSetScissorRects(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_RSSetScissorRects(ID3D12GraphicsCommandList2 *iface, UINT rect_count, const D3D12_RECT *rects) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); VkRect2D vk_rects[D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE]; const struct vkd3d_vk_device_procs *vk_procs; unsigned int i;
@@ -3680,10 +3681,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_RSSetScissorRects(ID3D12Graphic VK_CALL(vkCmdSetScissor(list->vk_command_buffer, 0, rect_count, vk_rects)); }
-static void STDMETHODCALLTYPE d3d12_command_list_OMSetBlendFactor(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_OMSetBlendFactor(ID3D12GraphicsCommandList2 *iface, const FLOAT blend_factor[4]) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct vkd3d_vk_device_procs *vk_procs;
TRACE("iface %p, blend_factor %p.\n", iface, blend_factor);
@@ -3692,10 +3693,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_OMSetBlendFactor(ID3D12Graphics VK_CALL(vkCmdSetBlendConstants(list->vk_command_buffer, blend_factor)); }
-static void STDMETHODCALLTYPE d3d12_command_list_OMSetStencilRef(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_OMSetStencilRef(ID3D12GraphicsCommandList2 *iface, UINT stencil_ref) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct vkd3d_vk_device_procs *vk_procs;
TRACE("iface %p, stencil_ref %u.\n", iface, stencil_ref);
@@ -3704,11 +3705,11 @@ static void STDMETHODCALLTYPE d3d12_command_list_OMSetStencilRef(ID3D12GraphicsC VK_CALL(vkCmdSetStencilReference(list->vk_command_buffer, VK_STENCIL_FRONT_AND_BACK, stencil_ref)); }
-static void STDMETHODCALLTYPE d3d12_command_list_SetPipelineState(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetPipelineState(ID3D12GraphicsCommandList2 *iface, ID3D12PipelineState *pipeline_state) { struct d3d12_pipeline_state *state = unsafe_impl_from_ID3D12PipelineState(pipeline_state);
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct vkd3d_vk_device_procs *vk_procs;
TRACE("iface %p, pipeline_state %p.\n", iface, pipeline_state);
@@ -3770,10 +3771,10 @@ static unsigned int d3d12_find_ds_multiplanar_transition(const D3D12_RESOURCE_BA return 0; }
-static void STDMETHODCALLTYPE d3d12_command_list_ResourceBarrier(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_ResourceBarrier(ID3D12GraphicsCommandList2 *iface, UINT barrier_count, const D3D12_RESOURCE_BARRIER *barriers) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); bool have_aliasing_barriers = false, have_split_barriers = false; const struct vkd3d_vk_device_procs *vk_procs; const struct vkd3d_vulkan_info *vk_info;
@@ -4003,13 +4004,13 @@ static void STDMETHODCALLTYPE d3d12_command_list_ResourceBarrier(ID3D12GraphicsC WARN("Issuing split barrier(s) on D3D12_RESOURCE_BARRIER_FLAG_END_ONLY.\n"); }
-static void STDMETHODCALLTYPE d3d12_command_list_ExecuteBundle(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_ExecuteBundle(ID3D12GraphicsCommandList2 *iface, ID3D12GraphicsCommandList *command_list) { FIXME("iface %p, command_list %p stub!\n", iface, command_list); }
-static void STDMETHODCALLTYPE d3d12_command_list_SetDescriptorHeaps(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetDescriptorHeaps(ID3D12GraphicsCommandList2 *iface, UINT heap_count, ID3D12DescriptorHeap *const *heaps) { TRACE("iface %p, heap_count %u, heaps %p.\n", iface, heap_count, heaps); @@ -4034,10 +4035,10 @@ static void d3d12_command_list_set_root_signature(struct d3d12_command_list *lis bindings->push_descriptor_dirty_mask = bindings->push_descriptor_active_mask & root_signature->push_descriptor_mask; }
-static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootSignature(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootSignature(ID3D12GraphicsCommandList2 *iface, ID3D12RootSignature *root_signature) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_signature %p.\n", iface, root_signature);
@@ -4045,10 +4046,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootSignature(ID3D12G unsafe_impl_from_ID3D12RootSignature(root_signature)); }
-static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRootSignature(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRootSignature(ID3D12GraphicsCommandList2 *iface, ID3D12RootSignature *root_signature) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_signature %p.\n", iface, root_signature);
@@ -4070,10 +4071,10 @@ static void d3d12_command_list_set_descriptor_table(struct d3d12_command_list *l bindings->descriptor_table_active_mask |= (uint64_t)1 << index; }
-static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootDescriptorTable(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootDescriptorTable(ID3D12GraphicsCommandList2 *iface, UINT root_parameter_index, D3D12_GPU_DESCRIPTOR_HANDLE base_descriptor) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_parameter_index %u, base_descriptor %#"PRIx64".\n", iface, root_parameter_index, base_descriptor.ptr);
@@ -4082,10 +4083,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootDescriptorTable(I root_parameter_index, base_descriptor); }
-static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRootDescriptorTable(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRootDescriptorTable(ID3D12GraphicsCommandList2 *iface, UINT root_parameter_index, D3D12_GPU_DESCRIPTOR_HANDLE base_descriptor) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_parameter_index %u, base_descriptor %#"PRIx64".\n", iface, root_parameter_index, base_descriptor.ptr);
@@ -4107,10 +4108,10 @@ static void d3d12_command_list_set_root_constants(struct d3d12_command_list *lis c->stage_flags, c->offset + offset * sizeof(uint32_t), count * sizeof(uint32_t), data)); }
-static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRoot32BitConstant(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRoot32BitConstant(ID3D12GraphicsCommandList2 *iface, UINT root_parameter_index, UINT data, UINT dst_offset) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_parameter_index %u, data 0x%08x, dst_offset %u.\n", iface, root_parameter_index, data, dst_offset);
@@ -4119,10 +4120,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRoot32BitConstant(ID3 root_parameter_index, dst_offset, 1, &data); }
-static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRoot32BitConstant(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRoot32BitConstant(ID3D12GraphicsCommandList2 *iface, UINT root_parameter_index, UINT data, UINT dst_offset) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_parameter_index %u, data 0x%08x, dst_offset %u.\n", iface, root_parameter_index, data, dst_offset);
@@ -4131,10 +4132,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRoot32BitConstant(ID root_parameter_index, dst_offset, 1, &data); }
-static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRoot32BitConstants(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRoot32BitConstants(ID3D12GraphicsCommandList2 *iface, UINT root_parameter_index, UINT constant_count, const void *data, UINT dst_offset) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_parameter_index %u, constant_count %u, data %p, dst_offset %u.\n", iface, root_parameter_index, constant_count, data, dst_offset);
@@ -4143,10 +4144,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRoot32BitConstants(ID root_parameter_index, dst_offset, constant_count, data); }
-static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRoot32BitConstants(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRoot32BitConstants(ID3D12GraphicsCommandList2 *iface, UINT root_parameter_index, UINT constant_count, const void *data, UINT dst_offset) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_parameter_index %u, constant_count %u, data %p, dst_offset %u.\n", iface, root_parameter_index, constant_count, data, dst_offset);
@@ -4199,9 +4200,9 @@ static void d3d12_command_list_set_root_cbv(struct d3d12_command_list *list, }
static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootConstantBufferView(
ID3D12GraphicsCommandList1 *iface, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address)
{ID3D12GraphicsCommandList2 *iface, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address)
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_parameter_index %u, address %#"PRIx64".\n", iface, root_parameter_index, address);
@@ -4210,9 +4211,9 @@ static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootConstantBufferVie }
static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRootConstantBufferView(
ID3D12GraphicsCommandList1 *iface, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address)
{ID3D12GraphicsCommandList2 *iface, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address)
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_parameter_index %u, address %#"PRIx64".\n", iface, root_parameter_index, address);
@@ -4271,9 +4272,9 @@ static void d3d12_command_list_set_root_descriptor(struct d3d12_command_list *li }
static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootShaderResourceView(
ID3D12GraphicsCommandList1 *iface, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address)
{ID3D12GraphicsCommandList2 *iface, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address)
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_parameter_index %u, address %#"PRIx64".\n", iface, root_parameter_index, address);
@@ -4283,9 +4284,9 @@ static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootShaderResourceVie }
static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRootShaderResourceView(
ID3D12GraphicsCommandList1 *iface, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address)
{ID3D12GraphicsCommandList2 *iface, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address)
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_parameter_index %u, address %#"PRIx64".\n", iface, root_parameter_index, address);
@@ -4295,9 +4296,9 @@ static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRootShaderResourceVi }
static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootUnorderedAccessView(
ID3D12GraphicsCommandList1 *iface, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address)
{ID3D12GraphicsCommandList2 *iface, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address)
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_parameter_index %u, address %#"PRIx64".\n", iface, root_parameter_index, address);
@@ -4307,9 +4308,9 @@ static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootUnorderedAccessVi }
static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRootUnorderedAccessView(
ID3D12GraphicsCommandList1 *iface, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address)
{ID3D12GraphicsCommandList2 *iface, UINT root_parameter_index, D3D12_GPU_VIRTUAL_ADDRESS address)
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
TRACE("iface %p, root_parameter_index %u, address %#"PRIx64".\n", iface, root_parameter_index, address);
@@ -4318,10 +4319,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_SetGraphicsRootUnorderedAccessV root_parameter_index, address); }
-static void STDMETHODCALLTYPE d3d12_command_list_IASetIndexBuffer(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_IASetIndexBuffer(ID3D12GraphicsCommandList2 *iface, const D3D12_INDEX_BUFFER_VIEW *view) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct vkd3d_vk_device_procs *vk_procs; struct d3d12_resource *resource; enum VkIndexType index_type;
@@ -4356,10 +4357,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_IASetIndexBuffer(ID3D12Graphics view->BufferLocation - resource->gpu_address, index_type)); }
-static void STDMETHODCALLTYPE d3d12_command_list_IASetVertexBuffers(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_IASetVertexBuffers(ID3D12GraphicsCommandList2 *iface, UINT start_slot, UINT view_count, const D3D12_VERTEX_BUFFER_VIEW *views) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct vkd3d_null_resources *null_resources; struct vkd3d_gpu_va_allocator *gpu_va_allocator; VkDeviceSize offsets[ARRAY_SIZE(list->strides)];
@@ -4408,10 +4409,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_IASetVertexBuffers(ID3D12Graphi d3d12_command_list_invalidate_current_pipeline(list); }
-static void STDMETHODCALLTYPE d3d12_command_list_SOSetTargets(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SOSetTargets(ID3D12GraphicsCommandList2 *iface, UINT start_slot, UINT view_count, const D3D12_STREAM_OUTPUT_BUFFER_VIEW *views) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); VkDeviceSize offsets[ARRAY_SIZE(list->so_counter_buffers)]; VkDeviceSize sizes[ARRAY_SIZE(list->so_counter_buffers)]; VkBuffer buffers[ARRAY_SIZE(list->so_counter_buffers)];
@@ -4473,11 +4474,11 @@ static void STDMETHODCALLTYPE d3d12_command_list_SOSetTargets(ID3D12GraphicsComm VK_CALL(vkCmdBindTransformFeedbackBuffersEXT(list->vk_command_buffer, first, count, buffers, offsets, sizes)); }
-static void STDMETHODCALLTYPE d3d12_command_list_OMSetRenderTargets(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_OMSetRenderTargets(ID3D12GraphicsCommandList2 *iface, UINT render_target_descriptor_count, const D3D12_CPU_DESCRIPTOR_HANDLE *render_target_descriptors, BOOL single_descriptor_handle, const D3D12_CPU_DESCRIPTOR_HANDLE *depth_stencil_descriptor) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct d3d12_rtv_desc *rtv_desc; const struct d3d12_dsv_desc *dsv_desc; VkFormat prev_dsv_format;
@@ -4678,12 +4679,12 @@ static void d3d12_command_list_clear(struct d3d12_command_list *list, } }
-static void STDMETHODCALLTYPE d3d12_command_list_ClearDepthStencilView(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_ClearDepthStencilView(ID3D12GraphicsCommandList2 *iface, D3D12_CPU_DESCRIPTOR_HANDLE dsv, D3D12_CLEAR_FLAGS flags, float depth, UINT8 stencil, UINT rect_count, const D3D12_RECT *rects) { const union VkClearValue clear_value = {.depthStencil = {depth, stencil}};
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct d3d12_dsv_desc *dsv_desc = d3d12_dsv_desc_from_cpu_handle(dsv); struct VkAttachmentDescription attachment_desc; struct VkAttachmentReference ds_reference;
@@ -4727,10 +4728,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_ClearDepthStencilView(ID3D12Gra &clear_value, rect_count, rects); }
-static void STDMETHODCALLTYPE d3d12_command_list_ClearRenderTargetView(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_ClearRenderTargetView(ID3D12GraphicsCommandList2 *iface, D3D12_CPU_DESCRIPTOR_HANDLE rtv, const FLOAT color[4], UINT rect_count, const D3D12_RECT *rects) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct d3d12_rtv_desc *rtv_desc = d3d12_rtv_desc_from_cpu_handle(rtv); struct VkAttachmentDescription attachment_desc; struct VkAttachmentReference color_reference;
@@ -4781,11 +4782,11 @@ static void STDMETHODCALLTYPE d3d12_command_list_ClearRenderTargetView(ID3D12Gra &clear_value, rect_count, rects); }
-static void STDMETHODCALLTYPE d3d12_command_list_ClearUnorderedAccessViewUint(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_ClearUnorderedAccessViewUint(ID3D12GraphicsCommandList2 *iface, D3D12_GPU_DESCRIPTOR_HANDLE gpu_handle, D3D12_CPU_DESCRIPTOR_HANDLE cpu_handle, ID3D12Resource *resource, const UINT values[4], UINT rect_count, const D3D12_RECT *rects) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const struct vkd3d_vk_device_procs *vk_procs; const struct vkd3d_vulkan_info *vk_info; const struct d3d12_desc *cpu_descriptor;
@@ -4878,11 +4879,11 @@ static void STDMETHODCALLTYPE d3d12_command_list_ClearUnorderedAccessViewUint(ID } }
-static void STDMETHODCALLTYPE d3d12_command_list_ClearUnorderedAccessViewFloat(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_ClearUnorderedAccessViewFloat(ID3D12GraphicsCommandList2 *iface, D3D12_GPU_DESCRIPTOR_HANDLE gpu_handle, D3D12_CPU_DESCRIPTOR_HANDLE cpu_handle, ID3D12Resource *resource, const float values[4], UINT rect_count, const D3D12_RECT *rects) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); struct d3d12_resource *resource_impl;
FIXME("iface %p, gpu_handle %#"PRIx64", cpu_handle %lx, resource %p, values %p, rect_count %u, rects %p stub!\n",
@@ -4893,16 +4894,16 @@ static void STDMETHODCALLTYPE d3d12_command_list_ClearUnorderedAccessViewFloat(I d3d12_command_list_track_resource_usage(list, resource_impl); }
-static void STDMETHODCALLTYPE d3d12_command_list_DiscardResource(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_DiscardResource(ID3D12GraphicsCommandList2 *iface, ID3D12Resource *resource, const D3D12_DISCARD_REGION *region) { FIXME_ONCE("iface %p, resource %p, region %p stub!\n", iface, resource, region); }
-static void STDMETHODCALLTYPE d3d12_command_list_BeginQuery(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_BeginQuery(ID3D12GraphicsCommandList2 *iface, ID3D12QueryHeap *heap, D3D12_QUERY_TYPE type, UINT index) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); struct d3d12_query_heap *query_heap = unsafe_impl_from_ID3D12QueryHeap(heap); const struct vkd3d_vk_device_procs *vk_procs; VkQueryControlFlags flags = 0;
@@ -4929,10 +4930,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_BeginQuery(ID3D12GraphicsComman VK_CALL(vkCmdBeginQuery(list->vk_command_buffer, query_heap->vk_query_pool, index, flags)); }
-static void STDMETHODCALLTYPE d3d12_command_list_EndQuery(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_EndQuery(ID3D12GraphicsCommandList2 *iface, ID3D12QueryHeap *heap, D3D12_QUERY_TYPE type, UINT index) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); struct d3d12_query_heap *query_heap = unsafe_impl_from_ID3D12QueryHeap(heap); const struct vkd3d_vk_device_procs *vk_procs;
@@ -4974,12 +4975,12 @@ static size_t get_query_stride(D3D12_QUERY_TYPE type) return sizeof(uint64_t); }
-static void STDMETHODCALLTYPE d3d12_command_list_ResolveQueryData(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_ResolveQueryData(ID3D12GraphicsCommandList2 *iface, ID3D12QueryHeap *heap, D3D12_QUERY_TYPE type, UINT start_index, UINT query_count, ID3D12Resource *dst_buffer, UINT64 aligned_dst_buffer_offset) { const struct d3d12_query_heap *query_heap = unsafe_impl_from_ID3D12QueryHeap(heap);
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); struct d3d12_resource *buffer = unsafe_impl_from_ID3D12Resource(dst_buffer); const struct vkd3d_vk_device_procs *vk_procs; unsigned int i, first, count;
@@ -5055,10 +5056,10 @@ static void STDMETHODCALLTYPE d3d12_command_list_ResolveQueryData(ID3D12Graphics } }
-static void STDMETHODCALLTYPE d3d12_command_list_SetPredication(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetPredication(ID3D12GraphicsCommandList2 *iface, ID3D12Resource *buffer, UINT64 aligned_buffer_offset, D3D12_PREDICATION_OP operation) {
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); struct d3d12_resource *resource = unsafe_impl_from_ID3D12Resource(buffer); const struct vkd3d_vulkan_info *vk_info = &list->device->vk_info; const struct vkd3d_vk_device_procs *vk_procs;
@@ -5127,19 +5128,19 @@ static void STDMETHODCALLTYPE d3d12_command_list_SetPredication(ID3D12GraphicsCo } }
-static void STDMETHODCALLTYPE d3d12_command_list_SetMarker(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetMarker(ID3D12GraphicsCommandList2 *iface, UINT metadata, const void *data, UINT size) { FIXME("iface %p, metadata %#x, data %p, size %u stub!\n", iface, metadata, data, size); }
-static void STDMETHODCALLTYPE d3d12_command_list_BeginEvent(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_BeginEvent(ID3D12GraphicsCommandList2 *iface, UINT metadata, const void *data, UINT size) { FIXME("iface %p, metadata %#x, data %p, size %u stub!\n", iface, metadata, data, size); }
-static void STDMETHODCALLTYPE d3d12_command_list_EndEvent(ID3D12GraphicsCommandList1 *iface) +static void STDMETHODCALLTYPE d3d12_command_list_EndEvent(ID3D12GraphicsCommandList2 *iface) { FIXME("iface %p stub!\n", iface); } @@ -5148,14 +5149,14 @@ STATIC_ASSERT(sizeof(VkDispatchIndirectCommand) == sizeof(D3D12_DISPATCH_ARGUMEN STATIC_ASSERT(sizeof(VkDrawIndexedIndirectCommand) == sizeof(D3D12_DRAW_INDEXED_ARGUMENTS)); STATIC_ASSERT(sizeof(VkDrawIndirectCommand) == sizeof(D3D12_DRAW_ARGUMENTS));
-static void STDMETHODCALLTYPE d3d12_command_list_ExecuteIndirect(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_ExecuteIndirect(ID3D12GraphicsCommandList2 *iface, ID3D12CommandSignature *command_signature, UINT max_command_count, ID3D12Resource *arg_buffer, UINT64 arg_buffer_offset, ID3D12Resource *count_buffer, UINT64 count_buffer_offset) { struct d3d12_command_signature *sig_impl = unsafe_impl_from_ID3D12CommandSignature(command_signature); struct d3d12_resource *count_impl = unsafe_impl_from_ID3D12Resource(count_buffer); struct d3d12_resource *arg_impl = unsafe_impl_from_ID3D12Resource(arg_buffer);
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface); const D3D12_COMMAND_SIGNATURE_DESC *signature_desc; const struct vkd3d_vk_device_procs *vk_procs; unsigned int i;
@@ -5254,7 +5255,7 @@ static void STDMETHODCALLTYPE d3d12_command_list_ExecuteIndirect(ID3D12GraphicsC } }
-static void STDMETHODCALLTYPE d3d12_command_list_AtomicCopyBufferUINT(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_AtomicCopyBufferUINT(ID3D12GraphicsCommandList2 *iface, ID3D12Resource *dst_buffer, UINT64 dst_offset, ID3D12Resource *src_buffer, UINT64 src_offset, UINT dependent_resource_count, ID3D12Resource * const *dependent_resources, @@ -5267,7 +5268,7 @@ static void STDMETHODCALLTYPE d3d12_command_list_AtomicCopyBufferUINT(ID3D12Grap dependent_resource_count, dependent_resources, dependent_sub_resource_ranges); }
-static void STDMETHODCALLTYPE d3d12_command_list_AtomicCopyBufferUINT64(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_AtomicCopyBufferUINT64(ID3D12GraphicsCommandList2 *iface, ID3D12Resource *dst_buffer, UINT64 dst_offset, ID3D12Resource *src_buffer, UINT64 src_offset, UINT dependent_resource_count, ID3D12Resource * const *dependent_resources, @@ -5280,20 +5281,20 @@ static void STDMETHODCALLTYPE d3d12_command_list_AtomicCopyBufferUINT64(ID3D12Gr dependent_resource_count, dependent_resources, dependent_sub_resource_ranges); }
-static void STDMETHODCALLTYPE d3d12_command_list_OMSetDepthBounds(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_OMSetDepthBounds(ID3D12GraphicsCommandList2 *iface, FLOAT min, FLOAT max) { FIXME("iface %p, min %.8e, max %.8e stub!\n", iface, min, max); }
-static void STDMETHODCALLTYPE d3d12_command_list_SetSamplePositions(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_SetSamplePositions(ID3D12GraphicsCommandList2 *iface, UINT sample_count, UINT pixel_count, D3D12_SAMPLE_POSITION *sample_positions) { FIXME("iface %p, sample_count %u, pixel_count %u, sample_positions %p stub!\n", iface, sample_count, pixel_count, sample_positions); }
-static void STDMETHODCALLTYPE d3d12_command_list_ResolveSubresourceRegion(ID3D12GraphicsCommandList1 *iface, +static void STDMETHODCALLTYPE d3d12_command_list_ResolveSubresourceRegion(ID3D12GraphicsCommandList2 *iface, ID3D12Resource *dst_resource, UINT dst_sub_resource_idx, UINT dst_x, UINT dst_y, ID3D12Resource *src_resource, UINT src_sub_resource_idx, D3D12_RECT *src_rect, DXGI_FORMAT format, D3D12_RESOLVE_MODE mode) @@ -5305,7 +5306,68 @@ static void STDMETHODCALLTYPE d3d12_command_list_ResolveSubresourceRegion(ID3D12 src_resource, src_sub_resource_idx, src_rect, format, mode); }
-static const struct ID3D12GraphicsCommandList1Vtbl d3d12_command_list_vtbl = +static void STDMETHODCALLTYPE d3d12_command_list_SetViewInstanceMask(ID3D12GraphicsCommandList2 *iface, UINT mask) +{
- FIXME("iface %p, mask %u stub!\n", iface, mask);
+}
+static void STDMETHODCALLTYPE d3d12_command_list_WriteBufferImmediate(ID3D12GraphicsCommandList2 *iface,
UINT count, const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *params,
const D3D12_WRITEBUFFERIMMEDIATE_MODE *modes)
+{
- struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList2(iface);
- const struct vkd3d_vulkan_info *vk_info = &list->device->vk_info;
- const struct vkd3d_vk_device_procs *vk_procs;
- struct d3d12_resource *resource;
- VkPipelineStageFlagBits stage;
- UINT i;
- TRACE("iface %p, count %u, params %p, modes %p.\n", iface, count, params, modes);
- if (!vk_info->AMD_buffer_marker)
- {
FIXME("No buffer marker extension found. Command not executed.\n");
return;
- }
- vk_procs = &list->device->vk_procs;
- stage = VK_PIPELINE_STAGE_TRANSFER_BIT;
- for (i = 0; i < count; ++i)
- {
resource = vkd3d_gpu_va_allocator_dereference(&list->device->gpu_va_allocator, params[i].Dest);
if (!d3d12_resource_is_buffer(resource))
{
FIXME("Textures are not supported.\n");
continue;
}
if (modes)
{
switch(modes[i])
{
case D3D12_WRITEBUFFERIMMEDIATE_MODE_MARKER_IN:
FIXME("D3D12_WRITEBUFFERIMMEDIATE_MODE_MARKER_IN not supported; using default.\n");
/* Fall through. */
case D3D12_WRITEBUFFERIMMEDIATE_MODE_DEFAULT:
stage = VK_PIPELINE_STAGE_TRANSFER_BIT;
break;
case D3D12_WRITEBUFFERIMMEDIATE_MODE_MARKER_OUT:
stage = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT;
break;
default:
d3d12_command_list_mark_as_invalid(list, "Invalid D3D12_WRITEBUFFERIMMEDIATE_MODE 0x%x.\n", modes[i]);
return;
}
}
VK_CALL(vkCmdWriteBufferMarkerAMD(list->vk_command_buffer, stage, resource->u.vk_buffer,
params[i].Dest - resource->gpu_address, params[i].Value));
- }
+}
+static const struct ID3D12GraphicsCommandList2Vtbl d3d12_command_list_vtbl = { /* IUnknown methods */ d3d12_command_list_QueryInterface, @@ -5378,6 +5440,9 @@ static const struct ID3D12GraphicsCommandList1Vtbl d3d12_command_list_vtbl = d3d12_command_list_OMSetDepthBounds, d3d12_command_list_SetSamplePositions, d3d12_command_list_ResolveSubresourceRegion,
d3d12_command_list_SetViewInstanceMask,
/* ID3D12GraphicsCommandList2 methods */
d3d12_command_list_WriteBufferImmediate, };
static struct d3d12_command_list *unsafe_impl_from_ID3D12CommandList(ID3D12CommandList *iface)
@@ -5385,7 +5450,7 @@ static struct d3d12_command_list *unsafe_impl_from_ID3D12CommandList(ID3D12Comma if (!iface) return NULL; assert(iface->lpVtbl == (struct ID3D12CommandListVtbl *)&d3d12_command_list_vtbl);
- return CONTAINING_RECORD(iface, struct d3d12_command_list, ID3D12GraphicsCommandList1_iface);
return CONTAINING_RECORD(iface, struct d3d12_command_list, ID3D12GraphicsCommandList2_iface); }
static HRESULT d3d12_command_list_init(struct d3d12_command_list *list, struct d3d12_device *device,
@@ -5394,7 +5459,7 @@ static HRESULT d3d12_command_list_init(struct d3d12_command_list *list, struct d { HRESULT hr;
- list->ID3D12GraphicsCommandList1_iface.lpVtbl = &d3d12_command_list_vtbl;
list->ID3D12GraphicsCommandList2_iface.lpVtbl = &d3d12_command_list_vtbl; list->refcount = 1;
list->type = type;
diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 13ebc70..996eda0 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -136,6 +136,8 @@ static const struct vkd3d_optional_extension_info optional_device_extensions[] = VK_EXTENSION(EXT_TEXEL_BUFFER_ALIGNMENT, EXT_texel_buffer_alignment), VK_EXTENSION(EXT_TRANSFORM_FEEDBACK, EXT_transform_feedback), VK_EXTENSION(EXT_VERTEX_ATTRIBUTE_DIVISOR, EXT_vertex_attribute_divisor),
/* AMD extensions */
VK_EXTENSION(AMD_BUFFER_MARKER, AMD_buffer_marker), };
static unsigned int get_spec_version(const VkExtensionProperties *extensions,
@@ -2307,8 +2309,8 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandList(ID3D12Device *if initial_pipeline_state, &object))) return hr;
- return return_interface(&object->ID3D12GraphicsCommandList1_iface,
&IID_ID3D12GraphicsCommandList1, riid, command_list);
return return_interface(&object->ID3D12GraphicsCommandList2_iface,
&IID_ID3D12GraphicsCommandList2, riid, command_list);
}
/* Direct3D feature levels restrict which formats can be optionally supported. */
diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index 2d62fda..9cab193 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -110,6 +110,9 @@ struct vkd3d_vulkan_info bool EXT_transform_feedback; bool EXT_vertex_attribute_divisor;
- /* AMD device extensions */
- bool AMD_buffer_marker;
bool rasterization_stream; bool transform_feedback_queries;
@@ -906,7 +909,7 @@ struct vkd3d_pipeline_bindings /* ID3D12CommandList */ struct d3d12_command_list {
- ID3D12GraphicsCommandList1 ID3D12GraphicsCommandList1_iface;
ID3D12GraphicsCommandList2 ID3D12GraphicsCommandList2_iface; LONG refcount;
D3D12_COMMAND_LIST_TYPE type;
diff --git a/libs/vkd3d/vulkan_procs.h b/libs/vkd3d/vulkan_procs.h index ec29eb4..68fd097 100644 --- a/libs/vkd3d/vulkan_procs.h +++ b/libs/vkd3d/vulkan_procs.h @@ -106,6 +106,7 @@ VK_DEVICE_PFN(vkCmdSetStencilWriteMask) VK_DEVICE_PFN(vkCmdSetViewport) VK_DEVICE_PFN(vkCmdUpdateBuffer) VK_DEVICE_PFN(vkCmdWaitEvents) +VK_DEVICE_PFN(vkCmdWriteBufferMarkerAMD) VK_DEVICE_PFN(vkCmdWriteTimestamp) VK_DEVICE_PFN(vkCreateBuffer) VK_DEVICE_PFN(vkCreateBufferView)
Yes it looks like vkCmdUpdateBuffer is the best generic way. I haven't really looked at doing more than this patch at the moment because the main reason for it is to check if it fixes Hitman 2, which it doesn't. A more general solution may still prove necessary though.
Conor
On Sat, 9 Nov 2019, 1:27 AM Philip Rebohle philip.rebohle@tu-dortmund.de wrote:
Hello,
is it really necessary to use the AMD extension here?
Maybe I'm overlooking something, but looking at the MSDN docs, it should be possible to make a vendor-neutral implementation using core Vulkan functionality (vkCmdUpdateBuffer), and to also support the in/out modes via barriers:
VkPipelineStageFlags src_stages = 0;
for (i = 0; i < Count; i++) { if (pParams[i].Mode == MODE_MARKER_IN) src_stages |= TOP_OF_PIPE_BIT; else if (pParams[i].Mode == MODE_MARKER_OUT) src_stages |= BOTTOM_OF_PIPE_BIT; }
if (src_stages) memory_barrier(src_stages, TRANSFER_BIT);
for (i = 0; i < Count; i++) { update_buffer(...)
- Philip