This patchset implements dynamic resource handling, and in particular NOOVERWRITE buffer maps, in situations where we don't have GL_ARB_buffer_storage. This is relevant e.g. on MacOS but probably also on some ARM CPUs where write combined memory has different performance characteristics than windows games expect [0].
Some benchmark results from hl2 (chosen because it is very CPU heavy on modern systems and heavy use of dynamic resources), tested on a MacBookPro14,3 on Linux with GL_ARB_buffer_storage disabled.
"csmt usr" means with patch "wined3d: Avoid heap_alloc in update_sub_resource.", "heap usr" without this patch.
"no dyn" means the current upstream code with buffer storage disabled. "sysmem dyn" means the entire patchset of this MR with buffer storage disabled. "BO dyn" is current wine code with GL_ARB_buffer_storage available. I also double checked that this patchset has no impact on this default case. "heapalloc dyn" means the current code in cs_map_upload_bo that returns HeapAlloc'ed memory, just enabled for dynamic buffer maps. This code is faster than sysmem dyn because it doesn't re-upload the entire BO after a DISCARD map. It also happens to be incorrect for non-DISCARD maps because we aren't allowed to throw away existing data, but I think it isn't ever used for maps in practise due to mutually exclusive flag checks in the callers and callee.
Summary: This patchset improves performance measurably (240 fps to 327 fps). The patch that avoids HeapAlloc calls when setting shader constants has an impact, but it is relatively small - much smaller than I expected. Plus the ntdll heap code is pretty good by now.
csmt usr heap usr no dyn 246 240 sysmem dyn 327 318 BO dyn 382 369 heapalloc dyn 344 335