Nikolay Sivov : d3d10/effect: Forward to pool effect in GetConstantBufferByName().

Alexandre Julliard julliard at winehq.org
Thu Sep 23 15:35:06 CDT 2021


Module: wine
Branch: master
Commit: f3f2fec52d0aadb9316200eaf408356c20ab6659
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=f3f2fec52d0aadb9316200eaf408356c20ab6659

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Tue Sep 21 08:22:19 2021 +0300

d3d10/effect: Forward to pool effect in GetConstantBufferByName().

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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);




More information about the wine-cvs mailing list