From 89e2898e9ecfcf93c337b99542b06892a8e30cbe Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Wed, 27 Feb 2013 23:50:15 +0100 Subject: r600g: always map uninitialized buffer range as unsynchronized Any driver can implement this simple and efficient optimization. Team Fortress 2 hits it always. The DISCARD_RANGE codepath is not even used with TF2 anymore, so we avoid a ton of useless buffer copies. Tested-by: Andreas Boll NOTE: This is a candidate for the 9.1 branch. --- src/gallium/drivers/r600/r600.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/gallium/drivers/r600/r600.h') diff --git a/src/gallium/drivers/r600/r600.h b/src/gallium/drivers/r600/r600.h index d018ebb0298..15196f7579f 100644 --- a/src/gallium/drivers/r600/r600.h +++ b/src/gallium/drivers/r600/r600.h @@ -28,6 +28,7 @@ #include "../../winsys/radeon/drm/radeon_winsys.h" #include "util/u_double_list.h" +#include "util/u_range.h" #include "util/u_transfer.h" #define R600_ERR(fmt, args...) \ @@ -50,6 +51,16 @@ struct r600_resource { /* Resource state. */ unsigned domains; + + /* The buffer range which is initialized (with a write transfer, + * streamout, DMA, or as a random access target). The rest of + * the buffer is considered invalid and can be mapped unsynchronized. + * + * This allows unsychronized mapping of a buffer range which hasn't + * been used yet. It's for applications which forget to use + * the unsynchronized map flag and expect the driver to figure it out. + */ + struct util_range valid_buffer_range; }; #define R600_BLOCK_MAX_BO 32 -- cgit v1.2.3