Module: wine Branch: master Commit: 1c84acd0573176b0f3b4b33ecd58d8aec428270a URL: https://gitlab.winehq.org/wine/wine/-/commit/1c84acd0573176b0f3b4b33ecd58d8a...
Author: Anton Baskanov baskanov@gmail.com Date: Thu Nov 17 15:01:05 2022 +0700
wined3d: Add a lower size bound for the streaming buffer allocation.
Apps that issues many small draw calls (e.g. Earth 2150) may cause frequent DISCARD maps, which are significantly slower than NOOVERWRITE ones.
---
dlls/wined3d/buffer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index fca7f2916b7..74c2a1b8b2b 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -34,6 +34,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); #define VB_MAXFULLCONVERSIONS 5 /* Number of full conversions before we stop converting */ #define VB_RESETFULLCONVS 20 /* Reset full conversion counts after that number of draws */
+#define SB_MIN_SIZE (512 * 1024) /* Minimum size of an allocated streaming buffer. */ + struct wined3d_buffer_ops { BOOL (*buffer_prepare_location)(struct wined3d_buffer *buffer, @@ -1665,7 +1667,7 @@ static HRESULT wined3d_streaming_buffer_prepare(struct wined3d_device *device, return S_OK; }
- size = max(old_size * 2, min_size); + size = max(SB_MIN_SIZE, max(old_size * 2, min_size)); TRACE("Growing buffer to %u bytes.\n", size);
desc.byte_width = size;