wined3d: Call arbfp_blit_surface and ffp_blit_blit_surface through the blit interfaces.

This commit is contained in:
Stefan Dösinger 2015-04-14 11:16:26 +02:00 committed by Alexandre Julliard
parent 6b455e74a0
commit 27209c69a9
3 changed files with 23 additions and 24 deletions

View File

@ -7870,7 +7870,7 @@ static BOOL arbfp_blit_supported(const struct wined3d_gl_info *gl_info,
} }
} }
HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter, static void arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
struct wined3d_surface *src_surface, const RECT *src_rect_in, struct wined3d_surface *src_surface, const RECT *src_rect_in,
struct wined3d_surface *dst_surface, const RECT *dst_rect_in, struct wined3d_surface *dst_surface, const RECT *dst_rect_in,
const struct wined3d_color_key *color_key) const struct wined3d_color_key *color_key)
@ -7923,8 +7923,6 @@ HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding); surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding);
surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding);
return WINED3D_OK;
} }
static HRESULT arbfp_blit_color_fill(struct wined3d_device *device, struct wined3d_surface *dst_surface, static HRESULT arbfp_blit_color_fill(struct wined3d_device *device, struct wined3d_surface *dst_surface,
@ -7949,4 +7947,5 @@ const struct blit_shader arbfp_blit = {
arbfp_blit_supported, arbfp_blit_supported,
arbfp_blit_color_fill, arbfp_blit_color_fill,
arbfp_blit_depth_fill, arbfp_blit_depth_fill,
arbfp_blit_surface,
}; };

View File

@ -4409,6 +4409,7 @@ const struct blit_shader ffp_blit = {
ffp_blit_supported, ffp_blit_supported,
ffp_blit_color_fill, ffp_blit_color_fill,
ffp_blit_depth_fill, ffp_blit_depth_fill,
ffp_blit_blit_surface,
}; };
static HRESULT cpu_blit_alloc(struct wined3d_device *device) static HRESULT cpu_blit_alloc(struct wined3d_device *device)
@ -5046,6 +5047,15 @@ static HRESULT cpu_blit_depth_fill(struct wined3d_device *device,
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
} }
static void cpu_blit_blit_surface(struct wined3d_device *device, DWORD filter,
struct wined3d_surface *src_surface, const RECT *src_rect,
struct wined3d_surface *dst_surface, const RECT *dst_rect,
const struct wined3d_color_key *color_key)
{
/* FIXME: Remove error returns from surface_blt_cpu. */
ERR("Blit method not implemented by cpu_blit.\n");
}
const struct blit_shader cpu_blit = { const struct blit_shader cpu_blit = {
cpu_blit_alloc, cpu_blit_alloc,
cpu_blit_free, cpu_blit_free,
@ -5054,6 +5064,7 @@ const struct blit_shader cpu_blit = {
cpu_blit_supported, cpu_blit_supported,
cpu_blit_color_fill, cpu_blit_color_fill,
cpu_blit_depth_fill, cpu_blit_depth_fill,
cpu_blit_blit_surface,
}; };
HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect_in, HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect_in,
@ -5253,6 +5264,8 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
} }
else else
{ {
const struct blit_shader *blitter;
/* In principle this would apply to depth blits as well, but we don't /* In principle this would apply to depth blits as well, but we don't
* implement those in the CPU blitter at the moment. */ * implement those in the CPU blitter at the moment. */
if ((dst_surface->locations & dst_surface->resource.map_binding) if ((dst_surface->locations & dst_surface->resource.map_binding)
@ -5354,23 +5367,12 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
return WINED3D_OK; return WINED3D_OK;
} }
if (arbfp_blit.blit_supported(&device->adapter->gl_info, &device->adapter->d3d_info, blit_op, blitter = wined3d_select_blitter(&device->adapter->gl_info, &device->adapter->d3d_info, blit_op,
&src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format, &src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format,
&dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format)) &dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format);
if (blitter)
{ {
TRACE("Using arbfp blit.\n"); blitter->blit_surface(device, filter, src_surface, &src_rect, dst_surface, &dst_rect, color_key);
if (SUCCEEDED(arbfp_blit_surface(device, filter, src_surface, &src_rect,
dst_surface, &dst_rect, color_key)))
return WINED3D_OK;
}
if (ffp_blit.blit_supported(&device->adapter->gl_info, &device->adapter->d3d_info, blit_op,
&src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format,
&dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format))
{
TRACE("Using FFP blit.\n");
ffp_blit_blit_surface(device, filter, src_surface, &src_rect, dst_surface, &dst_rect, color_key);
return WINED3D_OK; return WINED3D_OK;
} }
} }

View File

@ -1351,6 +1351,10 @@ struct blit_shader
const RECT *dst_rect, const struct wined3d_color *color); const RECT *dst_rect, const struct wined3d_color *color);
HRESULT (*depth_fill)(struct wined3d_device *device, HRESULT (*depth_fill)(struct wined3d_device *device,
struct wined3d_surface *surface, const RECT *rect, float depth); struct wined3d_surface *surface, const RECT *rect, float depth);
void (*blit_surface)(struct wined3d_device *device, DWORD filter,
struct wined3d_surface *src_surface, const RECT *src_rect,
struct wined3d_surface *dst_surface, const RECT *dst_rect,
const struct wined3d_color_key *color_key);
}; };
extern const struct blit_shader ffp_blit DECLSPEC_HIDDEN; extern const struct blit_shader ffp_blit DECLSPEC_HIDDEN;
@ -1363,12 +1367,6 @@ const struct blit_shader *wined3d_select_blitter(const struct wined3d_gl_info *g
const RECT *dst_rect, DWORD dst_usage, enum wined3d_pool dst_pool, const struct wined3d_format *dst_format) const RECT *dst_rect, DWORD dst_usage, enum wined3d_pool dst_pool, const struct wined3d_format *dst_format)
DECLSPEC_HIDDEN; DECLSPEC_HIDDEN;
/* Temporary blit_shader helper functions */
HRESULT arbfp_blit_surface(struct wined3d_device *device, DWORD filter,
struct wined3d_surface *src_surface, const RECT *src_rect,
struct wined3d_surface *dst_surface, const RECT *dst_rect,
const struct wined3d_color_key *color_key) DECLSPEC_HIDDEN;
struct wined3d_context *context_acquire(const struct wined3d_device *device, struct wined3d_context *context_acquire(const struct wined3d_device *device,
struct wined3d_surface *target) DECLSPEC_HIDDEN; struct wined3d_surface *target) DECLSPEC_HIDDEN;
void context_alloc_event_query(struct wined3d_context *context, void context_alloc_event_query(struct wined3d_context *context,