Commit 5a5af75f authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

d3dx9: Implement D3DXCompileShaderFromResource.

parent de8f35bb
......@@ -458,6 +458,52 @@ HRESULT WINAPI D3DXCompileShaderFromFileW(LPCWSTR filename,
return hr;
}
HRESULT WINAPI D3DXCompileShaderFromResourceA(HMODULE module,
LPCSTR resource,
CONST D3DXMACRO* defines,
LPD3DXINCLUDE include,
LPCSTR entrypoint,
LPCSTR profile,
DWORD flags,
LPD3DXBUFFER* shader,
LPD3DXBUFFER* error_messages,
LPD3DXCONSTANTTABLE* constant_table)
{
HRSRC res;
LPCSTR buffer;
DWORD len;
if (!(res = FindResourceA(module, resource, (LPCSTR)RT_RCDATA)))
return D3DXERR_INVALIDDATA;
if (FAILED(load_resource_into_memory(module, res, (LPVOID *)&buffer, &len)))
return D3DXERR_INVALIDDATA;
return D3DXCompileShader(buffer, len, defines, include, entrypoint, profile,
flags, shader, error_messages, constant_table);
}
HRESULT WINAPI D3DXCompileShaderFromResourceW(HMODULE module,
LPCWSTR resource,
CONST D3DXMACRO* defines,
LPD3DXINCLUDE include,
LPCSTR entrypoint,
LPCSTR profile,
DWORD flags,
LPD3DXBUFFER* shader,
LPD3DXBUFFER* error_messages,
LPD3DXCONSTANTTABLE* constant_table)
{
HRSRC res;
LPCSTR buffer;
DWORD len;
if (!(res = FindResourceW(module, resource, (LPCWSTR)RT_RCDATA)))
return D3DXERR_INVALIDDATA;
if (FAILED(load_resource_into_memory(module, res, (LPVOID *)&buffer, &len)))
return D3DXERR_INVALIDDATA;
return D3DXCompileShader(buffer, len, defines, include, entrypoint, profile,
flags, shader, error_messages, constant_table);
}
static const struct ID3DXConstantTableVtbl ID3DXConstantTable_Vtbl;
typedef struct ID3DXConstantTableImpl {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment