Commit 5eadfb09 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

d3d10core/tests: Test specifying the multisample mask via OMSetBlendState().

parent 87ab21dd
......@@ -17791,6 +17791,72 @@ static void test_multisample_resolve(void)
release_test_context(&test_context);
}
static void test_sample_mask(void)
{
static const DWORD ps_code[] =
{
#if 0
float4 main() : sv_target
{
return float4(1.0, 1.0, 1.0, 1.0);
}
#endif
0x43425844, 0x949557e7, 0x1480242b, 0x831e64fc, 0x7c0305d2, 0x00000001, 0x000000b0, 0x00000003,
0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000,
0x0000000f, 0x745f7673, 0x65677261, 0xabab0074, 0x52444853, 0x00000038, 0x00000040, 0x0000000e,
0x03000065, 0x001020f2, 0x00000000, 0x08000036, 0x001020f2, 0x00000000, 0x00004002, 0x3f800000,
0x3f800000, 0x3f800000, 0x3f800000, 0x0100003e,
};
static const float black[] = {0.0f, 0.0f, 0.0f, 0.0f};
struct d3d10core_test_context test_context;
D3D10_TEXTURE2D_DESC texture_desc;
ID3D10RenderTargetView *rtv;
ID3D10Texture2D *texture;
ID3D10PixelShader *ps;
ID3D10Device *device;
UINT quality_levels;
HRESULT hr;
if (!init_test_context(&test_context))
return;
device = test_context.device;
hr = ID3D10Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_TYPELESS, 4, &quality_levels);
ok(hr == S_OK, "Failed to check multisample quality levels, hr %#x.\n", hr);
if (!quality_levels)
{
skip("4xMSAA not supported.\n");
release_test_context(&test_context);
return;
}
hr = ID3D10Device_CreatePixelShader(device, ps_code, sizeof(ps_code), &ps);
ok(hr == S_OK, "Failed to create pixel shader, hr %#x.\n", hr);
ID3D10Device_PSSetShader(device, ps);
ID3D10Texture2D_GetDesc(test_context.backbuffer, &texture_desc);
texture_desc.SampleDesc.Count = 4;
texture_desc.SampleDesc.Quality = 0;
hr = ID3D10Device_CreateTexture2D(device, &texture_desc, NULL, &texture);
ok(hr == S_OK, "Failed to create texture, hr %#x.\n", hr);
hr = ID3D10Device_CreateRenderTargetView(device, (ID3D10Resource *)texture, NULL, &rtv);
ok(hr == S_OK, "Failed to create render target view, hr %#x.\n", hr);
ID3D10Device_OMSetRenderTargets(device, 1, &rtv, NULL);
ID3D10Device_OMSetBlendState(device, NULL, NULL, 0xb);
ID3D10Device_ClearRenderTargetView(device, rtv, black);
draw_quad(&test_context);
ID3D10Device_ResolveSubresource(device, (ID3D10Resource *)test_context.backbuffer, 0,
(ID3D10Resource *)texture, 0, texture_desc.Format);
todo_wine check_texture_color(test_context.backbuffer, 0xbfbfbfbf, 1);
ID3D10RenderTargetView_Release(rtv);
ID3D10Texture2D_Release(texture);
ID3D10PixelShader_Release(ps);
release_test_context(&test_context);
}
static void test_depth_clip(void)
{
struct d3d10core_test_context test_context;
......@@ -18466,6 +18532,7 @@ START_TEST(d3d10core)
queue_test(test_unbound_multisample_texture);
queue_test(test_multiple_viewports);
queue_test(test_multisample_resolve);
queue_test(test_sample_mask);
queue_test(test_depth_clip);
queue_test(test_staging_buffers);
queue_test(test_render_a8);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment