summaryrefslogtreecommitdiffstats
path: root/o3d
diff options
context:
space:
mode:
authorkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-29 00:33:31 +0000
committerkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-29 00:33:31 +0000
commita3a26dd03418a7dcd2a8d01e1d083a5560a6be90 (patch)
treefee8e387abdaee3c63b19ade8f580f6ee9e9f440 /o3d
parented154597ae809d73a5d4001ee5f57699b5f4a1aa (diff)
downloadchromium_src-a3a26dd03418a7dcd2a8d01e1d083a5560a6be90.zip
chromium_src-a3a26dd03418a7dcd2a8d01e1d083a5560a6be90.tar.gz
chromium_src-a3a26dd03418a7dcd2a8d01e1d083a5560a6be90.tar.bz2
Fixed bug in effect.js during lookup of attribute locations. Fixed
variable scoping problems making debugging more difficult. BUG=none TEST=none TBR=petersont Review URL: http://codereview.chromium.org/1758015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45890 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r--o3d/samples/o3d-webgl/effect.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/o3d/samples/o3d-webgl/effect.js b/o3d/samples/o3d-webgl/effect.js
index 155c67d..0f241db 100644
--- a/o3d/samples/o3d-webgl/effect.js
+++ b/o3d/samples/o3d-webgl/effect.js
@@ -288,8 +288,8 @@ o3d.Effect.prototype.getUniforms_ =
/**
- * Iterates through the active uniforms of the program and gets the
- * location of each one and stores them by name in the uniforms
+ * Iterates through the active attributes of the program and gets the
+ * location of each one and stores them by name in the attributes
* object.
* @private
*/
@@ -301,7 +301,7 @@ o3d.Effect.prototype.getAttributes_ =
for (var i = 0; i < numAttributes; ++i) {
var info = this.gl.getActiveAttrib(this.program_, i);
this.attributes_[info.name] = {info:info,
- location:this.gl.getUniformLocation(this.program_, info.name)};
+ location:this.gl.getAttribLocation(this.program_, info.name)};
}
};
@@ -348,7 +348,7 @@ o3d.Effect.prototype.createUniformParameters =
'worldProjectionInverseTranspose': true,
'worldViewProjectionInverseTranspose': true};
- for (name in this.uniforms_) {
+ for (var name in this.uniforms_) {
var info = this.uniforms_[name].info;
if (sasNames[name])
@@ -464,14 +464,14 @@ o3d.Effect.prototype.getStreamInfo = function() {
*/
o3d.Effect.prototype.searchForParams_ = function(object_list) {
var filled_map = {};
- for (name in this.uniforms_) {
+ for (var name in this.uniforms_) {
filled_map[name] = false;
}
this.gl.useProgram(this.program_);
o3d.Param.texture_index_ = 0;
for (var i = 0; i < object_list.length; ++i) {
var obj = object_list[i];
- for (name in this.uniforms_) {
+ for (var name in this.uniforms_) {
var uniformInfo = this.uniforms_[name];
if (filled_map[name]) {
continue;
@@ -488,9 +488,9 @@ o3d.Effect.prototype.searchForParams_ = function(object_list) {
this.gl.displayInfo.height);
filled_map[o3d.Effect.HELPER_CONSTANT_NAME] = true;
- for (name in this.uniforms_) {
+ for (var name in this.uniforms_) {
if (!filled_map[name]) {
- throw ('Uniform param not filled: '+name);
+ throw ('Uniform param not filled: "'+ name + '"');
}
}
};