[PATCH 4/4] wined3d: use stretch_rect_fbo for swapchainless blits

Roderick Colenbrander thunderbird2k at gmail.com
Tue Jun 22 14:38:00 CDT 2010

On Wed, Apr 28, 2010 at 2:56 PM, Henri Verbeet <hverbeet at gmail.com> wrote:
> On 28 April 2010 14:29, Roderick Colenbrander <thunderbird2k at gmail.com> wrote:
>> +    /* Early sort out of cases where no render target is used */
>> +    if (!dstSwapchain && !srcSwapchain
>> +            && src_surface != device->render_targets[0]
>> +            && dst_surface != device->render_targets[0])
>> +    {
>> +        if (fbo_blit_supported(&device->adapter->gl_info, BLIT_OP_BLIT,
>> +                &src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format_desc,
>> +                &dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format_desc))
>> +        {
>> +            stretch_rect_fbo(device, src_surface, &src_rect, dst_surface, &dst_rect, Filter);
>> +            return WINED3D_OK;
>> +        }
>> +
>> +        TRACE("No surface is render target, not using hardware blit.\n");
>> +        return WINED3DERR_INVALIDCALL;
>> +    }
>> +
> You might as well try FBO blits first, before doing most of the other
> checks. That's how it's eventually supposed to work anyway, and you
> could remove the other strecth_rect_fbo() calls in that case. That
> does depend on fbo_blit_supported() working properly, of course.

I'm investigating how I want to continue with this code after the code
freeze is over. In the mean time I plan to write a few tests (if
needed) to hopefully prevent regressions later on. I have a few
questions left regarding this reply from a while back.

In the end we want some mechanism to select the right blit_shader
using 'blit_supported()' and use that to perform the requested blit.
At this point I think that fbo_blit_supported() works properly for the
cases we call stretch_rect_fbo (though there is still some unneeded
if-statement in fbo_blit_supported which I still have to take out).
Regarding BltOverride in what way did you want to 'try the FBO blit
first'. Did you want fbo_blit_supported sorting out the 'unsupported
swapchain cases' (it lacks surface info and only has flags) itself or
was all you wanted just:
if ( !unhandled_swapchain_cases && !color_keying && fbo_blit_supported(..))

continue with all other checks

I'm planning to write some more DirectDraw Blt tests to stress this
code some more. Are there any specific tests (or perhaps some D3D9
tests) you want to see as well when I'm at it?


More information about the wine-devel mailing list