Henri Verbeet : vkd3d: Use vkd3d_atomic_increment_u32() in d3d12_resource_incref().
Module: vkd3d Branch: master Commit: a9582a7355ec02441394885a4b4a468bee1254ce URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/a9582a7355ec02441394885a4b4a46... Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Jan 29 17:17:51 2024 +0100 vkd3d: Use vkd3d_atomic_increment_u32() in d3d12_resource_incref(). --- 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 53978e65..f607b178 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -1003,7 +1003,7 @@ static void d3d12_resource_destroy(struct d3d12_resource *resource, struct d3d12 static ULONG d3d12_resource_incref(struct d3d12_resource *resource) { - ULONG refcount = InterlockedIncrement(&resource->internal_refcount); + unsigned int refcount = vkd3d_atomic_increment_u32(&resource->internal_refcount); TRACE("%p increasing refcount to %u.\n", resource, refcount); @@ -1012,7 +1012,7 @@ static ULONG d3d12_resource_incref(struct d3d12_resource *resource) static ULONG d3d12_resource_decref(struct d3d12_resource *resource) { - ULONG refcount = InterlockedDecrement(&resource->internal_refcount); + unsigned int refcount = InterlockedDecrement((LONG *)&resource->internal_refcount); TRACE("%p decreasing refcount to %u.\n", resource, refcount); diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index 4b4daa53..68941537 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -722,7 +722,7 @@ struct d3d12_resource { ID3D12Resource1 ID3D12Resource1_iface; LONG refcount; - LONG internal_refcount; + unsigned int internal_refcount; D3D12_RESOURCE_DESC desc; const struct vkd3d_format *format;
participants (1)
-
Alexandre Julliard