wined3d: Use PBO for read-only staging textures.

Signed-off-by: Andrew Wesie <awesie@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Andrew Wesie 2018-09-30 12:01:59 -05:00 committed by Alexandre Julliard
parent 2742ce91f5
commit b86716ebed
1 changed files with 9 additions and 5 deletions

View File

@ -46,11 +46,15 @@ struct wined3d_rect_f
static BOOL wined3d_texture_use_pbo(const struct wined3d_texture *texture, const struct wined3d_gl_info *gl_info)
{
return !(texture->resource.access & WINED3D_RESOURCE_ACCESS_CPU)
&& texture->resource.usage & WINED3DUSAGE_DYNAMIC
&& gl_info->supported[ARB_PIXEL_BUFFER_OBJECT]
&& !texture->resource.format->conv_byte_count
&& !(texture->flags & (WINED3D_TEXTURE_PIN_SYSMEM | WINED3D_TEXTURE_COND_NP2_EMULATED));
if (!gl_info->supported[ARB_PIXEL_BUFFER_OBJECT]
|| texture->resource.format->conv_byte_count
|| (texture->flags & (WINED3D_TEXTURE_PIN_SYSMEM | WINED3D_TEXTURE_COND_NP2_EMULATED)))
return FALSE;
/* Use a PBO for dynamic textures and read-only staging textures. */
return (!(texture->resource.access & WINED3D_RESOURCE_ACCESS_CPU)
&& texture->resource.usage & WINED3DUSAGE_DYNAMIC)
|| texture->resource.access == (WINED3D_RESOURCE_ACCESS_CPU | WINED3D_RESOURCE_ACCESS_MAP_R);
}
static BOOL wined3d_texture_use_immutable_storage(const struct wined3d_texture *texture,