Nikolay Sivov : d2d1/effect: Add LoadPixelShader().
Alexandre Julliard
julliard at winehq.org
Mon Jun 20 16:56:07 CDT 2022
Module: wine
Branch: master
Commit: f15b3172602fc41c61c8e8353083d24895469208
URL: https://source.winehq.org/git/wine.git/?a=commit;h=f15b3172602fc41c61c8e8353083d24895469208
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Sun Jun 19 20:08:26 2022 +0300
d2d1/effect: Add LoadPixelShader().
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
dlls/d2d1/effect.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/dlls/d2d1/effect.c b/dlls/d2d1/effect.c
index 8345a5aa7d7..2da655b00d8 100644
--- a/dlls/d2d1/effect.c
+++ b/dlls/d2d1/effect.c
@@ -195,10 +195,27 @@ static HRESULT STDMETHODCALLTYPE d2d_effect_context_CreateBoundsAdjustmentTransf
static HRESULT STDMETHODCALLTYPE d2d_effect_context_LoadPixelShader(ID2D1EffectContext *iface,
REFGUID shader_id, const BYTE *buffer, UINT32 buffer_size)
{
- FIXME("iface %p, shader_id %s, buffer %p, buffer_size %u stub!\n",
+ struct d2d_effect_context *effect_context = impl_from_ID2D1EffectContext(iface);
+ ID3D11PixelShader *shader;
+ HRESULT hr;
+
+ TRACE("iface %p, shader_id %s, buffer %p, buffer_size %u.\n",
iface, debugstr_guid(shader_id), buffer, buffer_size);
- return E_NOTIMPL;
+ if (ID2D1EffectContext_IsShaderLoaded(iface, shader_id))
+ return S_OK;
+
+ if (FAILED(hr = ID3D11Device1_CreatePixelShader(effect_context->device_context->d3d_device,
+ buffer, buffer_size, NULL, &shader)))
+ {
+ WARN("Failed to create a pixel shader, hr %#lx.\n", hr);
+ return hr;
+ }
+
+ hr = d2d_effect_context_add_shader(effect_context, shader_id, shader);
+ ID3D11PixelShader_Release(shader);
+
+ return hr;
}
static HRESULT STDMETHODCALLTYPE d2d_effect_context_LoadVertexShader(ID2D1EffectContext *iface,
More information about the wine-cvs
mailing list