Module: Mesa
Branch: master
Commit: 05e6b0f20035d8c20ad6a74db3149da127675225
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=05e6b0f20035d8c20ad6a74db3149da127675225

Author: Axel Davy <[email protected]>
Date:   Fri Mar 12 11:48:48 2021 +0100

st/nine: Always use DYNAMIC with SYSTEMMEM

The disadvantages of the DYNAMIC path over the
non-dynamic path are minor.
The advantages are many.

As we don't know if bad behaving apps use
non-dynamic SYSTEMMEM in a dynamic fashion,
let's be safe and always be dynamic.

Signed-off-by: Axel Davy <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9451>

---

 src/gallium/frontends/nine/buffer9.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/gallium/frontends/nine/buffer9.c 
b/src/gallium/frontends/nine/buffer9.c
index 23728c25781..d63480af9ce 100644
--- a/src/gallium/frontends/nine/buffer9.c
+++ b/src/gallium/frontends/nine/buffer9.c
@@ -89,6 +89,16 @@ NineBuffer9_ctor( struct NineBuffer9 *This,
         /* Note: the application cannot retrieve Pool and Usage */
     }
 
+    /* Always use the DYNAMIC path for SYSTEMMEM.
+     * If the app uses the vertex buffer is a dynamic fashion,
+     * this is going to be very significantly faster that way.
+     * If the app uses the vertex buffer in a static fashion,
+     * instead of being filled all at once, the buffer will be filled
+     * little per little, until it is fully filled, thus the perf hit
+     * will be very small. */
+    if (Pool == D3DPOOL_SYSTEMMEM)
+        Usage |= D3DUSAGE_DYNAMIC;
+
     /* It is hard to find clear information on where to place the buffer in
      * memory depending on the flag.
      * MSDN: resources are static, except for those with DYNAMIC, thus why you

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to