Paul Gofman : d3dx9: Fix zero object_id handling in d3dx9_base_effect_get_pass_desc().
Alexandre Julliard
julliard at winehq.org
Fri Sep 8 15:03:20 CDT 2017
Module: wine
Branch: master
Commit: 0778f1c294e4140736c813c99bc12adbeb27f0aa
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0778f1c294e4140736c813c99bc12adbeb27f0aa
Author: Paul Gofman <gofmanp at gmail.com>
Date: Fri Sep 1 21:19:04 2017 +0300
d3dx9: Fix zero object_id handling in d3dx9_base_effect_get_pass_desc().
Signed-off-by: Paul Gofman <gofmanp at gmail.com>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/d3dx9_36/effect.c | 12 ++++--------
dlls/d3dx9_36/tests/effect.c | 1 -
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c
index 75e0931..ce2e5d8 100644
--- a/dlls/d3dx9_36/effect.c
+++ b/dlls/d3dx9_36/effect.c
@@ -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;
}
}
diff --git a/dlls/d3dx9_36/tests/effect.c b/dlls/d3dx9_36/tests/effect.c
index 45d3ace..96b21f0 100644
--- a/dlls/d3dx9_36/tests/effect.c
+++ b/dlls/d3dx9_36/tests/effect.c
@@ -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");
More information about the wine-cvs
mailing list