[PATCH 1/2] d3d10core/tests: Multisampled render targets are zeroed on creation (v2).
Henri Verbeet
hverbeet at gmail.com
Thu Jan 7 02:25:26 CST 2016
On 6 January 2016 at 23:56, Stefan Dösinger <stefandoesinger at gmx.at> wrote:
> + hr = ID3D10Device_CreateTexture2D(device, &desc, NULL, &single);
> + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr);
> + ID3D10Device_ResolveSubresource(device, (ID3D10Resource *)single, 0,
> + (ID3D10Resource *)multi, 0, DXGI_FORMAT_R8G8B8A8_UNORM);
> +
> + get_texture_readback(single, &rb);
> + for (y = 0; y < 480; ++y)
> + {
> + for (x = 0; x < 640; ++x)
> + {
> + color = get_readback_color(&rb, x, y);
> + if (!compare_color(color, 0x00000000, 0))
> + {
> + all_zero = FALSE;
> + break;
> + }
> + }
> + if (!all_zero)
> + break;
> + }
> + release_texture_readback(&rb);
> + ok(all_zero, "Got unexpected color 0x%08x, position %ux%u.\n", color, x, y);
> +
This probably works, but depends very much on ResolveSubresource()
working as intended. I think it would be a little more robust to first
clear "single" with a different color. Also, it's not strictly
required, but if you use a swapchain surface to resolve to, it's
easier to later debug the test visually by inserting a Present() call
in the appropriate place.
More information about the wine-devel
mailing list