MCPcopy Create free account
hub / github.com/microsoft/SandDance / getGLTypeFromTypedArray

Function getGLTypeFromTypedArray

docs/app/js/sanddance-app.js:61747–61769  ·  view source on GitHub ↗
(arrayOrType)

Source from the content-addressed store, hash-verified

61745parcelHelpers.export(exports, "scalePixels", ()=>scalePixels);
61746var ERR_TYPE_DEDUCTION = "Failed to deduce GL constant from typed array";
61747function getGLTypeFromTypedArray(arrayOrType) {
61748 var type = ArrayBuffer.isView(arrayOrType) ? arrayOrType.constructor : arrayOrType;
61749 switch(type){
61750 case Float32Array:
61751 return 5126;
61752 case Uint16Array:
61753 return 5123;
61754 case Uint32Array:
61755 return 5125;
61756 case Uint8Array:
61757 return 5121;
61758 case Uint8ClampedArray:
61759 return 5121;
61760 case Int8Array:
61761 return 5120;
61762 case Int16Array:
61763 return 5122;
61764 case Int32Array:
61765 return 5124;
61766 default:
61767 throw new Error(ERR_TYPE_DEDUCTION);
61768 }
61769}
61770function getTypedArrayFromGLType(glType) {
61771 var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref$clamped = _ref.clamped, clamped = _ref$clamped === void 0 ? true : _ref$clamped;
61772 switch(glType){

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected