OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010, Google Inc. | 2 * Copyright 2010, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 var infoArray = []; | 423 var infoArray = []; |
424 var sasTypes = o3d.Param.sasTypes_; | 424 var sasTypes = o3d.Param.sasTypes_; |
425 var paramTypes = o3d.Effect.getParamTypes_(this.gl); | 425 var paramTypes = o3d.Effect.getParamTypes_(this.gl); |
426 var semanticMap = o3d.Effect.semanticMap_; | 426 var semanticMap = o3d.Effect.semanticMap_; |
427 | 427 |
428 for (var name in this.uniforms_) { | 428 for (var name in this.uniforms_) { |
429 var info = this.uniforms_[name].info; | 429 var info = this.uniforms_[name].info; |
430 var sasTypeName = sasTypes[name] || ''; | 430 var sasTypeName = sasTypes[name] || ''; |
431 var className = paramTypes[info.type] || ''; | 431 var className = paramTypes[info.type] || ''; |
432 var numElements = 0; // TODO(petersont): Add array support. | 432 var numElements = 0; // TODO(petersont): Add array support. |
433 var semantic = semanticMap[name].semantic || o3d.Stream.UNKNOWN_SEMANTIC; | 433 var semantic = (semanticMap[name] && semanticMap[name].semantic) ? |
| 434 semanticMap[name].semantic : o3d.Stream.UNKNOWN_SEMANTIC; |
434 | 435 |
435 infoArray.push(new EffectParameterInfo( | 436 infoArray.push(new o3d.EffectParameterInfo( |
436 name, className, numElements, semantic, sasClassName)); | 437 name, className, numElements, semantic, sasTypeName)); |
437 } | 438 } |
438 | 439 |
439 return infoArray; | 440 return infoArray; |
440 }; | 441 }; |
441 | 442 |
442 | 443 |
443 /** | 444 /** |
444 * Gets info about the streams this effect needs. | 445 * Gets info about the streams this effect needs. |
445 * @return {!Array.<!o3d.EffectStreamInfo>} an array of | 446 * @return {!Array.<!o3d.EffectStreamInfo>} an array of |
446 * EffectStreamInfo objects. | 447 * EffectStreamInfo objects. |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 o3d.Effect.prototype.matrix_load_order_ = o3d.Effect.ROW_MAJOR; | 549 o3d.Effect.prototype.matrix_load_order_ = o3d.Effect.ROW_MAJOR; |
549 | 550 |
550 | 551 |
551 /** | 552 /** |
552 * The source for the shaders on this Effect. | 553 * The source for the shaders on this Effect. |
553 * @type {string} | 554 * @type {string} |
554 */ | 555 */ |
555 o3d.Effect.prototype.source_ = ''; | 556 o3d.Effect.prototype.source_ = ''; |
556 | 557 |
557 | 558 |
OLD | NEW |