shader read optimization (#2109)

Currently `const char * str` gets converted to a StringView when its passed to `bx::strFindNl`, incurring a strlen. We have the data to calculate the strlen and fully construct the StringView.
This commit is contained in:
James Fulop 2020-04-15 21:12:33 -07:00 committed by GitHub
parent ad4fb184e6
commit ea4bbbfcb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -87,7 +87,7 @@ namespace bgfx
uint32_t pos = m_pos;
const char* str = &m_str[pos];
const char* nl = bx::strFindNl(str).getPtr();
const char* nl = bx::strFindNl(bx::StringView(str, str + (m_size - pos))).getPtr();
pos += (uint32_t)(nl - str);
const char* eol = &m_str[pos];