[PATCH 4/4] wined3d: Move resource->type away from the access time field.

Stefan Dösinger stefan at codeweavers.com
Wed Feb 23 10:01:44 CST 2022


I am not signing off on this patch yet as I think a more thorough look
at all our structures would be benefitial. E.g. we might want to move a
few things (bind_count, map_count, etc into wined3d_client_resource and
look at the alignment of our allocations.

This apparently avoids cache line stealing when the main thread sets the
access time and the CS thread reads the resource type for preloading
purposes.

The reason to move type and not access_time is that ref and bind_count
are accessed from the main thread too.
---
 dlls/wined3d/wined3d_private.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 4cf454549f6..fbc39b53cbe 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -4316,7 +4316,6 @@ struct wined3d_resource
     LONG map_count;
     ULONG access_time;
     struct wined3d_device *device;
-    enum wined3d_resource_type type;
     enum wined3d_gl_resource_type gl_type;
     const struct wined3d_format *format;
     unsigned int format_flags;
@@ -4346,6 +4345,7 @@ struct wined3d_resource
 
     int32_t srv_bind_count_device;
     int32_t rtv_bind_count_device;
+    enum wined3d_resource_type type;
 };
 
 static inline ULONG wined3d_resource_incref(struct wined3d_resource *resource)
-- 
2.34.1




More information about the wine-devel mailing list