From dfeded6460ce067fe1c0540306c2964a170bed2a Mon Sep 17 00:00:00 2001 From: Jan Sikorski Date: Thu, 7 Oct 2021 12:57:27 +0200 Subject: [PATCH] wined3d: Use atomic instructions for resource view bind counts. Signed-off-by: Jan Sikorski Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/wined3d_private.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 657b6acee39..56c90ba6606 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4157,8 +4157,8 @@ struct wined3d_resource struct list resource_list_entry; - uint32_t srv_bind_count_device; - uint32_t rtv_bind_count_device; + int32_t srv_bind_count_device; + int32_t rtv_bind_count_device; }; static inline ULONG wined3d_resource_incref(struct wined3d_resource *resource) @@ -6329,22 +6329,22 @@ static inline bool wined3d_rtv_all_subresources(const struct wined3d_rendertarge static inline void wined3d_srv_bind_count_inc(struct wined3d_shader_resource_view *srv) { - ++srv->resource->srv_bind_count_device; + InterlockedIncrement(&srv->resource->srv_bind_count_device); } static inline void wined3d_srv_bind_count_dec(struct wined3d_shader_resource_view *srv) { - --srv->resource->srv_bind_count_device; + InterlockedDecrement(&srv->resource->srv_bind_count_device); } static inline void wined3d_rtv_bind_count_inc(struct wined3d_rendertarget_view *rtv) { - ++rtv->resource->rtv_bind_count_device; + InterlockedIncrement(&rtv->resource->rtv_bind_count_device); } static inline void wined3d_rtv_bind_count_dec(struct wined3d_rendertarget_view *rtv) { - --rtv->resource->rtv_bind_count_device; + InterlockedDecrement(&rtv->resource->rtv_bind_count_device); } static inline bool wined3d_rtv_overlaps_srv(const struct wined3d_rendertarget_view *rtv,