st/nine: SYSTEMMEM ignores DISCARD.
authorAxel Davy <axel.davy@ens.fr>
Tue, 13 Dec 2016 00:10:15 +0000 (01:10 +0100)
committerAxel Davy <axel.davy@ens.fr>
Tue, 20 Dec 2016 22:44:23 +0000 (23:44 +0100)
Tests show SYSTEMMEM should ignore DISCARD.

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

Signed-off-by: Axel Davy <axel.davy@ens.fr>
src/gallium/state_trackers/nine/buffer9.c

index 726408aed89b7b15b42d27186f473a10ce941332..e497222434b2fac1cebbe253730f40d34a960e3a 100644 (file)
@@ -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;