diff options
author | Marek Olšák <[email protected]> | 2014-06-19 23:34:27 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2014-07-08 20:46:23 +0200 |
commit | fe6be9926f63e68d9007571956bed0687003e932 (patch) | |
tree | 1ce6957e3a528e19d68a8c2faab683ad63cfd13c /src/gallium/auxiliary/util/u_transfer.c | |
parent | cf430408c46745eeb82bfc9a62559bc85d35ded5 (diff) |
gallium: fix u_default_transfer_inline_write for textures
This doesn't fix any known issue. In fact, radeon drivers ignore all
the discard flags for textures and implicitly do "discard range"
for any write transfer.
Cc: [email protected]
Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util/u_transfer.c')
-rw-r--r-- | src/gallium/auxiliary/util/u_transfer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/util/u_transfer.c b/src/gallium/auxiliary/util/u_transfer.c index 7804f2a82ea..71da35d6d39 100644 --- a/src/gallium/auxiliary/util/u_transfer.c +++ b/src/gallium/auxiliary/util/u_transfer.c @@ -25,8 +25,8 @@ void u_default_transfer_inline_write( struct pipe_context *pipe, usage |= PIPE_TRANSFER_WRITE; /* transfer_inline_write implicitly discards the rewritten buffer range */ - /* XXX this looks very broken for non-buffer resources having more than one dim. */ - if (box->x == 0 && box->width == resource->width0) { + if (resource->target == PIPE_BUFFER && + box->x == 0 && box->width == resource->width0) { usage |= PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE; } else { usage |= PIPE_TRANSFER_DISCARD_RANGE; |