r600g: re-enable handling of DISCARD_RANGE, improving performance
authorMarek Olšák <maraeo@gmail.com>
Thu, 1 Nov 2012 01:00:37 +0000 (02:00 +0100)
committerMarek Olšák <maraeo@gmail.com>
Thu, 1 Nov 2012 02:17:58 +0000 (03:17 +0100)
It seems to work for me now. Even the graphics corruption is gone.

This also boosts performance in Reaction Quake.

src/gallium/drivers/r600/r600_buffer.c

index 116ab51196f1c0fb9cf03870db9da905d7f00e8c..968824ea1bb042ae60d6f6607b043def44c4e150 100644 (file)
@@ -136,7 +136,6 @@ static void *r600_buffer_transfer_map(struct pipe_context *ctx,
                        r600_set_constants_dirty_if_bound(rctx, rbuffer);
                }
        }
-#if 0 /* this is broken (see Bug 53130) */
        else if ((usage & PIPE_TRANSFER_DISCARD_RANGE) &&
                 !(usage & PIPE_TRANSFER_UNSYNCHRONIZED) &&
                 rctx->screen->has_streamout &&
@@ -159,7 +158,6 @@ static void *r600_buffer_transfer_map(struct pipe_context *ctx,
                                                        ptransfer, data, staging);
                }
        }
-#endif
 
        data = rctx->ws->buffer_map(rbuffer->cs_buf, rctx->cs, usage);
        if (!data) {