Nikolay Sivov : d2d1/effect: Add LoadComputeShader().
Alexandre Julliard
julliard at winehq.org
Mon Jun 20 16:56:07 CDT 2022
Module: wine
Branch: master
Commit: 89e1a7614e17c63781585af5662654a16320f995
URL: https://source.winehq.org/git/wine.git/?a=commit;h=89e1a7614e17c63781585af5662654a16320f995
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Sun Jun 19 20:11:26 2022 +0300
d2d1/effect: Add LoadComputeShader().
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 2da655b00d8..d298985c020 100644
--- a/dlls/d2d1/effect.c
+++ b/dlls/d2d1/effect.c
@@ -247,10 +247,27 @@ static HRESULT STDMETHODCALLTYPE d2d_effect_context_LoadVertexShader(ID2D1Effect
static HRESULT STDMETHODCALLTYPE d2d_effect_context_LoadComputeShader(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);
+ ID3D11ComputeShader *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_CreateComputeShader(effect_context->device_context->d3d_device,
+ buffer, buffer_size, NULL, &shader)))
+ {
+ WARN("Failed to create a compute shader, hr %#lx.\n", hr);
+ return hr;
+ }
+
+ hr = d2d_effect_context_add_shader(effect_context, shader_id, shader);
+ ID3D11ComputeShader_Release(shader);
+
+ return hr;
}
static BOOL STDMETHODCALLTYPE d2d_effect_context_IsShaderLoaded(ID2D1EffectContext *iface, REFGUID shader_id)
More information about the wine-cvs
mailing list