[PATCH 05/10] wined3d: Add dirty region tracking in resource_init() and resource_cleanup().

Masanori Kakura kakurasan at gmail.com
Mon Apr 17 08:47:10 CDT 2017


Signed-off-by: Masanori Kakura <kakurasan at gmail.com>
---
 dlls/wined3d/resource.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 5f75b9300b..523b8b0245 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -203,6 +203,13 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
     resource->parent_ops = parent_ops;
     resource->resource_ops = resource_ops;
     resource->map_binding = WINED3D_LOCATION_SYSMEM;
+    resource->dirty_regions = NULL;
+
+    if (!wined3d_dirty_regions_add(&resource->dirty_regions, 0, 0, width, height, 0, depth))
+    {
+        ERR("Failed to allocate memory.\n");
+        return E_OUTOFMEMORY;
+    }
 
     if (size)
     {
@@ -263,6 +270,7 @@ void resource_cleanup(struct wined3d_resource *resource)
         device_resource_released(resource->device, resource);
     }
     wined3d_resource_acquire(resource);
+    wined3d_dirty_regions_clear(&resource->dirty_regions);
     wined3d_cs_destroy_object(resource->device->cs, wined3d_resource_destroy_object, resource);
 }
 
-- 
2.11.0




More information about the wine-patches mailing list