-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
WebGLUniforms: Remove cache on uniform arrays #16366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Sounds good. In this way the caching separation is more clear. |
|
@Mugen87 done! I have also renamed the functions for consistency across singular and pure array, eg:
|
|
Maybe we could even be more explicit eg: |
I vote for |
done |
|
Thanks! |
|
Um, it seems I'm getting the following error now in
Some other examples (e.g. |
|
The problem is that function setValueV1i( gl, v ) {
var cache = this.cache;
if ( cache[ 0 ] === v ) return;
gl.uniform1i( this.addr, v );
cache[ 0 ] = v;
} |
|
I've merged a quick fix so |
|
@Mugen87 good catch! sorry about that :) |
|
NP^^. I've also missed it during testing. Not all examples were affected. |
Address the issue exposed on #16355
Currently I'm removing the cache on the array of matrices, textures and vectors.
Babylon.js is using a similar approach, they just cache single elements: scalar, vector2, vector3, vector4 and matrix (actually just 4x4).
The only arrays left without caching are the
setValue2iv,setValue3ivandsetValue4ivas they are shared between single and pure array setters.I don't have an strong opinion about these, but we could leave the current
setValue*ivwith cache for single setters and introducesetValue*ivafor arrays without cache. Thoughts?