From: Zebediah Figura zfigura@codeweavers.com
d3d maps of such resources will map the CPU copy, and uploads and downloads use glBufferSubData() and glGetBufferSubData() respectively. There is no need to map the BO.
This improves performance of Indivisible on NVidia GPUs. The game uses a d3d9 MANAGED buffer for streaming vertex data, which results in poor performance on NVidia when using GL_MAP_READ_BIT | GL_MAP_PERSISTENT_BIT. With this change we use neither. --- dlls/wined3d/resource.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 08edce3630c..c32c9580ae9 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -379,10 +379,13 @@ GLbitfield wined3d_resource_gl_storage_flags(const struct wined3d_resource *reso
if (resource->usage & WINED3DUSAGE_DYNAMIC) flags |= GL_CLIENT_STORAGE_BIT; - if (access & WINED3D_RESOURCE_ACCESS_MAP_W) - flags |= GL_MAP_WRITE_BIT; - if (access & WINED3D_RESOURCE_ACCESS_MAP_R) - flags |= GL_MAP_READ_BIT; + if (!(access & WINED3D_RESOURCE_ACCESS_CPU)) + { + if (access & WINED3D_RESOURCE_ACCESS_MAP_W) + flags |= GL_MAP_WRITE_BIT; + if (access & WINED3D_RESOURCE_ACCESS_MAP_R) + flags |= GL_MAP_READ_BIT; + }
return flags; }