[PATCH 1/5] d3dcompiler_43/tests: Added HLSL test suite

Henri Verbeet hverbeet at gmail.com
Mon Sep 27 05:57:45 CDT 2010

On 27 September 2010 02:22, Travis Athougies <iammisc at gmail.com> wrote:
>>> +    /* The Direct3D 9 docs state that we cannot lock a render target surface,
>>> +       instead we must copy the render target onto this surface to lock it */
>> I think you can, if you create it with D3DUSAGE_DYNAMIC | D3DUSAGE_RENDERTARGET. If you want the backbuffer to be lockable you'll need some device creation flag whose name I forgot.
> There is the lockable boolean argument that I think might work. I will
> look into using this
Please don't. I think GetRenderTargetData() is the correct way to do
this. Generally you don't want lockable render targets at all, but the
case where they're "useful" is for writing data to the render target,
not reading.

The problem with your current setup is that you do the readback after
doing a Present(). Present() invalidates the contents of the

> +        ok(data[0] == D3DCOLOR_ARGB(0, 0, 255, 255),
> +                "swizzle_test: Got color %08x (should be 0x0000FFFF)\n", data[0]);
While I doubt you're going to care a lot for this specific test, I
think it makes sense to integrate something like color_match() from
the d3d9 tests right from the start. In fact, I think the way you want
to do this is to keep the actual testing inside
compile_pixel_shader9(). E.g., you could pass it an array with things
like probe locations, expected values, allowed deviations and failure

> +    if (caps.PixelShaderVersion >= 0xffff0200)
You can just use D3DPS_VERSION(2, 0) here.

More information about the wine-devel mailing list