fix shader source read in linux
This commit is contained in:
@ -65,6 +65,13 @@ namespace Prism
|
|||||||
while (pos != std::string::npos)
|
while (pos != std::string::npos)
|
||||||
{
|
{
|
||||||
size_t eol = m_ShaderSource.find("\r\n", pos);
|
size_t eol = m_ShaderSource.find("\r\n", pos);
|
||||||
|
if (eol == std::string::npos) {
|
||||||
|
eol = m_ShaderSource.find('\n', pos);
|
||||||
|
if (eol == std::string::npos) {
|
||||||
|
eol = m_ShaderSource.find('\r', pos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
PM_CORE_ASSERT(eol != std::string::npos, "Syntax error");
|
PM_CORE_ASSERT(eol != std::string::npos, "Syntax error");
|
||||||
size_t begin = pos + typeTokenLength + 1;
|
size_t begin = pos + typeTokenLength + 1;
|
||||||
std::string type = m_ShaderSource.substr(begin, eol - begin);
|
std::string type = m_ShaderSource.substr(begin, eol - begin);
|
||||||
|
|||||||
Reference in New Issue
Block a user