wined3d: Modify resource locations in wined3d_surface_blt() instead of the blitters.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2017-03-17 13:33:19 +01:00 committed by Alexandre Julliard
parent d5527c2d1c
commit d85d977a35
2 changed files with 6 additions and 9 deletions

View File

@ -7794,7 +7794,6 @@ static void arbfp_blit_surface(struct wined3d_device *device, enum wined3d_blit_
struct wined3d_surface *dst_surface, const RECT *dst_rect, struct wined3d_surface *dst_surface, const RECT *dst_rect,
const struct wined3d_color_key *color_key, enum wined3d_texture_filter_type filter) const struct wined3d_color_key *color_key, enum wined3d_texture_filter_type filter)
{ {
unsigned int dst_sub_resource_idx = surface_get_sub_resource_idx(dst_surface);
struct wined3d_texture *src_texture = src_surface->container; struct wined3d_texture *src_texture = src_surface->container;
struct wined3d_texture *dst_texture = dst_surface->container; struct wined3d_texture *dst_texture = dst_surface->container;
struct wined3d_color_key alpha_test_key; struct wined3d_color_key alpha_test_key;
@ -7850,9 +7849,6 @@ static void arbfp_blit_surface(struct wined3d_device *device, enum wined3d_blit_
if (wined3d_settings.strict_draw_ordering if (wined3d_settings.strict_draw_ordering
|| (dst_texture->swapchain && (dst_texture->swapchain->front_buffer == dst_texture))) || (dst_texture->swapchain && (dst_texture->swapchain->front_buffer == dst_texture)))
context->gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ context->gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */
wined3d_texture_validate_location(dst_texture, dst_sub_resource_idx, dst_texture->resource.draw_binding);
wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~dst_texture->resource.draw_binding);
} }
static HRESULT arbfp_blit_color_fill(struct wined3d_device *device, struct wined3d_rendertarget_view *view, static HRESULT arbfp_blit_color_fill(struct wined3d_device *device, struct wined3d_rendertarget_view *view,

View File

@ -2785,8 +2785,6 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, enum wined3d_bl
struct wined3d_surface *dst_surface, const RECT *dst_rect, struct wined3d_surface *dst_surface, const RECT *dst_rect,
const struct wined3d_color_key *color_key, enum wined3d_texture_filter_type filter) const struct wined3d_color_key *color_key, enum wined3d_texture_filter_type filter)
{ {
unsigned int dst_sub_resource_idx = surface_get_sub_resource_idx(dst_surface);
struct wined3d_texture *dst_texture = dst_surface->container;
struct wined3d_texture *src_texture = src_surface->container; struct wined3d_texture *src_texture = src_surface->container;
const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_gl_info *gl_info = context->gl_info;
@ -2810,9 +2808,6 @@ static void ffp_blit_blit_surface(struct wined3d_device *device, enum wined3d_bl
/* Restore the color key parameters */ /* Restore the color key parameters */
wined3d_texture_set_color_key(src_texture, WINED3D_CKEY_SRC_BLT, wined3d_texture_set_color_key(src_texture, WINED3D_CKEY_SRC_BLT,
(old_color_key_flags & WINED3D_CKEY_SRC_BLT) ? &old_blt_key : NULL); (old_color_key_flags & WINED3D_CKEY_SRC_BLT) ? &old_blt_key : NULL);
wined3d_texture_validate_location(dst_texture, dst_sub_resource_idx, dst_texture->resource.draw_binding);
wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~dst_texture->resource.draw_binding);
} }
const struct blit_shader ffp_blit = { const struct blit_shader ffp_blit = {
@ -3761,6 +3756,12 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
blitter->blit_surface(device, blit_op, context, src_surface, blitter->blit_surface(device, blit_op, context, src_surface,
src_rect, dst_surface, dst_rect, color_key, filter); src_rect, dst_surface, dst_rect, color_key, filter);
context_release(context); context_release(context);
wined3d_texture_validate_location(dst_texture, dst_sub_resource_idx,
dst_texture->resource.draw_binding);
wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx,
~dst_texture->resource.draw_binding);
return WINED3D_OK; return WINED3D_OK;
} }
} }