Skip to content

Commit c5656fb

Browse files
committed
Make FLOAT the default type
1 parent cb7a998 commit c5656fb

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/renderer/webgl/WebGLShader.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66

77
var Class = require('../../utils/Class');
8+
var GetFastValue = require('../../utils/object/GetFastValue');
9+
var WEBGL_CONST = require('./const');
810

911
/**
1012
* @classdesc
@@ -167,8 +169,10 @@ var WebGLShader = new Class({
167169

168170
var name = element.name;
169171
var size = element.size; // i.e. 1 for a float, 2 for a vec2, 4 for a vec4, etc
170-
var type = element.type.enum; // The GLenum
171-
var typeSize = element.type.size; // The size in bytes of the type
172+
var glType = GetFastValue(element, 'type', WEBGL_CONST.FLOAT);
173+
var type = glType.enum; // The GLenum
174+
var typeSize = glType.size; // The size in bytes of the type
175+
172176
var normalized = (element.normalized) ? true : false;
173177

174178
result.push({

0 commit comments

Comments
 (0)