Module: wine Branch: master Commit: bccfd7cc061cd41e2c50fc63ba15516652a869f6 URL: http://source.winehq.org/git/wine.git/?a=commit;h=bccfd7cc061cd41e2c50fc63ba...
Author: Roderick Colenbrander thunderbird2k@gmail.com Date: Mon Apr 12 12:17:09 2010 +0200
wined3d: Add BLT_OP_COLOR_FILL to blit_supported and use it in BltOverride.
---
dlls/wined3d/arb_program_shader.c | 15 +++++++------ dlls/wined3d/surface.c | 38 ++++++++++++++++++++++++++++-------- dlls/wined3d/wined3d_private.h | 3 +- 3 files changed, 39 insertions(+), 17 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index b939213..a40b940 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -6846,13 +6846,7 @@ static BOOL arbfp_blit_supported(const struct wined3d_gl_info *gl_info, enum bli const RECT *dst_rect, DWORD dst_usage, WINED3DPOOL dst_pool, const struct wined3d_format_desc *dst_format_desc) { - enum complex_fixup src_fixup = get_complex_fixup(src_format_desc->color_fixup); - - if (TRACE_ON(d3d_shader) && TRACE_ON(d3d)) - { - TRACE("Checking support for fixup:\n"); - dump_color_fixup_desc(src_format_desc->color_fixup); - } + enum complex_fixup src_fixup;
if (blit_op != BLIT_OP_BLIT) { @@ -6860,6 +6854,13 @@ static BOOL arbfp_blit_supported(const struct wined3d_gl_info *gl_info, enum bli return FALSE; }
+ src_fixup = get_complex_fixup(src_format_desc->color_fixup); + if (TRACE_ON(d3d_shader) && TRACE_ON(d3d)) + { + TRACE("Checking support for fixup:\n"); + dump_color_fixup_desc(src_format_desc->color_fixup); + } + if (!is_identity_fixup(dst_format_desc->color_fixup)) { TRACE("Destination fixups are not supported\n"); diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 667478d..309a62a 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -3759,16 +3759,19 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const return WINED3DERR_INVALIDCALL; }
- /* This == (IWineD3DSurfaceImpl *) myDevice->render_targets[0] || dstSwapchain - must be true if we are here */ - if (This != (IWineD3DSurfaceImpl *) myDevice->render_targets[0] && - !(This == (IWineD3DSurfaceImpl*) dstSwapchain->frontBuffer || - (dstSwapchain->backBuffer && This == (IWineD3DSurfaceImpl*) dstSwapchain->backBuffer[0]))) { - TRACE("Surface is higher back buffer, falling back to software\n"); + if (ffp_blit.blit_supported(&myDevice->adapter->gl_info, BLIT_OP_COLOR_FILL, + NULL, 0, 0, NULL, + &dst_rect, This->resource.usage, This->resource.pool, This->resource.format_desc)) + { + return ffp_blit.color_fill(myDevice, This, &dst_rect, color); + } + else if (cpu_blit.blit_supported(&myDevice->adapter->gl_info, BLIT_OP_COLOR_FILL, + NULL, 0, 0, NULL, + &dst_rect, This->resource.usage, This->resource.pool, This->resource.format_desc)) + { return cpu_blit.color_fill(myDevice, This, &dst_rect, color); } - - return ffp_blit.color_fill(myDevice, This, &dst_rect, color); + return WINED3DERR_INVALIDCALL; } }
@@ -4801,8 +4804,20 @@ static BOOL ffp_blit_supported(const struct wined3d_gl_info *gl_info, enum blit_ const RECT *dst_rect, DWORD dst_usage, WINED3DPOOL dst_pool, const struct wined3d_format_desc *dst_format_desc) { - enum complex_fixup src_fixup = get_complex_fixup(src_format_desc->color_fixup); + enum complex_fixup src_fixup;
+ if (blit_op == BLIT_OP_COLOR_FILL) + { + if (!(dst_usage & WINED3DUSAGE_RENDERTARGET)) + { + TRACE("Color fill not supported\n"); + return FALSE; + } + + return TRUE; + } + + src_fixup = get_complex_fixup(src_format_desc->color_fixup); if (TRACE_ON(d3d_surface) && TRACE_ON(d3d)) { TRACE("Checking support for fixup:\n"); @@ -4880,6 +4895,11 @@ static BOOL cpu_blit_supported(const struct wined3d_gl_info *gl_info, enum blit_ const RECT *dst_rect, DWORD dst_usage, WINED3DPOOL dst_pool, const struct wined3d_format_desc *dst_format_desc) { + if (blit_op == BLIT_OP_COLOR_FILL) + { + return TRUE; + } + return FALSE; }
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 00d4c48..4652be5 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1171,7 +1171,8 @@ HRESULT compile_state_table(struct StateEntry *StateTable, APPLYSTATEFUNC **dev_
enum blit_operation { - BLIT_OP_BLIT + BLIT_OP_BLIT, + BLIT_OP_COLOR_FILL };
/* Shaders for color conversions in blits */