diff options
author | Marek Olšák <[email protected]> | 2013-02-27 23:50:15 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2013-03-01 13:46:32 +0100 |
commit | 89e2898e9ecfcf93c337b99542b06892a8e30cbe (patch) | |
tree | cc04229ada84b24ff72eeb2969f2a1a8723fe7e6 /src/gallium/drivers/r600/r600.h | |
parent | 44f37261fc34763003314245a811cfd21ce6fc87 (diff) |
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 <[email protected]>
NOTE: This is a candidate for the 9.1 branch.
Diffstat (limited to 'src/gallium/drivers/r600/r600.h')
-rw-r--r-- | src/gallium/drivers/r600/r600.h | 11 |
1 files changed, 11 insertions, 0 deletions
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 |