d3d10/effect: Release passes names on Optimize().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
eb1f76caa6
commit
c00d42f4ba
|
@ -3413,7 +3413,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_Optimize(ID3D10Effect *iface)
|
||||||
{
|
{
|
||||||
struct d3d10_effect *effect = impl_from_ID3D10Effect(iface);
|
struct d3d10_effect *effect = impl_from_ID3D10Effect(iface);
|
||||||
struct d3d10_effect_variable *v;
|
struct d3d10_effect_variable *v;
|
||||||
unsigned int i;
|
unsigned int i, j;
|
||||||
|
|
||||||
FIXME("iface %p semi-stub!\n", iface);
|
FIXME("iface %p semi-stub!\n", iface);
|
||||||
|
|
||||||
|
@ -3437,6 +3437,12 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_Optimize(ID3D10Effect *iface)
|
||||||
|
|
||||||
for (i = 0; i < effect->technique_count; ++i)
|
for (i = 0; i < effect->technique_count; ++i)
|
||||||
{
|
{
|
||||||
|
for (j = 0; j < effect->techniques[i].pass_count; ++j)
|
||||||
|
{
|
||||||
|
heap_free(effect->techniques[i].passes[j].name);
|
||||||
|
effect->techniques[i].passes[j].name = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
heap_free(effect->techniques[i].name);
|
heap_free(effect->techniques[i].name);
|
||||||
effect->techniques[i].name = NULL;
|
effect->techniques[i].name = NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5998,7 +5998,9 @@ static void test_effect_optimize(void)
|
||||||
ID3D10EffectShaderVariable *gs;
|
ID3D10EffectShaderVariable *gs;
|
||||||
D3D10_TECHNIQUE_DESC tech_desc;
|
D3D10_TECHNIQUE_DESC tech_desc;
|
||||||
ID3D10EffectTechnique *tech;
|
ID3D10EffectTechnique *tech;
|
||||||
|
D3D10_PASS_DESC pass_desc;
|
||||||
ID3D10EffectVariable *v;
|
ID3D10EffectVariable *v;
|
||||||
|
ID3D10EffectPass *pass;
|
||||||
ID3D10Effect *effect;
|
ID3D10Effect *effect;
|
||||||
ID3D10Device *device;
|
ID3D10Device *device;
|
||||||
ULONG refcount;
|
ULONG refcount;
|
||||||
|
@ -6018,6 +6020,11 @@ static void test_effect_optimize(void)
|
||||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||||
ok(!strcmp(tech_desc.Name, "Render"), "Unexpected technique name %s.\n", tech_desc.Name);
|
ok(!strcmp(tech_desc.Name, "Render"), "Unexpected technique name %s.\n", tech_desc.Name);
|
||||||
|
|
||||||
|
pass = tech->lpVtbl->GetPassByIndex(tech, 0);
|
||||||
|
hr = pass->lpVtbl->GetDesc(pass, &pass_desc);
|
||||||
|
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||||
|
ok(!strcmp(pass_desc.Name, "P0"), "Unexpected pass name %s.\n", pass_desc.Name);
|
||||||
|
|
||||||
v = effect->lpVtbl->GetVariableByName(effect, "g_so");
|
v = effect->lpVtbl->GetVariableByName(effect, "g_so");
|
||||||
|
|
||||||
gs = v->lpVtbl->AsShader(v);
|
gs = v->lpVtbl->AsShader(v);
|
||||||
|
@ -6049,6 +6056,13 @@ static void test_effect_optimize(void)
|
||||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||||
ok(!tech_desc.Name, "Unexpected technique name %p.\n", tech_desc.Name);
|
ok(!tech_desc.Name, "Unexpected technique name %p.\n", tech_desc.Name);
|
||||||
|
|
||||||
|
hr = pass->lpVtbl->GetDesc(pass, &pass_desc);
|
||||||
|
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||||
|
ok(!pass_desc.Name, "Unexpected pass name %p.\n", pass_desc.Name);
|
||||||
|
|
||||||
|
pass = tech->lpVtbl->GetPassByName(tech, "P0");
|
||||||
|
ok(!pass->lpVtbl->IsValid(pass), "Unexpected valid pass.\n");
|
||||||
|
|
||||||
tech = effect->lpVtbl->GetTechniqueByIndex(effect, 0);
|
tech = effect->lpVtbl->GetTechniqueByIndex(effect, 0);
|
||||||
ok(tech->lpVtbl->IsValid(tech), "Unexpected valid technique.\n");
|
ok(tech->lpVtbl->IsValid(tech), "Unexpected valid technique.\n");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue