More commits in one MR than usual, but the implementations are quite short, and it's good to get them all in at once.
From: Conor McCarthy cmccarthy@codeweavers.com
--- libs/vkd3d/device.c | 314 +++++++++++++++++++++++-------------- libs/vkd3d/resource.c | 2 +- libs/vkd3d/vkd3d_main.c | 4 +- libs/vkd3d/vkd3d_private.h | 12 +- 4 files changed, 202 insertions(+), 130 deletions(-)
diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 17c7ccb3e..f0ac5657b 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -2499,17 +2499,18 @@ static void vkd3d_desc_object_cache_cleanup(struct vkd3d_desc_object_cache *cach }
/* ID3D12Device */ -static inline struct d3d12_device *impl_from_ID3D12Device7(ID3D12Device7 *iface) +static inline struct d3d12_device *impl_from_ID3D12Device8(ID3D12Device8 *iface) { - return CONTAINING_RECORD(iface, struct d3d12_device, ID3D12Device7_iface); + return CONTAINING_RECORD(iface, struct d3d12_device, ID3D12Device8_iface); }
-static HRESULT STDMETHODCALLTYPE d3d12_device_QueryInterface(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_QueryInterface(ID3D12Device8 *iface, REFIID riid, void **object) { TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
- if (IsEqualGUID(riid, &IID_ID3D12Device7) + if (IsEqualGUID(riid, &IID_ID3D12Device8) + || IsEqualGUID(riid, &IID_ID3D12Device7) || IsEqualGUID(riid, &IID_ID3D12Device6) || IsEqualGUID(riid, &IID_ID3D12Device5) || IsEqualGUID(riid, &IID_ID3D12Device4) @@ -2531,9 +2532,9 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_QueryInterface(ID3D12Device7 *ifac return E_NOINTERFACE; }
-static ULONG STDMETHODCALLTYPE d3d12_device_AddRef(ID3D12Device7 *iface) +static ULONG STDMETHODCALLTYPE d3d12_device_AddRef(ID3D12Device8 *iface) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); unsigned int refcount = vkd3d_atomic_increment_u32(&device->refcount);
TRACE("%p increasing refcount to %u.\n", device, refcount); @@ -2563,9 +2564,9 @@ static HRESULT device_worker_stop(struct d3d12_device *device) return S_OK; }
-static ULONG STDMETHODCALLTYPE d3d12_device_Release(ID3D12Device7 *iface) +static ULONG STDMETHODCALLTYPE d3d12_device_Release(ID3D12Device8 *iface) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); unsigned int refcount = vkd3d_atomic_decrement_u32(&device->refcount);
TRACE("%p decreasing refcount to %u.\n", device, refcount); @@ -2602,10 +2603,10 @@ static ULONG STDMETHODCALLTYPE d3d12_device_Release(ID3D12Device7 *iface) return refcount; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_GetPrivateData(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_GetPrivateData(ID3D12Device8 *iface, REFGUID guid, UINT *data_size, void *data) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface);
TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); @@ -2613,10 +2614,10 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_GetPrivateData(ID3D12Device7 *ifac return vkd3d_get_private_data(&device->private_store, guid, data_size, data); }
-static HRESULT STDMETHODCALLTYPE d3d12_device_SetPrivateData(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_SetPrivateData(ID3D12Device8 *iface, REFGUID guid, UINT data_size, const void *data) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface);
TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); @@ -2624,19 +2625,19 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_SetPrivateData(ID3D12Device7 *ifac return vkd3d_set_private_data(&device->private_store, guid, data_size, data); }
-static HRESULT STDMETHODCALLTYPE d3d12_device_SetPrivateDataInterface(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_SetPrivateDataInterface(ID3D12Device8 *iface, REFGUID guid, const IUnknown *data) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface);
TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
return vkd3d_set_private_data_interface(&device->private_store, guid, data); }
-static HRESULT STDMETHODCALLTYPE d3d12_device_SetName(ID3D12Device7 *iface, const WCHAR *name) +static HRESULT STDMETHODCALLTYPE d3d12_device_SetName(ID3D12Device8 *iface, const WCHAR *name) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface);
TRACE("iface %p, name %s.\n", iface, debugstr_w(name, device->wchar_size));
@@ -2644,17 +2645,17 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_SetName(ID3D12Device7 *iface, cons VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, name); }
-static UINT STDMETHODCALLTYPE d3d12_device_GetNodeCount(ID3D12Device7 *iface) +static UINT STDMETHODCALLTYPE d3d12_device_GetNodeCount(ID3D12Device8 *iface) { TRACE("iface %p.\n", iface);
return 1; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandQueue(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandQueue(ID3D12Device8 *iface, const D3D12_COMMAND_QUEUE_DESC *desc, REFIID riid, void **command_queue) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); struct d3d12_command_queue *object; HRESULT hr;
@@ -2668,10 +2669,10 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandQueue(ID3D12Device7 * riid, command_queue); }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandAllocator(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandAllocator(ID3D12Device8 *iface, D3D12_COMMAND_LIST_TYPE type, REFIID riid, void **command_allocator) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); struct d3d12_command_allocator *object; HRESULT hr;
@@ -2685,10 +2686,10 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandAllocator(ID3D12Devic riid, command_allocator); }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateGraphicsPipelineState(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreateGraphicsPipelineState(ID3D12Device8 *iface, const D3D12_GRAPHICS_PIPELINE_STATE_DESC *desc, REFIID riid, void **pipeline_state) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); struct d3d12_pipeline_state *object; HRESULT hr;
@@ -2702,10 +2703,10 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateGraphicsPipelineState(ID3D12 &IID_ID3D12PipelineState, riid, pipeline_state); }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateComputePipelineState(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreateComputePipelineState(ID3D12Device8 *iface, const D3D12_COMPUTE_PIPELINE_STATE_DESC *desc, REFIID riid, void **pipeline_state) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); struct d3d12_pipeline_state *object; HRESULT hr;
@@ -2719,11 +2720,11 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateComputePipelineState(ID3D12D &IID_ID3D12PipelineState, riid, pipeline_state); }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandList(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandList(ID3D12Device8 *iface, UINT node_mask, D3D12_COMMAND_LIST_TYPE type, ID3D12CommandAllocator *command_allocator, ID3D12PipelineState *initial_pipeline_state, REFIID riid, void **command_list) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); struct d3d12_command_list *object; HRESULT hr;
@@ -2846,10 +2847,10 @@ bool d3d12_device_is_uma(struct d3d12_device *device, bool *coherent) return true; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CheckFeatureSupport(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CheckFeatureSupport(ID3D12Device8 *iface, D3D12_FEATURE feature, void *feature_data, UINT feature_data_size) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface);
TRACE("iface %p, feature %#x, feature_data %p, feature_data_size %u.\n", iface, feature, feature_data, feature_data_size); @@ -3521,10 +3522,10 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CheckFeatureSupport(ID3D12Device7 } }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateDescriptorHeap(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreateDescriptorHeap(ID3D12Device8 *iface, const D3D12_DESCRIPTOR_HEAP_DESC *desc, REFIID riid, void **descriptor_heap) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); struct d3d12_descriptor_heap *object; HRESULT hr;
@@ -3538,7 +3539,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateDescriptorHeap(ID3D12Device7 &IID_ID3D12DescriptorHeap, riid, descriptor_heap); }
-static UINT STDMETHODCALLTYPE d3d12_device_GetDescriptorHandleIncrementSize(ID3D12Device7 *iface, +static UINT STDMETHODCALLTYPE d3d12_device_GetDescriptorHandleIncrementSize(ID3D12Device8 *iface, D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type) { TRACE("iface %p, descriptor_heap_type %#x.\n", iface, descriptor_heap_type); @@ -3561,11 +3562,11 @@ static UINT STDMETHODCALLTYPE d3d12_device_GetDescriptorHandleIncrementSize(ID3D } }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateRootSignature(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreateRootSignature(ID3D12Device8 *iface, UINT node_mask, const void *bytecode, SIZE_T bytecode_length, REFIID riid, void **root_signature) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); struct d3d12_root_signature *object; HRESULT hr;
@@ -3581,10 +3582,10 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateRootSignature(ID3D12Device7 &IID_ID3D12RootSignature, riid, root_signature); }
-static void STDMETHODCALLTYPE d3d12_device_CreateConstantBufferView(ID3D12Device7 *iface, +static void STDMETHODCALLTYPE d3d12_device_CreateConstantBufferView(ID3D12Device8 *iface, const D3D12_CONSTANT_BUFFER_VIEW_DESC *desc, D3D12_CPU_DESCRIPTOR_HANDLE descriptor) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); struct d3d12_desc tmp = {0};
TRACE("iface %p, desc %p, descriptor %s.\n", iface, desc, debug_cpu_handle(descriptor)); @@ -3593,11 +3594,11 @@ static void STDMETHODCALLTYPE d3d12_device_CreateConstantBufferView(ID3D12Device d3d12_desc_write_atomic(d3d12_desc_from_cpu_handle(descriptor), &tmp, device); }
-static void STDMETHODCALLTYPE d3d12_device_CreateShaderResourceView(ID3D12Device7 *iface, +static void STDMETHODCALLTYPE d3d12_device_CreateShaderResourceView(ID3D12Device8 *iface, ID3D12Resource *resource, const D3D12_SHADER_RESOURCE_VIEW_DESC *desc, D3D12_CPU_DESCRIPTOR_HANDLE descriptor) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); struct d3d12_desc tmp = {0};
TRACE("iface %p, resource %p, desc %p, descriptor %s.\n", @@ -3607,11 +3608,11 @@ static void STDMETHODCALLTYPE d3d12_device_CreateShaderResourceView(ID3D12Device d3d12_desc_write_atomic(d3d12_desc_from_cpu_handle(descriptor), &tmp, device); }
-static void STDMETHODCALLTYPE d3d12_device_CreateUnorderedAccessView(ID3D12Device7 *iface, +static void STDMETHODCALLTYPE d3d12_device_CreateUnorderedAccessView(ID3D12Device8 *iface, ID3D12Resource *resource, ID3D12Resource *counter_resource, const D3D12_UNORDERED_ACCESS_VIEW_DESC *desc, D3D12_CPU_DESCRIPTOR_HANDLE descriptor) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); struct d3d12_desc tmp = {0};
TRACE("iface %p, resource %p, counter_resource %p, desc %p, descriptor %s.\n", @@ -3622,7 +3623,7 @@ static void STDMETHODCALLTYPE d3d12_device_CreateUnorderedAccessView(ID3D12Devic d3d12_desc_write_atomic(d3d12_desc_from_cpu_handle(descriptor), &tmp, device); }
-static void STDMETHODCALLTYPE d3d12_device_CreateRenderTargetView(ID3D12Device7 *iface, +static void STDMETHODCALLTYPE d3d12_device_CreateRenderTargetView(ID3D12Device8 *iface, ID3D12Resource *resource, const D3D12_RENDER_TARGET_VIEW_DESC *desc, D3D12_CPU_DESCRIPTOR_HANDLE descriptor) { @@ -3630,10 +3631,10 @@ static void STDMETHODCALLTYPE d3d12_device_CreateRenderTargetView(ID3D12Device7 iface, resource, desc, debug_cpu_handle(descriptor));
d3d12_rtv_desc_create_rtv(d3d12_rtv_desc_from_cpu_handle(descriptor), - impl_from_ID3D12Device7(iface), unsafe_impl_from_ID3D12Resource(resource), desc); + impl_from_ID3D12Device8(iface), unsafe_impl_from_ID3D12Resource(resource), desc); }
-static void STDMETHODCALLTYPE d3d12_device_CreateDepthStencilView(ID3D12Device7 *iface, +static void STDMETHODCALLTYPE d3d12_device_CreateDepthStencilView(ID3D12Device8 *iface, ID3D12Resource *resource, const D3D12_DEPTH_STENCIL_VIEW_DESC *desc, D3D12_CPU_DESCRIPTOR_HANDLE descriptor) { @@ -3641,13 +3642,13 @@ static void STDMETHODCALLTYPE d3d12_device_CreateDepthStencilView(ID3D12Device7 iface, resource, desc, debug_cpu_handle(descriptor));
d3d12_dsv_desc_create_dsv(d3d12_dsv_desc_from_cpu_handle(descriptor), - impl_from_ID3D12Device7(iface), unsafe_impl_from_ID3D12Resource(resource), desc); + impl_from_ID3D12Device8(iface), unsafe_impl_from_ID3D12Resource(resource), desc); }
-static void STDMETHODCALLTYPE d3d12_device_CreateSampler(ID3D12Device7 *iface, +static void STDMETHODCALLTYPE d3d12_device_CreateSampler(ID3D12Device8 *iface, const D3D12_SAMPLER_DESC *desc, D3D12_CPU_DESCRIPTOR_HANDLE descriptor) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); struct d3d12_desc tmp = {0};
TRACE("iface %p, desc %p, descriptor %s.\n", iface, desc, debug_cpu_handle(descriptor)); @@ -3656,14 +3657,14 @@ static void STDMETHODCALLTYPE d3d12_device_CreateSampler(ID3D12Device7 *iface, d3d12_desc_write_atomic(d3d12_desc_from_cpu_handle(descriptor), &tmp, device); }
-static void STDMETHODCALLTYPE d3d12_device_CopyDescriptors(ID3D12Device7 *iface, +static void STDMETHODCALLTYPE d3d12_device_CopyDescriptors(ID3D12Device8 *iface, UINT dst_descriptor_range_count, const D3D12_CPU_DESCRIPTOR_HANDLE *dst_descriptor_range_offsets, const UINT *dst_descriptor_range_sizes, UINT src_descriptor_range_count, const D3D12_CPU_DESCRIPTOR_HANDLE *src_descriptor_range_offsets, const UINT *src_descriptor_range_sizes, D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); unsigned int dst_range_idx, dst_idx, src_range_idx, src_idx; unsigned int dst_range_size, src_range_size; struct d3d12_descriptor_heap *dst_heap; @@ -3719,7 +3720,7 @@ static void STDMETHODCALLTYPE d3d12_device_CopyDescriptors(ID3D12Device7 *iface, } }
-static void STDMETHODCALLTYPE d3d12_device_CopyDescriptorsSimple(ID3D12Device7 *iface, +static void STDMETHODCALLTYPE d3d12_device_CopyDescriptorsSimple(ID3D12Device8 *iface, UINT descriptor_count, const D3D12_CPU_DESCRIPTOR_HANDLE dst_descriptor_range_offset, const D3D12_CPU_DESCRIPTOR_HANDLE src_descriptor_range_offset, D3D12_DESCRIPTOR_HEAP_TYPE descriptor_heap_type) @@ -3850,10 +3851,10 @@ static void d3d12_device_get_resource_allocation_info(struct d3d12_device *devic }
static D3D12_RESOURCE_ALLOCATION_INFO * STDMETHODCALLTYPE d3d12_device_GetResourceAllocationInfo( - ID3D12Device7 *iface, D3D12_RESOURCE_ALLOCATION_INFO *info, UINT visible_mask, + ID3D12Device8 *iface, D3D12_RESOURCE_ALLOCATION_INFO *info, UINT visible_mask, UINT count, const D3D12_RESOURCE_DESC *resource_descs) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface);
TRACE("iface %p, info %p, visible_mask 0x%08x, count %u, resource_descs %p.\n", iface, info, visible_mask, count, resource_descs); @@ -3865,10 +3866,10 @@ static D3D12_RESOURCE_ALLOCATION_INFO * STDMETHODCALLTYPE d3d12_device_GetResour return info; }
-static D3D12_HEAP_PROPERTIES * STDMETHODCALLTYPE d3d12_device_GetCustomHeapProperties(ID3D12Device7 *iface, +static D3D12_HEAP_PROPERTIES * STDMETHODCALLTYPE d3d12_device_GetCustomHeapProperties(ID3D12Device8 *iface, D3D12_HEAP_PROPERTIES *heap_properties, UINT node_mask, D3D12_HEAP_TYPE heap_type) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); bool coherent;
TRACE("iface %p, heap_properties %p, node_mask 0x%08x, heap_type %#x.\n", @@ -3908,12 +3909,12 @@ static D3D12_HEAP_PROPERTIES * STDMETHODCALLTYPE d3d12_device_GetCustomHeapPrope return heap_properties; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommittedResource(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommittedResource(ID3D12Device8 *iface, const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags, const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state, const D3D12_CLEAR_VALUE *optimized_clear_value, REFIID iid, void **resource) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); D3D12_RESOURCE_DESC1 resource_desc; struct d3d12_resource *object; HRESULT hr; @@ -3935,10 +3936,10 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommittedResource(ID3D12Devi return return_interface(&object->ID3D12Resource2_iface, &IID_ID3D12Resource2, iid, resource); }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateHeap(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreateHeap(ID3D12Device8 *iface, const D3D12_HEAP_DESC *desc, REFIID iid, void **heap) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); struct d3d12_heap *object; HRESULT hr;
@@ -3954,12 +3955,12 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateHeap(ID3D12Device7 *iface, return return_interface(&object->ID3D12Heap_iface, &IID_ID3D12Heap, iid, heap); }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePlacedResource(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePlacedResource(ID3D12Device8 *iface, ID3D12Heap *heap, UINT64 heap_offset, const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state, const D3D12_CLEAR_VALUE *optimized_clear_value, REFIID iid, void **resource) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); D3D12_RESOURCE_DESC1 resource_desc; struct d3d12_heap *heap_object; struct d3d12_resource *object; @@ -3980,11 +3981,11 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePlacedResource(ID3D12Device7 return return_interface(&object->ID3D12Resource2_iface, &IID_ID3D12Resource2, iid, resource); }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateReservedResource(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreateReservedResource(ID3D12Device8 *iface, const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state, const D3D12_CLEAR_VALUE *optimized_clear_value, REFIID iid, void **resource) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); D3D12_RESOURCE_DESC1 resource_desc; struct d3d12_resource *object; HRESULT hr; @@ -4001,11 +4002,11 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateReservedResource(ID3D12Devic return return_interface(&object->ID3D12Resource2_iface, &IID_ID3D12Resource2, iid, resource); }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateSharedHandle(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreateSharedHandle(ID3D12Device8 *iface, ID3D12DeviceChild *object, const SECURITY_ATTRIBUTES *attributes, DWORD access, const WCHAR *name, HANDLE *handle) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface);
FIXME("iface %p, object %p, attributes %p, access %#x, name %s, handle %p stub!\n", iface, object, attributes, (uint32_t)access, debugstr_w(name, device->wchar_size), handle); @@ -4013,7 +4014,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateSharedHandle(ID3D12Device7 * return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_OpenSharedHandle(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_OpenSharedHandle(ID3D12Device8 *iface, HANDLE handle, REFIID riid, void **object) { FIXME("iface %p, handle %p, riid %s, object %p stub!\n", @@ -4022,10 +4023,10 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_OpenSharedHandle(ID3D12Device7 *if return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_OpenSharedHandleByName(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_OpenSharedHandleByName(ID3D12Device8 *iface, const WCHAR *name, DWORD access, HANDLE *handle) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface);
FIXME("iface %p, name %s, access %#x, handle %p stub!\n", iface, debugstr_w(name, device->wchar_size), (uint32_t)access, handle); @@ -4033,7 +4034,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_OpenSharedHandleByName(ID3D12Devic return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_MakeResident(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_MakeResident(ID3D12Device8 *iface, UINT object_count, ID3D12Pageable * const *objects) { ID3D12Fence *fence; @@ -4041,17 +4042,17 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_MakeResident(ID3D12Device7 *iface,
TRACE("iface %p, object_count %u, objects %p.\n", iface, object_count, objects);
- if (FAILED(hr = ID3D12Device7_CreateFence(iface, 0, 0, &IID_ID3D12Fence, (void **)&fence))) + if (FAILED(hr = ID3D12Device8_CreateFence(iface, 0, 0, &IID_ID3D12Fence, (void **)&fence))) return hr;
- hr = ID3D12Device7_EnqueueMakeResident(iface, 0, object_count, objects, fence, 1); + hr = ID3D12Device8_EnqueueMakeResident(iface, 0, object_count, objects, fence, 1); if (SUCCEEDED(hr)) ID3D12Fence_SetEventOnCompletion(fence, 1, NULL); ID3D12Fence_Release(fence); return hr; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_Evict(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_Evict(ID3D12Device8 *iface, UINT object_count, ID3D12Pageable * const *objects) { FIXME_ONCE("iface %p, object_count %u, objects %p stub!\n", @@ -4060,10 +4061,10 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_Evict(ID3D12Device7 *iface, return S_OK; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateFence(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreateFence(ID3D12Device8 *iface, UINT64 initial_value, D3D12_FENCE_FLAGS flags, REFIID riid, void **fence) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); struct d3d12_fence *object; HRESULT hr;
@@ -4076,9 +4077,9 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateFence(ID3D12Device7 *iface, return return_interface(&object->ID3D12Fence1_iface, &IID_ID3D12Fence1, riid, fence); }
-static HRESULT STDMETHODCALLTYPE d3d12_device_GetDeviceRemovedReason(ID3D12Device7 *iface) +static HRESULT STDMETHODCALLTYPE d3d12_device_GetDeviceRemovedReason(ID3D12Device8 *iface) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface);
TRACE("iface %p.\n", iface);
@@ -4163,12 +4164,12 @@ static void d3d12_device_get_copyable_footprints(struct d3d12_device *device, *total_bytes = total; }
-static void STDMETHODCALLTYPE d3d12_device_GetCopyableFootprints(ID3D12Device7 *iface, +static void STDMETHODCALLTYPE d3d12_device_GetCopyableFootprints(ID3D12Device8 *iface, const D3D12_RESOURCE_DESC *desc, UINT first_sub_resource, UINT sub_resource_count, UINT64 base_offset, D3D12_PLACED_SUBRESOURCE_FOOTPRINT *layouts, UINT *row_counts, UINT64 *row_sizes, UINT64 *total_bytes) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); D3D12_RESOURCE_DESC1 resource_desc;
TRACE("iface %p, desc %p, first_sub_resource %u, sub_resource_count %u, base_offset %#"PRIx64", " @@ -4182,10 +4183,10 @@ static void STDMETHODCALLTYPE d3d12_device_GetCopyableFootprints(ID3D12Device7 * base_offset, layouts, row_counts, row_sizes, total_bytes); }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateQueryHeap(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreateQueryHeap(ID3D12Device8 *iface, const D3D12_QUERY_HEAP_DESC *desc, REFIID iid, void **heap) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); struct d3d12_query_heap *object; HRESULT hr;
@@ -4198,18 +4199,18 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateQueryHeap(ID3D12Device7 *ifa return return_interface(&object->ID3D12QueryHeap_iface, &IID_ID3D12QueryHeap, iid, heap); }
-static HRESULT STDMETHODCALLTYPE d3d12_device_SetStablePowerState(ID3D12Device7 *iface, BOOL enable) +static HRESULT STDMETHODCALLTYPE d3d12_device_SetStablePowerState(ID3D12Device8 *iface, BOOL enable) { FIXME("iface %p, enable %#x stub!\n", iface, enable);
return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandSignature(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandSignature(ID3D12Device8 *iface, const D3D12_COMMAND_SIGNATURE_DESC *desc, ID3D12RootSignature *root_signature, REFIID iid, void **command_signature) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); struct d3d12_command_signature *object; HRESULT hr;
@@ -4223,14 +4224,14 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandSignature(ID3D12Devic &IID_ID3D12CommandSignature, iid, command_signature); }
-static void STDMETHODCALLTYPE d3d12_device_GetResourceTiling(ID3D12Device7 *iface, +static void STDMETHODCALLTYPE d3d12_device_GetResourceTiling(ID3D12Device8 *iface, ID3D12Resource *resource, UINT *total_tile_count, D3D12_PACKED_MIP_INFO *packed_mip_info, D3D12_TILE_SHAPE *standard_tile_shape, UINT *sub_resource_tiling_count, UINT first_sub_resource_tiling, D3D12_SUBRESOURCE_TILING *sub_resource_tilings) { const struct d3d12_resource *resource_impl = impl_from_ID3D12Resource(resource); - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface);
TRACE("iface %p, resource %p, total_tile_count %p, packed_mip_info %p, " "standard_title_shape %p, sub_resource_tiling_count %p, " @@ -4243,9 +4244,9 @@ static void STDMETHODCALLTYPE d3d12_device_GetResourceTiling(ID3D12Device7 *ifac sub_resource_tiling_count, first_sub_resource_tiling, sub_resource_tilings); }
-static LUID * STDMETHODCALLTYPE d3d12_device_GetAdapterLuid(ID3D12Device7 *iface, LUID *luid) +static LUID * STDMETHODCALLTYPE d3d12_device_GetAdapterLuid(ID3D12Device8 *iface, LUID *luid) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface);
TRACE("iface %p, luid %p.\n", iface, luid);
@@ -4254,7 +4255,7 @@ static LUID * STDMETHODCALLTYPE d3d12_device_GetAdapterLuid(ID3D12Device7 *iface return luid; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePipelineLibrary(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePipelineLibrary(ID3D12Device8 *iface, const void *blob, SIZE_T blob_size, REFIID iid, void **lib) { FIXME("iface %p, blob %p, blob_size %"PRIuPTR", iid %s, lib %p stub!\n", @@ -4263,7 +4264,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePipelineLibrary(ID3D12Device return DXGI_ERROR_UNSUPPORTED; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_SetEventOnMultipleFenceCompletion(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_SetEventOnMultipleFenceCompletion(ID3D12Device8 *iface, ID3D12Fence *const *fences, const UINT64 *values, UINT fence_count, D3D12_MULTIPLE_FENCE_WAIT_FLAGS flags, HANDLE event) { @@ -4273,7 +4274,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_SetEventOnMultipleFenceCompletion( return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_SetResidencyPriority(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_SetResidencyPriority(ID3D12Device8 *iface, UINT object_count, ID3D12Pageable *const *objects, const D3D12_RESIDENCY_PRIORITY *priorities) { FIXME_ONCE("iface %p, object_count %u, objects %p, priorities %p stub!\n", iface, object_count, objects, priorities); @@ -4281,10 +4282,10 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_SetResidencyPriority(ID3D12Device7 return S_OK; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePipelineState(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePipelineState(ID3D12Device8 *iface, const D3D12_PIPELINE_STATE_STREAM_DESC *desc, REFIID iid, void **pipeline_state) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); struct d3d12_pipeline_state *object; HRESULT hr;
@@ -4296,7 +4297,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePipelineState(ID3D12Device7 return return_interface(&object->ID3D12PipelineState_iface, &IID_ID3D12PipelineState, iid, pipeline_state); }
-static HRESULT STDMETHODCALLTYPE d3d12_device_OpenExistingHeapFromAddress(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_OpenExistingHeapFromAddress(ID3D12Device8 *iface, const void *address, REFIID iid, void **heap) { FIXME("iface %p, address %p, iid %s, heap %p stub!\n", iface, address, debugstr_guid(iid), heap); @@ -4304,7 +4305,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_OpenExistingHeapFromAddress(ID3D12 return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_OpenExistingHeapFromFileMapping(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_OpenExistingHeapFromFileMapping(ID3D12Device8 *iface, HANDLE file_mapping, REFIID iid, void **heap) { FIXME("iface %p, file_mapping %p, iid %s, heap %p stub!\n", iface, file_mapping, debugstr_guid(iid), heap); @@ -4312,7 +4313,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_OpenExistingHeapFromFileMapping(ID return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_EnqueueMakeResident(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_EnqueueMakeResident(ID3D12Device8 *iface, D3D12_RESIDENCY_FLAGS flags, UINT num_objects, ID3D12Pageable *const *objects, ID3D12Fence *fence, UINT64 fence_value) { @@ -4323,7 +4324,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_EnqueueMakeResident(ID3D12Device7 return S_OK; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandList1(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandList1(ID3D12Device8 *iface, UINT node_mask, D3D12_COMMAND_LIST_TYPE type, D3D12_COMMAND_LIST_FLAGS flags, REFIID iid, void **command_list) { @@ -4333,7 +4334,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommandList1(ID3D12Device7 * return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateProtectedResourceSession(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreateProtectedResourceSession(ID3D12Device8 *iface, const D3D12_PROTECTED_RESOURCE_SESSION_DESC *desc, REFIID iid, void **session) { FIXME("iface %p, desc %p, iid %s, session %p stub!\n", iface, desc, debugstr_guid(iid), session); @@ -4341,13 +4342,13 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateProtectedResourceSession(ID3 return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommittedResource1(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommittedResource1(ID3D12Device8 *iface, const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags, const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state, const D3D12_CLEAR_VALUE *optimized_clear_value, ID3D12ProtectedResourceSession *protected_session, REFIID iid, void **resource) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); D3D12_RESOURCE_DESC1 resource_desc; struct d3d12_resource *object; HRESULT hr; @@ -4369,11 +4370,11 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommittedResource1(ID3D12Dev return return_interface(&object->ID3D12Resource2_iface, &IID_ID3D12Resource2, iid, resource); }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateHeap1(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreateHeap1(ID3D12Device8 *iface, const D3D12_HEAP_DESC *desc, ID3D12ProtectedResourceSession *protected_session, REFIID iid, void **heap) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface); struct d3d12_heap *object; HRESULT hr;
@@ -4389,7 +4390,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateHeap1(ID3D12Device7 *iface, return return_interface(&object->ID3D12Heap_iface, &IID_ID3D12Heap, iid, heap); }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateReservedResource1(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreateReservedResource1(ID3D12Device8 *iface, const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state, const D3D12_CLEAR_VALUE *optimized_clear_value, ID3D12ProtectedResourceSession *protected_session, REFIID iid, void **resource) @@ -4403,11 +4404,11 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateReservedResource1(ID3D12Devi }
static D3D12_RESOURCE_ALLOCATION_INFO * STDMETHODCALLTYPE d3d12_device_GetResourceAllocationInfo1( - ID3D12Device7 *iface, D3D12_RESOURCE_ALLOCATION_INFO *info, UINT visible_mask, + ID3D12Device8 *iface, D3D12_RESOURCE_ALLOCATION_INFO *info, UINT visible_mask, UINT count, const D3D12_RESOURCE_DESC *resource_descs, D3D12_RESOURCE_ALLOCATION_INFO1 *info1) { - struct d3d12_device *device = impl_from_ID3D12Device7(iface); + struct d3d12_device *device = impl_from_ID3D12Device8(iface);
TRACE("iface %p, info %p, visible_mask 0x%08x, count %u, resource_descs %p, info1 %p.\n", iface, info, visible_mask, count, resource_descs, info1); @@ -4419,7 +4420,7 @@ static D3D12_RESOURCE_ALLOCATION_INFO * STDMETHODCALLTYPE d3d12_device_GetResour return info; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateLifetimeTracker(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreateLifetimeTracker(ID3D12Device8 *iface, ID3D12LifetimeOwner *owner, REFIID iid, void **tracker) { FIXME("iface %p, owner %p, iid %s, tracker %p stub!\n", iface, owner, debugstr_guid(iid), tracker); @@ -4427,12 +4428,12 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateLifetimeTracker(ID3D12Device return E_NOTIMPL; }
-static void STDMETHODCALLTYPE d3d12_device_RemoveDevice(ID3D12Device7 *iface) +static void STDMETHODCALLTYPE d3d12_device_RemoveDevice(ID3D12Device8 *iface) { FIXME("iface %p stub!\n", iface); }
-static HRESULT STDMETHODCALLTYPE d3d12_device_EnumerateMetaCommands(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_EnumerateMetaCommands(ID3D12Device8 *iface, UINT *num_meta_commands, D3D12_META_COMMAND_DESC *command_desc) { FIXME("iface %p, num_meta_commands %p, command_desc %p stub!\n", iface, @@ -4441,7 +4442,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_EnumerateMetaCommands(ID3D12Device return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_EnumerateMetaCommandParameters(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_EnumerateMetaCommandParameters(ID3D12Device8 *iface, REFGUID command_id, D3D12_META_COMMAND_PARAMETER_STAGE stage, UINT *size_in_bytes, UINT *parameter_count, D3D12_META_COMMAND_PARAMETER_DESC *parameter_desc) @@ -4453,7 +4454,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_EnumerateMetaCommandParameters(ID3 return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateMetaCommand(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreateMetaCommand(ID3D12Device8 *iface, REFGUID command_id, UINT node_mask, const void *parameters_data, SIZE_T data_size_in_bytes, REFIID iid, void **meta_command) { @@ -4465,7 +4466,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateMetaCommand(ID3D12Device7 *i return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateStateObject(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreateStateObject(ID3D12Device8 *iface, const D3D12_STATE_OBJECT_DESC *desc, REFIID iid, void **state_object) { FIXME("iface %p, desc %p, iid %s, state_object %p stub!\n", iface, desc, debugstr_guid(iid), state_object); @@ -4473,14 +4474,14 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateStateObject(ID3D12Device7 *i return E_NOTIMPL; }
-static void STDMETHODCALLTYPE d3d12_device_GetRaytracingAccelerationStructurePrebuildInfo(ID3D12Device7 *iface, +static void STDMETHODCALLTYPE d3d12_device_GetRaytracingAccelerationStructurePrebuildInfo(ID3D12Device8 *iface, const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *desc, D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *info) { FIXME("iface %p, desc %p, info %p stub!\n", iface, desc, info); }
-static D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS STDMETHODCALLTYPE d3d12_device_CheckDriverMatchingIdentifier(ID3D12Device7 *iface, +static D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS STDMETHODCALLTYPE d3d12_device_CheckDriverMatchingIdentifier(ID3D12Device8 *iface, D3D12_SERIALIZED_DATA_TYPE data_type, const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *identifier) { FIXME("iface %p, data_type %u, identifier %p stub!\n", iface, data_type, identifier); @@ -4488,7 +4489,7 @@ static D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS STDMETHODCALLTYPE d3d12_device_Ch return D3D12_DRIVER_MATCHING_IDENTIFIER_UNRECOGNIZED; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_SetBackgroundProcessingMode(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_SetBackgroundProcessingMode(ID3D12Device8 *iface, D3D12_BACKGROUND_PROCESSING_MODE mode, D3D12_MEASUREMENTS_ACTION action, HANDLE event, BOOL *further_measurements_desired) { @@ -4498,7 +4499,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_SetBackgroundProcessingMode(ID3D12 return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_AddToStateObject(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_AddToStateObject(ID3D12Device8 *iface, const D3D12_STATE_OBJECT_DESC *addition, ID3D12StateObject *state_object_to_grow_from, REFIID riid, void **new_state_object) { @@ -4508,7 +4509,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_AddToStateObject(ID3D12Device7 *if return E_NOTIMPL; }
-static HRESULT STDMETHODCALLTYPE d3d12_device_CreateProtectedResourceSession1(ID3D12Device7 *iface, +static HRESULT STDMETHODCALLTYPE d3d12_device_CreateProtectedResourceSession1(ID3D12Device8 *iface, const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *desc, REFIID riid, void **session) { FIXME("iface %p, desc %p, riid %s, session %p stub!\n", iface, desc, debugstr_guid(riid), session); @@ -4516,7 +4517,72 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateProtectedResourceSession1(ID return E_NOTIMPL; }
-static const struct ID3D12Device7Vtbl d3d12_device_vtbl = +static D3D12_RESOURCE_ALLOCATION_INFO* STDMETHODCALLTYPE d3d12_device_GetResourceAllocationInfo2(ID3D12Device8 *iface, + D3D12_RESOURCE_ALLOCATION_INFO *info, UINT visible_mask, UINT count, + const D3D12_RESOURCE_DESC1 *resource_descs, D3D12_RESOURCE_ALLOCATION_INFO1 *info1) +{ + FIXME("iface %p, info %p, visible_mask 0x%08x, count %u, resource_descs %p, info1 %p stub!\n", + iface, info, visible_mask, count, resource_descs, info1); + + info->Alignment = 0; + info->SizeInBytes = ~(uint64_t)0; + return info; +} + +static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommittedResource2(ID3D12Device8 *iface, + const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags, const D3D12_RESOURCE_DESC1 *desc, + D3D12_RESOURCE_STATES initial_state, const D3D12_CLEAR_VALUE *optimized_clear_value, + ID3D12ProtectedResourceSession *protected_session, REFIID iid, void **resource) +{ + FIXME("iface %p, heap_properties %p, heap_flags %#x, desc %p, initial_state %#x, " + "optimized_clear_value %p, protected_session %p, iid %s, resource %p stub!\n", + iface, heap_properties, heap_flags, desc, initial_state, + optimized_clear_value, protected_session, debugstr_guid(iid), resource); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePlacedResource1(ID3D12Device8 *iface, + ID3D12Heap *heap, UINT64 heap_offset, const D3D12_RESOURCE_DESC1 *resource_desc, + D3D12_RESOURCE_STATES initial_state, const D3D12_CLEAR_VALUE *optimized_clear_value, + REFIID iid, void **resource) +{ + FIXME("iface %p, heap %p, heap_offset %#"PRIx64", desc %p, initial_state %#x, " + "optimized_clear_value %p, iid %s, resource %p stub!\n", + iface, heap, heap_offset, resource_desc, initial_state, + optimized_clear_value, debugstr_guid(iid), resource); + + return E_NOTIMPL; +} + +static void STDMETHODCALLTYPE d3d12_device_CreateSamplerFeedbackUnorderedAccessView(ID3D12Device8 *iface, + ID3D12Resource *target_resource, ID3D12Resource *feedback_resource, D3D12_CPU_DESCRIPTOR_HANDLE descriptor) +{ + FIXME("iface %p, target_resource %p, feedback_resource %p, descriptor %s stub!\n", + iface, target_resource, feedback_resource, debug_cpu_handle(descriptor)); +} + +static void STDMETHODCALLTYPE d3d12_device_GetCopyableFootprints1(ID3D12Device8 *iface, + const D3D12_RESOURCE_DESC1 *desc, UINT first_sub_resource, UINT sub_resource_count, + UINT64 base_offset, D3D12_PLACED_SUBRESOURCE_FOOTPRINT *layouts, UINT *row_counts, + UINT64 *row_sizes, UINT64 *total_bytes) +{ + FIXME("iface %p, desc %p, first_sub_resource %u, sub_resource_count %u, base_offset %#"PRIx64", " + "layouts %p, row_counts %p, row_sizes %p, total_bytes %p stub!\n", + iface, desc, first_sub_resource, sub_resource_count, base_offset, + layouts, row_counts, row_sizes, total_bytes); + + if (layouts) + memset(layouts, 0xff, sizeof(*layouts) * sub_resource_count); + if (row_counts) + memset(row_counts, 0xff, sizeof(*row_counts) * sub_resource_count); + if (row_sizes) + memset(row_sizes, 0xff, sizeof(*row_sizes) * sub_resource_count); + if (total_bytes) + *total_bytes = UINT64_MAX; +} + +static const struct ID3D12Device8Vtbl d3d12_device_vtbl = { /* IUnknown methods */ d3d12_device_QueryInterface, @@ -4596,14 +4662,20 @@ static const struct ID3D12Device7Vtbl d3d12_device_vtbl = /* ID3D12Device7 methods */ d3d12_device_AddToStateObject, d3d12_device_CreateProtectedResourceSession1, + /* ID3D12Device8 methods */ + d3d12_device_GetResourceAllocationInfo2, + d3d12_device_CreateCommittedResource2, + d3d12_device_CreatePlacedResource1, + d3d12_device_CreateSamplerFeedbackUnorderedAccessView, + d3d12_device_GetCopyableFootprints1, };
-struct d3d12_device *unsafe_impl_from_ID3D12Device7(ID3D12Device7 *iface) +struct d3d12_device *unsafe_impl_from_ID3D12Device8(ID3D12Device8 *iface) { if (!iface) return NULL; assert(iface->lpVtbl == &d3d12_device_vtbl); - return impl_from_ID3D12Device7(iface); + return impl_from_ID3D12Device8(iface); }
static void *device_worker_main(void *arg) @@ -4646,7 +4718,7 @@ static HRESULT d3d12_device_init(struct d3d12_device *device, const struct vkd3d_vk_device_procs *vk_procs; HRESULT hr;
- device->ID3D12Device7_iface.lpVtbl = &d3d12_device_vtbl; + device->ID3D12Device8_iface.lpVtbl = &d3d12_device_vtbl; device->refcount = 1;
vkd3d_instance_incref(device->vkd3d_instance = instance); @@ -4894,28 +4966,28 @@ HRESULT vkd3d_join_thread(struct vkd3d_instance *instance, union vkd3d_thread_ha
IUnknown *vkd3d_get_device_parent(ID3D12Device *device) { - struct d3d12_device *d3d12_device = impl_from_ID3D12Device7((ID3D12Device7 *)device); + struct d3d12_device *d3d12_device = impl_from_ID3D12Device8((ID3D12Device8 *)device);
return d3d12_device->parent; }
VkDevice vkd3d_get_vk_device(ID3D12Device *device) { - struct d3d12_device *d3d12_device = impl_from_ID3D12Device7((ID3D12Device7 *)device); + struct d3d12_device *d3d12_device = impl_from_ID3D12Device8((ID3D12Device8 *)device);
return d3d12_device->vk_device; }
VkPhysicalDevice vkd3d_get_vk_physical_device(ID3D12Device *device) { - struct d3d12_device *d3d12_device = impl_from_ID3D12Device7((ID3D12Device7 *)device); + struct d3d12_device *d3d12_device = impl_from_ID3D12Device8((ID3D12Device8 *)device);
return d3d12_device->vk_physical_device; }
struct vkd3d_instance *vkd3d_instance_from_device(ID3D12Device *device) { - struct d3d12_device *d3d12_device = impl_from_ID3D12Device7((ID3D12Device7 *)device); + struct d3d12_device *d3d12_device = impl_from_ID3D12Device8((ID3D12Device8 *)device);
return d3d12_device->vkd3d_instance; } diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index 89764d090..7304846f6 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -2253,7 +2253,7 @@ HRESULT d3d12_reserved_resource_create(struct d3d12_device *device, HRESULT vkd3d_create_image_resource(ID3D12Device *device, const struct vkd3d_image_resource_create_info *create_info, ID3D12Resource **resource) { - struct d3d12_device *d3d12_device = unsafe_impl_from_ID3D12Device7((ID3D12Device7 *)device); + struct d3d12_device *d3d12_device = unsafe_impl_from_ID3D12Device8((ID3D12Device8 *)device); struct d3d12_resource *object; HRESULT hr;
diff --git a/libs/vkd3d/vkd3d_main.c b/libs/vkd3d/vkd3d_main.c index 7919b7d87..f6925d47b 100644 --- a/libs/vkd3d/vkd3d_main.c +++ b/libs/vkd3d/vkd3d_main.c @@ -71,11 +71,11 @@ HRESULT vkd3d_create_device(const struct vkd3d_device_create_info *create_info,
if (!device) { - ID3D12Device_Release(&object->ID3D12Device7_iface); + ID3D12Device_Release(&object->ID3D12Device8_iface); return S_FALSE; }
- return return_interface(&object->ID3D12Device7_iface, &IID_ID3D12Device, iid, device); + return return_interface(&object->ID3D12Device8_iface, &IID_ID3D12Device, iid, device); }
/* ID3D12RootSignatureDeserializer */ diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index 20317ace2..4f82b211f 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -1735,7 +1735,7 @@ struct vkd3d_desc_object_cache /* ID3D12Device */ struct d3d12_device { - ID3D12Device7 ID3D12Device7_iface; + ID3D12Device8 ID3D12Device8_iface; unsigned int refcount;
VkDevice vk_device; @@ -1810,29 +1810,29 @@ struct vkd3d_queue *d3d12_device_get_vkd3d_queue(struct d3d12_device *device, D3 bool d3d12_device_is_uma(struct d3d12_device *device, bool *coherent); void d3d12_device_mark_as_removed(struct d3d12_device *device, HRESULT reason, const char *message, ...) VKD3D_PRINTF_FUNC(3, 4); -struct d3d12_device *unsafe_impl_from_ID3D12Device7(ID3D12Device7 *iface); +struct d3d12_device *unsafe_impl_from_ID3D12Device8(ID3D12Device8 *iface); HRESULT d3d12_device_add_descriptor_heap(struct d3d12_device *device, struct d3d12_descriptor_heap *heap); void d3d12_device_remove_descriptor_heap(struct d3d12_device *device, struct d3d12_descriptor_heap *heap);
static inline HRESULT d3d12_device_query_interface(struct d3d12_device *device, REFIID iid, void **object) { - return ID3D12Device7_QueryInterface(&device->ID3D12Device7_iface, iid, object); + return ID3D12Device8_QueryInterface(&device->ID3D12Device8_iface, iid, object); }
static inline ULONG d3d12_device_add_ref(struct d3d12_device *device) { - return ID3D12Device7_AddRef(&device->ID3D12Device7_iface); + return ID3D12Device8_AddRef(&device->ID3D12Device8_iface); }
static inline ULONG d3d12_device_release(struct d3d12_device *device) { - return ID3D12Device7_Release(&device->ID3D12Device7_iface); + return ID3D12Device8_Release(&device->ID3D12Device8_iface); }
static inline unsigned int d3d12_device_get_descriptor_handle_increment_size(struct d3d12_device *device, D3D12_DESCRIPTOR_HEAP_TYPE descriptor_type) { - return ID3D12Device7_GetDescriptorHandleIncrementSize(&device->ID3D12Device7_iface, descriptor_type); + return ID3D12Device8_GetDescriptorHandleIncrementSize(&device->ID3D12Device8_iface, descriptor_type); }
/* utils */
From: Conor McCarthy cmccarthy@codeweavers.com
--- tests/d3d12.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c index d7933ed63..9432eb410 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -32155,6 +32155,7 @@ static void test_resource_allocation_info(void) { D3D12_RESOURCE_ALLOCATION_INFO info; D3D12_RESOURCE_DESC desc; + ID3D12Device8 *device8; ID3D12Device4 *device4; ID3D12Device *device; uint64_t total = 0; @@ -32205,6 +32206,7 @@ static void test_resource_allocation_info(void) {260, 512, 1, 1, DXGI_FORMAT_BC1_UNORM}, }; D3D12_RESOURCE_ALLOCATION_INFO1 infos1[ARRAY_SIZE(texture_tests)] = {0}; + D3D12_RESOURCE_DESC1 desc_array1[ARRAY_SIZE(texture_tests)]; D3D12_RESOURCE_DESC desc_array[ARRAY_SIZE(texture_tests)]; uint64_t sizes[ARRAY_SIZE(texture_tests)];
@@ -32350,6 +32352,61 @@ static void test_resource_allocation_info(void) ID3D12Device4_Release(device4); }
+ if (FAILED(ID3D12Device_QueryInterface(device, &IID_ID3D12Device8, (void **)&device8))) + { + skip("ID3D12Device8 not available; skipping GetResourceAllocationInfo2() tests."); + goto release; + } + + for (i = 0; i < ARRAY_SIZE(texture_tests); ++i) + { + desc_array1[i].Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D; + desc_array1[i].Alignment = (i < 6) ? D3D12_SMALL_RESOURCE_PLACEMENT_ALIGNMENT + : D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT; + desc_array1[i].Width = texture_tests[i].width; + desc_array1[i].Height = texture_tests[i].height; + desc_array1[i].DepthOrArraySize = texture_tests[i].array_size; + desc_array1[i].MipLevels = texture_tests[i].miplevels; + desc_array1[i].Format = texture_tests[i].format; + desc_array1[i].SampleDesc.Count = 1; + desc_array1[i].SampleDesc.Quality = 0; + desc_array1[i].Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN; + desc_array1[i].Flags = 0; + memset(&desc_array1[i].SamplerFeedbackMipRegion, 0, sizeof(desc_array1[i].SamplerFeedbackMipRegion)); + } + + info = ID3D12Device8_GetResourceAllocationInfo2(device8, 0, ARRAY_SIZE(desc_array1), desc_array1, infos1); + todo + ok(info.Alignment >= D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT, + "Got unexpected alignment %"PRIu64".\n", info.Alignment); + todo + check_alignment(info.SizeInBytes, info.Alignment); + ok(info.SizeInBytes >= total, "Got unexpected size %"PRIu64".\n", info.SizeInBytes); + ok(!infos1[0].Offset, "Got unexpected offset %"PRIu64".\n", infos1[0].Offset); + + for (i = 0; i < ARRAY_SIZE(infos1); ++i) + { + vkd3d_test_push_context("Test %u", i); + + ok(infos1[i].Alignment >= desc_array1[i].Alignment, + "Got unexpected alignment %"PRIu64".\n", infos1[i].Alignment); + check_alignment(infos1[i].Offset, infos1[i].Alignment); + check_alignment(infos1[i].SizeInBytes, infos1[i].Alignment); + ok(infos1[i].SizeInBytes == sizes[i], "Got unexpected size %"PRIu64".\n", infos1[i].SizeInBytes); + + if (!i) + continue; + + ok(infos1[i].Offset - infos1[i - 1].Offset >= infos1[i - 1].SizeInBytes, + "Got unexpected prev size %"PRIu64", prev offset %"PRIu64", offset %"PRIu64".\n", + infos1[i - 1].SizeInBytes, infos1[i - 1].Offset, infos1[i].Offset); + + vkd3d_test_pop_context(); + } + + ID3D12Device8_Release(device8); + +release: refcount = ID3D12Device_Release(device); ok(!refcount, "ID3D12Device has %u references left.\n", (unsigned int)refcount); }
From: Conor McCarthy cmccarthy@codeweavers.com
--- tests/d3d12.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c index 9432eb410..3d803cc81 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -1548,12 +1548,15 @@ static void test_create_committed_resource(void) ID3D12ProtectedResourceSession *protected_session; D3D12_GPU_VIRTUAL_ADDRESS gpu_address; D3D12_HEAP_PROPERTIES heap_properties; + D3D12_RESOURCE_DESC1 resource_desc1; D3D12_RESOURCE_DESC resource_desc; ID3D12Device *device, *tmp_device; D3D12_CLEAR_VALUE clear_value; D3D12_RESOURCE_STATES state; + ID3D12Resource2 *resource2; ID3D12Resource1 *resource1; ID3D12Resource *resource; + ID3D12Device8 *device8; ID3D12Device4 *device4; unsigned int i; ULONG refcount; @@ -1899,6 +1902,36 @@ static void test_create_committed_resource(void) ID3D12Device4_Release(device4); }
+ if (SUCCEEDED(ID3D12Device_QueryInterface(device, &IID_ID3D12Device8, (void **)&device8))) + { + resource_desc1.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D; + resource_desc1.Alignment = 0; + resource_desc1.Width = 32; + resource_desc1.Height = 32; + resource_desc1.DepthOrArraySize = 1; + resource_desc1.MipLevels = 1; + resource_desc1.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + resource_desc1.SampleDesc.Count = 1; + resource_desc1.SampleDesc.Quality = 0; + resource_desc1.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN; + resource_desc1.Flags = D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET; + memset(&resource_desc1.SamplerFeedbackMipRegion, 0, sizeof(resource_desc1.SamplerFeedbackMipRegion)); + + hr = ID3D12Device8_CreateCommittedResource2(device8, &heap_properties, D3D12_HEAP_FLAG_NONE, + &resource_desc1, D3D12_RESOURCE_STATE_RENDER_TARGET, &clear_value, NULL, + &IID_ID3D12Resource2, (void **)&resource2); + todo + ok(hr == S_OK, "Failed to create committed resource, hr %#x.\n", hr); + + if (!hr) + { + check_interface(resource2, &IID_ID3D12Resource2, true); + ID3D12Resource2_Release(resource2); + } + + ID3D12Device8_Release(device8); + } + refcount = ID3D12Device_Release(device); ok(!refcount, "ID3D12Device has %u references left.\n", (unsigned int)refcount); }
From: Conor McCarthy cmccarthy@codeweavers.com
--- tests/d3d12.c | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-)
diff --git a/tests/d3d12.c b/tests/d3d12.c index 3d803cc81..c07194189 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -2183,13 +2183,16 @@ static void test_create_placed_resource(void) { ID3D12ProtectedResourceSession *protected_session; D3D12_GPU_VIRTUAL_ADDRESS gpu_address; - ID3D12Resource *resource, *resource2; + ID3D12Resource *resource, *resource_2; + D3D12_RESOURCE_DESC1 resource_desc1; D3D12_RESOURCE_DESC resource_desc; ID3D12Device *device, *tmp_device; D3D12_CLEAR_VALUE clear_value; D3D12_RESOURCE_STATES state; + ID3D12Resource2 *resource2; ID3D12Resource1 *resource1; D3D12_HEAP_DESC heap_desc; + ID3D12Device8 *device8; ID3D12Heap *heap; unsigned int i; ULONG refcount; @@ -2280,6 +2283,35 @@ static void test_create_placed_resource(void) refcount = ID3D12Resource_Release(resource); ok(!refcount, "ID3D12Resource has %u references left.\n", (unsigned int)refcount);
+ if (SUCCEEDED(ID3D12Device_QueryInterface(device, &IID_ID3D12Device8, (void **)&device8))) + { + resource_desc1.Dimension = D3D12_RESOURCE_DIMENSION_BUFFER; + resource_desc1.Alignment = 0; + resource_desc1.Width = 32; + resource_desc1.Height = 1; + resource_desc1.DepthOrArraySize = 1; + resource_desc1.MipLevels = 1; + resource_desc1.Format = DXGI_FORMAT_UNKNOWN; + resource_desc1.SampleDesc.Count = 1; + resource_desc1.SampleDesc.Quality = 0; + resource_desc1.Layout = D3D12_TEXTURE_LAYOUT_ROW_MAJOR; + resource_desc1.Flags = 0; + memset(&resource_desc1.SamplerFeedbackMipRegion, 0, sizeof(resource_desc1.SamplerFeedbackMipRegion)); + + hr = ID3D12Device8_CreatePlacedResource1(device8, heap, 0, + &resource_desc1, D3D12_RESOURCE_STATE_COMMON, NULL, &IID_ID3D12Resource2, (void **)&resource2); + todo + ok(hr == S_OK, "Failed to create placed resource, hr %#x.\n", hr); + + if (!hr) + { + check_interface(resource2, &IID_ID3D12Resource2, true); + ID3D12Resource2_Release(resource2); + } + + ID3D12Device8_Release(device8); + } + /* The clear value must be NULL for buffers. */ hr = ID3D12Device_CreatePlacedResource(device, heap, 0, &resource_desc, D3D12_RESOURCE_STATE_COMMON, &clear_value, @@ -2302,11 +2334,11 @@ static void test_create_placed_resource(void) ok(!refcount, "Got unexpected refcount %u.\n", (unsigned int)refcount);
hr = ID3D12Device_CreatePlacedResource(device, heap, D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT, - &resource_desc, D3D12_RESOURCE_STATE_COMMON, NULL, &IID_ID3D12Resource, (void **)&resource2); + &resource_desc, D3D12_RESOURCE_STATE_COMMON, NULL, &IID_ID3D12Resource, (void **)&resource_2); ok(hr == S_OK, "Failed to create placed resource, hr %#x.\n", hr);
ID3D12Resource_Release(resource); - ID3D12Resource_Release(resource2); + ID3D12Resource_Release(resource_2);
for (i = 0; i < ARRAY_SIZE(invalid_buffer_desc_tests); ++i) {
From: Conor McCarthy cmccarthy@codeweavers.com
--- tests/d3d12.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c index c07194189..d53c7c14d 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -20109,9 +20109,11 @@ static void check_copyable_footprints_(unsigned int line, const D3D12_RESOURCE_D static void test_get_copyable_footprints(void) { D3D12_PLACED_SUBRESOURCE_FOOTPRINT layouts[10]; + D3D12_RESOURCE_DESC1 resource_desc1; uint64_t row_sizes[10], total_size; D3D12_RESOURCE_DESC resource_desc; unsigned int sub_resource_count; + ID3D12Device8 *device8; unsigned int i, j, k; ID3D12Device *device; UINT row_counts[10]; @@ -20349,6 +20351,32 @@ static void test_get_copyable_footprints(void) check_copyable_footprints(&resource_desc, 0, 1, 0, layouts, row_counts, row_sizes, &total_size);
+ if (SUCCEEDED(ID3D12Device_QueryInterface(device, &IID_ID3D12Device8, (void **)&device8))) + { + resource_desc1.Dimension = resource_desc.Dimension; + resource_desc1.Alignment = resource_desc.Alignment; + resource_desc1.Width = resource_desc.Width; + resource_desc1.Height = resource_desc.Height; + resource_desc1.DepthOrArraySize = resource_desc.DepthOrArraySize; + resource_desc1.MipLevels = resource_desc.MipLevels; + resource_desc1.Format = resource_desc.Format; + resource_desc1.SampleDesc.Count = resource_desc.SampleDesc.Count; + resource_desc1.SampleDesc.Quality = resource_desc.SampleDesc.Quality; + resource_desc1.Flags = resource_desc.Flags; + memset(&resource_desc1.SamplerFeedbackMipRegion, 0, sizeof(resource_desc1.SamplerFeedbackMipRegion)); + memset(layouts, 0, sizeof(layouts)); + memset(row_counts, 0, sizeof(row_counts)); + memset(row_sizes, 0, sizeof(row_sizes)); + total_size = 0; + ID3D12Device8_GetCopyableFootprints1(device8, &resource_desc1, 0, 1, 0, + layouts, row_counts, row_sizes, &total_size); + todo + check_copyable_footprints(&resource_desc, 0, 1, 0, + layouts, row_counts, row_sizes, &total_size); + + ID3D12Device8_Release(device8); + } + for (i = 0; i < ARRAY_SIZE(invalid_descs); ++i) { resource_desc = invalid_descs[i].resource_desc;
From: Conor McCarthy cmccarthy@codeweavers.com
--- libs/vkd3d/device.c | 10 +++++++--- libs/vkd3d/resource.c | 7 +++++++ tests/d3d12.c | 2 -- 3 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index f0ac5657b..cb1051ddd 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -4521,11 +4521,15 @@ static D3D12_RESOURCE_ALLOCATION_INFO* STDMETHODCALLTYPE d3d12_device_GetResourc D3D12_RESOURCE_ALLOCATION_INFO *info, UINT visible_mask, UINT count, const D3D12_RESOURCE_DESC1 *resource_descs, D3D12_RESOURCE_ALLOCATION_INFO1 *info1) { - FIXME("iface %p, info %p, visible_mask 0x%08x, count %u, resource_descs %p, info1 %p stub!\n", + struct d3d12_device *device = impl_from_ID3D12Device8(iface); + + TRACE("iface %p, info %p, visible_mask 0x%08x, count %u, resource_descs %p, info1 %p.\n", iface, info, visible_mask, count, resource_descs, info1);
- info->Alignment = 0; - info->SizeInBytes = ~(uint64_t)0; + debug_ignored_node_mask(visible_mask); + + d3d12_device_get_resource1_allocation_info(device, info1, count, resource_descs, info); + return info; }
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index 7304846f6..446ef3ab0 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -1857,6 +1857,7 @@ static bool d3d12_resource_validate_texture_alignment(const D3D12_RESOURCE_DESC1
HRESULT d3d12_resource_validate_desc(const D3D12_RESOURCE_DESC1 *desc, struct d3d12_device *device) { + const D3D12_MIP_REGION *mip_region = &desc->SamplerFeedbackMipRegion; const struct vkd3d_format *format;
switch (desc->Dimension) @@ -1926,6 +1927,12 @@ HRESULT d3d12_resource_validate_desc(const D3D12_RESOURCE_DESC1 *desc, struct d3
d3d12_validate_resource_flags(desc->Flags);
+ if (mip_region->Width && mip_region->Height && mip_region->Depth) + { + FIXME("Unhandled sampler feedback mip region size (%u, %u, %u).\n", mip_region->Width, mip_region->Height, + mip_region->Depth); + } + return S_OK; }
diff --git a/tests/d3d12.c b/tests/d3d12.c index d53c7c14d..359227644 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -32469,10 +32469,8 @@ static void test_resource_allocation_info(void) }
info = ID3D12Device8_GetResourceAllocationInfo2(device8, 0, ARRAY_SIZE(desc_array1), desc_array1, infos1); - todo ok(info.Alignment >= D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT, "Got unexpected alignment %"PRIu64".\n", info.Alignment); - todo check_alignment(info.SizeInBytes, info.Alignment); ok(info.SizeInBytes >= total, "Got unexpected size %"PRIu64".\n", info.SizeInBytes); ok(!infos1[0].Offset, "Got unexpected offset %"PRIu64".\n", infos1[0].Offset);
From: Conor McCarthy cmccarthy@codeweavers.com
--- libs/vkd3d/device.c | 17 ++++++++++++++--- tests/d3d12.c | 8 ++------ 2 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index cb1051ddd..e6459e7e6 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -4538,12 +4538,23 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateCommittedResource2(ID3D12Dev D3D12_RESOURCE_STATES initial_state, const D3D12_CLEAR_VALUE *optimized_clear_value, ID3D12ProtectedResourceSession *protected_session, REFIID iid, void **resource) { - FIXME("iface %p, heap_properties %p, heap_flags %#x, desc %p, initial_state %#x, " - "optimized_clear_value %p, protected_session %p, iid %s, resource %p stub!\n", + struct d3d12_device *device = impl_from_ID3D12Device8(iface); + struct d3d12_resource *object; + HRESULT hr; + + TRACE("iface %p, heap_properties %p, heap_flags %#x, desc %p, initial_state %#x, " + "optimized_clear_value %p, protected_session %p, iid %s, resource %p.\n", iface, heap_properties, heap_flags, desc, initial_state, optimized_clear_value, protected_session, debugstr_guid(iid), resource);
- return E_NOTIMPL; + if (FAILED(hr = d3d12_committed_resource_create(device, heap_properties, heap_flags, + desc, initial_state, optimized_clear_value, protected_session, &object))) + { + *resource = NULL; + return hr; + } + + return return_interface(&object->ID3D12Resource2_iface, &IID_ID3D12Resource2, iid, resource); }
static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePlacedResource1(ID3D12Device8 *iface, diff --git a/tests/d3d12.c b/tests/d3d12.c index 359227644..aebe45791 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -1920,15 +1920,11 @@ static void test_create_committed_resource(void) hr = ID3D12Device8_CreateCommittedResource2(device8, &heap_properties, D3D12_HEAP_FLAG_NONE, &resource_desc1, D3D12_RESOURCE_STATE_RENDER_TARGET, &clear_value, NULL, &IID_ID3D12Resource2, (void **)&resource2); - todo ok(hr == S_OK, "Failed to create committed resource, hr %#x.\n", hr);
- if (!hr) - { - check_interface(resource2, &IID_ID3D12Resource2, true); - ID3D12Resource2_Release(resource2); - } + check_interface(resource2, &IID_ID3D12Resource2, true);
+ ID3D12Resource2_Release(resource2); ID3D12Device8_Release(device8); }
From: Conor McCarthy cmccarthy@codeweavers.com
--- libs/vkd3d/device.c | 17 ++++++++++++++--- tests/d3d12.c | 8 ++------ 2 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index e6459e7e6..8a2dcba8b 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -4562,12 +4562,23 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePlacedResource1(ID3D12Device D3D12_RESOURCE_STATES initial_state, const D3D12_CLEAR_VALUE *optimized_clear_value, REFIID iid, void **resource) { - FIXME("iface %p, heap %p, heap_offset %#"PRIx64", desc %p, initial_state %#x, " - "optimized_clear_value %p, iid %s, resource %p stub!\n", + struct d3d12_device *device = impl_from_ID3D12Device8(iface); + struct d3d12_heap *heap_object; + struct d3d12_resource *object; + HRESULT hr; + + TRACE("iface %p, heap %p, heap_offset %#"PRIx64", desc %p, initial_state %#x, " + "optimized_clear_value %p, iid %s, resource %p.\n", iface, heap, heap_offset, resource_desc, initial_state, optimized_clear_value, debugstr_guid(iid), resource);
- return E_NOTIMPL; + heap_object = unsafe_impl_from_ID3D12Heap(heap); + + if (FAILED(hr = d3d12_placed_resource_create(device, heap_object, heap_offset, + resource_desc, initial_state, optimized_clear_value, &object))) + return hr; + + return return_interface(&object->ID3D12Resource2_iface, &IID_ID3D12Resource2, iid, resource); }
static void STDMETHODCALLTYPE d3d12_device_CreateSamplerFeedbackUnorderedAccessView(ID3D12Device8 *iface, diff --git a/tests/d3d12.c b/tests/d3d12.c index aebe45791..247685f02 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -2296,15 +2296,11 @@ static void test_create_placed_resource(void)
hr = ID3D12Device8_CreatePlacedResource1(device8, heap, 0, &resource_desc1, D3D12_RESOURCE_STATE_COMMON, NULL, &IID_ID3D12Resource2, (void **)&resource2); - todo ok(hr == S_OK, "Failed to create placed resource, hr %#x.\n", hr);
- if (!hr) - { - check_interface(resource2, &IID_ID3D12Resource2, true); - ID3D12Resource2_Release(resource2); - } + check_interface(resource2, &IID_ID3D12Resource2, true);
+ ID3D12Resource2_Release(resource2); ID3D12Device8_Release(device8); }
From: Conor McCarthy cmccarthy@codeweavers.com
--- libs/vkd3d/device.c | 16 ++++++---------- tests/d3d12.c | 1 - 2 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 8a2dcba8b..4d914ff20 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -4593,19 +4593,15 @@ static void STDMETHODCALLTYPE d3d12_device_GetCopyableFootprints1(ID3D12Device8 UINT64 base_offset, D3D12_PLACED_SUBRESOURCE_FOOTPRINT *layouts, UINT *row_counts, UINT64 *row_sizes, UINT64 *total_bytes) { - FIXME("iface %p, desc %p, first_sub_resource %u, sub_resource_count %u, base_offset %#"PRIx64", " - "layouts %p, row_counts %p, row_sizes %p, total_bytes %p stub!\n", + struct d3d12_device *device = impl_from_ID3D12Device8(iface); + + TRACE("iface %p, desc %p, first_sub_resource %u, sub_resource_count %u, base_offset %#"PRIx64", " + "layouts %p, row_counts %p, row_sizes %p, total_bytes %p.\n", iface, desc, first_sub_resource, sub_resource_count, base_offset, layouts, row_counts, row_sizes, total_bytes);
- if (layouts) - memset(layouts, 0xff, sizeof(*layouts) * sub_resource_count); - if (row_counts) - memset(row_counts, 0xff, sizeof(*row_counts) * sub_resource_count); - if (row_sizes) - memset(row_sizes, 0xff, sizeof(*row_sizes) * sub_resource_count); - if (total_bytes) - *total_bytes = UINT64_MAX; + d3d12_device_get_copyable_footprints(device, desc, first_sub_resource, sub_resource_count, + base_offset, layouts, row_counts, row_sizes, total_bytes); }
static const struct ID3D12Device8Vtbl d3d12_device_vtbl = diff --git a/tests/d3d12.c b/tests/d3d12.c index 247685f02..ae93e8990 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -20362,7 +20362,6 @@ static void test_get_copyable_footprints(void) total_size = 0; ID3D12Device8_GetCopyableFootprints1(device8, &resource_desc1, 0, 1, 0, layouts, row_counts, row_sizes, &total_size); - todo check_copyable_footprints(&resource_desc, 0, 1, 0, layouts, row_counts, row_sizes, &total_size);
+static D3D12_RESOURCE_ALLOCATION_INFO* STDMETHODCALLTYPE d3d12_device_GetResourceAllocationInfo2(ID3D12Device8 *iface, + D3D12_RESOURCE_ALLOCATION_INFO *info, UINT visible_mask, UINT count, + const D3D12_RESOURCE_DESC1 *resource_descs, D3D12_RESOURCE_ALLOCATION_INFO1 *info1)
Small formatting error.