Module: vkd3d Branch: master Commit: 30a00160e2a75e2d5996035f9056912510a42fd8 URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/30a00160e2a75e2d5996035f905691...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Wed Jan 24 20:57:35 2024 +0100
vkd3d: Use vkd3d_atomic_increment_u32() in vkd3d_bind_heap_memory().
---
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 05463cb3..e5f743f5 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 5b5ef9b0..4b4daa53 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;