d3d10/effect: Validate flags vs pool instance when creating child effects.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b6f4284bb1
commit
de49664d06
|
@ -8443,6 +8443,9 @@ HRESULT WINAPI D3D10CreateEffectFromMemory(void *data, SIZE_T data_size, UINT fl
|
|||
FIXME("data %p, data_size %lu, flags %#x, device %p, effect_pool %p, effect %p stub!\n",
|
||||
data, data_size, flags, device, effect_pool, effect);
|
||||
|
||||
if (!(flags & D3D10_EFFECT_COMPILE_CHILD_EFFECT) != !effect_pool)
|
||||
return E_INVALIDARG;
|
||||
|
||||
if (FAILED(hr = d3d10_create_effect(data, data_size, device, &d3d10_effect_vtbl, &object)))
|
||||
{
|
||||
WARN("Failed to create an effect, hr %#x.\n", hr);
|
||||
|
|
|
@ -6486,9 +6486,7 @@ todo_wine
|
|||
|
||||
/* Create standalone effect from the same blob used for pool, */
|
||||
hr = create_effect(fx_test_pool, D3D10_EFFECT_COMPILE_CHILD_EFFECT, device, NULL, &child_effect);
|
||||
todo_wine
|
||||
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
|
||||
if (SUCCEEDED(hr)) child_effect->lpVtbl->Release(child_effect);
|
||||
|
||||
hr = create_effect(fx_test_pool, 0, device, NULL, &effect2);
|
||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||
|
@ -6564,14 +6562,10 @@ todo_wine
|
|||
|
||||
/* When pool is specified, corresponding flag has to be set. */
|
||||
hr = create_effect(fx_test_pool_child, 0, device, pool, &child_effect);
|
||||
todo_wine
|
||||
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
|
||||
if (SUCCEEDED(hr)) child_effect->lpVtbl->Release(child_effect);
|
||||
|
||||
hr = create_effect(fx_test_pool_child, D3D10_EFFECT_COMPILE_CHILD_EFFECT, device, NULL, &child_effect);
|
||||
todo_wine
|
||||
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
|
||||
if (SUCCEEDED(hr)) child_effect->lpVtbl->Release(child_effect);
|
||||
|
||||
refcount = get_refcount(pool);
|
||||
ok(refcount == 1, "Unexpected refcount %u.\n", refcount);
|
||||
|
|
Loading…
Reference in New Issue