summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr
diff options
context:
space:
mode:
authorGeorge Kyriazis <[email protected]>2017-01-10 17:12:03 -0600
committerTim Rowley <[email protected]>2017-01-12 09:10:15 -0600
commita61528fa33f8d7f39167e62da6d9317ed84c43b8 (patch)
tree0b49587ed687f5966570be913eebc5cad7f1fe38 /src/gallium/drivers/swr
parentce44501ea87ff66267c9cf280e4596065ffebd46 (diff)
Always defer memory free in swr_resource_destroy
Defer delete on regular resources. This ensures that any work being done on the resource is completed before freeing up the resource's memory. Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr')
-rw-r--r--src/gallium/drivers/swr/swr_screen.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/gallium/drivers/swr/swr_screen.cpp b/src/gallium/drivers/swr/swr_screen.cpp
index cc8030eaff6..50123887b50 100644
--- a/src/gallium/drivers/swr/swr_screen.cpp
+++ b/src/gallium/drivers/swr/swr_screen.cpp
@@ -880,18 +880,11 @@ swr_resource_destroy(struct pipe_screen *p_screen, struct pipe_resource *pt)
winsys->displaytarget_destroy(winsys, spr->display_target);
} else {
- /* For regular resources, if the resource is being used, defer deletion
- * (use aligned-free) */
- if (pipe && spr->status) {
- swr_resource_unused(pt);
- swr_fence_work_free(screen->flush_fence,
- spr->swr.pBaseAddress, true);
- swr_fence_work_free(screen->flush_fence,
- spr->secondary.pBaseAddress, true);
- } else {
- AlignedFree(spr->swr.pBaseAddress);
- AlignedFree(spr->secondary.pBaseAddress);
- }
+ /* For regular resources, defer deletion */
+ swr_resource_unused(pt);
+ swr_fence_work_free(screen->flush_fence, spr->swr.pBaseAddress, true);
+ swr_fence_work_free(screen->flush_fence,
+ spr->secondary.pBaseAddress, true);
}
FREE(spr);