From: Henri Verbeet hverbeet@codeweavers.com
--- libs/vkd3d/resource.c | 4 ++-- libs/vkd3d/vkd3d_private.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index 05463cb34..e5f743f53 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -358,7 +358,7 @@ static ULONG STDMETHODCALLTYPE d3d12_heap_Release(ID3D12Heap *iface)
static void d3d12_heap_resource_destroyed(struct d3d12_heap *heap) { - if (!InterlockedDecrement(&heap->resource_count) && (!heap->refcount || heap->is_private)) + if (!InterlockedDecrement((LONG *)&heap->resource_count) && (!heap->refcount || heap->is_private)) d3d12_heap_destroy(heap); }
@@ -2174,7 +2174,7 @@ static HRESULT vkd3d_bind_heap_memory(struct d3d12_device *device, { resource->heap = heap; resource->heap_offset = heap_offset; - InterlockedIncrement(&heap->resource_count); + vkd3d_atomic_increment_u32(&heap->resource_count); } else { diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index 5b5ef9b08..4b4daa53d 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -666,7 +666,7 @@ struct d3d12_heap { ID3D12Heap ID3D12Heap_iface; unsigned int refcount; - LONG resource_count; + unsigned int resource_count;
bool is_private; D3D12_HEAP_DESC desc;