mirror of
git://source.winehq.org/git/wine.git
synced 2024-07-21 14:44:09 +00:00
d3dx9: Fix zero object_id handling in d3dx9_base_effect_get_pass_desc().
Signed-off-by: Paul Gofman <gofmanp@gmail.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
07cc9acc9f
commit
0778f1c294
|
@ -1144,21 +1144,17 @@ static HRESULT d3dx9_base_effect_get_pass_desc(struct d3dx9_base_effect *base,
|
||||||
void *param_value;
|
void *param_value;
|
||||||
BOOL param_dirty;
|
BOOL param_dirty;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
void *data;
|
||||||
|
|
||||||
if (FAILED(hr = d3dx9_get_param_value_ptr(pass, &pass->states[i], ¶m_value, ¶m,
|
if (FAILED(hr = d3dx9_get_param_value_ptr(pass, &pass->states[i], ¶m_value, ¶m,
|
||||||
FALSE, ¶m_dirty)))
|
FALSE, ¶m_dirty)))
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
if (!param->object_id)
|
data = param->object_id ? base->objects[param->object_id].data : NULL;
|
||||||
{
|
|
||||||
FIXME("Zero object ID in shader parameter.\n");
|
|
||||||
return E_FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (state_table[state->operation].class == SC_VERTEXSHADER)
|
if (state_table[state->operation].class == SC_VERTEXSHADER)
|
||||||
desc->pVertexShaderFunction = base->objects[param->object_id].data;
|
desc->pVertexShaderFunction = data;
|
||||||
else
|
else
|
||||||
desc->pPixelShaderFunction = base->objects[param->object_id].data;
|
desc->pPixelShaderFunction = data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7248,7 +7248,6 @@ static void test_effect_null_shader(void)
|
||||||
pass = effect->lpVtbl->GetPass(effect, "tech0", 0);
|
pass = effect->lpVtbl->GetPass(effect, "tech0", 0);
|
||||||
ok(!!pass, "GetPass() failed.\n");
|
ok(!!pass, "GetPass() failed.\n");
|
||||||
hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
|
hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
|
||||||
todo_wine
|
|
||||||
ok(hr == D3D_OK, "Got result %#x.\n", hr);
|
ok(hr == D3D_OK, "Got result %#x.\n", hr);
|
||||||
ok(!desc.pVertexShaderFunction, "Got non NULL vertex function.\n");
|
ok(!desc.pVertexShaderFunction, "Got non NULL vertex function.\n");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue