d3d9: Add some visual tests for Direct3DDevice9_StretchRect()

Jason Green jave27 at gmail.com
Tue Apr 1 08:32:49 CDT 2008

On Tue, Apr 1, 2008 at 5:45 AM, Stefan Dösinger <stefan at codeweavers.com> wrote:
> Am Dienstag, 1. April 2008 07:20:44 schrieb Jason Green:
>  Did you take a look at the various capability flags? I think the test as you
>  submitted it is correct for dx9 level cards and drivers, but there are a few
>  capability flags like D3DDEVCAPS2_CANSTRETCHRECTFROMTEXTURE or similar. Also
>  some drivers seem to refuse StretchRecting between offscreenplain surfaces,
>  even if no stretching is used.

Yeah, I meant to make a comment about that as a TODO, but I didn't
have any cards lying around that didn't advertise that cap.  If anyone
does, it'd be interesting to see how Windows handles some of those
cases.  I'd guess it would be just like MSDN claims, but you never
know until you actually test it.

>  Do you have any ideas what the scheme behind the allowed/forbidden blits is?
>  So far I can see this:
>  -> Blitting to a rendertarget surface/texture is always OK
>  -> blitting between offscreen surfaces is ok as long as no stretching occurs
>  -> blitting to non-RT surfaces/textures faily, except the above

Yeah - turns out that MSDN was correct on this scheme:


These tests show that the results of the dx9 drivers are valid
according to that page.

>  Did you test blitting from/to sysmem surfaces? The msdn says both must be
>  D3DPOOL_DEFAULT as far as I remember

Yep - I probably should have left a few tests in there for that, but
the only surfaces that are valid to call StretchRect on must be in
D3DPOOL_DEFAULT (both source and destination).  Everything else fails.

More information about the wine-devel mailing list