This commit is contained in:
Branimir Karadžić 2015-04-11 20:52:05 -07:00
parent f0b2c57eb5
commit 7825f3a41e
1 changed files with 9 additions and 4 deletions

View File

@ -397,7 +397,7 @@ bool getReflectionDataDx11(ID3DBlob* _code, bool _vshader, UniformArray& _unifor
return true; return true;
} }
bool compileHLSLShader(bx::CommandLine& _cmdLine, uint32_t _d3d, const std::string& _code, bx::WriterI* _writer, bool firstPass) bool compileHLSLShader(bx::CommandLine& _cmdLine, uint32_t _d3d, const std::string& _code, bx::WriterI* _writer, bool _firstPass)
{ {
BX_TRACE("DX11"); BX_TRACE("DX11");
@ -497,15 +497,20 @@ bool compileHLSLShader(bx::CommandLine& _cmdLine, uint32_t _d3d, const std::stri
if (_d3d == 9) if (_d3d == 9)
{ {
if (!getReflectionDataDx9(code, uniforms) ) if (!getReflectionDataDx9(code, uniforms) )
{
return false; return false;
}
} }
else else
{ {
UniformNameList unusedUniforms; UniformNameList unusedUniforms;
if (!getReflectionDataDx11(code, profile[0] == 'v', uniforms, numAttrs, attrs, size, unusedUniforms) ) if (!getReflectionDataDx11(code, profile[0] == 'v', uniforms, numAttrs, attrs, size, unusedUniforms) )
{
return false; return false;
}
if (firstPass && unusedUniforms.size() > 0) if (_firstPass
&& unusedUniforms.size() > 0)
{ {
const size_t strLength = strlen("uniform"); const size_t strLength = strlen("uniform");
@ -629,9 +634,9 @@ bool compileHLSLShader(bx::CommandLine& _cmdLine, uint32_t _d3d, const std::stri
#else #else
bool compileHLSLShader(bx::CommandLine& _cmdLine, uint32_t _d3d, const std::string& _code, bx::WriterI* _writer) bool compileHLSLShader(bx::CommandLine& _cmdLine, uint32_t _d3d, const std::string& _code, bx::WriterI* _writer, bool _firstPass)
{ {
BX_UNUSED(_cmdLine, _d3d, _code, _writer); BX_UNUSED(_cmdLine, _d3d, _code, _writer, _firstPass);
fprintf(stderr, "HLSL compiler is not supported on this platform.\n"); fprintf(stderr, "HLSL compiler is not supported on this platform.\n");
return false; return false;
} }