Commit c50090cb authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wined3d: Return the up-to-date locations from blitters.

parent 99168377
......@@ -7782,7 +7782,7 @@ static BOOL arbfp_blit_supported(const struct wined3d_gl_info *gl_info,
}
}
static void arbfp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_op op,
static DWORD arbfp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_op op,
struct wined3d_context *context, struct wined3d_surface *src_surface, DWORD src_location,
const RECT *src_rect, struct wined3d_surface *dst_surface, DWORD dst_location, const RECT *dst_rect,
const struct wined3d_color_key *color_key, enum wined3d_texture_filter_type filter)
......@@ -7800,9 +7800,8 @@ static void arbfp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_bli
dst_texture->resource.pool, dst_texture->resource.format, dst_location))
{
if ((next = blitter->next))
next->ops->blitter_blit(next, op, context, src_surface, src_location,
return next->ops->blitter_blit(next, op, context, src_surface, src_location,
src_rect, dst_surface, dst_location, dst_rect, color_key, filter);
return;
}
arbfp_blitter = CONTAINING_RECORD(blitter, struct wined3d_arbfp_blitter, blitter);
......@@ -7877,6 +7876,8 @@ static void arbfp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_bli
if (wined3d_settings.strict_draw_ordering
|| (dst_texture->swapchain && (dst_texture->swapchain->front_buffer == dst_texture)))
context->gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */
return dst_location;
}
static void arbfp_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_device *device,
......
......@@ -2409,7 +2409,7 @@ static void fbo_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_de
clear_rects, draw_rect, flags, colour, depth, stencil);
}
static void fbo_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_op op,
static DWORD fbo_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_op op,
struct wined3d_context *context, struct wined3d_surface *src_surface, DWORD src_location,
const RECT *src_rect, struct wined3d_surface *dst_surface, DWORD dst_location, const RECT *dst_rect,
const struct wined3d_color_key *colour_key, enum wined3d_texture_filter_type filter)
......@@ -2424,9 +2424,8 @@ static void fbo_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_
src_resource->usage, dst_resource->pool, dst_resource->format, dst_location))
{
if ((next = blitter->next))
next->ops->blitter_blit(next, op, context, src_surface, src_location,
return next->ops->blitter_blit(next, op, context, src_surface, src_location,
src_rect, dst_surface, dst_location, dst_rect, colour_key, filter);
return;
}
if (op == WINED3D_BLIT_OP_COLOR_BLIT)
......@@ -2434,17 +2433,18 @@ static void fbo_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_
TRACE("Colour blit.\n");
surface_blt_fbo(device, context, filter, src_surface, src_location,
src_rect, dst_surface, dst_location, dst_rect);
return;
return dst_location;
}
if (op == WINED3D_BLIT_OP_DEPTH_BLIT)
{
TRACE("Depth/stencil blit.\n");
surface_depth_blt_fbo(device, src_surface, src_location, src_rect, dst_surface, dst_location, dst_rect);
return;
return dst_location;
}
ERR("This blitter does not implement blit op %#x.\n", op);
return dst_location;
}
static const struct wined3d_blitter_ops fbo_blitter_ops =
......@@ -2610,7 +2610,7 @@ static void ffp_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_de
clear_rects, draw_rect, next_flags, colour, depth, stencil);
}
static void ffp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_op op,
static DWORD ffp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_op op,
struct wined3d_context *context, struct wined3d_surface *src_surface, DWORD src_location,
const RECT *src_rect, struct wined3d_surface *dst_surface, DWORD dst_location, const RECT *dst_rect,
const struct wined3d_color_key *color_key, enum wined3d_texture_filter_type filter)
......@@ -2634,9 +2634,8 @@ static void ffp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_
dst_resource->usage, dst_resource->pool, dst_resource->format, dst_location))
{
if ((next = blitter->next))
next->ops->blitter_blit(next, op, context, src_surface, src_location,
return next->ops->blitter_blit(next, op, context, src_surface, src_location,
src_rect, dst_surface, dst_location, dst_rect, color_key, filter);
return;
}
TRACE("Blt from surface %p to rendertarget %p\n", src_surface, dst_surface);
......@@ -2731,6 +2730,8 @@ static void ffp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_
/* Restore the color key parameters */
wined3d_texture_set_color_key(src_texture, WINED3D_CKEY_SRC_BLT,
(old_color_key_flags & WINED3D_CKEY_SRC_BLT) ? &old_blt_key : NULL);
return dst_location;
}
static const struct wined3d_blitter_ops ffp_blitter_ops =
......@@ -3501,7 +3502,7 @@ static void cpu_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_de
}
}
static void cpu_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_op op,
static DWORD cpu_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_op op,
struct wined3d_context *context, struct wined3d_surface *src_surface, DWORD src_location,
const RECT *src_rect, struct wined3d_surface *dst_surface, DWORD dst_location, const RECT *dst_rect,
const struct wined3d_color_key *color_key, enum wined3d_texture_filter_type filter)
......@@ -3537,6 +3538,8 @@ static void cpu_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_
src_texture, src_sub_resource_idx, &src_box, flags, &fx, filter)))
ERR("Failed to blit.\n");
wined3d_texture_load_location(dst_texture, dst_sub_resource_idx, context, dst_location);
return dst_texture->resource.map_binding | dst_location;
}
static const struct wined3d_blitter_ops cpu_blitter_ops =
......@@ -3575,11 +3578,11 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
struct wined3d_device *device = dst_texture->resource.device;
struct wined3d_swapchain *src_swapchain, *dst_swapchain;
const struct wined3d_color_key *colour_key = NULL;
DWORD dst_location, valid_locations;
DWORD src_ds_flags, dst_ds_flags;
struct wined3d_context *context;
enum wined3d_blit_op blit_op;
BOOL scale, convert;
DWORD dst_location;
static const DWORD simple_blit = WINED3D_BLT_SRC_CKEY
| WINED3D_BLT_SRC_CKEY_OVERRIDE
......@@ -3660,13 +3663,14 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
dst_location = dst_texture->resource.draw_binding;
context = context_acquire(device, dst_texture, dst_sub_resource_idx);
device->blitter->ops->blitter_blit(device->blitter, WINED3D_BLIT_OP_DEPTH_BLIT, context,
valid_locations = device->blitter->ops->blitter_blit(device->blitter,
WINED3D_BLIT_OP_DEPTH_BLIT, context,
src_surface, src_texture->resource.draw_binding, src_rect,
dst_surface, dst_location, dst_rect, NULL, filter);
context_release(context);
wined3d_texture_validate_location(dst_texture, dst_sub_resource_idx, dst_location);
wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~dst_location);
wined3d_texture_validate_location(dst_texture, dst_sub_resource_idx, valid_locations);
wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~valid_locations);
return WINED3D_OK;
}
......@@ -3758,13 +3762,13 @@ HRESULT wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst
dst_location = dst_texture->resource.draw_binding;
context = context_acquire(device, dst_texture, dst_sub_resource_idx);
device->blitter->ops->blitter_blit(device->blitter, blit_op, context,
valid_locations = device->blitter->ops->blitter_blit(device->blitter, blit_op, context,
src_surface, src_texture->resource.draw_binding, src_rect,
dst_surface, dst_location, dst_rect, colour_key, filter);
context_release(context);
wined3d_texture_validate_location(dst_texture, dst_sub_resource_idx, dst_location);
wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~dst_location);
wined3d_texture_validate_location(dst_texture, dst_sub_resource_idx, valid_locations);
wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~valid_locations);
return WINED3D_OK;
......
......@@ -2059,7 +2059,7 @@ struct wined3d_blitter_ops
void (*blitter_clear)(struct wined3d_blitter *blitter, struct wined3d_device *device,
unsigned int rt_count, const struct wined3d_fb_state *fb, unsigned int rect_count, const RECT *clear_rects,
const RECT *draw_rect, DWORD flags, const struct wined3d_color *colour, float depth, DWORD stencil);
void (*blitter_blit)(struct wined3d_blitter *blitter, enum wined3d_blit_op op, struct wined3d_context *context,
DWORD (*blitter_blit)(struct wined3d_blitter *blitter, enum wined3d_blit_op op, struct wined3d_context *context,
struct wined3d_surface *src_surface, DWORD src_location, const RECT *src_rect,
struct wined3d_surface *dst_surface, DWORD dst_location, const RECT *dst_rect,
const struct wined3d_color_key *color_key, enum wined3d_texture_filter_type filter);
......
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