summaryrefslogtreecommitdiffstats
path: root/o3d/samples/o3d-webgl/primitive.js
diff options
context:
space:
mode:
Diffstat (limited to 'o3d/samples/o3d-webgl/primitive.js')
-rw-r--r--o3d/samples/o3d-webgl/primitive.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/o3d/samples/o3d-webgl/primitive.js b/o3d/samples/o3d-webgl/primitive.js
index 71b32ec..358c3955 100644
--- a/o3d/samples/o3d-webgl/primitive.js
+++ b/o3d/samples/o3d-webgl/primitive.js
@@ -145,10 +145,7 @@ o3d.Primitive.prototype.render = function() {
this.gl.enableVertexAttribArray(gl_index);
enabled_attribs.push(gl_index);
- // TODO(petersont): When the constant WebGLFloatArray.BYTES_PER_ELEMENT
- // becomes available in implementations, use that here instead of this
- // hard-coded 4.
- var kFloatSize = 4;
+ var kFloatSize = Float32Array.BYTES_PER_ELEMENT;
this.gl.vertexAttribPointer(
gl_index, field.numComponents, this.gl.FLOAT, false,
buffer.totalComponents * kFloatSize, field.offset_ * kFloatSize);