Commit 0778f1c2 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

d3dx9: Fix zero object_id handling in d3dx9_base_effect_get_pass_desc().

parent 07cc9acc
......@@ -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], &param_value, &param,
FALSE, &param_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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment