d3dx10: Partially implement D3DX10CreateEffectFromFileW().

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2021-08-10 15:56:43 +02:00 committed by Alexandre Julliard
parent 5279212cd9
commit eb2946addf
2 changed files with 33 additions and 13 deletions

View File

@ -60,3 +60,36 @@ HRESULT WINAPI D3DX10CreateEffectFromMemory(const void *data, SIZE_T datasize, c
return hr;
}
HRESULT WINAPI D3DX10CreateEffectFromFileW(const WCHAR *filename, const D3D10_SHADER_MACRO *defines,
ID3D10Include *include, const char *profile, UINT shader_flags, UINT effect_flags,
ID3D10Device *device, ID3D10EffectPool *effect_pool, ID3DX10ThreadPump *pump,
ID3D10Effect **effect, ID3D10Blob **errors, HRESULT *hresult)
{
ID3D10Blob *code;
HRESULT hr;
TRACE("filename %s, defines %p, include %p, profile %s, shader_flags %#x, effect_flags %#x, "
"device %p, effect_pool %p, pump %p, effect %p, errors %p, hresult %p.\n",
debugstr_w(filename), defines, include, debugstr_a(profile), shader_flags, effect_flags,
device, effect_pool, pump, effect, errors, hresult);
if (pump)
FIXME("Asynchronous mode is not supported.\n");
if (!include)
include = D3D_COMPILE_STANDARD_FILE_INCLUDE;
if (FAILED(hr = D3DCompileFromFile(filename, defines, include, "main", profile, shader_flags,
effect_flags, &code, errors)))
{
WARN("Effect compilation failed, hr %#x.\n", hr);
return hr;
}
hr = D3D10CreateEffectFromMemory(ID3D10Blob_GetBufferPointer(code), ID3D10Blob_GetBufferSize(code),
effect_flags, device, effect_pool, effect);
ID3D10Blob_Release(code);
return hr;
}

View File

@ -61,19 +61,6 @@ HRESULT WINAPI D3DX10CreateEffectFromFileA(const char *filename, const D3D10_SHA
return E_NOTIMPL;
}
HRESULT WINAPI D3DX10CreateEffectFromFileW(const WCHAR *filename, const D3D10_SHADER_MACRO *defines,
ID3D10Include *include, const char *profile, UINT hlslflags, UINT fxflags, ID3D10Device *device,
ID3D10EffectPool *effectpool, ID3DX10ThreadPump *pump, ID3D10Effect **effect, ID3D10Blob **errors,
HRESULT *hresult)
{
FIXME("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;
}
HRESULT WINAPI D3DX10CreateEffectPoolFromMemory(const void *data, SIZE_T datasize, const char *filename,
const D3D10_SHADER_MACRO *defines, ID3D10Include *include, const char *profile, UINT hlslflags,
UINT fxflags, ID3D10Device *device, ID3DX10ThreadPump *pump, ID3D10EffectPool **effectpool,