aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2013-10-08 23:15:07 +0300
committerJukka Jylänki <jujjyl@gmail.com>2013-10-08 23:15:07 +0300
commit5ce6618b98640e2bc3d17cc57422209a17476eeb (patch)
treea896f643afb44b07291765f21341ac5da7b711b3 /src
parentefe00bfe59083f041e33056ee22e4f8e3b6054c8 (diff)
Add a note that the previous commits shift the performance landscape to be heavier towards initial glLinkProgram time instead of doing work lazily in glGetUniformLocation time, which would get complicated for arrays, structs and SoA scenarios.
Diffstat (limited to 'src')
-rw-r--r--src/library_gl.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/library_gl.js b/src/library_gl.js
index 5ffa9bc0..713763d2 100644
--- a/src/library_gl.js
+++ b/src/library_gl.js
@@ -416,6 +416,9 @@ var LibraryGL = {
// In GLES2, uniforms are accessed via indices. Therefore we must generate a mapping of indices -> WebGLUniformLocations
// to provide the client code the API that uses indices.
// This function takes a linked GL program and generates a mapping table for the program.
+ // NOTE: Populating the uniform table is performed eagerly at glLinkProgram time, so glLinkProgram should be considered
+ // to be a slow/costly function call. Calling glGetUniformLocation is relatively fast, since it is always a read-only
+ // lookup to the table populated in this function call.
populateUniformTable: function(program) {
#if GL_ASSERTIONS
GL.validateGLObjectID(GL.programs, program, 'populateUniformTable', 'program');