Source: dependencies/pixi-gl-core/shader/mapSize.js

dependencies/pixi-gl-core/shader/mapSize.js

  1. /**
  2. * @class
  3. * @memberof PIXI.glCore.shader
  4. * @param type {String}
  5. * @return {Number}
  6. */
  7. var mapSize = function(type)
  8. {
  9. return GLSL_TO_SIZE[type];
  10. };
  11. var GLSL_TO_SIZE = {
  12. 'float': 1,
  13. 'vec2': 2,
  14. 'vec3': 3,
  15. 'vec4': 4,
  16. 'int': 1,
  17. 'ivec2': 2,
  18. 'ivec3': 3,
  19. 'ivec4': 4,
  20. 'bool': 1,
  21. 'bvec2': 2,
  22. 'bvec3': 3,
  23. 'bvec4': 4,
  24. 'mat2': 4,
  25. 'mat3': 9,
  26. 'mat4': 16,
  27. 'sampler2D': 1
  28. };
  29. module.exports = mapSize;