[Mesa-dev] [PATCH] st/nine: SYSTEMMEM ignores DISCARD.

Axel Davy axel.davy at ens.fr
Tue Dec 13 22:50:30 UTC 2016


Tests show SYSTEMMEM should ignore DISCARD.

Prevents game bugs with following patches reimplementing
DISCARD. Halo is affected.

Signed-off-by: Axel Davy <axel.davy at ens.fr>
---
This patch prevents a regression on radeonsi for Halo (and probably
other games) with "st/nine: Implement Fast path for dynamic buffers and csmt".
Previously radeonsi was ignoring the DISCARD for the rendering path
used because the game is locking separated regions with DISCARD,
and radeonsi ignores the DISCARD when the mapping is nonoverlapping
with previous maps. The new path for DISCARD implemented in the mentionned
patch doesn't have that behaviour.
The patch would be merged before
"st/nine: Implement Fast path for dynamic buffers and csmt".

 src/gallium/state_trackers/nine/buffer9.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/nine/buffer9.c b/src/gallium/state_trackers/nine/buffer9.c
index 726408a..414ae5c 100644
--- a/src/gallium/state_trackers/nine/buffer9.c
+++ b/src/gallium/state_trackers/nine/buffer9.c
@@ -225,7 +225,11 @@ NineBuffer9_Lock( struct NineBuffer9 *This,
      * D3DERR_WASSTILLDRAWING if the resource is in use, except for DYNAMIC.
      * Our tests: some apps do use both DISCARD and NOOVERWRITE at the same
      * time. On windows it seems to return different pointer, thus indicating
-     * DISCARD is taken into account. */
+     * DISCARD is taken into account.
+     * our tests: SYSTEMMEM doesn't DISCARD */
+
+    if (This->base.pool == D3DPOOL_SYSTEMMEM)
+        Flags &= ~D3DLOCK_DISCARD;
 
     if (Flags & D3DLOCK_DISCARD)
         usage = PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE;
-- 
2.10.2



More information about the mesa-dev mailing list