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;
|
||||
BOOL param_dirty;
|
||||
HRESULT hr;
|
||||
void *data;
|
||||
|
||||
if (FAILED(hr = d3dx9_get_param_value_ptr(pass, &pass->states[i], ¶m_value, ¶m,
|
||||
FALSE, ¶m_dirty)))
|
||||
return hr;
|
||||
|
||||
if (!param->object_id)
|
||||
{
|
||||
FIXME("Zero object ID in shader parameter.\n");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
data = param->object_id ? base->objects[param->object_id].data : NULL;
|
||||
if (state_table[state->operation].class == SC_VERTEXSHADER)
|
||||
desc->pVertexShaderFunction = base->objects[param->object_id].data;
|
||||
desc->pVertexShaderFunction = data;
|
||||
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);
|
||||
ok(!!pass, "GetPass() failed.\n");
|
||||
hr = effect->lpVtbl->GetPassDesc(effect, pass, &desc);
|
||||
todo_wine
|
||||
ok(hr == D3D_OK, "Got result %#x.\n", hr);
|
||||
ok(!desc.pVertexShaderFunction, "Got non NULL vertex function.\n");
|
||||
|
||||
|
|
Loading…
Reference in New Issue