UNPKG

6.49 kBJavaScriptView Raw
1import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
3var _primitiveMap, _usageMap, _dataTypeMap, _formatMap, _mipmapMap, _filterMap, _wrapModeMap, _colorSpaceMap, _depthFuncMap, _blendEquationMap, _blendFuncMap, _stencilFuncMap, _stencilOpMap, _cullFaceMap;
4
5/**
6 * @desc 由于 regl 使用大量字符串而非 WebGL 常量,因此需要映射
7 */
8import { gl } from '@antv/g-webgpu-core';
9// @see https://github.com/regl-project/regl/blob/gh-pages/lib/constants/primitives.json
10export var primitiveMap = (_primitiveMap = {}, _defineProperty(_primitiveMap, gl.POINTS, 'points'), _defineProperty(_primitiveMap, gl.LINES, 'lines'), _defineProperty(_primitiveMap, gl.LINE_LOOP, 'line loop'), _defineProperty(_primitiveMap, gl.LINE_STRIP, 'line strip'), _defineProperty(_primitiveMap, gl.TRIANGLES, 'triangles'), _defineProperty(_primitiveMap, gl.TRIANGLE_FAN, 'triangle fan'), _defineProperty(_primitiveMap, gl.TRIANGLE_STRIP, 'triangle strip'), _primitiveMap);
11export var usageMap = (_usageMap = {}, _defineProperty(_usageMap, gl.STATIC_DRAW, 'static'), _defineProperty(_usageMap, gl.DYNAMIC_DRAW, 'dynamic'), _defineProperty(_usageMap, gl.STREAM_DRAW, 'stream'), _usageMap);
12export var dataTypeMap = (_dataTypeMap = {}, _defineProperty(_dataTypeMap, gl.BYTE, 'int8'), _defineProperty(_dataTypeMap, gl.UNSIGNED_INT, 'int16'), _defineProperty(_dataTypeMap, gl.INT, 'int32'), _defineProperty(_dataTypeMap, gl.UNSIGNED_BYTE, 'uint8'), _defineProperty(_dataTypeMap, gl.UNSIGNED_SHORT, 'uint16'), _defineProperty(_dataTypeMap, gl.UNSIGNED_INT, 'uint32'), _defineProperty(_dataTypeMap, gl.FLOAT, 'float'), _dataTypeMap);
13export var formatMap = (_formatMap = {}, _defineProperty(_formatMap, gl.ALPHA, 'alpha'), _defineProperty(_formatMap, gl.LUMINANCE, 'luminance'), _defineProperty(_formatMap, gl.LUMINANCE_ALPHA, 'luminance alpha'), _defineProperty(_formatMap, gl.RGB, 'rgb'), _defineProperty(_formatMap, gl.RGBA, 'rgba'), _defineProperty(_formatMap, gl.RGBA4, 'rgba4'), _defineProperty(_formatMap, gl.RGB5_A1, 'rgb5 a1'), _defineProperty(_formatMap, gl.RGB565, 'rgb565'), _defineProperty(_formatMap, gl.DEPTH_COMPONENT, 'depth'), _defineProperty(_formatMap, gl.DEPTH_STENCIL, 'depth stencil'), _formatMap);
14export var mipmapMap = (_mipmapMap = {}, _defineProperty(_mipmapMap, gl.DONT_CARE, 'dont care'), _defineProperty(_mipmapMap, gl.NICEST, 'nice'), _defineProperty(_mipmapMap, gl.FASTEST, 'fast'), _mipmapMap);
15export var filterMap = (_filterMap = {}, _defineProperty(_filterMap, gl.NEAREST, 'nearest'), _defineProperty(_filterMap, gl.LINEAR, 'linear'), _defineProperty(_filterMap, gl.LINEAR_MIPMAP_LINEAR, 'mipmap'), _defineProperty(_filterMap, gl.NEAREST_MIPMAP_LINEAR, 'nearest mipmap linear'), _defineProperty(_filterMap, gl.LINEAR_MIPMAP_NEAREST, 'linear mipmap nearest'), _defineProperty(_filterMap, gl.NEAREST_MIPMAP_NEAREST, 'nearest mipmap nearest'), _filterMap);
16export var wrapModeMap = (_wrapModeMap = {}, _defineProperty(_wrapModeMap, gl.REPEAT, 'repeat'), _defineProperty(_wrapModeMap, gl.CLAMP_TO_EDGE, 'clamp'), _defineProperty(_wrapModeMap, gl.MIRRORED_REPEAT, 'mirror'), _wrapModeMap);
17export var colorSpaceMap = (_colorSpaceMap = {}, _defineProperty(_colorSpaceMap, gl.NONE, 'none'), _defineProperty(_colorSpaceMap, gl.BROWSER_DEFAULT_WEBGL, 'browser'), _colorSpaceMap);
18export var depthFuncMap = (_depthFuncMap = {}, _defineProperty(_depthFuncMap, gl.NEVER, 'never'), _defineProperty(_depthFuncMap, gl.ALWAYS, 'always'), _defineProperty(_depthFuncMap, gl.LESS, 'less'), _defineProperty(_depthFuncMap, gl.LEQUAL, 'lequal'), _defineProperty(_depthFuncMap, gl.GREATER, 'greater'), _defineProperty(_depthFuncMap, gl.GEQUAL, 'gequal'), _defineProperty(_depthFuncMap, gl.EQUAL, 'equal'), _defineProperty(_depthFuncMap, gl.NOTEQUAL, 'notequal'), _depthFuncMap);
19export var blendEquationMap = (_blendEquationMap = {}, _defineProperty(_blendEquationMap, gl.FUNC_ADD, 'add'), _defineProperty(_blendEquationMap, gl.MIN_EXT, 'min'), _defineProperty(_blendEquationMap, gl.MAX_EXT, 'max'), _defineProperty(_blendEquationMap, gl.FUNC_SUBTRACT, 'subtract'), _defineProperty(_blendEquationMap, gl.FUNC_REVERSE_SUBTRACT, 'reverse subtract'), _blendEquationMap);
20export var blendFuncMap = (_blendFuncMap = {}, _defineProperty(_blendFuncMap, gl.ZERO, 'zero'), _defineProperty(_blendFuncMap, gl.ONE, 'one'), _defineProperty(_blendFuncMap, gl.SRC_COLOR, 'src color'), _defineProperty(_blendFuncMap, gl.ONE_MINUS_SRC_COLOR, 'one minus src color'), _defineProperty(_blendFuncMap, gl.SRC_ALPHA, 'src alpha'), _defineProperty(_blendFuncMap, gl.ONE_MINUS_SRC_ALPHA, 'one minus src alpha'), _defineProperty(_blendFuncMap, gl.DST_COLOR, 'dst color'), _defineProperty(_blendFuncMap, gl.ONE_MINUS_DST_COLOR, 'one minus dst color'), _defineProperty(_blendFuncMap, gl.DST_ALPHA, 'dst alpha'), _defineProperty(_blendFuncMap, gl.ONE_MINUS_DST_ALPHA, 'one minus dst alpha'), _defineProperty(_blendFuncMap, gl.CONSTANT_COLOR, 'constant color'), _defineProperty(_blendFuncMap, gl.ONE_MINUS_CONSTANT_COLOR, 'one minus constant color'), _defineProperty(_blendFuncMap, gl.CONSTANT_ALPHA, 'constant alpha'), _defineProperty(_blendFuncMap, gl.ONE_MINUS_CONSTANT_ALPHA, 'one minus constant alpha'), _defineProperty(_blendFuncMap, gl.SRC_ALPHA_SATURATE, 'src alpha saturate'), _blendFuncMap);
21export var stencilFuncMap = (_stencilFuncMap = {}, _defineProperty(_stencilFuncMap, gl.NEVER, 'never'), _defineProperty(_stencilFuncMap, gl.ALWAYS, 'always'), _defineProperty(_stencilFuncMap, gl.LESS, 'less'), _defineProperty(_stencilFuncMap, gl.LEQUAL, 'lequal'), _defineProperty(_stencilFuncMap, gl.GREATER, 'greater'), _defineProperty(_stencilFuncMap, gl.GEQUAL, 'gequal'), _defineProperty(_stencilFuncMap, gl.EQUAL, 'equal'), _defineProperty(_stencilFuncMap, gl.NOTEQUAL, 'notequal'), _stencilFuncMap);
22export var stencilOpMap = (_stencilOpMap = {}, _defineProperty(_stencilOpMap, gl.ZERO, 'zero'), _defineProperty(_stencilOpMap, gl.KEEP, 'keep'), _defineProperty(_stencilOpMap, gl.REPLACE, 'replace'), _defineProperty(_stencilOpMap, gl.INVERT, 'invert'), _defineProperty(_stencilOpMap, gl.INCR, 'increment'), _defineProperty(_stencilOpMap, gl.DECR, 'decrement'), _defineProperty(_stencilOpMap, gl.INCR_WRAP, 'increment wrap'), _defineProperty(_stencilOpMap, gl.DECR_WRAP, 'decrement wrap'), _stencilOpMap);
23export var cullFaceMap = (_cullFaceMap = {}, _defineProperty(_cullFaceMap, gl.FRONT, 'front'), _defineProperty(_cullFaceMap, gl.BACK, 'back'), _cullFaceMap);
24//# sourceMappingURL=constants.js.map
\No newline at end of file