Commit ebbcc10b authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wined3d: Do not enforce GL map access for resources with WINED3D_RESOURCE_ACCESS_CPU.

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. This change should only affect managed resources, i.e. those with both CPU and GPU access. We never create a BO for CPU-only resources.
parent 4172c048
......@@ -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_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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment