mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 06:01:17 +00:00
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.
This commit is contained in:
parent
4172c04826
commit
ebbcc10b05
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue