Mesa (master): d3d12: Use an appropriate pipe resource usage for map intermediates
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jan 5 23:03:11 UTC 2021
Module: Mesa
Branch: master
Commit: 34bae108df0c707a638b4305af9a1d08d15832b4
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=34bae108df0c707a638b4305af9a1d08d15832b4
Author: Jesse Natalie <jenatali at microsoft.com>
Date: Mon Dec 14 11:53:39 2020 -0800
d3d12: Use an appropriate pipe resource usage for map intermediates
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8095>
---
src/gallium/drivers/d3d12/d3d12_resource.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/d3d12/d3d12_resource.cpp b/src/gallium/drivers/d3d12/d3d12_resource.cpp
index 6f15d4f92ab..8fc90c75ad8 100644
--- a/src/gallium/drivers/d3d12/d3d12_resource.cpp
+++ b/src/gallium/drivers/d3d12/d3d12_resource.cpp
@@ -972,8 +972,11 @@ d3d12_transfer_map(struct pipe_context *pctx,
range.Begin = aligned_x;
}
+ pipe_resource_usage staging_usage = (usage & (PIPE_MAP_READ | PIPE_MAP_READ_WRITE)) ?
+ PIPE_USAGE_STAGING : PIPE_USAGE_STREAM;
+
trans->staging_res = pipe_buffer_create(pctx->screen, 0,
- PIPE_USAGE_STAGING,
+ staging_usage,
staging_res_size);
if (!trans->staging_res)
return NULL;
More information about the mesa-commit
mailing list