Commit 5815b639 authored by Joris Huizer's avatar Joris Huizer Committed by Alexandre Julliard

d3dx9_36: D3DXPreprocessShaderFromFileW: remove unneeded code.

parent a418f257
...@@ -548,10 +548,9 @@ HRESULT WINAPI D3DXPreprocessShaderFromFileW(LPCWSTR filename, ...@@ -548,10 +548,9 @@ HRESULT WINAPI D3DXPreprocessShaderFromFileW(LPCWSTR filename,
LPD3DXBUFFER* error_messages) LPD3DXBUFFER* error_messages)
{ {
void *buffer; void *buffer;
DWORD len, filename_len; DWORD len;
HRESULT hr; HRESULT hr;
struct D3DXIncludeImpl includefromfile; struct D3DXIncludeImpl includefromfile;
char *filename_a;
if (FAILED(map_view_of_file(filename, &buffer, &len))) if (FAILED(map_view_of_file(filename, &buffer, &len)))
return D3DXERR_INVALIDDATA; return D3DXERR_INVALIDDATA;
...@@ -562,21 +561,11 @@ HRESULT WINAPI D3DXPreprocessShaderFromFileW(LPCWSTR filename, ...@@ -562,21 +561,11 @@ HRESULT WINAPI D3DXPreprocessShaderFromFileW(LPCWSTR filename,
include = (LPD3DXINCLUDE)&includefromfile; include = (LPD3DXINCLUDE)&includefromfile;
} }
filename_len = WideCharToMultiByte(CP_ACP, 0, filename, -1, NULL, 0, NULL, NULL);
filename_a = HeapAlloc(GetProcessHeap(), 0, filename_len * sizeof(char));
if (!filename_a)
{
UnmapViewOfFile(buffer);
return E_OUTOFMEMORY;
}
WideCharToMultiByte(CP_ACP, 0, filename, -1, filename_a, filename_len, NULL, NULL);
hr = D3DPreprocess(buffer, len, NULL, hr = D3DPreprocess(buffer, len, NULL,
(const D3D_SHADER_MACRO *)defines, (const D3D_SHADER_MACRO *)defines,
(ID3DInclude *) include, (ID3DInclude *) include,
(ID3DBlob **)shader, (ID3DBlob **)error_messages); (ID3DBlob **)shader, (ID3DBlob **)error_messages);
HeapFree(GetProcessHeap(), 0, filename_a);
UnmapViewOfFile(buffer); UnmapViewOfFile(buffer);
return hr; return hr;
} }
......
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