Fix usage of bx::findIdentifierMatch for gl_FragDepth (#2533)

When trying to find all the instances of gl_FragDepth
and replace them with bgfx_FragDepth it only finds
the first instance.
This commit is contained in:
kingscallop 2021-06-05 21:56:00 +01:00 committed by GitHub
parent 1ab27e277b
commit 6a529fca4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6199,7 +6199,7 @@ namespace bgfx { namespace gl
// Replace all instances of gl_FragDepth with bgfx_FragDepth.
for (bx::StringView fragDepth = bx::findIdentifierMatch(temp, "gl_FragDepth")
; !fragDepth.isEmpty()
; fragDepth = bx::findIdentifierMatch(fragDepth, "gl_FragDepth")
; fragDepth = bx::findIdentifierMatch(fragDepth.getPtr(), "gl_FragDepth")
)
{
char* insert = const_cast<char*>(fragDepth.getPtr() );