summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gallium/drivers/radeonsi/cik_sdma.c7
-rw-r--r--src/gallium/drivers/radeonsi/si_cp_dma.c1
-rw-r--r--src/gallium/drivers/radeonsi/si_dma.c7
3 files changed, 11 insertions, 4 deletions
diff --git a/src/gallium/drivers/radeonsi/cik_sdma.c b/src/gallium/drivers/radeonsi/cik_sdma.c
index 38833666a8d..99285a6de17 100644
--- a/src/gallium/drivers/radeonsi/cik_sdma.c
+++ b/src/gallium/drivers/radeonsi/cik_sdma.c
@@ -80,7 +80,8 @@ static void cik_sdma_clear_buffer(struct pipe_context *ctx,
unsigned i, ncopy, csize;
struct r600_resource *rdst = r600_resource(dst);
- if (!cs || offset % 4 != 0 || size % 4 != 0) {
+ if (!cs || offset % 4 != 0 || size % 4 != 0 ||
+ dst->flags & PIPE_RESOURCE_FLAG_SPARSE) {
ctx->clear_buffer(ctx, dst, offset, size, &clear_value, 4);
return;
}
@@ -526,7 +527,9 @@ static void cik_sdma_copy(struct pipe_context *ctx,
{
struct si_context *sctx = (struct si_context *)ctx;
- if (!sctx->b.dma.cs)
+ if (!sctx->b.dma.cs ||
+ src->flags & PIPE_RESOURCE_FLAG_SPARSE ||
+ dst->flags & PIPE_RESOURCE_FLAG_SPARSE)
goto fallback;
if (dst->target == PIPE_BUFFER && src->target == PIPE_BUFFER) {
diff --git a/src/gallium/drivers/radeonsi/si_cp_dma.c b/src/gallium/drivers/radeonsi/si_cp_dma.c
index 74e0b2d46df..9505d622aef 100644
--- a/src/gallium/drivers/radeonsi/si_cp_dma.c
+++ b/src/gallium/drivers/radeonsi/si_cp_dma.c
@@ -223,6 +223,7 @@ static void si_clear_buffer(struct pipe_context *ctx, struct pipe_resource *dst,
/* dma_clear_buffer can use clear_buffer on failure. Make sure that
* doesn't happen. We don't want an infinite recursion: */
if (sctx->b.dma.cs &&
+ !(dst->flags & PIPE_RESOURCE_FLAG_SPARSE) &&
(offset % 4 == 0) &&
/* CP DMA is very slow. Always use SDMA for big clears. This
* alone improves DeusEx:MD performance by 70%. */
diff --git a/src/gallium/drivers/radeonsi/si_dma.c b/src/gallium/drivers/radeonsi/si_dma.c
index 500247fccfd..af639a532e8 100644
--- a/src/gallium/drivers/radeonsi/si_dma.c
+++ b/src/gallium/drivers/radeonsi/si_dma.c
@@ -89,7 +89,8 @@ static void si_dma_clear_buffer(struct pipe_context *ctx,
unsigned i, ncopy, csize;
struct r600_resource *rdst = r600_resource(dst);
- if (!cs || offset % 4 != 0 || size % 4 != 0) {
+ if (!cs || offset % 4 != 0 || size % 4 != 0 ||
+ dst->flags & PIPE_RESOURCE_FLAG_SPARSE) {
ctx->clear_buffer(ctx, dst, offset, size, &clear_value, 4);
return;
}
@@ -233,7 +234,9 @@ static void si_dma_copy(struct pipe_context *ctx,
unsigned src_x, src_y;
unsigned dst_x = dstx, dst_y = dsty, dst_z = dstz;
- if (sctx->b.dma.cs == NULL) {
+ if (sctx->b.dma.cs == NULL ||
+ src->flags & PIPE_RESOURCE_FLAG_SPARSE ||
+ dst->flags & PIPE_RESOURCE_FLAG_SPARSE) {
goto fallback;
}