summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-10-25 15:33:00 -0400
committerMarek Olšák <[email protected]>2018-10-30 16:03:02 -0400
commit8ad12c8bec4bd20ea4241e412b477a155a42186b (patch)
tree4155600e79320d788e4f1df43e2b9230b5f67684 /src/gallium/drivers/radeonsi
parent00fc56a68d21d7aa91b95f0eaacba59a96c466f5 (diff)
gallium: rework PIPE_HANDLE_USAGE_* flags
Only radeonsi uses them, so adjust them to match its needs.
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r--src/gallium/drivers/radeonsi/si_texture.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c
index bcff226a586..2fb79253a72 100644
--- a/src/gallium/drivers/radeonsi/si_texture.c
+++ b/src/gallium/drivers/radeonsi/si_texture.c
@@ -445,7 +445,7 @@ static bool si_can_disable_dcc(struct si_texture *tex)
/* We can't disable DCC if it can be written by another process. */
return tex->dcc_offset &&
(!tex->buffer.b.is_shared ||
- !(tex->buffer.external_usage & PIPE_HANDLE_USAGE_WRITE));
+ !(tex->buffer.external_usage & PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE));
}
static bool si_texture_discard_dcc(struct si_screen *sscreen,
@@ -763,7 +763,7 @@ static boolean si_texture_get_handle(struct pipe_screen* screen,
* disable it for external clients that want write
* access.
*/
- if (usage & PIPE_HANDLE_USAGE_WRITE && tex->dcc_offset) {
+ if (usage & PIPE_HANDLE_USAGE_SHADER_WRITE && tex->dcc_offset) {
if (si_texture_disable_dcc(sctx, tex)) {
update_metadata = true;
/* si_texture_disable_dcc flushes the context */
@@ -2373,7 +2373,8 @@ si_texture_from_memobj(struct pipe_screen *screen,
struct pipe_resource *tex =
si_texture_from_winsys_buffer(sscreen, templ, memobj->buf,
memobj->stride, offset,
- PIPE_HANDLE_USAGE_READ_WRITE,
+ PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE |
+ PIPE_HANDLE_USAGE_SHADER_WRITE,
memobj->b.dedicated);
if (!tex)
return NULL;