Zebediah Figura : d3d10core/tests: Test specifying the multisample mask via OMSetBlendState().
Alexandre Julliard
julliard at winehq.org
Wed Sep 2 15:24:33 CDT 2020
Module: wine
Branch: master
Commit: 5eadfb093189497a8dfa7171b3ad498d5687c4be
URL: https://source.winehq.org/git/wine.git/?a=commit;h=5eadfb093189497a8dfa7171b3ad498d5687c4be
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Wed Sep 2 00:27:40 2020 -0500
d3d10core/tests: Test specifying the multisample mask via OMSetBlendState().
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/d3d10core/tests/d3d10core.c | 67 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 67 insertions(+)
diff --git a/dlls/d3d10core/tests/d3d10core.c b/dlls/d3d10core/tests/d3d10core.c
index 97a00a0715..c3bb951ed8 100644
--- a/dlls/d3d10core/tests/d3d10core.c
+++ b/dlls/d3d10core/tests/d3d10core.c
@@ -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);
More information about the wine-cvs
mailing list