vkd3d: Remove _2 suffix from d3d12_heap_2 and related functions.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
This commit is contained in:
Philip Rebohle 2021-02-04 18:59:10 +01:00 committed by Hans-Kristian Arntzen
parent 6f8bb2a4c0
commit a2e14d7d1d
5 changed files with 35 additions and 35 deletions

View File

@ -8533,7 +8533,7 @@ static void STDMETHODCALLTYPE d3d12_command_queue_UpdateTileMappings(ID3D12Comma
struct d3d12_command_queue *command_queue = impl_from_ID3D12CommandQueue(iface);
unsigned int region_tile = 0, region_idx = 0, range_tile = 0, range_idx = 0;
struct d3d12_resource *res = unsafe_impl_from_ID3D12Resource(resource);
struct d3d12_heap_2 *memory_heap = unsafe_impl_from_ID3D12Heap_2(heap);
struct d3d12_heap *memory_heap = unsafe_impl_from_ID3D12Heap(heap);
struct vkd3d_sparse_memory_bind *bind, **bound_tiles;
struct d3d12_sparse_info *sparse = &res->sparse;
D3D12_TILED_RESOURCE_COORDINATE region_coord;

View File

@ -3524,7 +3524,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreatePlacedResource(d3d12_device_
const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state,
const D3D12_CLEAR_VALUE *optimized_clear_value, REFIID iid, void **resource)
{
struct d3d12_heap_2 *heap_object = unsafe_impl_from_ID3D12Heap_2(heap);
struct d3d12_heap *heap_object = unsafe_impl_from_ID3D12Heap(heap);
struct d3d12_device *device = impl_from_ID3D12Device(iface);
struct d3d12_resource *object;
HRESULT hr;
@ -3864,7 +3864,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_OpenExistingHeapFromAddress(d3d12_
#ifdef _WIN32
MEMORY_BASIC_INFORMATION info;
struct d3d12_device *device;
struct d3d12_heap_2 *object;
struct d3d12_heap *object;
D3D12_HEAP_DESC heap_desc;
size_t allocation_size;
HRESULT hr;
@ -3911,7 +3911,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_OpenExistingHeapFromAddress(d3d12_
heap_desc.Properties.VisibleNodeMask = 1;
heap_desc.SizeInBytes = allocation_size;
if (FAILED(hr = d3d12_heap_create_2(device, &heap_desc, address, &object)))
if (FAILED(hr = d3d12_heap_create(device, &heap_desc, address, &object)))
{
*heap = NULL;
return hr;
@ -4018,7 +4018,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateHeap1(d3d12_device_iface *if
REFIID iid, void **heap)
{
struct d3d12_device *device = impl_from_ID3D12Device(iface);
struct d3d12_heap_2 *object;
struct d3d12_heap *object;
HRESULT hr;
TRACE("iface %p, desc %p, protected_session %p, iid %s, heap %p.\n",
@ -4027,7 +4027,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateHeap1(d3d12_device_iface *if
if (protected_session)
FIXME("Ignoring protected session %p.\n", protected_session);
if (FAILED(hr = d3d12_heap_create_2(device, desc, NULL, &object)))
if (FAILED(hr = d3d12_heap_create(device, desc, NULL, &object)))
{
*heap = NULL;
return hr;

View File

@ -23,9 +23,9 @@
#include "vkd3d_private.h"
/* ID3D12Heap */
static inline struct d3d12_heap_2 *impl_from_ID3D12Heap(d3d12_heap_iface *iface)
static inline struct d3d12_heap *impl_from_ID3D12Heap(d3d12_heap_iface *iface)
{
return CONTAINING_RECORD(iface, struct d3d12_heap_2, ID3D12Heap_iface);
return CONTAINING_RECORD(iface, struct d3d12_heap, ID3D12Heap_iface);
}
static HRESULT STDMETHODCALLTYPE d3d12_heap_QueryInterface(d3d12_heap_iface *iface,
@ -53,14 +53,14 @@ static HRESULT STDMETHODCALLTYPE d3d12_heap_QueryInterface(d3d12_heap_iface *ifa
static ULONG STDMETHODCALLTYPE d3d12_heap_AddRef(d3d12_heap_iface *iface)
{
struct d3d12_heap_2 *heap = impl_from_ID3D12Heap(iface);
struct d3d12_heap *heap = impl_from_ID3D12Heap(iface);
ULONG refcount = InterlockedIncrement(&heap->refcount);
TRACE("%p increasing refcount to %u.\n", heap, refcount);
return refcount;
}
static void d3d12_heap_destroy(struct d3d12_heap_2 *heap)
static void d3d12_heap_destroy(struct d3d12_heap *heap)
{
TRACE("Destroying heap %p.\n", heap);
@ -72,7 +72,7 @@ static void d3d12_heap_destroy(struct d3d12_heap_2 *heap)
static ULONG STDMETHODCALLTYPE d3d12_heap_Release(d3d12_heap_iface *iface)
{
struct d3d12_heap_2 *heap = impl_from_ID3D12Heap(iface);
struct d3d12_heap *heap = impl_from_ID3D12Heap(iface);
ULONG refcount = InterlockedDecrement(&heap->refcount);
TRACE("%p decreasing refcount to %u.\n", heap, refcount);
@ -86,7 +86,7 @@ static ULONG STDMETHODCALLTYPE d3d12_heap_Release(d3d12_heap_iface *iface)
static HRESULT STDMETHODCALLTYPE d3d12_heap_GetPrivateData(d3d12_heap_iface *iface,
REFGUID guid, UINT *data_size, void *data)
{
struct d3d12_heap_2 *heap = impl_from_ID3D12Heap(iface);
struct d3d12_heap *heap = impl_from_ID3D12Heap(iface);
TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
@ -96,7 +96,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_heap_GetPrivateData(d3d12_heap_iface *ifa
static HRESULT STDMETHODCALLTYPE d3d12_heap_SetPrivateData(d3d12_heap_iface *iface,
REFGUID guid, UINT data_size, const void *data)
{
struct d3d12_heap_2 *heap = impl_from_ID3D12Heap(iface);
struct d3d12_heap *heap = impl_from_ID3D12Heap(iface);
TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
@ -106,7 +106,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_heap_SetPrivateData(d3d12_heap_iface *ifa
static HRESULT STDMETHODCALLTYPE d3d12_heap_SetPrivateDataInterface(d3d12_heap_iface *iface,
REFGUID guid, const IUnknown *data)
{
struct d3d12_heap_2 *heap = impl_from_ID3D12Heap(iface);
struct d3d12_heap *heap = impl_from_ID3D12Heap(iface);
TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data);
@ -115,7 +115,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_heap_SetPrivateDataInterface(d3d12_heap_i
static HRESULT STDMETHODCALLTYPE d3d12_heap_SetName(d3d12_heap_iface *iface, const WCHAR *name)
{
struct d3d12_heap_2 *heap = impl_from_ID3D12Heap(iface);
struct d3d12_heap *heap = impl_from_ID3D12Heap(iface);
TRACE("iface %p, name %s.\n", iface, debugstr_w(name));
@ -128,7 +128,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_heap_SetName(d3d12_heap_iface *iface, con
static HRESULT STDMETHODCALLTYPE d3d12_heap_GetDevice(d3d12_heap_iface *iface, REFIID iid, void **device)
{
struct d3d12_heap_2 *heap = impl_from_ID3D12Heap(iface);
struct d3d12_heap *heap = impl_from_ID3D12Heap(iface);
TRACE("iface %p, iid %s, device %p.\n", iface, debugstr_guid(iid), device);
@ -138,7 +138,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_heap_GetDevice(d3d12_heap_iface *iface, R
static D3D12_HEAP_DESC * STDMETHODCALLTYPE d3d12_heap_GetDesc(d3d12_heap_iface *iface,
D3D12_HEAP_DESC *desc)
{
struct d3d12_heap_2 *heap = impl_from_ID3D12Heap(iface);
struct d3d12_heap *heap = impl_from_ID3D12Heap(iface);
TRACE("iface %p, desc %p.\n", iface, desc);
@ -173,7 +173,7 @@ static CONST_VTBL struct ID3D12Heap1Vtbl d3d12_heap_vtbl =
d3d12_heap_GetProtectedResourceSession,
};
static struct d3d12_heap_2 *unsafe_impl_from_ID3D12Heap1(ID3D12Heap1 *iface)
static struct d3d12_heap *unsafe_impl_from_ID3D12Heap1(ID3D12Heap1 *iface)
{
if (!iface)
return NULL;
@ -181,7 +181,7 @@ static struct d3d12_heap_2 *unsafe_impl_from_ID3D12Heap1(ID3D12Heap1 *iface)
return impl_from_ID3D12Heap(iface);
}
struct d3d12_heap_2 *unsafe_impl_from_ID3D12Heap_2(ID3D12Heap *iface)
struct d3d12_heap *unsafe_impl_from_ID3D12Heap(ID3D12Heap *iface)
{
return unsafe_impl_from_ID3D12Heap1((ID3D12Heap1 *)iface);
}
@ -210,7 +210,7 @@ static HRESULT validate_heap_desc(const D3D12_HEAP_DESC *desc)
return S_OK;
}
static HRESULT d3d12_heap_init_2(struct d3d12_heap_2 *heap, struct d3d12_device *device,
static HRESULT d3d12_heap_init(struct d3d12_heap *heap, struct d3d12_device *device,
const D3D12_HEAP_DESC *desc, void* host_address)
{
struct vkd3d_allocate_heap_memory_info alloc_info;
@ -249,16 +249,16 @@ static HRESULT d3d12_heap_init_2(struct d3d12_heap_2 *heap, struct d3d12_device
return S_OK;
}
HRESULT d3d12_heap_create_2(struct d3d12_device *device, const D3D12_HEAP_DESC *desc,
void* host_address, struct d3d12_heap_2 **heap)
HRESULT d3d12_heap_create(struct d3d12_device *device, const D3D12_HEAP_DESC *desc,
void* host_address, struct d3d12_heap **heap)
{
struct d3d12_heap_2 *object;
struct d3d12_heap *object;
HRESULT hr;
if (!(object = vkd3d_malloc(sizeof(*object))))
return E_OUTOFMEMORY;
if (FAILED(hr = d3d12_heap_init_2(object, device, desc, host_address)))
if (FAILED(hr = d3d12_heap_init(object, device, desc, host_address)))
{
vkd3d_free(object);
return hr;

View File

@ -2370,10 +2370,10 @@ static HRESULT d3d12_resource_bind_image_memory_2(struct d3d12_resource *resourc
resource->vk_image, memory_requirements.alignment, resource->heap_offset);
memset(&allocate_info, 0, sizeof(allocate_info));
allocate_info.heap_desc.Properties = resource->heap_2->desc.Properties;
allocate_info.heap_desc.Properties = resource->heap->desc.Properties;
allocate_info.heap_desc.SizeInBytes = memory_requirements.size;
allocate_info.heap_desc.Alignment = memory_requirements.alignment;
allocate_info.heap_desc.Flags = resource->heap_2->desc.Flags | D3D12_HEAP_FLAG_DENY_BUFFERS;
allocate_info.heap_desc.Flags = resource->heap->desc.Flags | D3D12_HEAP_FLAG_DENY_BUFFERS;
if (FAILED(hr = vkd3d_allocate_heap_memory_2(device,
&device->memory_allocator, &allocate_info, &resource->mem)))
@ -2393,7 +2393,7 @@ static HRESULT d3d12_resource_bind_image_memory_2(struct d3d12_resource *resourc
return S_OK;
}
static HRESULT d3d12_resource_validate_heap(const D3D12_RESOURCE_DESC *resource_desc, struct d3d12_heap_2 *heap)
static HRESULT d3d12_resource_validate_heap(const D3D12_RESOURCE_DESC *resource_desc, struct d3d12_heap *heap)
{
D3D12_HEAP_FLAGS deny_flag;
@ -2421,7 +2421,7 @@ static HRESULT d3d12_resource_validate_heap(const D3D12_RESOURCE_DESC *resource_
}
HRESULT d3d12_resource_create_placed_2(struct d3d12_device *device, const D3D12_RESOURCE_DESC *desc,
struct d3d12_heap_2 *heap, uint64_t heap_offset, D3D12_RESOURCE_STATES initial_state,
struct d3d12_heap *heap, uint64_t heap_offset, D3D12_RESOURCE_STATES initial_state,
const D3D12_CLEAR_VALUE *optimized_clear_value, struct d3d12_resource **resource)
{
struct d3d12_resource *object;
@ -2434,7 +2434,7 @@ HRESULT d3d12_resource_create_placed_2(struct d3d12_device *device, const D3D12_
desc, &heap->desc.Properties, initial_state, optimized_clear_value, &object)))
return hr;
object->heap_2 = heap;
object->heap = heap;
/* The exact allocation size is not important here since the
* resource does not own the allocation, so just set it to 0. */
vkd3d_memory_allocation_slice(&object->mem, &heap->allocation, heap_offset, 0);

View File

@ -598,7 +598,7 @@ HRESULT vkd3d_memory_allocator_flush_clears(struct vkd3d_memory_allocator *alloc
/* ID3D12Heap */
typedef ID3D12Heap1 d3d12_heap_iface;
struct d3d12_heap_2
struct d3d12_heap
{
d3d12_heap_iface ID3D12Heap_iface;
LONG refcount;
@ -610,9 +610,9 @@ struct d3d12_heap_2
struct vkd3d_private_store private_store;
};
HRESULT d3d12_heap_create_2(struct d3d12_device *device, const D3D12_HEAP_DESC *desc,
void *host_address, struct d3d12_heap_2 **heap);
struct d3d12_heap_2 *unsafe_impl_from_ID3D12Heap_2(ID3D12Heap *iface);
HRESULT d3d12_heap_create(struct d3d12_device *device, const D3D12_HEAP_DESC *desc,
void *host_address, struct d3d12_heap **heap);
struct d3d12_heap *unsafe_impl_from_ID3D12Heap(ID3D12Heap *iface);
enum vkd3d_resource_flag
{
@ -695,7 +695,7 @@ struct d3d12_resource
VkImage vk_image;
};
struct d3d12_heap_2 *heap_2;
struct d3d12_heap *heap;
uint64_t heap_offset;
uint32_t flags;
@ -739,7 +739,7 @@ HRESULT d3d12_resource_create_committed_2(struct d3d12_device *device, const D3D
const D3D12_HEAP_PROPERTIES *heap_properties, D3D12_HEAP_FLAGS heap_flags, D3D12_RESOURCE_STATES initial_state,
const D3D12_CLEAR_VALUE *optimized_clear_value, struct d3d12_resource **resource);
HRESULT d3d12_resource_create_placed_2(struct d3d12_device *device, const D3D12_RESOURCE_DESC *desc,
struct d3d12_heap_2 *heap, uint64_t heap_offset, D3D12_RESOURCE_STATES initial_state,
struct d3d12_heap *heap, uint64_t heap_offset, D3D12_RESOURCE_STATES initial_state,
const D3D12_CLEAR_VALUE *optimized_clear_value, struct d3d12_resource **resource);
HRESULT d3d12_resource_create_reserved_2(struct d3d12_device *device,
const D3D12_RESOURCE_DESC *desc, D3D12_RESOURCE_STATES initial_state,