Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 6 ++++++ dlls/d3d10/tests/effect.c | 17 +++++++++++++++++ 2 files changed, 23 insertions(+)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 6d2f862f252..d850928248a 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -3435,6 +3435,12 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_Optimize(ID3D10Effect *iface) v->u.shader.stream_output_declaration = NULL; }
+ for (i = 0; i < effect->technique_count; ++i) + { + heap_free(effect->techniques[i].name); + effect->techniques[i].name = NULL; + } + return S_OK; }
diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 505f782ecdc..b560b47f8a9 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -5996,6 +5996,8 @@ static void test_effect_optimize(void) { D3D10_EFFECT_SHADER_DESC shaderdesc; ID3D10EffectShaderVariable *gs; + D3D10_TECHNIQUE_DESC tech_desc; + ID3D10EffectTechnique *tech; ID3D10EffectVariable *v; ID3D10Effect *effect; ID3D10Device *device; @@ -6011,6 +6013,11 @@ static void test_effect_optimize(void) hr = create_effect(fx_local_shader, 0, device, NULL, &effect); ok(SUCCEEDED(hr), "Failed to create an effect.\n");
+ tech = effect->lpVtbl->GetTechniqueByIndex(effect, 0); + hr = tech->lpVtbl->GetDesc(tech, &tech_desc); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!strcmp(tech_desc.Name, "Render"), "Unexpected technique name %s.\n", tech_desc.Name); + v = effect->lpVtbl->GetVariableByName(effect, "g_so");
gs = v->lpVtbl->AsShader(v); @@ -6038,6 +6045,16 @@ static void test_effect_optimize(void) ok(!shaderdesc.NumInputSignatureEntries, "Unexpected input signature count.\n"); ok(!shaderdesc.NumOutputSignatureEntries, "Unexpected output signature count.\n");
+ hr = tech->lpVtbl->GetDesc(tech, &tech_desc); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!tech_desc.Name, "Unexpected technique name %p.\n", tech_desc.Name); + + tech = effect->lpVtbl->GetTechniqueByIndex(effect, 0); + ok(tech->lpVtbl->IsValid(tech), "Unexpected valid technique.\n"); + + tech = effect->lpVtbl->GetTechniqueByName(effect, "Render"); + ok(!tech->lpVtbl->IsValid(tech), "Unexpected valid technique.\n"); + effect->lpVtbl->Release(effect);
refcount = ID3D10Device_Release(device);