Module: Mesa
Branch: 10.2
Commit: abe859d56e43b2ecdc0a99f32f537af57ac1f681
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=abe859d56e43b2ecdc0a99f32f537af57ac1f681

Author: Marek Olšák <marek.ol...@amd.com>
Date:   Thu Jun 19 23:34:27 2014 +0200

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: mesa-sta...@lists.freedesktop.org
Reviewed-by: Roland Scheidegger <srol...@vmware.com>
(cherry picked from commit fe6be9926f63e68d9007571956bed0687003e932)

---

 src/gallium/auxiliary/util/u_transfer.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_transfer.c 
b/src/gallium/auxiliary/util/u_transfer.c
index 7804f2a..71da35d 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;

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to