Signed-off-by: Nikolay Sivov nsivov@codeweavers.com ---
v2: use default include handler
dlls/d3dx10_43/d3dx10_43_main.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/dlls/d3dx10_43/d3dx10_43_main.c b/dlls/d3dx10_43/d3dx10_43_main.c index da9e105efba..09359e0460a 100644 --- a/dlls/d3dx10_43/d3dx10_43_main.c +++ b/dlls/d3dx10_43/d3dx10_43_main.c @@ -67,12 +67,32 @@ HRESULT WINAPI D3DX10CreateEffectFromFileW(const WCHAR *filename, const D3D10_SH ID3D10EffectPool *effectpool, ID3DX10ThreadPump *pump, ID3D10Effect **effect, ID3D10Blob **errors, HRESULT *hresult) { - FIXME("filename %s, defines %p, include %p, profile %s, hlslflags %#x, fxflags %#x, " + ID3D10Blob *code; + HRESULT hr; + + TRACE("filename %s, defines %p, include %p, profile %s, hlslflags %#x, fxflags %#x, " "device %p, effectpool %p, pump %p, effect %p, errors %p, hresult %p\n", debugstr_w(filename), defines, include, debugstr_a(profile), hlslflags, fxflags, device, effectpool, pump, effect, errors, hresult);
- return E_NOTIMPL; + if (pump) + FIXME("Asynchronous mode is not supported.\n"); + + if (!include) + include = D3D_COMPILE_STANDARD_FILE_INCLUDE; + + if (FAILED(hr = D3DCompileFromFile(filename, defines, include, NULL, profile, hlslflags, + fxflags, &code, errors))) + { + WARN("Effect compilation failed, hr %#x.\n", hr); + return hr; + } + + hr = D3D10CreateEffectFromMemory(ID3D10Blob_GetBufferPointer(code), ID3D10Blob_GetBufferSize(code), + fxflags, device, effectpool, effect); + ID3D10Blob_Release(code); + + return hr; }
HRESULT WINAPI D3DX10CreateEffectFromMemory(const void *data, SIZE_T datasize, const char *filename,