Commit b86716eb authored by Andrew Wesie's avatar Andrew Wesie Committed by Alexandre Julliard

wined3d: Use PBO for read-only staging textures.

parent 2742ce91
...@@ -46,11 +46,15 @@ struct wined3d_rect_f ...@@ -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) 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) if (!gl_info->supported[ARB_PIXEL_BUFFER_OBJECT]
&& texture->resource.usage & WINED3DUSAGE_DYNAMIC || texture->resource.format->conv_byte_count
&& gl_info->supported[ARB_PIXEL_BUFFER_OBJECT] || (texture->flags & (WINED3D_TEXTURE_PIN_SYSMEM | WINED3D_TEXTURE_COND_NP2_EMULATED)))
&& !texture->resource.format->conv_byte_count return FALSE;
&& !(texture->flags & (WINED3D_TEXTURE_PIN_SYSMEM | WINED3D_TEXTURE_COND_NP2_EMULATED));
/* 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, static BOOL wined3d_texture_use_immutable_storage(const struct wined3d_texture *texture,
......
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