[PATCH v2] wined3d: Allocate a heap memory buffer in wined3d_cs_map_upload_bo() if possible.

Stefan Dösinger stefandoesinger at gmail.com
Mon Feb 28 02:51:58 CST 2022



> Am 25.02.2022 um 20:17 schrieb Zebediah Figura <zfigura at codeweavers.com>:
> 
> +            heap_free((void *)op->bo.addr.addr);
> +    }
> ...
> +    if (!(map_desc->data = heap_alloc(size)))

Just an fyi, and I guess you're already aware of it anyhow: HeapAlloc / HeapFree here can be quite expensive; I found it benefitial to cache those memory allocations, similarly to how we cache Vulcan / GL side buffers.

Though the broader design question is if said optimization should be in wined3d or ntdll.

I had pretty good results in my old CSMT with having just one upload allocation cached per resource. That way we don't have to search for a matching slab in a big-ish cache, but otoh free and re-alloc a few times. But AFAIR it reduced the amount of alloc / frees by 90% or so,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20220228/91bfc2a2/attachment.sig>


More information about the wine-devel mailing list