diff --git a/README.md b/README.md index 24e0963162..562815aa10 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,6 @@ Several related changes are included in the patchset as well: **This patchset is prototype-quality at the moment. If `ARB_buffer_storage` is not present, you're not going to have a good time.** -Currently, these patches are based off wine-staging 3.7. +Currently, these patches are based off wine-staging 3.14. [Details can be found here.](https://comminos.com/posts/2018-02-21-wined3d-profiling.html) diff --git a/patches/0001-wined3d-Initial-implementation-of-a-persistent-mappe.patch b/patches/0001-wined3d-Initial-implementation-of-a-persistent-mappe.patch index 892cc16d08..010e8fa0d5 100644 --- a/patches/0001-wined3d-Initial-implementation-of-a-persistent-mappe.patch +++ b/patches/0001-wined3d-Initial-implementation-of-a-persistent-mappe.patch @@ -1,4 +1,4 @@ -From db8f9546baea233a4bcfae27fa12d655e7c4be3d Mon Sep 17 00:00:00 2001 +From aa286ccab751f7bf77c13734e8a83aed6fdf50a0 Mon Sep 17 00:00:00 2001 From: Andrew Comminos Date: Mon, 5 Mar 2018 15:38:35 -0800 Subject: [PATCH 1/9] wined3d: Initial implementation of a persistent mapped @@ -6,10 +6,10 @@ Subject: [PATCH 1/9] wined3d: Initial implementation of a persistent mapped --- dlls/wined3d/Makefile.in | 1 + + dlls/wined3d/adapter_gl.c | 3 + dlls/wined3d/buffer_heap.c | 508 +++++++++++++++++++++++++++++++++ dlls/wined3d/cs.c | 9 + dlls/wined3d/device.c | 52 ++++ - dlls/wined3d/directx.c | 3 + dlls/wined3d/query.c | 2 +- dlls/wined3d/wined3d_gl.h | 1 + dlls/wined3d/wined3d_private.h | 68 ++++- @@ -17,10 +17,10 @@ Subject: [PATCH 1/9] wined3d: Initial implementation of a persistent mapped create mode 100644 dlls/wined3d/buffer_heap.c diff --git a/dlls/wined3d/Makefile.in b/dlls/wined3d/Makefile.in -index b850ba6872c..52ef8666fb7 100644 +index abc0ec6adba..a1a37c0e03b 100644 --- a/dlls/wined3d/Makefile.in +++ b/dlls/wined3d/Makefile.in -@@ -6,6 +6,7 @@ C_SRCS = \ +@@ -7,6 +7,7 @@ C_SRCS = \ arb_program_shader.c \ ati_fragment_shader.c \ buffer.c \ @@ -28,6 +28,27 @@ index b850ba6872c..52ef8666fb7 100644 context.c \ cs.c \ device.c \ +diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c +index 11cf6cac691..b932ae9e3fc 100644 +--- a/dlls/wined3d/adapter_gl.c ++++ b/dlls/wined3d/adapter_gl.c +@@ -58,6 +58,7 @@ static const struct wined3d_extension_map gl_extension_map[] = + /* ARB */ + {"GL_ARB_base_instance", ARB_BASE_INSTANCE }, + {"GL_ARB_blend_func_extended", ARB_BLEND_FUNC_EXTENDED }, ++ {"GL_ARB_buffer_storage", ARB_BUFFER_STORAGE }, + {"GL_ARB_clear_buffer_object", ARB_CLEAR_BUFFER_OBJECT }, + {"GL_ARB_clear_texture", ARB_CLEAR_TEXTURE }, + {"GL_ARB_clip_control", ARB_CLIP_CONTROL }, +@@ -2075,6 +2076,8 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info) + /* GL_ARB_blend_func_extended */ + USE_GL_FUNC(glBindFragDataLocationIndexed) + USE_GL_FUNC(glGetFragDataIndex) ++ /* GL_ARB_buffer_storage */ ++ USE_GL_FUNC(glBufferStorage) + /* GL_ARB_clear_buffer_object */ + USE_GL_FUNC(glClearBufferData) + USE_GL_FUNC(glClearBufferSubData) diff --git a/dlls/wined3d/buffer_heap.c b/dlls/wined3d/buffer_heap.c new file mode 100644 index 00000000000..b133bd68933 @@ -543,10 +564,10 @@ index 00000000000..b133bd68933 + return WINED3D_OK; +} diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index c60d67b83a7..e2bfd88dd2c 100644 +index 488369cf72e..ea8903f8e61 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c -@@ -467,6 +467,15 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) +@@ -526,6 +526,15 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) } InterlockedDecrement(&cs->pending_presents); @@ -563,7 +584,7 @@ index c60d67b83a7..e2bfd88dd2c 100644 void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain, diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index b97b7b963ba..f6bf07604c7 100644 +index 49be6e8af47..ae52fda9422 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -837,6 +837,53 @@ static void destroy_default_samplers(struct wined3d_device *device, struct wined @@ -639,29 +660,8 @@ index b97b7b963ba..f6bf07604c7 100644 context_release(context); } -diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c -index d55d5674f4f..eabdb658b48 100644 ---- a/dlls/wined3d/directx.c -+++ b/dlls/wined3d/directx.c -@@ -111,6 +111,7 @@ static const struct wined3d_extension_map gl_extension_map[] = - /* ARB */ - {"GL_ARB_base_instance", ARB_BASE_INSTANCE }, - {"GL_ARB_blend_func_extended", ARB_BLEND_FUNC_EXTENDED }, -+ {"GL_ARB_buffer_storage", ARB_BUFFER_STORAGE }, - {"GL_ARB_clear_buffer_object", ARB_CLEAR_BUFFER_OBJECT }, - {"GL_ARB_clear_texture", ARB_CLEAR_TEXTURE }, - {"GL_ARB_clip_control", ARB_CLIP_CONTROL }, -@@ -2713,6 +2714,8 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info) - /* GL_ARB_blend_func_extended */ - USE_GL_FUNC(glBindFragDataLocationIndexed) - USE_GL_FUNC(glGetFragDataIndex) -+ /* GL_ARB_buffer_storage */ -+ USE_GL_FUNC(glBufferStorage) - /* GL_ARB_clear_buffer_object */ - USE_GL_FUNC(glClearBufferData) - USE_GL_FUNC(glClearBufferSubData) diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index 5ea79b6e4a7..f3ca1630e58 100644 +index 1eb35306b9a..bf1ece51ac4 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c @@ -88,7 +88,7 @@ static BOOL wined3d_fence_supported(const struct wined3d_gl_info *gl_info) @@ -674,7 +674,7 @@ index 5ea79b6e4a7..f3ca1630e58 100644 { const struct wined3d_gl_info *gl_info; diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h -index bbee7881f2f..730eff131f3 100644 +index 14f8a497344..21f842c9933 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -44,6 +44,7 @@ enum wined3d_gl_extension @@ -686,10 +686,10 @@ index bbee7881f2f..730eff131f3 100644 ARB_CLEAR_TEXTURE, ARB_CLIP_CONTROL, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index ee4e1a4d6c3..dea1c2f5207 100644 +index 50e182e5780..d8a813858be 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -1726,6 +1726,9 @@ void wined3d_fence_destroy(struct wined3d_fence *fence) DECLSPEC_HIDDEN; +@@ -1710,6 +1710,9 @@ void wined3d_fence_destroy(struct wined3d_fence *fence) DECLSPEC_HIDDEN; void wined3d_fence_issue(struct wined3d_fence *fence, const struct wined3d_device *device) DECLSPEC_HIDDEN; enum wined3d_fence_result wined3d_fence_wait(const struct wined3d_fence *fence, const struct wined3d_device *device) DECLSPEC_HIDDEN; @@ -699,7 +699,7 @@ index ee4e1a4d6c3..dea1c2f5207 100644 /* Direct3D terminology with little modifications. We do not have an issued * state because only the driver knows about it, but we have a created state -@@ -3015,6 +3018,10 @@ struct wined3d_device +@@ -3048,6 +3051,10 @@ struct wined3d_device /* Context management */ struct wined3d_context **contexts; UINT context_count; @@ -710,7 +710,7 @@ index ee4e1a4d6c3..dea1c2f5207 100644 }; void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, const struct wined3d_fb_state *fb, -@@ -3522,6 +3529,12 @@ void state_init(struct wined3d_state *state, struct wined3d_fb_state *fb, +@@ -3557,6 +3564,12 @@ void state_init(struct wined3d_state *state, struct wined3d_fb_state *fb, DWORD flags) DECLSPEC_HIDDEN; void state_unbind_resources(struct wined3d_state *state) DECLSPEC_HIDDEN; @@ -723,7 +723,7 @@ index ee4e1a4d6c3..dea1c2f5207 100644 enum wined3d_cs_queue_id { WINED3D_CS_QUEUE_DEFAULT = 0, -@@ -3699,12 +3712,61 @@ enum wined3d_buffer_conversion_type +@@ -3734,12 +3747,61 @@ enum wined3d_buffer_conversion_type CONV_POSITIONT, }; @@ -789,5 +789,5 @@ index ee4e1a4d6c3..dea1c2f5207 100644 { struct wined3d_resource resource; -- -2.17.0 +2.18.0 diff --git a/patches/0002-wined3d-Add-support-for-backing-dynamic-wined3d_buff.patch b/patches/0002-wined3d-Add-support-for-backing-dynamic-wined3d_buff.patch index 2a45fb25dd..9745426fe3 100644 --- a/patches/0002-wined3d-Add-support-for-backing-dynamic-wined3d_buff.patch +++ b/patches/0002-wined3d-Add-support-for-backing-dynamic-wined3d_buff.patch @@ -1,4 +1,4 @@ -From 21a562c674ab753e3f818d4c2fc96af6cbe27013 Mon Sep 17 00:00:00 2001 +From 8777f63a02d819ce4adc38d7ce4969ea95ad051c Mon Sep 17 00:00:00 2001 From: Andrew Comminos Date: Mon, 5 Mar 2018 15:39:11 -0800 Subject: [PATCH 2/9] wined3d: Add support for backing dynamic wined3d_buffer @@ -16,7 +16,7 @@ Subject: [PATCH 2/9] wined3d: Add support for backing dynamic wined3d_buffer 8 files changed, 336 insertions(+), 10 deletions(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 2350661e363..40c454e4668 100644 +index bf1486b8c11..4a4f23b878c 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -28,12 +28,14 @@ @@ -331,7 +331,7 @@ index 2350661e363..40c454e4668 100644 }; static GLenum buffer_type_hint_from_bind_flags(const struct wined3d_gl_info *gl_info, -@@ -1392,12 +1590,30 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device +@@ -1394,12 +1592,30 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device buffer->flags |= WINED3D_BUFFER_PIN_SYSMEM; } @@ -364,10 +364,10 @@ index 2350661e363..40c454e4668 100644 TRACE("Not creating a BO because GL_ARB_vertex_buffer is not supported.\n"); } diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index cff50df6574..698ba6fc8f2 100644 +index 0e86f76e961..a47ed2862ea 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c -@@ -4970,7 +4970,11 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s +@@ -4979,7 +4979,11 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s if (parameters->indexed) { struct wined3d_buffer *index_buffer = state->index_buffer; @@ -381,7 +381,7 @@ index cff50df6574..698ba6fc8f2 100644 idx_data = index_buffer->resource.heap_memory; } diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index e2bfd88dd2c..a11d21d1961 100644 +index ea8903f8e61..76f9648d857 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -73,6 +73,7 @@ enum wined3d_cs_op @@ -406,7 +406,7 @@ index e2bfd88dd2c..a11d21d1961 100644 struct wined3d_cs_stop { enum wined3d_cs_op opcode; -@@ -2025,7 +2033,7 @@ static void wined3d_cs_exec_map(struct wined3d_cs *cs, const void *data) +@@ -2083,7 +2091,7 @@ static void wined3d_cs_exec_map(struct wined3d_cs *cs, const void *data) const struct wined3d_cs_map *op = data; struct wined3d_resource *resource = op->resource; @@ -415,7 +415,7 @@ index e2bfd88dd2c..a11d21d1961 100644 op->sub_resource_idx, op->map_desc, op->box, op->flags); } -@@ -2059,7 +2067,7 @@ static void wined3d_cs_exec_unmap(struct wined3d_cs *cs, const void *data) +@@ -2117,7 +2125,7 @@ static void wined3d_cs_exec_unmap(struct wined3d_cs *cs, const void *data) const struct wined3d_cs_unmap *op = data; struct wined3d_resource *resource = op->resource; @@ -424,7 +424,7 @@ index e2bfd88dd2c..a11d21d1961 100644 } HRESULT wined3d_cs_unmap(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx) -@@ -2454,6 +2462,53 @@ void wined3d_cs_emit_generate_mipmaps(struct wined3d_cs *cs, struct wined3d_shad +@@ -2512,6 +2520,53 @@ void wined3d_cs_emit_generate_mipmaps(struct wined3d_cs *cs, struct wined3d_shad cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT); } @@ -478,7 +478,7 @@ index e2bfd88dd2c..a11d21d1961 100644 static void wined3d_cs_emit_stop(struct wined3d_cs *cs) { struct wined3d_cs_stop *op; -@@ -2514,6 +2569,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void +@@ -2572,6 +2627,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_CLEAR_UNORDERED_ACCESS_VIEW */ wined3d_cs_exec_clear_unordered_access_view, /* WINED3D_CS_OP_COPY_UAV_COUNTER */ wined3d_cs_exec_copy_uav_counter, /* WINED3D_CS_OP_GENERATE_MIPMAPS */ wined3d_cs_exec_generate_mipmaps, @@ -487,7 +487,7 @@ index e2bfd88dd2c..a11d21d1961 100644 static BOOL wined3d_cs_st_check_space(struct wined3d_cs *cs, size_t size, enum wined3d_cs_queue_id queue_id) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index df73997c84c..7060d71613a 100644 +index d856f6b446c..e136f14ab0b 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -334,6 +334,7 @@ static DWORD wined3d_resource_sanitise_map_flags(const struct wined3d_resource * @@ -533,10 +533,10 @@ index df73997c84c..7060d71613a 100644 UINT CDECL wined3d_resource_update_info(struct wined3d_resource *resource, unsigned int sub_resource_idx, diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c -index 89f2576fd01..6564f7cc180 100644 +index 1bd38632b82..07d8d69083f 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c -@@ -4348,7 +4348,11 @@ static void indexbuffer(struct wined3d_context *context, const struct wined3d_st +@@ -4323,7 +4323,11 @@ static void indexbuffer(struct wined3d_context *context, const struct wined3d_st else { struct wined3d_buffer *ib = state->index_buffer; @@ -549,7 +549,7 @@ index 89f2576fd01..6564f7cc180 100644 } } -@@ -4414,6 +4418,7 @@ static void state_cb(struct wined3d_context *context, const struct wined3d_state +@@ -4407,6 +4411,7 @@ static void state_cb(struct wined3d_context *context, const struct wined3d_state enum wined3d_shader_type shader_type; struct wined3d_buffer *buffer; unsigned int i, base, count; @@ -557,7 +557,7 @@ index 89f2576fd01..6564f7cc180 100644 TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id); -@@ -4426,7 +4431,15 @@ static void state_cb(struct wined3d_context *context, const struct wined3d_state +@@ -4419,7 +4424,15 @@ static void state_cb(struct wined3d_context *context, const struct wined3d_state for (i = 0; i < count; ++i) { buffer = state->cb[shader_type][i]; @@ -575,10 +575,10 @@ index 89f2576fd01..6564f7cc180 100644 checkGLcall("bind constant buffers"); } diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c -index 3290879451d..e15cfa42544 100644 +index 540f58b6641..dafa0ef6f3a 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c -@@ -2216,6 +2216,12 @@ static void wined3d_texture_unload(struct wined3d_resource *resource) +@@ -2243,6 +2243,12 @@ static void wined3d_texture_unload(struct wined3d_resource *resource) static HRESULT texture_resource_sub_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) @@ -591,7 +591,7 @@ index 3290879451d..e15cfa42544 100644 { const struct wined3d_format *format = resource->format; struct wined3d_texture_sub_resource *sub_resource; -@@ -2376,6 +2382,11 @@ static HRESULT texture_resource_sub_resource_map_info(struct wined3d_resource *r +@@ -2403,6 +2409,11 @@ static HRESULT texture_resource_sub_resource_map_info(struct wined3d_resource *r } static HRESULT texture_resource_sub_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx) @@ -603,7 +603,7 @@ index 3290879451d..e15cfa42544 100644 { struct wined3d_texture_sub_resource *sub_resource; struct wined3d_device *device = resource->device; -@@ -2428,6 +2439,8 @@ static const struct wined3d_resource_ops texture_resource_ops = +@@ -2455,6 +2466,8 @@ static const struct wined3d_resource_ops texture_resource_ops = texture_resource_sub_resource_map, texture_resource_sub_resource_map_info, texture_resource_sub_resource_unmap, @@ -613,10 +613,10 @@ index 3290879451d..e15cfa42544 100644 /* Context activation is done by the caller. */ diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c -index a092c83e03b..f834decba88 100644 +index cfa2d3cfb82..1ea542d83f8 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c -@@ -6322,6 +6322,7 @@ const char *wined3d_debug_location(DWORD location) +@@ -6565,6 +6565,7 @@ const char *wined3d_debug_location(DWORD location) LOCATION_TO_STR(WINED3D_LOCATION_DRAWABLE); LOCATION_TO_STR(WINED3D_LOCATION_RB_MULTISAMPLE); LOCATION_TO_STR(WINED3D_LOCATION_RB_RESOLVED); @@ -625,10 +625,10 @@ index a092c83e03b..f834decba88 100644 if (location) FIXME("Unrecognized location flag(s) %#x.\n", location); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index dea1c2f5207..4918293b82b 100644 +index d8a813858be..bc8ba6e708a 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -1484,6 +1484,7 @@ struct wined3d_bo_address +@@ -1468,6 +1468,7 @@ struct wined3d_bo_address { GLuint buffer_object; BYTE *addr; @@ -636,7 +636,7 @@ index dea1c2f5207..4918293b82b 100644 }; struct wined3d_const_bo_address -@@ -3063,6 +3064,9 @@ struct wined3d_resource_ops +@@ -3096,6 +3097,9 @@ struct wined3d_resource_ops HRESULT (*resource_map_info)(struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_info *info, DWORD flags); HRESULT (*resource_sub_resource_unmap)(struct wined3d_resource *resource, unsigned int sub_resource_idx); @@ -646,7 +646,7 @@ index dea1c2f5207..4918293b82b 100644 }; struct wined3d_resource -@@ -3377,6 +3381,7 @@ void wined3d_texture_validate_location(struct wined3d_texture *texture, +@@ -3412,6 +3416,7 @@ void wined3d_texture_validate_location(struct wined3d_texture *texture, #define WINED3D_LOCATION_DRAWABLE 0x00000040 #define WINED3D_LOCATION_RB_MULTISAMPLE 0x00000080 #define WINED3D_LOCATION_RB_RESOLVED 0x00000100 @@ -654,7 +654,7 @@ index dea1c2f5207..4918293b82b 100644 const char *wined3d_debug_location(DWORD location) DECLSPEC_HIDDEN; -@@ -3679,6 +3684,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou +@@ -3714,6 +3719,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch, unsigned int slice_pitch) DECLSPEC_HIDDEN; @@ -662,7 +662,7 @@ index dea1c2f5207..4918293b82b 100644 void wined3d_cs_init_object(struct wined3d_cs *cs, void (*callback)(void *object), void *object) DECLSPEC_HIDDEN; HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx, -@@ -3791,6 +3797,11 @@ struct wined3d_buffer +@@ -3826,6 +3832,11 @@ struct wined3d_buffer UINT stride; /* 0 if no conversion */ enum wined3d_buffer_conversion_type *conversion_map; /* NULL if no conversion */ UINT conversion_stride; /* 0 if no shifted conversion */ @@ -675,5 +675,5 @@ index dea1c2f5207..4918293b82b 100644 static inline struct wined3d_buffer *buffer_from_resource(struct wined3d_resource *resource) -- -2.17.0 +2.18.0 diff --git a/patches/0003-wined3d-Use-ARB_multi_bind-to-speed-up-UBO-updates.patch b/patches/0003-wined3d-Use-ARB_multi_bind-to-speed-up-UBO-updates.patch index 50219c0bd8..b86b4545c7 100644 --- a/patches/0003-wined3d-Use-ARB_multi_bind-to-speed-up-UBO-updates.patch +++ b/patches/0003-wined3d-Use-ARB_multi_bind-to-speed-up-UBO-updates.patch @@ -1,4 +1,4 @@ -From 0b9f86381d6cb80e95dcce5374b22574ce395ca0 Mon Sep 17 00:00:00 2001 +From ddd357e1931faed40b9ae75c337e58ea8bda193a Mon Sep 17 00:00:00 2001 From: Andrew Comminos Date: Mon, 5 Mar 2018 20:28:34 -0800 Subject: [PATCH 3/9] wined3d: Use ARB_multi_bind to speed up UBO updates. @@ -7,16 +7,16 @@ More frequent UBO remaps as a result of the persistent buffer allocator causes glBindBufferRange to be a bottleneck. Using ARB_multi_bind massively reduces state change overhead. --- - dlls/wined3d/directx.c | 4 ++++ + dlls/wined3d/adapter_gl.c | 4 ++++ dlls/wined3d/state.c | 46 +++++++++++++++++++++++++++++++++------ dlls/wined3d/wined3d_gl.h | 1 + 3 files changed, 44 insertions(+), 7 deletions(-) -diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c -index eabdb658b48..2831baa1d7e 100644 ---- a/dlls/wined3d/directx.c -+++ b/dlls/wined3d/directx.c -@@ -149,6 +149,7 @@ static const struct wined3d_extension_map gl_extension_map[] = +diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c +index b932ae9e3fc..c627c8a94e6 100644 +--- a/dlls/wined3d/adapter_gl.c ++++ b/dlls/wined3d/adapter_gl.c +@@ -96,6 +96,7 @@ static const struct wined3d_extension_map gl_extension_map[] = {"GL_ARB_internalformat_query2", ARB_INTERNALFORMAT_QUERY2 }, {"GL_ARB_map_buffer_alignment", ARB_MAP_BUFFER_ALIGNMENT }, {"GL_ARB_map_buffer_range", ARB_MAP_BUFFER_RANGE }, @@ -24,7 +24,7 @@ index eabdb658b48..2831baa1d7e 100644 {"GL_ARB_multisample", ARB_MULTISAMPLE }, {"GL_ARB_multitexture", ARB_MULTITEXTURE }, {"GL_ARB_occlusion_query", ARB_OCCLUSION_QUERY }, -@@ -2795,6 +2796,8 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info) +@@ -2157,6 +2158,8 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info) /* GL_ARB_map_buffer_range */ USE_GL_FUNC(glFlushMappedBufferRange) USE_GL_FUNC(glMapBufferRange) @@ -33,7 +33,7 @@ index eabdb658b48..2831baa1d7e 100644 /* GL_ARB_multisample */ USE_GL_FUNC(glSampleCoverageARB) /* GL_ARB_multitexture */ -@@ -3954,6 +3957,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter, +@@ -3328,6 +3331,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter, {ARB_TEXTURE_VIEW, MAKEDWORD_VERSION(4, 3)}, {ARB_CLEAR_TEXTURE, MAKEDWORD_VERSION(4, 4)}, @@ -42,10 +42,10 @@ index eabdb658b48..2831baa1d7e 100644 {ARB_CLIP_CONTROL, MAKEDWORD_VERSION(4, 5)}, {ARB_CULL_DISTANCE, MAKEDWORD_VERSION(4, 5)}, diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c -index 6564f7cc180..c66ec71647e 100644 +index 07d8d69083f..e993d9fa1dc 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c -@@ -4428,19 +4428,51 @@ static void state_cb(struct wined3d_context *context, const struct wined3d_state +@@ -4421,19 +4421,51 @@ static void state_cb(struct wined3d_context *context, const struct wined3d_state shader_type = WINED3D_SHADER_TYPE_COMPUTE; wined3d_gl_limits_get_uniform_block_range(&gl_info->limits, shader_type, &base, &count); @@ -105,7 +105,7 @@ index 6564f7cc180..c66ec71647e 100644 } diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h -index 730eff131f3..4ece45c26f0 100644 +index 21f842c9933..02524f03d69 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -82,6 +82,7 @@ enum wined3d_gl_extension @@ -117,5 +117,5 @@ index 730eff131f3..4ece45c26f0 100644 ARB_MULTITEXTURE, ARB_OCCLUSION_QUERY, -- -2.17.0 +2.18.0 diff --git a/patches/0004-wined3d-Use-GL_CLIENT_STORAGE_BIT-for-persistent-map.patch b/patches/0004-wined3d-Use-GL_CLIENT_STORAGE_BIT-for-persistent-map.patch index f18a9141cb..4410272a14 100644 --- a/patches/0004-wined3d-Use-GL_CLIENT_STORAGE_BIT-for-persistent-map.patch +++ b/patches/0004-wined3d-Use-GL_CLIENT_STORAGE_BIT-for-persistent-map.patch @@ -1,4 +1,4 @@ -From 8039b7c863b0c01d12a25c3dbe59e850832559a2 Mon Sep 17 00:00:00 2001 +From 8e497b8231cd84ff9e61454a6c97ec14ec901aee Mon Sep 17 00:00:00 2001 From: Andrew Comminos Date: Tue, 6 Mar 2018 02:07:31 -0800 Subject: [PATCH 4/9] wined3d: Use GL_CLIENT_STORAGE_BIT for persistent @@ -22,5 +22,5 @@ index b133bd68933..75f84b00882 100644 // TODO(acomminos): where should we be checking for errors here? GL_EXTCALL(glGenBuffers(1, &object->buffer_object)); -- -2.17.0 +2.18.0 diff --git a/patches/0005-wined3d-Disable-persistently-mapped-shader-resource-.patch b/patches/0005-wined3d-Disable-persistently-mapped-shader-resource-.patch index 509c8a5386..73cc9e1443 100644 --- a/patches/0005-wined3d-Disable-persistently-mapped-shader-resource-.patch +++ b/patches/0005-wined3d-Disable-persistently-mapped-shader-resource-.patch @@ -1,4 +1,4 @@ -From 2a0957bcb0bf9731715a46dc681efd516a6d8191 Mon Sep 17 00:00:00 2001 +From f610ff39dff1117cb6dfb0c5790b4a0ce85fbf90 Mon Sep 17 00:00:00 2001 From: Andrew Comminos Date: Thu, 8 Mar 2018 22:00:33 -0800 Subject: [PATCH 5/9] wined3d: Disable persistently mapped shader resource @@ -9,10 +9,10 @@ Subject: [PATCH 5/9] wined3d: Disable persistently mapped shader resource 1 file changed, 4 insertions(+) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 40c454e4668..59334816132 100644 +index 4a4f23b878c..05f40a6e9da 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c -@@ -1596,6 +1596,10 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device +@@ -1598,6 +1598,10 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device { WARN_(d3d_perf)("Not creating a persistent mapping for a dynamic buffer because ARB_buffer_storage is unsupported.\n"); } @@ -24,5 +24,5 @@ index 40c454e4668..59334816132 100644 { // If supported, use persistent mapped buffers instead of a -- -2.17.0 +2.18.0 diff --git a/patches/0006-wined3d-Perform-initial-allocation-of-persistent-buf.patch b/patches/0006-wined3d-Perform-initial-allocation-of-persistent-buf.patch index 3d626fcc4e..b301221a06 100644 --- a/patches/0006-wined3d-Perform-initial-allocation-of-persistent-buf.patch +++ b/patches/0006-wined3d-Perform-initial-allocation-of-persistent-buf.patch @@ -1,4 +1,4 @@ -From edc7f11845fcafb7414dde498b73c69507dfc5e8 Mon Sep 17 00:00:00 2001 +From bfb3d2dd8f5f718c28f2c7427564ca79c5867381 Mon Sep 17 00:00:00 2001 From: Andrew Comminos Date: Thu, 8 Mar 2018 22:42:03 -0800 Subject: [PATCH 6/9] wined3d: Perform initial allocation of persistent buffers @@ -9,7 +9,7 @@ Subject: [PATCH 6/9] wined3d: Perform initial allocation of persistent buffers 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 59334816132..825a796db1b 100644 +index 05f40a6e9da..edc4fb8e8e1 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -272,7 +272,7 @@ fail: @@ -88,5 +88,5 @@ index 59334816132..825a796db1b 100644 return E_NOTIMPL; -- -2.17.0 +2.18.0 diff --git a/patches/0007-wined3d-Avoid-freeing-persistent-buffer-heap-element.patch b/patches/0007-wined3d-Avoid-freeing-persistent-buffer-heap-element.patch index d0f4d00f68..d86da17da5 100644 --- a/patches/0007-wined3d-Avoid-freeing-persistent-buffer-heap-element.patch +++ b/patches/0007-wined3d-Avoid-freeing-persistent-buffer-heap-element.patch @@ -1,4 +1,4 @@ -From f47b2a6c8b6f1cea62cb26965fe662e919547913 Mon Sep 17 00:00:00 2001 +From 002ba597d5afd1455cae2234ec6f5d7a507e48a4 Mon Sep 17 00:00:00 2001 From: Andrew Comminos Date: Thu, 8 Mar 2018 23:01:50 -0800 Subject: [PATCH 7/9] wined3d: Avoid freeing persistent buffer heap elements @@ -15,7 +15,7 @@ for long. 5 files changed, 61 insertions(+), 60 deletions(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 825a796db1b..533befd2fcb 100644 +index edc4fb8e8e1..d710abe57be 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -276,7 +276,7 @@ static BOOL buffer_alloc_persistent_map(struct wined3d_buffer *buffer) @@ -235,10 +235,10 @@ index 75f84b00882..80670c515f7 100644 struct wined3d_buffer_heap_bin *bin = &heap->pending_fenced_bins.bins[bin_index]; diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c -index 698ba6fc8f2..a08f93ac53f 100644 +index a47ed2862ea..fea59cf37ad 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c -@@ -4970,9 +4970,9 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s +@@ -4979,9 +4979,9 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s if (parameters->indexed) { struct wined3d_buffer *index_buffer = state->index_buffer; @@ -251,7 +251,7 @@ index 698ba6fc8f2..a08f93ac53f 100644 else if (!index_buffer->buffer_object || !stream_info->all_vbo) { diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c -index a11d21d1961..6814a8d1022 100644 +index 76f9648d857..0fd56590df7 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -444,7 +444,7 @@ struct wined3d_cs_discard_buffer @@ -263,7 +263,7 @@ index a11d21d1961..6814a8d1022 100644 }; struct wined3d_cs_stop -@@ -2495,14 +2495,14 @@ static void wined3d_cs_exec_discard_buffer(struct wined3d_cs *cs, const void *da +@@ -2553,14 +2553,14 @@ static void wined3d_cs_exec_discard_buffer(struct wined3d_cs *cs, const void *da wined3d_resource_release(&op->buffer->resource); } @@ -281,10 +281,10 @@ index a11d21d1961..6814a8d1022 100644 wined3d_resource_acquire(&buffer->resource); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 4918293b82b..34f3fb540df 100644 +index bc8ba6e708a..b90848629ea 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -3540,6 +3540,18 @@ struct wined3d_map_range +@@ -3575,6 +3575,18 @@ struct wined3d_map_range GLsizeiptr size; }; @@ -303,7 +303,7 @@ index 4918293b82b..34f3fb540df 100644 enum wined3d_cs_queue_id { WINED3D_CS_QUEUE_DEFAULT = 0, -@@ -3684,7 +3696,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou +@@ -3719,7 +3731,7 @@ void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resou void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch, unsigned int slice_pitch) DECLSPEC_HIDDEN; @@ -312,7 +312,7 @@ index 4918293b82b..34f3fb540df 100644 void wined3d_cs_init_object(struct wined3d_cs *cs, void (*callback)(void *object), void *object) DECLSPEC_HIDDEN; HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx, -@@ -3718,7 +3730,6 @@ enum wined3d_buffer_conversion_type +@@ -3753,7 +3765,6 @@ enum wined3d_buffer_conversion_type CONV_POSITIONT, }; @@ -320,7 +320,7 @@ index 4918293b82b..34f3fb540df 100644 struct wined3d_buffer_heap_fenced_element; // Number of power-of-two buckets to populate. -@@ -3757,11 +3768,11 @@ HRESULT wined3d_buffer_heap_create(struct wined3d_context *context, GLsizeiptr s +@@ -3792,11 +3803,11 @@ HRESULT wined3d_buffer_heap_create(struct wined3d_context *context, GLsizeiptr s HRESULT wined3d_buffer_heap_destroy(struct wined3d_buffer_heap *heap, struct wined3d_context *context) DECLSPEC_HIDDEN; // Fetches a buffer from the heap of at least the given size. // Attempts to coalesce blocks under memory pressure. @@ -335,7 +335,7 @@ index 4918293b82b..34f3fb540df 100644 // Issues a fence for the current set of pending fenced buffers. // Double-buffered: if the last fence issued has not yet been triggered, waits // on it. -@@ -3800,8 +3811,8 @@ struct wined3d_buffer +@@ -3835,8 +3846,8 @@ struct wined3d_buffer /* persistent mapped buffer */ struct wined3d_buffer_heap *buffer_heap; @@ -347,5 +347,5 @@ index 4918293b82b..34f3fb540df 100644 static inline struct wined3d_buffer *buffer_from_resource(struct wined3d_resource *resource) -- -2.17.0 +2.18.0 diff --git a/patches/0008-wined3d-Add-DISABLE_PBA-envvar-some-PBA-cleanup.patch b/patches/0008-wined3d-Add-DISABLE_PBA-envvar-some-PBA-cleanup.patch index 85b4935299..5636e8a1fa 100644 --- a/patches/0008-wined3d-Add-DISABLE_PBA-envvar-some-PBA-cleanup.patch +++ b/patches/0008-wined3d-Add-DISABLE_PBA-envvar-some-PBA-cleanup.patch @@ -1,4 +1,4 @@ -From bffc7d7444b681a5a797dafd136c978e9c97c0db Mon Sep 17 00:00:00 2001 +From 3cb934ca4fc5042004b5ea07a5adee7df3ec0106 Mon Sep 17 00:00:00 2001 From: Andrew Comminos Date: Thu, 15 Mar 2018 21:07:21 -0700 Subject: [PATCH 8/9] wined3d: Add DISABLE_PBA envvar, some PBA cleanup. @@ -12,10 +12,10 @@ Subject: [PATCH 8/9] wined3d: Add DISABLE_PBA envvar, some PBA cleanup. 5 files changed, 57 insertions(+), 27 deletions(-) diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c -index 533befd2fcb..3a56d9c9a39 100644 +index d710abe57be..e31c14541bc 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c -@@ -1601,9 +1601,9 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device +@@ -1603,9 +1603,9 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device if (buffer->resource.usage & WINED3DUSAGE_DYNAMIC) { @@ -104,7 +104,7 @@ index 80670c515f7..899aad96126 100644 } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index f6bf07604c7..a79241f28cc 100644 +index ae52fda9422..f0a2c62b251 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -841,16 +841,27 @@ static void destroy_default_samplers(struct wined3d_device *device, struct wined @@ -171,7 +171,7 @@ index f6bf07604c7..a79241f28cc 100644 /* Context activation is done by the caller. */ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c -index f3ca1630e58..5ea79b6e4a7 100644 +index bf1ece51ac4..1eb35306b9a 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c @@ -88,7 +88,7 @@ static BOOL wined3d_fence_supported(const struct wined3d_gl_info *gl_info) @@ -184,10 +184,10 @@ index f3ca1630e58..5ea79b6e4a7 100644 { const struct wined3d_gl_info *gl_info; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 34f3fb540df..1335c122890 100644 +index b90848629ea..04817c6a9c8 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -1727,9 +1727,6 @@ void wined3d_fence_destroy(struct wined3d_fence *fence) DECLSPEC_HIDDEN; +@@ -1711,9 +1711,6 @@ void wined3d_fence_destroy(struct wined3d_fence *fence) DECLSPEC_HIDDEN; void wined3d_fence_issue(struct wined3d_fence *fence, const struct wined3d_device *device) DECLSPEC_HIDDEN; enum wined3d_fence_result wined3d_fence_wait(const struct wined3d_fence *fence, const struct wined3d_device *device) DECLSPEC_HIDDEN; @@ -197,7 +197,7 @@ index 34f3fb540df..1335c122890 100644 /* Direct3D terminology with little modifications. We do not have an issued * state because only the driver knows about it, but we have a created state -@@ -2968,7 +2965,8 @@ struct wined3d_device +@@ -3000,7 +2997,8 @@ struct wined3d_device BYTE inScene : 1; /* A flag to check for proper BeginScene / EndScene call pairs */ BYTE softwareVertexProcessing : 1; /* process vertex shaders using software or hardware */ BYTE filter_messages : 1; @@ -208,5 +208,5 @@ index 34f3fb540df..1335c122890 100644 unsigned char surface_alignment; /* Line Alignment of surfaces */ -- -2.17.0 +2.18.0 diff --git a/patches/0009-wined3d-Add-quirk-to-use-GL_CLIENT_STORAGE_BIT-for-m.patch b/patches/0009-wined3d-Add-quirk-to-use-GL_CLIENT_STORAGE_BIT-for-m.patch index a0da56cde6..3323c5771e 100644 --- a/patches/0009-wined3d-Add-quirk-to-use-GL_CLIENT_STORAGE_BIT-for-m.patch +++ b/patches/0009-wined3d-Add-quirk-to-use-GL_CLIENT_STORAGE_BIT-for-m.patch @@ -1,14 +1,58 @@ -From e6f5ba632e17f58949272f84814a8522f6ee2c29 Mon Sep 17 00:00:00 2001 +From 983609039bf60a9e24d827134a15e136dd5c5ee1 Mon Sep 17 00:00:00 2001 From: Andrew Comminos Date: Thu, 15 Mar 2018 21:22:06 -0700 Subject: [PATCH 9/9] wined3d: Add quirk to use GL_CLIENT_STORAGE_BIT for mesa. --- + dlls/wined3d/adapter_gl.c | 19 +++++++++++++++++++ dlls/wined3d/buffer_heap.c | 15 ++++++++++++++- - dlls/wined3d/directx.c | 19 +++++++++++++++++++ dlls/wined3d/wined3d_private.h | 1 + 3 files changed, 34 insertions(+), 1 deletion(-) +diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c +index c627c8a94e6..6c53524a7f0 100644 +--- a/dlls/wined3d/adapter_gl.c ++++ b/dlls/wined3d/adapter_gl.c +@@ -831,6 +831,13 @@ static BOOL match_broken_viewport_subpixel_bits(const struct wined3d_gl_info *gl + return !wined3d_caps_gl_ctx_test_viewport_subpixel_bits(ctx); + } + ++static BOOL match_mesa(const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx, ++ const char *gl_renderer, enum wined3d_gl_vendor gl_vendor, ++ enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device) ++{ ++ return gl_vendor == GL_VENDOR_MESA; ++} ++ + static void quirk_apple_glsl_constants(struct wined3d_gl_info *gl_info) + { + /* MacOS needs uniforms for relative addressing offsets. This can +@@ -985,6 +992,13 @@ static void quirk_broken_viewport_subpixel_bits(struct wined3d_gl_info *gl_info) + } + } + ++static void quirk_use_client_storage_bit(struct wined3d_gl_info *gl_info) ++{ ++ // Using ARB_buffer_storage on Mesa requires the GL_CLIENT_STORAGE_BIT to be ++ // set to use GTT for immutable buffers on radeon (see PIPE_USAGE_STREAM). ++ gl_info->quirks |= WINED3D_QUIRK_USE_CLIENT_STORAGE_BIT; ++} ++ + static const struct wined3d_gpu_description *query_gpu_description(const struct wined3d_gl_info *gl_info, + UINT64 *vram_bytes) + { +@@ -1145,6 +1159,11 @@ static void fixup_extensions(struct wined3d_gl_info *gl_info, struct wined3d_cap + quirk_broken_viewport_subpixel_bits, + "NVIDIA viewport subpixel bits bug" + }, ++ { ++ match_mesa, ++ quirk_use_client_storage_bit, ++ "Use GL_CLIENT_STORAGE_BIT for persistent buffers on mesa", ++ }, + }; + + for (i = 0; i < ARRAY_SIZE(quirk_table); ++i) diff --git a/dlls/wined3d/buffer_heap.c b/dlls/wined3d/buffer_heap.c index 899aad96126..9e8f2d799df 100644 --- a/dlls/wined3d/buffer_heap.c @@ -35,55 +79,11 @@ index 899aad96126..9e8f2d799df 100644 GL_EXTCALL(glGenBuffers(1, &object->buffer_object)); checkGLcall("glGenBuffers"); -diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c -index 2831baa1d7e..ee0d4c7b2d8 100644 ---- a/dlls/wined3d/directx.c -+++ b/dlls/wined3d/directx.c -@@ -946,6 +946,13 @@ static BOOL match_broken_viewport_subpixel_bits(const struct wined3d_gl_info *gl - return !wined3d_caps_gl_ctx_test_viewport_subpixel_bits(ctx); - } - -+static BOOL match_mesa(const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx, -+ const char *gl_renderer, enum wined3d_gl_vendor gl_vendor, -+ enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device) -+{ -+ return gl_vendor == GL_VENDOR_MESA; -+} -+ - static void quirk_apple_glsl_constants(struct wined3d_gl_info *gl_info) - { - /* MacOS needs uniforms for relative addressing offsets. This can accumulate to quite a few uniforms. -@@ -1083,6 +1090,13 @@ static void quirk_broken_viewport_subpixel_bits(struct wined3d_gl_info *gl_info) - } - } - -+static void quirk_use_client_storage_bit(struct wined3d_gl_info *gl_info) -+{ -+ // Using ARB_buffer_storage on Mesa requires the GL_CLIENT_STORAGE_BIT to be -+ // set to use GTT for immutable buffers on radeon (see PIPE_USAGE_STREAM). -+ gl_info->quirks |= WINED3D_QUIRK_USE_CLIENT_STORAGE_BIT; -+} -+ - struct driver_quirk - { - BOOL (*match)(const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx, -@@ -1179,6 +1193,11 @@ static const struct driver_quirk quirk_table[] = - quirk_broken_viewport_subpixel_bits, - "Nvidia viewport subpixel bits bug" - }, -+ { -+ match_mesa, -+ quirk_use_client_storage_bit, -+ "Use GL_CLIENT_STORAGE_BIT for persistent buffers on mesa", -+ }, - }; - - /* Certain applications (Steam) complain if we report an outdated driver version. In general, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index 1335c122890..71fef7ff88b 100644 +index 04817c6a9c8..00487990a17 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -75,6 +75,7 @@ +@@ -71,6 +71,7 @@ #define WINED3D_QUIRK_INFO_LOG_SPAM 0x00000080 #define WINED3D_QUIRK_LIMITED_TEX_FILTERING 0x00000100 #define WINED3D_QUIRK_BROKEN_ARB_FOG 0x00000200 @@ -92,5 +92,5 @@ index 1335c122890..71fef7ff88b 100644 enum wined3d_ffp_idx { -- -2.17.0 +2.18.0