=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: d3d11/tests: Add test for predication state refcounting.
Alexandre Julliard
julliard at winehq.org
Thu May 11 15:07:28 CDT 2017
Module: wine
Branch: master
Commit: 6f11fd9728d4490294e33360b57f52303eda5446
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6f11fd9728d4490294e33360b57f52303eda5446
Author: Józef Kucia <jkucia at codeweavers.com>
Date: Wed May 10 15:54:08 2017 +0200
d3d11/tests: Add test for predication state refcounting.
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/d3d11/tests/d3d11.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 22de6d5..6626ea2 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -5227,11 +5227,13 @@ static void test_private_data(void)
static void test_state_refcounting(const D3D_FEATURE_LEVEL feature_level)
{
ID3D11RasterizerState *rasterizer_state, *tmp_rasterizer_state;
+ ID3D11Predicate *predicate, *tmp_predicate;
ID3D11SamplerState *sampler, *tmp_sampler;
ID3D11ShaderResourceView *srv, *tmp_srv;
ID3D11RenderTargetView *rtv, *tmp_rtv;
D3D11_RASTERIZER_DESC rasterizer_desc;
D3D11_TEXTURE2D_DESC texture_desc;
+ D3D11_QUERY_DESC predicate_desc;
D3D11_SAMPLER_DESC sampler_desc;
struct device_desc device_desc;
ID3D11DeviceContext *context;
@@ -5340,6 +5342,23 @@ static void test_state_refcounting(const D3D_FEATURE_LEVEL feature_level)
refcount = ID3D11RenderTargetView_Release(tmp_rtv);
ok(!refcount, "Got refcount %u, expected 0.\n", refcount);
+ /* ID3D11Predicate */
+ if (feature_level >= D3D_FEATURE_LEVEL_10_0)
+ {
+ predicate_desc.Query = D3D11_QUERY_OCCLUSION_PREDICATE;
+ predicate_desc.MiscFlags = 0;
+ hr = ID3D11Device_CreatePredicate(device, &predicate_desc, &predicate);
+ ok(SUCCEEDED(hr), "Failed to create predicate, hr %#x.\n", hr);
+
+ ID3D11DeviceContext_SetPredication(context, predicate, TRUE);
+ refcount = ID3D11Predicate_Release(predicate);
+ ok(!refcount, "Got refcount %u, expected 0.\n", refcount);
+ ID3D11DeviceContext_GetPredication(context, &tmp_predicate, NULL);
+ ok(tmp_predicate == predicate, "Got predicate %p, expected %p.\n", tmp_predicate, predicate);
+ refcount = ID3D11Predicate_Release(tmp_predicate);
+ ok(!refcount, "Got refcount %u, expected 0.\n", refcount);
+ }
+
ID3D11DeviceContext_Release(context);
refcount = ID3D11Device_Release(device);
ok(!refcount, "Device has %u references left.\n", refcount);
More information about the wine-cvs
mailing list