Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 13 ++++++++----- dlls/d3d10/tests/effect.c | 9 +++------ 2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 9436d0277f2..ebcb5f4145b 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -3258,7 +3258,7 @@ static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableB static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByName(ID3D10Effect *iface, const char *name) { - struct d3d10_effect *This = impl_from_ID3D10Effect(iface); + struct d3d10_effect *effect = impl_from_ID3D10Effect(iface); unsigned int i;
TRACE("iface %p, name %s.\n", iface, debugstr_a(name)); @@ -3269,9 +3269,9 @@ static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableB return &null_variable.ID3D10EffectVariable_iface; }
- for (i = 0; i < This->local_buffer_count; ++i) + for (i = 0; i < effect->local_buffer_count; ++i) { - struct d3d10_effect_variable *l = &This->local_buffers[i]; + struct d3d10_effect_variable *l = &effect->local_buffers[i]; unsigned int j;
for (j = 0; j < l->type->member_count; ++j) @@ -3286,9 +3286,9 @@ static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableB } }
- for (i = 0; i < This->local_variable_count; ++i) + for (i = 0; i < effect->local_variable_count; ++i) { - struct d3d10_effect_variable *v = &This->local_variables[i]; + struct d3d10_effect_variable *v = &effect->local_variables[i];
if (v->name && !strcmp(v->name, name)) { @@ -3297,6 +3297,9 @@ static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableB } }
+ if (effect->pool) + return effect->pool->lpVtbl->GetVariableByName(effect->pool, name); + WARN("Invalid name specified\n");
return &null_variable.ID3D10EffectVariable_iface; diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 3243e7b2713..9fbf8b9e865 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -6671,13 +6671,10 @@ todo_wine
v = child_effect->lpVtbl->GetVariableByName(child_effect, "s_texture"); hr = v->lpVtbl->GetDesc(v, &var_desc); -todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - if (SUCCEEDED(hr)) - { - ok(!strcmp(var_desc.Name, "s_texture"), "Unexpected name %s.\n", var_desc.Name); - ok(var_desc.Flags == D3D10_EFFECT_VARIABLE_POOLED, "Unexpected flags %#x.\n", var_desc.Flags); - } + ok(!strcmp(var_desc.Name, "s_texture"), "Unexpected name %s.\n", var_desc.Name); +todo_wine + ok(var_desc.Flags == D3D10_EFFECT_VARIABLE_POOLED, "Unexpected flags %#x.\n", var_desc.Flags);
v = child_effect->lpVtbl->GetVariableBySemantic(child_effect, "COLOR0"); hr = v->lpVtbl->GetDesc(v, &var_desc);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 14 +++++++++----- dlls/d3d10/tests/effect.c | 27 +++++++++------------------ 2 files changed, 18 insertions(+), 23 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index ebcb5f4145b..672cbae3920 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -3223,14 +3223,14 @@ static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetCon
static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableByIndex(ID3D10Effect *iface, UINT index) { - struct d3d10_effect *This = impl_from_ID3D10Effect(iface); + struct d3d10_effect *effect = impl_from_ID3D10Effect(iface); unsigned int i;
TRACE("iface %p, index %u\n", iface, index);
- for (i = 0; i < This->local_buffer_count; ++i) + for (i = 0; i < effect->local_buffer_count; ++i) { - struct d3d10_effect_variable *l = &This->local_buffers[i]; + struct d3d10_effect_variable *l = &effect->local_buffers[i];
if (index < l->type->member_count) { @@ -3242,13 +3242,17 @@ static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableB index -= l->type->member_count; }
- if (index < This->local_variable_count) + if (index < effect->local_variable_count) { - struct d3d10_effect_variable *v = &This->local_variables[index]; + struct d3d10_effect_variable *v = &effect->local_variables[index];
TRACE("Returning variable %p.\n", v); return &v->ID3D10EffectVariable_iface; } + index -= effect->local_variable_count; + + if (effect->pool) + return effect->pool->lpVtbl->GetVariableByIndex(effect->pool, index);
WARN("Invalid index specified\n");
diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 9fbf8b9e865..31edd4a1c48 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -6641,33 +6641,24 @@ todo_wine
v = child_effect->lpVtbl->GetVariableByIndex(child_effect, 2); hr = v->lpVtbl->GetDesc(v, &var_desc); -todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - if (SUCCEEDED(hr)) - { - ok(!strcmp(var_desc.Name, "f1"), "Unexpected name %s.\n", var_desc.Name); - ok(var_desc.Flags == D3D10_EFFECT_VARIABLE_POOLED, "Unexpected flags %#x.\n", var_desc.Flags); - } + ok(!strcmp(var_desc.Name, "f1"), "Unexpected name %s.\n", var_desc.Name); +todo_wine + ok(var_desc.Flags == D3D10_EFFECT_VARIABLE_POOLED, "Unexpected flags %#x.\n", var_desc.Flags);
v = child_effect->lpVtbl->GetVariableByIndex(child_effect, 3); hr = v->lpVtbl->GetDesc(v, &var_desc); -todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - if (SUCCEEDED(hr)) - { - ok(!strcmp(var_desc.Name, "f2"), "Unexpected name %s.\n", var_desc.Name); - ok(var_desc.Flags == D3D10_EFFECT_VARIABLE_POOLED, "Unexpected flags %#x.\n", var_desc.Flags); - } + ok(!strcmp(var_desc.Name, "f2"), "Unexpected name %s.\n", var_desc.Name); +todo_wine + ok(var_desc.Flags == D3D10_EFFECT_VARIABLE_POOLED, "Unexpected flags %#x.\n", var_desc.Flags);
v = child_effect->lpVtbl->GetVariableByIndex(child_effect, 4); hr = v->lpVtbl->GetDesc(v, &var_desc); -todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - if (SUCCEEDED(hr)) - { - ok(!strcmp(var_desc.Name, "s_blendstate"), "Unexpected name %s.\n", var_desc.Name); - ok(var_desc.Flags == D3D10_EFFECT_VARIABLE_POOLED, "Unexpected flags %#x.\n", var_desc.Flags); - } + ok(!strcmp(var_desc.Name, "s_blendstate"), "Unexpected name %s.\n", var_desc.Name); +todo_wine + ok(var_desc.Flags == D3D10_EFFECT_VARIABLE_POOLED, "Unexpected flags %#x.\n", var_desc.Flags);
v = child_effect->lpVtbl->GetVariableByName(child_effect, "s_texture"); hr = v->lpVtbl->GetDesc(v, &var_desc);
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 13 ++++++++----- dlls/d3d10/tests/effect.c | 9 +++------ 2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 672cbae3920..623183311f2 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -3312,7 +3312,7 @@ static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableB static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableBySemantic(ID3D10Effect *iface, const char *semantic) { - struct d3d10_effect *This = impl_from_ID3D10Effect(iface); + struct d3d10_effect *effect = impl_from_ID3D10Effect(iface); unsigned int i;
TRACE("iface %p, semantic %s\n", iface, debugstr_a(semantic)); @@ -3323,9 +3323,9 @@ static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableB return &null_variable.ID3D10EffectVariable_iface; }
- for (i = 0; i < This->local_buffer_count; ++i) + for (i = 0; i < effect->local_buffer_count; ++i) { - struct d3d10_effect_variable *l = &This->local_buffers[i]; + struct d3d10_effect_variable *l = &effect->local_buffers[i]; unsigned int j;
for (j = 0; j < l->type->member_count; ++j) @@ -3340,9 +3340,9 @@ static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableB } }
- for (i = 0; i < This->local_variable_count; ++i) + for (i = 0; i < effect->local_variable_count; ++i) { - struct d3d10_effect_variable *v = &This->local_variables[i]; + struct d3d10_effect_variable *v = &effect->local_variables[i];
if (v->semantic && !stricmp(v->semantic, semantic)) { @@ -3351,6 +3351,9 @@ static struct ID3D10EffectVariable * STDMETHODCALLTYPE d3d10_effect_GetVariableB } }
+ if (effect->pool) + return effect->pool->lpVtbl->GetVariableBySemantic(effect->pool, semantic); + WARN("Invalid semantic specified\n");
return &null_variable.ID3D10EffectVariable_iface; diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 31edd4a1c48..1dfd420ae36 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -6675,13 +6675,10 @@ todo_wine
v = child_effect->lpVtbl->GetVariableBySemantic(child_effect, "COLOR1"); hr = v->lpVtbl->GetDesc(v, &var_desc); -todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - if (SUCCEEDED(hr)) - { - ok(!strcmp(var_desc.Name, "f2"), "Unexpected name %s.\n", var_desc.Name); - ok(var_desc.Flags == D3D10_EFFECT_VARIABLE_POOLED, "Unexpected flags %#x.\n", var_desc.Flags); - } + ok(!strcmp(var_desc.Name, "f2"), "Unexpected name %s.\n", var_desc.Name); +todo_wine + ok(var_desc.Flags == D3D10_EFFECT_VARIABLE_POOLED, "Unexpected flags %#x.\n", var_desc.Flags);
child_effect->lpVtbl->Release(child_effect);
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 19 ++++++++++++------- dlls/d3d10/tests/effect.c | 10 +++------- 2 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 623183311f2..19befb64b0f 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -3179,22 +3179,27 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDesc(ID3D10Effect *iface, D3D10 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByIndex(ID3D10Effect *iface, UINT index) { - struct d3d10_effect *This = impl_from_ID3D10Effect(iface); + struct d3d10_effect *effect = impl_from_ID3D10Effect(iface); struct d3d10_effect_variable *l;
TRACE("iface %p, index %u\n", iface, index);
- if (index >= This->local_buffer_count) + if (index < effect->local_buffer_count) { - WARN("Invalid index specified\n"); - return (ID3D10EffectConstantBuffer *)&null_local_buffer.ID3D10EffectVariable_iface; + l = &effect->local_buffers[index]; + + TRACE("Returning buffer %p, %s.\n", l, debugstr_a(l->name)); + + return (ID3D10EffectConstantBuffer *)&l->ID3D10EffectVariable_iface; } + index -= effect->local_buffer_count;
- l = &This->local_buffers[index]; + if (effect->pool) + return effect->pool->lpVtbl->GetConstantBufferByIndex(effect->pool, index);
- TRACE("Returning buffer %p, %s.\n", l, debugstr_a(l->name)); + WARN("Invalid index specified\n");
- return (ID3D10EffectConstantBuffer *)&l->ID3D10EffectVariable_iface; + return (ID3D10EffectConstantBuffer *)&null_local_buffer.ID3D10EffectVariable_iface; }
static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByName(ID3D10Effect *iface, diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index 1dfd420ae36..d2761462c6d 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -6607,17 +6607,13 @@ todo_wine
cb = child_effect->lpVtbl->GetConstantBufferByIndex(child_effect, 2); ret = cb->lpVtbl->IsValid(cb); -todo_wine ok(ret, "Unexpected invalid variable.\n");
hr = cb->lpVtbl->GetDesc(cb, &var_desc); -todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr); - if (SUCCEEDED(hr)) - { - ok(!strcmp(var_desc.Name, "s_cb"), "Unexpected name %s.\n", var_desc.Name); - ok(var_desc.Flags == D3D10_EFFECT_VARIABLE_POOLED, "Unexpected flags %#x.\n", var_desc.Flags); - } + ok(!strcmp(var_desc.Name, "s_cb"), "Unexpected name %s.\n", var_desc.Name); +todo_wine + ok(var_desc.Flags == D3D10_EFFECT_VARIABLE_POOLED, "Unexpected flags %#x.\n", var_desc.Flags);
/* Pool techniques are not accessible */ t = effect->lpVtbl->GetTechniqueByIndex(effect, 0);
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 9 ++++++--- dlls/d3d10/tests/effect.c | 1 - 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 19befb64b0f..71bc8161c76 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -3205,14 +3205,14 @@ static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetCon static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByName(ID3D10Effect *iface, const char *name) { - struct d3d10_effect *This = impl_from_ID3D10Effect(iface); + struct d3d10_effect *effect = impl_from_ID3D10Effect(iface); unsigned int i;
TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
- for (i = 0; i < This->local_buffer_count; ++i) + for (i = 0; i < effect->local_buffer_count; ++i) { - struct d3d10_effect_variable *l = &This->local_buffers[i]; + struct d3d10_effect_variable *l = &effect->local_buffers[i];
if (l->name && !strcmp(l->name, name)) { @@ -3221,6 +3221,9 @@ static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetCon } }
+ if (effect->pool) + return effect->pool->lpVtbl->GetConstantBufferByName(effect->pool, name); + WARN("Invalid name specified\n");
return (ID3D10EffectConstantBuffer *)&null_local_buffer.ID3D10EffectVariable_iface; diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index d2761462c6d..9daf3faf8d0 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -6543,7 +6543,6 @@ todo_wine { ID3D10Device_Release(device3);
cb = child_effect->lpVtbl->GetConstantBufferByName(child_effect, "s_cb"); -todo_wine ok(cb->lpVtbl->IsValid(cb), "Expected valid constant buffer.\n");
hr = cb->lpVtbl->GetConstantBuffer(cb, &buffer);
Signed-off-by: Matteo Bruni mbruni@codeweavers.com