Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/wined3d/adapter_gl.c | 1 + dlls/wined3d/adapter_vk.c | 1 + dlls/wined3d/texture.c | 12 +++++------- dlls/wined3d/wined3d_private.h | 1 + 4 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index 902b9620f30..f20e93df67e 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -5129,6 +5129,7 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_ d3d_info->clip_control = !!gl_info->supported[ARB_CLIP_CONTROL]; d3d_info->full_ffp_varyings = !!(shader_caps.wined3d_caps & WINED3D_SHADER_CAP_FULL_FFP_VARYINGS); d3d_info->scaled_resolve = !!gl_info->supported[EXT_FRAMEBUFFER_MULTISAMPLE_BLIT_SCALED]; + d3d_info->pbo = !!gl_info->supported[ARB_PIXEL_BUFFER_OBJECT]; d3d_info->feature_level = feature_level_from_caps(gl_info, &shader_caps, &fragment_caps);
if (gl_info->supported[ARB_TEXTURE_MULTISAMPLE]) diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c index 1db25a4d72f..74540134e10 100644 --- a/dlls/wined3d/adapter_vk.c +++ b/dlls/wined3d/adapter_vk.c @@ -2198,6 +2198,7 @@ static void wined3d_adapter_vk_init_d3d_info(struct wined3d_adapter_vk *adapter_ d3d_info->clip_control = true; d3d_info->full_ffp_varyings = !!(shader_caps.wined3d_caps & WINED3D_SHADER_CAP_FULL_FFP_VARYINGS); d3d_info->scaled_resolve = false; + d3d_info->pbo = false; d3d_info->feature_level = feature_level_from_caps(&shader_caps);
d3d_info->multisample_draw_location = WINED3D_LOCATION_TEXTURE_RGB; diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 75479f5066a..1c885b72c10 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -47,10 +47,9 @@ struct wined3d_rect_f float b; };
-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_d3d_info *d3d_info) { - if (!gl_info->supported[ARB_PIXEL_BUFFER_OBJECT] - || texture->resource.format->conv_byte_count + if (!d3d_info->pbo || texture->resource.format->conv_byte_count || (texture->flags & (WINED3D_TEXTURE_PIN_SYSMEM | WINED3D_TEXTURE_COND_NP2_EMULATED))) return FALSE;
@@ -1962,7 +1961,7 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, unsig * If the surface didn't use PBOs previously but could now, don't * change it - whatever made us not use PBOs might come back, e.g. * color keys. */ - if (texture->resource.map_binding == WINED3D_LOCATION_BUFFER && !wined3d_texture_use_pbo(texture, gl_info)) + if (texture->resource.map_binding == WINED3D_LOCATION_BUFFER && !wined3d_texture_use_pbo(texture, d3d_info)) texture->resource.map_binding = WINED3D_LOCATION_SYSMEM;
wined3d_texture_validate_location(texture, sub_resource_idx, WINED3D_LOCATION_SYSMEM); @@ -3629,7 +3628,6 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc { const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info; struct wined3d_device_parent *device_parent = device->device_parent; - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; unsigned int sub_count, i, j, size, offset = 0; unsigned int pow2_width, pow2_height; const struct wined3d_format *format; @@ -3837,11 +3835,11 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc texture->pow2_matrix[15] = 1.0f; TRACE("x scale %.8e, y scale %.8e.\n", texture->pow2_matrix[0], texture->pow2_matrix[5]);
- if (wined3d_texture_use_pbo(texture, gl_info)) + if (wined3d_texture_use_pbo(texture, d3d_info)) texture->resource.map_binding = WINED3D_LOCATION_BUFFER;
if (desc->resource_type != WINED3D_RTYPE_TEXTURE_3D - || !wined3d_texture_use_pbo(texture, gl_info)) + || !wined3d_texture_use_pbo(texture, d3d_info)) { if (!wined3d_resource_prepare_sysmem(&texture->resource)) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 601fefd0145..508ad3634e2 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -239,6 +239,7 @@ struct wined3d_d3d_info uint32_t clip_control : 1; uint32_t full_ffp_varyings : 1; uint32_t scaled_resolve : 1; + uint32_t pbo : 1; enum wined3d_feature_level feature_level;
DWORD multisample_draw_location;