You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that the modernizeShader function can port shaders to GLSL 3.0. It did this by using replaceInSourceString and replaceInSourceRegex to replace strings which is String.prototype.replace() in deed.
This will cause severe performance problem when there are many draw calls. The shader cache can not handle this kind of situation because it can only get the keyword after combining shaders.
(A better way may be assigning an identifier and use it as the keyword to avoid calling replace functions each draw call.)
I noticed that the
modernizeShader
function can port shaders to GLSL 3.0. It did this by usingreplaceInSourceString
andreplaceInSourceRegex
to replace strings which isString.prototype.replace()
in deed.This will cause severe performance problem when there are many draw calls. The shader cache can not handle this kind of situation because it can only get the keyword after combining shaders.
(A better way may be assigning an identifier and use it as the keyword to avoid calling replace functions each draw call.)
The text was updated successfully, but these errors were encountered: