Ziqing Hui : d2d1: Implement ID2D1EffectContext_IsShaderLoaded().

Alexandre Julliard julliard at winehq.org
Wed May 25 16:51:46 CDT 2022


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

Author: Ziqing Hui <zhui at codeweavers.com>
Date:   Wed May 25 10:29:12 2022 +0300

d2d1: Implement ID2D1EffectContext_IsShaderLoaded().

Signed-off-by: Ziqing Hui <zhui at codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d2d1/effect.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/dlls/d2d1/effect.c b/dlls/d2d1/effect.c
index eceb6234193..ff808475a78 100644
--- a/dlls/d2d1/effect.c
+++ b/dlls/d2d1/effect.c
@@ -195,6 +195,9 @@ static HRESULT STDMETHODCALLTYPE d2d_effect_context_LoadVertexShader(ID2D1Effect
     TRACE("iface %p, shader_id %s, buffer %p, buffer_size %u.\n",
             iface, debugstr_guid(shader_id), buffer, buffer_size);
 
+    if (ID2D1EffectContext_IsShaderLoaded(iface, shader_id))
+        return S_OK;
+
     if (FAILED(hr = ID3D11Device1_CreateVertexShader(effect_context->device_context->d3d_device,
             buffer, buffer_size, NULL, &vertex_shader)))
     {
@@ -231,7 +234,16 @@ static HRESULT STDMETHODCALLTYPE d2d_effect_context_LoadComputeShader(ID2D1Effec
 
 static BOOL STDMETHODCALLTYPE d2d_effect_context_IsShaderLoaded(ID2D1EffectContext *iface, REFGUID shader_id)
 {
-    FIXME("iface %p, shader_id %s stub!\n", iface, debugstr_guid(shader_id));
+    struct d2d_effect_context *effect_context = impl_from_ID2D1EffectContext(iface);
+    size_t i;
+
+    TRACE("iface %p, shader_id %s.\n", iface, debugstr_guid(shader_id));
+
+    for (i = 0; i < effect_context->shader_count; ++i)
+    {
+        if (IsEqualGUID(shader_id, &effect_context->shaders[i].id))
+            return TRUE;
+    }
 
     return FALSE;
 }




More information about the wine-cvs mailing list