@@ -646,28 +646,7 @@ static HRESULT create_shader(LPCSTR const pTarget, DWORD const* buffer, u32 cons
646646 result->constants .parse (pConstants, ShaderTypeTraits<T>::GetShaderDest ());
647647 }
648648 else
649- {
650649 Msg (" ! D3DXFindShaderComment %s hr == 0x%08x" , file_name, _hr);
651- }
652-
653- return _hr;
654- }
655-
656- static HRESULT create_shader (LPCSTR const pTarget, DWORD const * buffer, u32 const buffer_size, LPCSTR const file_name, void *& result, bool const disasm)
657- {
658- HRESULT _result = E_FAIL;
659- if (pTarget[0 ] == ' p' )
660- {
661- _result = create_shader (pTarget, buffer, buffer_size, file_name, (SPS*&)result, disasm);
662- }
663- else if (pTarget[0 ] == ' v' )
664- {
665- _result = create_shader (pTarget, buffer, buffer_size, file_name, (SVS*&)result, disasm);
666- }
667- else
668- {
669- NODEFAULT;
670- }
671650
672651 if (disasm)
673652 {
@@ -681,7 +660,19 @@ static HRESULT create_shader(LPCSTR const pTarget, DWORD const* buffer, u32 cons
681660 _RELEASE (disasm);
682661 }
683662
684- return _result;
663+ return _hr;
664+ }
665+
666+ inline HRESULT create_shader (LPCSTR const pTarget, DWORD const * buffer, u32 const buffer_size, LPCSTR const file_name, void *& result, bool const disasm)
667+ {
668+ if (pTarget[0 ] == ' p' )
669+ return create_shader (pTarget, buffer, buffer_size, file_name, (SPS*&)result, disasm);
670+
671+ if (pTarget[0 ] == ' v' )
672+ return create_shader (pTarget, buffer, buffer_size, file_name, (SVS*&)result, disasm);
673+
674+ NODEFAULT;
675+ return E_FAIL;
685676}
686677
687678class includer : public ID3DXInclude
@@ -723,7 +714,7 @@ static inline bool match_shader_id(
723714 LPCSTR const debug_shader_id, LPCSTR const full_shader_id, FS_FileSet const & file_set, string_path& result);
724715
725716HRESULT CRender::shader_compile (LPCSTR name, DWORD const * pSrcData, UINT SrcDataLen, LPCSTR pFunctionName,
726- LPCSTR pTarget, DWORD Flags, void *& result)
717+ LPCSTR pTarget, DWORD Flags, void *& result)
727718{
728719 D3DXMACRO defines[128 ];
729720 int def_it = 0 ;
@@ -1137,7 +1128,7 @@ HRESULT CRender::shader_compile(LPCSTR name, DWORD const* pSrcData, UINT SrcData
11371128 LPD3DXINCLUDE pInclude = (LPD3DXINCLUDE)&Includer;
11381129
11391130 _result = D3DXCompileShader ((LPCSTR)pSrcData, SrcDataLen, defines, pInclude, pFunctionName, pTarget,
1140- Flags | D3DXSHADER_USE_LEGACY_D3DX9_31_DLL, &pShaderBuf, &pErrorBuf, &pConstants);
1131+ Flags | D3DXSHADER_USE_LEGACY_D3DX9_31_DLL, &pShaderBuf, &pErrorBuf, &pConstants);
11411132 if (SUCCEEDED (_result))
11421133 {
11431134 IWriter* file = FS.w_open (file_name);
@@ -1147,7 +1138,7 @@ HRESULT CRender::shader_compile(LPCSTR name, DWORD const* pSrcData, UINT SrcData
11471138 FS.w_close (file);
11481139
11491140 _result = create_shader (pTarget, (DWORD*)pShaderBuf->GetBufferPointer (), pShaderBuf->GetBufferSize (),
1150- file_name, result, o.disasm );
1141+ file_name, result, o.disasm );
11511142 }
11521143 else
11531144 {
0 commit comments