@luma.gl/webgl 9.0.0-alpha.26 → 9.0.0-alpha.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/adapter/helpers/get-shader-layout.d.ts +8 -5
  2. package/dist/adapter/helpers/get-shader-layout.d.ts.map +1 -1
  3. package/dist/adapter/helpers/get-shader-layout.js +59 -16
  4. package/dist/adapter/helpers/get-shader-layout.js.map +1 -1
  5. package/dist/adapter/helpers/get-vertex-buffer-layout.d.ts +12 -0
  6. package/dist/adapter/helpers/get-vertex-buffer-layout.d.ts.map +1 -0
  7. package/dist/adapter/helpers/get-vertex-buffer-layout.js +84 -0
  8. package/dist/adapter/helpers/get-vertex-buffer-layout.js.map +1 -0
  9. package/dist/adapter/objects/webgl-vertex-array-object.d.ts +35 -8
  10. package/dist/adapter/objects/webgl-vertex-array-object.d.ts.map +1 -1
  11. package/dist/adapter/objects/webgl-vertex-array-object.js +116 -16
  12. package/dist/adapter/objects/webgl-vertex-array-object.js.map +1 -1
  13. package/dist/adapter/resources/webgl-buffer.d.ts +13 -4
  14. package/dist/adapter/resources/webgl-buffer.d.ts.map +1 -1
  15. package/dist/adapter/resources/webgl-buffer.js +23 -21
  16. package/dist/adapter/resources/webgl-buffer.js.map +1 -1
  17. package/dist/adapter/resources/webgl-external-texture.js.map +1 -1
  18. package/dist/adapter/resources/webgl-render-pipeline.d.ts +38 -5
  19. package/dist/adapter/resources/webgl-render-pipeline.d.ts.map +1 -1
  20. package/dist/adapter/resources/webgl-render-pipeline.js +35 -7
  21. package/dist/adapter/resources/webgl-render-pipeline.js.map +1 -1
  22. package/dist/adapter/webgl-device.d.ts.map +1 -1
  23. package/dist/adapter/webgl-device.js +5 -2
  24. package/dist/adapter/webgl-device.js.map +1 -1
  25. package/dist/classic/buffer-with-accessor.d.ts +5 -15
  26. package/dist/classic/buffer-with-accessor.d.ts.map +1 -1
  27. package/dist/classic/buffer-with-accessor.js +25 -30
  28. package/dist/classic/buffer-with-accessor.js.map +1 -1
  29. package/dist/classic/copy-and-blit.d.ts.map +1 -1
  30. package/dist/classic/copy-and-blit.js +2 -2
  31. package/dist/classic/copy-and-blit.js.map +1 -1
  32. package/dist/context/debug/webgl-developer-tools.d.ts.map +1 -1
  33. package/dist/context/debug/webgl-developer-tools.js +2 -1
  34. package/dist/context/debug/webgl-developer-tools.js.map +1 -1
  35. package/dist/context/parameters/webgl-parameter-tables.js +2 -2
  36. package/dist/context/parameters/webgl-parameter-tables.js.map +1 -1
  37. package/dist/dist.dev.js +350 -99
  38. package/dist/index.cjs +343 -157
  39. package/dist/index.d.ts +1 -1
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +1 -1
  42. package/dist/index.js.map +1 -1
  43. package/dist.min.js +22 -22
  44. package/package.json +5 -5
  45. package/src/adapter/helpers/get-shader-layout.ts +93 -33
  46. package/src/adapter/helpers/get-vertex-buffer-layout.ts +123 -0
  47. package/src/adapter/objects/webgl-vertex-array-object.ts +192 -28
  48. package/src/adapter/resources/webgl-buffer.ts +40 -41
  49. package/src/adapter/resources/webgl-external-texture.ts +1 -1
  50. package/src/adapter/resources/webgl-render-pipeline.ts +73 -36
  51. package/src/adapter/webgl-device.ts +4 -2
  52. package/src/classic/buffer-with-accessor.ts +42 -43
  53. package/src/classic/copy-and-blit.ts +2 -3
  54. package/src/context/debug/webgl-developer-tools.ts +8 -2
  55. package/src/context/parameters/webgl-parameter-tables.ts +2 -2
  56. package/src/index.ts +1 -1
@@ -1,4 +1,4 @@
1
- import { ShaderLayout, ProgramBindings } from '@luma.gl/api';
1
+ import type { ShaderLayout, AttributeLayout, BufferMapping } from '@luma.gl/api';
2
2
  /**
3
3
  * Extract metadata describing binding information for a program's shaders
4
4
  * Note: `linkProgram()` needs to have been called
@@ -6,11 +6,14 @@ import { ShaderLayout, ProgramBindings } from '@luma.gl/api';
6
6
  */
7
7
  export declare function getShaderLayout(gl: WebGLRenderingContext, program: WebGLProgram): ShaderLayout;
8
8
  /**
9
- * Extract metadata describing binding information for a program's shaders
10
- * Note: `linkProgram()` needs to have been called
11
- * (although linking does not need to have been successful).
9
+ * Merges an provided shader layout into a base shader layout
10
+ * In WebGL, this allows the auto generated shader layout to be overridden by the application
11
+ * Typically to change the format of the vertex attributes (from float32x4 to uint8x4 etc).
12
+ * @todo Drop this? This could also be done more clearly with bufferMapping
12
13
  */
13
- export declare function getProgramBindings(gl: WebGLRenderingContext, program: WebGLProgram): ProgramBindings;
14
+ export declare function mergeShaderLayout(baseLayout: ShaderLayout, overrideLayout: ShaderLayout): ShaderLayout;
15
+ export declare function mergeBufferMap(baseLayout: ShaderLayout, bufferMap: BufferMapping[]): ShaderLayout;
16
+ export declare function getAttributeFromLayout(shaderLayout: ShaderLayout, name: string): AttributeLayout | null;
14
17
  /**
15
18
  * TODO - verify this is a copy of above and delete
16
19
  * import type {TextureFormat} from '@luma.gl/api';
@@ -1 +1 @@
1
- {"version":3,"file":"get-shader-layout.d.ts","sourceRoot":"","sources":["../../../src/adapter/helpers/get-shader-layout.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EAIZ,eAAe,EAKhB,MAAM,cAAc,CAAC;AAQtB;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,qBAAqB,EAAE,OAAO,EAAE,YAAY,GAAG,YAAY,CAoE9F;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,EAAE,EAAE,qBAAqB,EACzB,OAAO,EAAE,YAAY,GACpB,eAAe,CAWjB;AA+PD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG"}
1
+ {"version":3,"file":"get-shader-layout.d.ts","sourceRoot":"","sources":["../../../src/adapter/helpers/get-shader-layout.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EAMf,aAAa,EAEd,MAAM,cAAc,CAAC;AAStB;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,qBAAqB,EAAE,OAAO,EAAE,YAAY,GAAG,YAAY,CAwE9F;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,YAAY,EACxB,cAAc,EAAE,YAAY,GAC3B,YAAY,CAiBd;AAED,wBAAgB,cAAc,CAAC,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,YAAY,CAsBjG;AAYD,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,MAAM,GACX,eAAe,GAAG,IAAI,CAMxB;AAkQD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG"}
@@ -1,3 +1,4 @@
1
+ import { log } from '@luma.gl/api';
1
2
  import { GL } from '@luma.gl/constants';
2
3
  import { isWebGL2 } from "../../context/context/webgl-checks.js";
3
4
  import { Accessor } from "../../classic/accessor.js";
@@ -5,13 +6,12 @@ import { decodeUniformType, decodeAttributeType } from "./uniforms.js";
5
6
  import { getVertexFormat } from "../converters/vertex-formats.js";
6
7
  import { isSamplerUniform } from "./uniforms.js";
7
8
  export function getShaderLayout(gl, program) {
8
- var _programBindings$unif, _programBindings$vary;
9
- const programBindings = getProgramBindings(gl, program);
10
9
  const shaderLayout = {
11
10
  attributes: [],
12
11
  bindings: []
13
12
  };
14
- for (const attribute of programBindings.attributes) {
13
+ const attributes = readAttributeBindings(gl, program);
14
+ for (const attribute of attributes) {
15
15
  const size = Math.min(attribute.accessor.size, 4);
16
16
  const format = getVertexFormat(attribute.accessor.type || GL.FLOAT, size);
17
17
  shaderLayout.attributes.push({
@@ -21,7 +21,8 @@ export function getShaderLayout(gl, program) {
21
21
  stepMode: attribute.accessor.divisor === 1 ? 'instance' : 'vertex'
22
22
  });
23
23
  }
24
- for (const uniformBlock of programBindings.uniformBlocks) {
24
+ const uniformBlocks = readUniformBlocks(gl, program);
25
+ for (const uniformBlock of uniformBlocks) {
25
26
  const uniforms = uniformBlock.uniforms.map(uniform => ({
26
27
  name: uniform.name,
27
28
  format: uniform.format,
@@ -38,8 +39,9 @@ export function getShaderLayout(gl, program) {
38
39
  uniforms
39
40
  });
40
41
  }
42
+ const uniforms = readUniformBindings(gl, program);
41
43
  let textureUnit = 0;
42
- for (const uniform of programBindings.uniforms) {
44
+ for (const uniform of uniforms) {
43
45
  if (isSamplerUniform(uniform.type)) {
44
46
  const {
45
47
  viewDimension,
@@ -56,24 +58,65 @@ export function getShaderLayout(gl, program) {
56
58
  textureUnit += 1;
57
59
  }
58
60
  }
59
- const uniforms = ((_programBindings$unif = programBindings.uniforms) === null || _programBindings$unif === void 0 ? void 0 : _programBindings$unif.filter(uniform => uniform.location !== null)) || [];
60
61
  if (uniforms.length) {
61
62
  shaderLayout.uniforms = uniforms;
62
63
  }
63
- if ((_programBindings$vary = programBindings.varyings) !== null && _programBindings$vary !== void 0 && _programBindings$vary.length) {
64
- shaderLayout.varyings = programBindings.varyings;
64
+ const varyings = readVaryings(gl, program);
65
+ if (varyings !== null && varyings !== void 0 && varyings.length) {
66
+ shaderLayout.varyings = varyings;
65
67
  }
66
68
  return shaderLayout;
67
69
  }
68
- export function getProgramBindings(gl, program) {
69
- const config = {
70
- attributes: readAttributeBindings(gl, program),
71
- uniforms: readUniformBindings(gl, program),
72
- uniformBlocks: readUniformBlocks(gl, program),
73
- varyings: readVaryings(gl, program)
70
+ export function mergeShaderLayout(baseLayout, overrideLayout) {
71
+ const mergedLayout = {
72
+ ...baseLayout,
73
+ attributes: baseLayout.attributes.map(attribute => ({
74
+ ...attribute
75
+ }))
74
76
  };
75
- Object.seal(config);
76
- return config;
77
+ for (const attribute of (overrideLayout === null || overrideLayout === void 0 ? void 0 : overrideLayout.attributes) || []) {
78
+ const baseAttribute = mergedLayout.attributes.find(attr => attr.name === attribute.name);
79
+ if (!baseAttribute) {
80
+ log.warn("shader layout attribute ".concat(attribute.name, " not present in shader"));
81
+ } else {
82
+ baseAttribute.format = attribute.format || baseAttribute.format;
83
+ baseAttribute.stepMode = attribute.stepMode || baseAttribute.stepMode;
84
+ }
85
+ }
86
+ return mergedLayout;
87
+ }
88
+ export function mergeBufferMap(baseLayout, bufferMap) {
89
+ const mergedLayout = {
90
+ ...baseLayout,
91
+ attributes: baseLayout.attributes.map(attribute => ({
92
+ ...attribute
93
+ }))
94
+ };
95
+ for (const bufferMapping of bufferMap) {
96
+ switch (bufferMapping.type) {
97
+ case 'interleave':
98
+ for (const attributeOverride of bufferMapping.attributes) {
99
+ overrideShaderLayoutAttribute(mergedLayout, attributeOverride);
100
+ }
101
+ break;
102
+ default:
103
+ overrideShaderLayoutAttribute(mergedLayout, bufferMapping);
104
+ }
105
+ }
106
+ return mergedLayout;
107
+ }
108
+ function overrideShaderLayoutAttribute(layout, attributeOverride) {
109
+ const attribute = getAttributeFromLayout(layout, attributeOverride.name);
110
+ if (attribute && attributeOverride.format) {
111
+ attribute.format = attributeOverride.format;
112
+ }
113
+ }
114
+ export function getAttributeFromLayout(shaderLayout, name) {
115
+ const attribute = shaderLayout.attributes.find(attr => attr.name === name);
116
+ if (!attribute) {
117
+ log.warn("shader layout attribute \"".concat(name, "\" not present in shader"));
118
+ }
119
+ return attribute || null;
77
120
  }
78
121
  function readAttributeBindings(gl, program) {
79
122
  const attributes = [];
@@ -1 +1 @@
1
- {"version":3,"file":"get-shader-layout.js","names":["GL","isWebGL2","Accessor","decodeUniformType","decodeAttributeType","getVertexFormat","isSamplerUniform","getShaderLayout","gl","program","_programBindings$unif","_programBindings$vary","programBindings","getProgramBindings","shaderLayout","attributes","bindings","attribute","size","Math","min","accessor","format","type","FLOAT","push","name","location","stepMode","divisor","uniformBlock","uniformBlocks","uniforms","map","uniform","byteOffset","byteStride","arrayLength","visibility","vertex","fragment","minBindingSize","byteLength","textureUnit","viewDimension","sampleType","getSamplerInfo","filter","length","varyings","config","readAttributeBindings","readUniformBindings","readUniformBlocks","readVaryings","Object","seal","count","getProgramParameter","ACTIVE_ATTRIBUTES","index","activeInfo","getActiveAttrib","Error","compositeType","getAttribLocation","glType","components","test","attributeInfo","sort","a","b","gl2","TRANSFORM_FEEDBACK_VARYINGS","getTransformFeedbackVarying","varying","uniformCount","ACTIVE_UNIFORMS","i","getActiveUniform","rawName","isArray","parseUniformName","webglLocation","getUniformLocation","uniformInfo","j","elementName","concat","arrayElementUniformInfo","getBlockParameter","blockIndex","pname","getActiveUniformBlockParameter","blockCount","ACTIVE_UNIFORM_BLOCKS","blockInfo","getActiveUniformBlockName","UNIFORM_BLOCK_BINDING","UNIFORM_BLOCK_DATA_SIZE","UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER","UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER","UNIFORM_BLOCK_ACTIVE_UNIFORMS","uniformIndices","UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES","uniformType","getActiveUniforms","UNIFORM_TYPE","uniformArrayLength","UNIFORM_SIZE","uniformOffset","UNIFORM_OFFSET","uniformStride","UNIFORM_ARRAY_STRIDE","SAMPLER_UNIFORMS_GL_TO_GPU","SAMPLER_2D","SAMPLER_CUBE","SAMPLER_3D","SAMPLER_2D_SHADOW","SAMPLER_2D_ARRAY","SAMPLER_2D_ARRAY_SHADOW","SAMPLER_CUBE_SHADOW","INT_SAMPLER_2D","INT_SAMPLER_3D","INT_SAMPLER_CUBE","INT_SAMPLER_2D_ARRAY","UNSIGNED_INT_SAMPLER_2D","UNSIGNED_INT_SAMPLER_3D","UNSIGNED_INT_SAMPLER_CUBE","UNSIGNED_INT_SAMPLER_2D_ARRAY","sampler","UNIFORM_NAME_REGEXP","matches","exec","Boolean"],"sources":["../../../src/adapter/helpers/get-shader-layout.ts"],"sourcesContent":["// luma.gl, MIT license\n\nimport {\n ShaderLayout,\n // BindingLayout,\n UniformBinding,\n UniformBlockBinding,\n ProgramBindings,\n AttributeBinding,\n VaryingBinding,\n // AttributeLayout,\n AccessorObject\n} from '@luma.gl/api';\nimport {GL} from '@luma.gl/constants';\nimport {isWebGL2} from '../../context/context/webgl-checks';\nimport {Accessor} from '../../classic/accessor'; // TODO - should NOT depend on classic API\nimport {decodeUniformType, decodeAttributeType} from './uniforms';\nimport {getVertexFormat} from '../converters/vertex-formats';\nimport {isSamplerUniform} from './uniforms';\n\n/**\n * Extract metadata describing binding information for a program's shaders\n * Note: `linkProgram()` needs to have been called\n * (although linking does not need to have been successful).\n */\nexport function getShaderLayout(gl: WebGLRenderingContext, program: WebGLProgram): ShaderLayout {\n const programBindings = getProgramBindings(gl, program);\n\n const shaderLayout: ShaderLayout = {\n attributes: [],\n bindings: []\n };\n\n for (const attribute of programBindings.attributes) {\n // TODO - multicolumn attributes like a matrix4 can be up to 16 elts...\n const size = Math.min(attribute.accessor.size, 4);\n const format =\n // attribute.accessor.format ||\n getVertexFormat(attribute.accessor.type || GL.FLOAT, size);\n shaderLayout.attributes.push({\n name: attribute.name,\n location: attribute.location,\n format,\n stepMode: attribute.accessor.divisor === 1 ? 'instance' : 'vertex'\n });\n }\n\n // Uniform blocks\n for (const uniformBlock of programBindings.uniformBlocks) {\n const uniforms = uniformBlock.uniforms.map((uniform) => ({\n name: uniform.name,\n format: uniform.format,\n byteOffset: uniform.byteOffset,\n byteStride: uniform.byteStride,\n arrayLength: uniform.arrayLength\n }));\n shaderLayout.bindings.push({\n type: 'uniform',\n name: uniformBlock.name,\n location: uniformBlock.location,\n visibility: (uniformBlock.vertex ? 0x1 : 0) & (uniformBlock.fragment ? 0x2 : 0),\n minBindingSize: uniformBlock.byteLength,\n uniforms\n });\n }\n\n let textureUnit = 0;\n for (const uniform of programBindings.uniforms) {\n if (isSamplerUniform(uniform.type)) {\n const {viewDimension, sampleType} = getSamplerInfo(uniform.type);\n shaderLayout.bindings.push({\n type: 'texture',\n name: uniform.name,\n location: textureUnit,\n viewDimension,\n sampleType\n });\n\n // @ts-expect-error\n uniform.textureUnit = textureUnit;\n textureUnit += 1;\n }\n }\n\n const uniforms = programBindings.uniforms?.filter((uniform) => uniform.location !== null) || [];\n if (uniforms.length) {\n shaderLayout.uniforms = uniforms;\n }\n if (programBindings.varyings?.length) {\n shaderLayout.varyings = programBindings.varyings;\n }\n\n return shaderLayout;\n}\n\n/**\n * Extract metadata describing binding information for a program's shaders\n * Note: `linkProgram()` needs to have been called\n * (although linking does not need to have been successful).\n */\nexport function getProgramBindings(\n gl: WebGLRenderingContext,\n program: WebGLProgram\n): ProgramBindings {\n const config: ProgramBindings = {\n attributes: readAttributeBindings(gl, program),\n uniforms: readUniformBindings(gl, program),\n uniformBlocks: readUniformBlocks(gl, program),\n varyings: readVaryings(gl, program)\n };\n\n Object.seal(config);\n return config;\n // generateWebGPUStyleBindings(bindings);\n}\n\n/**\n * Extract info about all transform feedback varyings\n *\n * linkProgram needs to have been called, although linking does not need to have been successful\n */\nfunction readAttributeBindings(\n gl: WebGLRenderingContext,\n program: WebGLProgram\n): AttributeBinding[] {\n const attributes: AttributeBinding[] = [];\n\n const count = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES);\n\n for (let index = 0; index < count; index++) {\n const activeInfo = gl.getActiveAttrib(program, index);\n if (!activeInfo) {\n throw new Error('activeInfo');\n }\n const {name, type: compositeType, size} = activeInfo;\n const location = gl.getAttribLocation(program, name);\n // Add only user provided attributes, for built-in attributes like\n // `gl_InstanceID` locaiton will be < 0\n if (location >= 0) {\n const {glType, components} = decodeAttributeType(compositeType);\n const accessor: AccessorObject = {type: glType, size: size * components};\n // Any attribute name containing the word \"instance\" will be assumed to be instanced\n if (/instance/i.test(name)) {\n accessor.divisor = 1;\n }\n const attributeInfo = {location, name, accessor: new Accessor(accessor)}; // Base values\n attributes.push(attributeInfo);\n }\n }\n\n attributes.sort((a: AttributeBinding, b: AttributeBinding) => a.location - b.location);\n return attributes;\n}\n\n/**\n * Extract info about all transform feedback varyings\n *\n * linkProgram needs to have been called, although linking does not need to have been successful\n */\nfunction readVaryings(gl: WebGLRenderingContext, program: WebGLProgram): VaryingBinding[] {\n if (!isWebGL2(gl)) {\n return [];\n }\n const gl2 = gl as WebGL2RenderingContext;\n\n const varyings: VaryingBinding[] = [];\n\n const count = gl.getProgramParameter(program, GL.TRANSFORM_FEEDBACK_VARYINGS);\n for (let location = 0; location < count; location++) {\n const activeInfo = gl2.getTransformFeedbackVarying(program, location);\n if (!activeInfo) {\n throw new Error('activeInfo');\n }\n const {name, type: compositeType, size} = activeInfo;\n const {glType, components} = decodeUniformType(compositeType);\n const accessor = new Accessor({type: glType, size: size * components});\n const varying = {location, name, accessor}; // Base values\n varyings.push(varying);\n }\n\n varyings.sort((a, b) => a.location - b.location);\n return varyings;\n}\n\n/**\n * Extract info about all uniforms\n *\n * Query uniform locations and build name to setter map.\n */\nfunction readUniformBindings(gl: WebGLRenderingContext, program: WebGLProgram): UniformBinding[] {\n const uniforms: UniformBinding[] = [];\n\n const uniformCount = gl.getProgramParameter(program, GL.ACTIVE_UNIFORMS);\n for (let i = 0; i < uniformCount; i++) {\n const activeInfo = gl.getActiveUniform(program, i);\n if (!activeInfo) {\n throw new Error('activeInfo');\n }\n const {name: rawName, size, type} = activeInfo;\n const {name, isArray} = parseUniformName(rawName);\n let webglLocation = gl.getUniformLocation(program, name);\n const uniformInfo = {\n // WebGL locations are uniquely typed but just numbers\n location: webglLocation as number,\n name,\n size,\n type,\n isArray\n };\n uniforms.push(uniformInfo);\n\n // Array (e.g. matrix) uniforms can occupy several 4x4 byte banks\n if (uniformInfo.size > 1) {\n for (let j = 0; j < uniformInfo.size; j++) {\n const elementName = `${name}[${j}]`;\n\n webglLocation = gl.getUniformLocation(program, elementName);\n\n const arrayElementUniformInfo = {\n ...uniformInfo,\n name: elementName,\n location: webglLocation as number\n };\n\n uniforms.push(arrayElementUniformInfo);\n }\n }\n }\n return uniforms;\n}\n\n/**\n * Extract info about all \"active\" uniform blocks\n *\n * (\"Active\" just means that unused (aka inactive) blocks may have been\n * optimized away during linking)\n */\nfunction readUniformBlocks(\n gl: WebGLRenderingContext,\n program: WebGLProgram\n): UniformBlockBinding[] {\n if (!isWebGL2(gl)) {\n return [];\n }\n const gl2 = gl as WebGL2RenderingContext;\n\n const getBlockParameter = (blockIndex: number, pname: GL): any =>\n gl2.getActiveUniformBlockParameter(program, blockIndex, pname);\n\n const uniformBlocks: UniformBlockBinding[] = [];\n\n const blockCount = gl2.getProgramParameter(program, GL.ACTIVE_UNIFORM_BLOCKS);\n for (let blockIndex = 0; blockIndex < blockCount; blockIndex++) {\n const blockInfo: UniformBlockBinding = {\n name: gl2.getActiveUniformBlockName(program, blockIndex) || '',\n location: getBlockParameter(blockIndex, GL.UNIFORM_BLOCK_BINDING),\n byteLength: getBlockParameter(blockIndex, GL.UNIFORM_BLOCK_DATA_SIZE),\n vertex: getBlockParameter(blockIndex, GL.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER),\n fragment: getBlockParameter(blockIndex, GL.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER),\n uniformCount: getBlockParameter(blockIndex, GL.UNIFORM_BLOCK_ACTIVE_UNIFORMS),\n uniforms: [] as any[]\n };\n\n const uniformIndices = getBlockParameter(blockIndex, GL.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES) as number[] || [];\n\n const uniformType = gl2.getActiveUniforms(program, uniformIndices, GL.UNIFORM_TYPE); // Array of GLenum indicating the types of the uniforms.\n const uniformArrayLength = gl2.getActiveUniforms(program, uniformIndices, GL.UNIFORM_SIZE); // Array of GLuint indicating the sizes of the uniforms.\n // const uniformBlockIndex = gl2.getActiveUniforms(\n // program,\n // uniformIndices,\n // GL.UNIFORM_BLOCK_INDEX\n // ); // Array of GLint indicating the block indices of the uniforms.\n const uniformOffset = gl2.getActiveUniforms(program, uniformIndices, GL.UNIFORM_OFFSET); // Array of GLint indicating the uniform buffer offsets.\n const uniformStride = gl2.getActiveUniforms(program, uniformIndices, GL.UNIFORM_ARRAY_STRIDE); // Array of GLint indicating the strides between the elements.\n // const uniformMatrixStride = gl2.getActiveUniforms(\n // program,\n // uniformIndices,\n // GL.UNIFORM_MATRIX_STRIDE\n // ); // Array of GLint indicating the strides between columns of a column-major matrix or a row-major matrix.\n // const uniformRowMajor = gl2.getActiveUniforms(program, uniformIndices, GL.UNIFORM_IS_ROW_MAJOR);\n for (let i = 0; i < blockInfo.uniformCount; ++i) {\n const activeInfo = gl2.getActiveUniform(program, uniformIndices[i]);\n if (!activeInfo) {\n throw new Error('activeInfo');\n }\n \n blockInfo.uniforms.push({\n name: activeInfo.name,\n format: decodeUniformType(uniformType[i]).format,\n type: uniformType[i],\n arrayLength: uniformArrayLength[i],\n byteOffset: uniformOffset[i],\n byteStride: uniformStride[i],\n // matrixStride: uniformStride[i],\n // rowMajor: uniformRowMajor[i]\n });\n }\n\n uniformBlocks.push(blockInfo);\n }\n\n uniformBlocks.sort((a, b) => a.location - b.location);\n return uniformBlocks;\n}\n\nconst SAMPLER_UNIFORMS_GL_TO_GPU: Record<\n number,\n [\n '1d' | '2d' | '2d-array' | 'cube' | 'cube-array' | '3d',\n 'float' | 'unfilterable-float' | 'depth' | 'sint' | 'uint'\n ]\n> = {\n [GL.SAMPLER_2D]: ['2d', 'float'],\n [GL.SAMPLER_CUBE]: ['cube', 'float'],\n [GL.SAMPLER_3D]: ['3d', 'float'],\n [GL.SAMPLER_2D_SHADOW]: ['3d', 'depth'],\n [GL.SAMPLER_2D_ARRAY]: ['2d-array', 'float'],\n [GL.SAMPLER_2D_ARRAY_SHADOW]: ['2d-array', 'depth'],\n [GL.SAMPLER_CUBE_SHADOW]: ['cube', 'float'],\n [GL.INT_SAMPLER_2D]: ['2d', 'sint'],\n [GL.INT_SAMPLER_3D]: ['3d', 'sint'],\n [GL.INT_SAMPLER_CUBE]: ['cube', 'sint'],\n [GL.INT_SAMPLER_2D_ARRAY]: ['2d-array', 'uint'],\n [GL.UNSIGNED_INT_SAMPLER_2D]: ['2d', 'uint'],\n [GL.UNSIGNED_INT_SAMPLER_3D]: ['3d', 'uint'],\n [GL.UNSIGNED_INT_SAMPLER_CUBE]: ['cube', 'uint'],\n [GL.UNSIGNED_INT_SAMPLER_2D_ARRAY]: ['2d-array', 'uint']\n};\n\ntype SamplerInfo = | {\n viewDimension: '1d' | '2d' | '2d-array' | 'cube' | 'cube-array' | '3d';\n sampleType: 'float' | 'unfilterable-float' | 'depth' | 'sint' | 'uint';\n};\n\nfunction getSamplerInfo(type: GL): SamplerInfo {\n const sampler = SAMPLER_UNIFORMS_GL_TO_GPU[type];\n if (!sampler) {\n throw new Error('sampler');\n }\n const [viewDimension, sampleType] = sampler;\n return {viewDimension, sampleType};\n}\n\n// HELPERS\n\nfunction parseUniformName(name: string): {name: string; length: number; isArray: boolean} {\n // Shortcut to avoid redundant or bad matches\n if (name[name.length - 1] !== ']') {\n return {\n name,\n length: 1,\n isArray: false\n };\n }\n\n // if array name then clean the array brackets\n const UNIFORM_NAME_REGEXP = /([^[]*)(\\[[0-9]+\\])?/;\n const matches = UNIFORM_NAME_REGEXP.exec(name);\n if (!matches || matches.length < 2) {\n throw new Error(`Failed to parse GLSL uniform name ${name}`);\n }\n\n return {\n name: matches[1],\n length: matches[2] ? 1 : 0,\n isArray: Boolean(matches[2])\n };\n}\n\n/**\n * TODO - verify this is a copy of above and delete\n * import type {TextureFormat} from '@luma.gl/api';\n* Extract info about all \"active\" uniform blocks\n * (\"Active\" just means that unused (inactive) blocks may have been optimized away during linking)\n *\n function getUniformBlockBindings(gl: WebGLRenderingContext, program): Binding[] {\n if (!isWebGL2(gl)) {\n return;\n }\n const bindings: Binding[] = [];\n const count = gl.getProgramParameter(program, gl.ACTIVE_UNIFORM_BLOCKS);\n for (let blockIndex = 0; blockIndex < count; blockIndex++) {\n const vertex = gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER),\n const fragment = gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER),\n const visibility = (vertex) + (fragment);\n const binding: BufferBinding = {\n location: gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_BINDING),\n // name: gl.getActiveUniformBlockName(program, blockIndex),\n type: 'uniform',\n visibility,\n minBindingSize: gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_DATA_SIZE),\n // uniformCount: gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_ACTIVE_UNIFORMS),\n // uniformIndices: gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES),\n }\n bindings.push(binding);\n }\n return bindings;\n}\n\nfunction setBindings(gl2: WebGL2RenderingContext, program: WebGLProgram, bindings: Binding[][]): void {\n for (const bindGroup of bindings) {\n for (const binding of bindGroup) {\n\n }\n }\n\n // Set up indirection table\n // this.gl2.uniformBlockBinding(this.handle, blockIndex, blockBinding);\n}\n */\n"],"mappings":"AAaA,SAAQA,EAAE,QAAO,oBAAoB;AAAC,SAC9BC,QAAQ;AAAA,SACRC,QAAQ;AAAA,SACRC,iBAAiB,EAAEC,mBAAmB;AAAA,SACtCC,eAAe;AAAA,SACfC,gBAAgB;AAOxB,OAAO,SAASC,eAAeA,CAACC,EAAyB,EAAEC,OAAqB,EAAgB;EAAA,IAAAC,qBAAA,EAAAC,qBAAA;EAC9F,MAAMC,eAAe,GAAGC,kBAAkB,CAACL,EAAE,EAAEC,OAAO,CAAC;EAEvD,MAAMK,YAA0B,GAAG;IACjCC,UAAU,EAAE,EAAE;IACdC,QAAQ,EAAE;EACZ,CAAC;EAED,KAAK,MAAMC,SAAS,IAAIL,eAAe,CAACG,UAAU,EAAE;IAElD,MAAMG,IAAI,GAAGC,IAAI,CAACC,GAAG,CAACH,SAAS,CAACI,QAAQ,CAACH,IAAI,EAAE,CAAC,CAAC;IACjD,MAAMI,MAAM,GAEVjB,eAAe,CAACY,SAAS,CAACI,QAAQ,CAACE,IAAI,IAAIvB,EAAE,CAACwB,KAAK,EAAEN,IAAI,CAAC;IAC5DJ,YAAY,C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AC,SAAS,CAAC;EAC5B;EACA,MAAM,CAACnB,aAAa,EAAEC,UAAU,CAAC,GAAGsF,OAAO;EAC3C,OAAO;IAACvF,aAAa;IAAEC;EAAU,CAAC;AACpC;AAIA,SAASsC,gBAAgBA,CAACzD,IAAY,EAAoD;EAExF,IAAIA,IAAI,CAACA,IAAI,CAACsB,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;IACjC,OAAO;MACLtB,IAAI;MACJsB,MAAM,EAAE,CAAC;MACTkC,OAAO,EAAE;IACX,CAAC;EACH;EAGA,MAAMkD,mBAAmB,GAAG,sBAAsB;EAClD,MAAMC,OAAO,GAAGD,mBAAmB,CAACE,IAAI,CAAC5G,IAAI,CAAC;EAC9C,IAAI,CAAC2G,OAAO,IAAIA,OAAO,CAACrF,MAAM,GAAG,CAAC,EAAE;IAClC,MAAM,IAAIe,KAAK,sCAAA0B,MAAA,CAAsC/D,IAAI,CAAE,CAAC;EAC9D;EAEA,OAAO;IACLA,IAAI,EAAE2G,OAAO,CAAC,CAAC,CAAC;IAChBrF,MAAM,EAAEqF,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAC1BnD,OAAO,EAAEqD,OAAO,CAACF,OAAO,CAAC,CAAC,CAAC;EAC7B,CAAC;AACH"}
1
+ {"version":3,"file":"get-shader-layout.js","names":["log","GL","isWebGL2","Accessor","decodeUniformType","decodeAttributeType","getVertexFormat","isSamplerUniform","getShaderLayout","gl","program","shaderLayout","attributes","bindings","readAttributeBindings","attribute","size","Math","min","accessor","format","type","FLOAT","push","name","location","stepMode","divisor","uniformBlocks","readUniformBlocks","uniformBlock","uniforms","map","uniform","byteOffset","byteStride","arrayLength","visibility","vertex","fragment","minBindingSize","byteLength","readUniformBindings","textureUnit","viewDimension","sampleType","getSamplerInfo","length","varyings","readVaryings","mergeShaderLayout","baseLayout","overrideLayout","mergedLayout","baseAttribute","find","attr","warn","concat","mergeBufferMap","bufferMap","bufferMapping","attributeOverride","overrideShaderLayoutAttribute","layout","getAttributeFromLayout","count","getProgramParameter","ACTIVE_ATTRIBUTES","index","activeInfo","getActiveAttrib","Error","compositeType","getAttribLocation","glType","components","test","attributeInfo","sort","a","b","gl2","TRANSFORM_FEEDBACK_VARYINGS","getTransformFeedbackVarying","varying","uniformCount","ACTIVE_UNIFORMS","i","getActiveUniform","rawName","isArray","parseUniformName","webglLocation","getUniformLocation","uniformInfo","j","elementName","arrayElementUniformInfo","getBlockParameter","blockIndex","pname","getActiveUniformBlockParameter","blockCount","ACTIVE_UNIFORM_BLOCKS","blockInfo","getActiveUniformBlockName","UNIFORM_BLOCK_BINDING","UNIFORM_BLOCK_DATA_SIZE","UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER","UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER","UNIFORM_BLOCK_ACTIVE_UNIFORMS","uniformIndices","UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES","uniformType","getActiveUniforms","UNIFORM_TYPE","uniformArrayLength","UNIFORM_SIZE","uniformOffset","UNIFORM_OFFSET","uniformStride","UNIFORM_ARRAY_STRIDE","SAMPLER_UNIFORMS_GL_TO_GPU","SAMPLER_2D","SAMPLER_CUBE","SAMPLER_3D","SAMPLER_2D_SHADOW","SAMPLER_2D_ARRAY","SAMPLER_2D_ARRAY_SHADOW","SAMPLER_CUBE_SHADOW","INT_SAMPLER_2D","INT_SAMPLER_3D","INT_SAMPLER_CUBE","INT_SAMPLER_2D_ARRAY","UNSIGNED_INT_SAMPLER_2D","UNSIGNED_INT_SAMPLER_3D","UNSIGNED_INT_SAMPLER_CUBE","UNSIGNED_INT_SAMPLER_2D_ARRAY","sampler","UNIFORM_NAME_REGEXP","matches","exec","Boolean"],"sources":["../../../src/adapter/helpers/get-shader-layout.ts"],"sourcesContent":["// luma.gl, MIT license\n\nimport type {\n ShaderLayout,\n AttributeLayout,\n UniformBinding,\n UniformBlockBinding,\n AttributeBinding,\n VaryingBinding,\n AccessorObject,\n BufferMapping,\n VertexFormat\n} from '@luma.gl/api';\nimport {log} from '@luma.gl/api';\nimport {GL} from '@luma.gl/constants';\nimport {isWebGL2} from '../../context/context/webgl-checks';\nimport {Accessor} from '../../classic/accessor'; // TODO - should NOT depend on classic API\nimport {decodeUniformType, decodeAttributeType} from './uniforms';\nimport {getVertexFormat} from '../converters/vertex-formats';\nimport {isSamplerUniform} from './uniforms';\n\n/**\n * Extract metadata describing binding information for a program's shaders\n * Note: `linkProgram()` needs to have been called\n * (although linking does not need to have been successful).\n */\nexport function getShaderLayout(gl: WebGLRenderingContext, program: WebGLProgram): ShaderLayout {\n const shaderLayout: ShaderLayout = {\n attributes: [],\n bindings: []\n };\n\n const attributes: AttributeBinding[] = readAttributeBindings(gl, program);\n for (const attribute of attributes) {\n // TODO - multicolumn attributes like a matrix4 can be up to 16 elts...\n const size = Math.min(attribute.accessor.size, 4);\n const format =\n // attribute.accessor.format ||\n getVertexFormat(attribute.accessor.type || GL.FLOAT, size);\n shaderLayout.attributes.push({\n name: attribute.name,\n location: attribute.location,\n format,\n stepMode: attribute.accessor.divisor === 1 ? 'instance' : 'vertex'\n });\n }\n\n // Uniform blocks\n const uniformBlocks: UniformBlockBinding[] = readUniformBlocks(gl, program);\n for (const uniformBlock of uniformBlocks) {\n const uniforms = uniformBlock.uniforms.map(uniform => ({\n name: uniform.name,\n format: uniform.format,\n byteOffset: uniform.byteOffset,\n byteStride: uniform.byteStride,\n arrayLength: uniform.arrayLength\n }));\n shaderLayout.bindings.push({\n type: 'uniform',\n name: uniformBlock.name,\n location: uniformBlock.location,\n visibility: (uniformBlock.vertex ? 0x1 : 0) & (uniformBlock.fragment ? 0x2 : 0),\n minBindingSize: uniformBlock.byteLength,\n uniforms\n });\n }\n\n const uniforms: UniformBinding[] = readUniformBindings(gl, program);\n let textureUnit = 0;\n for (const uniform of uniforms) {\n if (isSamplerUniform(uniform.type)) {\n const {viewDimension, sampleType} = getSamplerInfo(uniform.type);\n shaderLayout.bindings.push({\n type: 'texture',\n name: uniform.name,\n location: textureUnit,\n viewDimension,\n sampleType\n });\n\n // @ts-expect-error\n uniform.textureUnit = textureUnit;\n textureUnit += 1;\n }\n }\n\n if (uniforms.length) {\n shaderLayout.uniforms = uniforms;\n }\n\n // Varyings\n const varyings: VaryingBinding[] = readVaryings(gl, program);\n // Note - samplers are always in unform bindings, even if uniform blocks are used\n if (varyings?.length) {\n shaderLayout.varyings = varyings;\n }\n\n return shaderLayout;\n}\n\n/**\n * Merges an provided shader layout into a base shader layout\n * In WebGL, this allows the auto generated shader layout to be overridden by the application\n * Typically to change the format of the vertex attributes (from float32x4 to uint8x4 etc).\n * @todo Drop this? This could also be done more clearly with bufferMapping\n */\nexport function mergeShaderLayout(\n baseLayout: ShaderLayout,\n overrideLayout: ShaderLayout\n): ShaderLayout {\n // Deep clone the base layout\n const mergedLayout: ShaderLayout = {\n ...baseLayout,\n attributes: baseLayout.attributes.map(attribute => ({...attribute}))\n };\n // Merge the attributes\n for (const attribute of overrideLayout?.attributes || []) {\n const baseAttribute = mergedLayout.attributes.find(attr => attr.name === attribute.name);\n if (!baseAttribute) {\n log.warn(`shader layout attribute ${attribute.name} not present in shader`);\n } else {\n baseAttribute.format = attribute.format || baseAttribute.format;\n baseAttribute.stepMode = attribute.stepMode || baseAttribute.stepMode;\n }\n }\n return mergedLayout;\n}\n\nexport function mergeBufferMap(baseLayout: ShaderLayout, bufferMap: BufferMapping[]): ShaderLayout {\n // Deep clone the base layout\n const mergedLayout: ShaderLayout = {\n ...baseLayout,\n attributes: baseLayout.attributes.map(attribute => ({...attribute}))\n };\n for (const bufferMapping of bufferMap) {\n // Handle interleave\n switch (bufferMapping.type) {\n case 'interleave':\n // Handle interleaved buffer mapping\n for (const attributeOverride of bufferMapping.attributes) {\n overrideShaderLayoutAttribute(mergedLayout, attributeOverride);\n }\n break;\n\n default:\n // Handle simple attribute overrides\n overrideShaderLayoutAttribute(mergedLayout, bufferMapping);\n }\n }\n return mergedLayout;\n}\n\nfunction overrideShaderLayoutAttribute(\n layout: ShaderLayout,\n attributeOverride: {name: string; format?: VertexFormat}\n): void {\n const attribute = getAttributeFromLayout(layout, attributeOverride.name);\n if (attribute && attributeOverride.format) {\n attribute.format = attributeOverride.format;\n }\n}\n\nexport function getAttributeFromLayout(\n shaderLayout: ShaderLayout,\n name: string\n): AttributeLayout | null {\n const attribute = shaderLayout.attributes.find(attr => attr.name === name);\n if (!attribute) {\n log.warn(`shader layout attribute \"${name}\" not present in shader`);\n }\n return attribute || null;\n}\n\n// HELPERS\n\n/**\n * Extract info about all transform feedback varyings\n *\n * linkProgram needs to have been called, although linking does not need to have been successful\n */\nfunction readAttributeBindings(\n gl: WebGLRenderingContext,\n program: WebGLProgram\n): AttributeBinding[] {\n const attributes: AttributeBinding[] = [];\n\n const count = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES);\n\n for (let index = 0; index < count; index++) {\n const activeInfo = gl.getActiveAttrib(program, index);\n if (!activeInfo) {\n throw new Error('activeInfo');\n }\n const {name, type: compositeType, size} = activeInfo;\n const location = gl.getAttribLocation(program, name);\n // Add only user provided attributes, for built-in attributes like\n // `gl_InstanceID` locaiton will be < 0\n if (location >= 0) {\n const {glType, components} = decodeAttributeType(compositeType);\n const accessor: AccessorObject = {type: glType, size: size * components};\n // Any attribute name containing the word \"instance\" will be assumed to be instanced\n if (/instance/i.test(name)) {\n accessor.divisor = 1;\n }\n const attributeInfo = {location, name, accessor: new Accessor(accessor)}; // Base values\n attributes.push(attributeInfo);\n }\n }\n\n attributes.sort((a: AttributeBinding, b: AttributeBinding) => a.location - b.location);\n return attributes;\n}\n\n/**\n * Extract info about all transform feedback varyings\n *\n * linkProgram needs to have been called, although linking does not need to have been successful\n */\nfunction readVaryings(gl: WebGLRenderingContext, program: WebGLProgram): VaryingBinding[] {\n if (!isWebGL2(gl)) {\n return [];\n }\n const gl2 = gl as WebGL2RenderingContext;\n\n const varyings: VaryingBinding[] = [];\n\n const count = gl.getProgramParameter(program, GL.TRANSFORM_FEEDBACK_VARYINGS);\n for (let location = 0; location < count; location++) {\n const activeInfo = gl2.getTransformFeedbackVarying(program, location);\n if (!activeInfo) {\n throw new Error('activeInfo');\n }\n const {name, type: compositeType, size} = activeInfo;\n const {glType, components} = decodeUniformType(compositeType);\n const accessor = new Accessor({type: glType, size: size * components});\n const varying = {location, name, accessor}; // Base values\n varyings.push(varying);\n }\n\n varyings.sort((a, b) => a.location - b.location);\n return varyings;\n}\n\n/**\n * Extract info about all uniforms\n *\n * Query uniform locations and build name to setter map.\n */\nfunction readUniformBindings(gl: WebGLRenderingContext, program: WebGLProgram): UniformBinding[] {\n const uniforms: UniformBinding[] = [];\n\n const uniformCount = gl.getProgramParameter(program, GL.ACTIVE_UNIFORMS);\n for (let i = 0; i < uniformCount; i++) {\n const activeInfo = gl.getActiveUniform(program, i);\n if (!activeInfo) {\n throw new Error('activeInfo');\n }\n const {name: rawName, size, type} = activeInfo;\n const {name, isArray} = parseUniformName(rawName);\n let webglLocation = gl.getUniformLocation(program, name);\n const uniformInfo = {\n // WebGL locations are uniquely typed but just numbers\n location: webglLocation as number,\n name,\n size,\n type,\n isArray\n };\n uniforms.push(uniformInfo);\n\n // Array (e.g. matrix) uniforms can occupy several 4x4 byte banks\n if (uniformInfo.size > 1) {\n for (let j = 0; j < uniformInfo.size; j++) {\n const elementName = `${name}[${j}]`;\n\n webglLocation = gl.getUniformLocation(program, elementName);\n\n const arrayElementUniformInfo = {\n ...uniformInfo,\n name: elementName,\n location: webglLocation as number\n };\n\n uniforms.push(arrayElementUniformInfo);\n }\n }\n }\n return uniforms;\n}\n\n/**\n * Extract info about all \"active\" uniform blocks\n *\n * (\"Active\" just means that unused (aka inactive) blocks may have been\n * optimized away during linking)\n */\nfunction readUniformBlocks(\n gl: WebGLRenderingContext,\n program: WebGLProgram\n): UniformBlockBinding[] {\n if (!isWebGL2(gl)) {\n return [];\n }\n const gl2 = gl as WebGL2RenderingContext;\n\n const getBlockParameter = (blockIndex: number, pname: GL): any =>\n gl2.getActiveUniformBlockParameter(program, blockIndex, pname);\n\n const uniformBlocks: UniformBlockBinding[] = [];\n\n const blockCount = gl2.getProgramParameter(program, GL.ACTIVE_UNIFORM_BLOCKS);\n for (let blockIndex = 0; blockIndex < blockCount; blockIndex++) {\n const blockInfo: UniformBlockBinding = {\n name: gl2.getActiveUniformBlockName(program, blockIndex) || '',\n location: getBlockParameter(blockIndex, GL.UNIFORM_BLOCK_BINDING),\n byteLength: getBlockParameter(blockIndex, GL.UNIFORM_BLOCK_DATA_SIZE),\n vertex: getBlockParameter(blockIndex, GL.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER),\n fragment: getBlockParameter(blockIndex, GL.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER),\n uniformCount: getBlockParameter(blockIndex, GL.UNIFORM_BLOCK_ACTIVE_UNIFORMS),\n uniforms: [] as any[]\n };\n\n const uniformIndices =\n (getBlockParameter(blockIndex, GL.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES) as number[]) || [];\n\n const uniformType = gl2.getActiveUniforms(program, uniformIndices, GL.UNIFORM_TYPE); // Array of GLenum indicating the types of the uniforms.\n const uniformArrayLength = gl2.getActiveUniforms(program, uniformIndices, GL.UNIFORM_SIZE); // Array of GLuint indicating the sizes of the uniforms.\n // const uniformBlockIndex = gl2.getActiveUniforms(\n // program,\n // uniformIndices,\n // GL.UNIFORM_BLOCK_INDEX\n // ); // Array of GLint indicating the block indices of the uniforms.\n const uniformOffset = gl2.getActiveUniforms(program, uniformIndices, GL.UNIFORM_OFFSET); // Array of GLint indicating the uniform buffer offsets.\n const uniformStride = gl2.getActiveUniforms(program, uniformIndices, GL.UNIFORM_ARRAY_STRIDE); // Array of GLint indicating the strides between the elements.\n // const uniformMatrixStride = gl2.getActiveUniforms(\n // program,\n // uniformIndices,\n // GL.UNIFORM_MATRIX_STRIDE\n // ); // Array of GLint indicating the strides between columns of a column-major matrix or a row-major matrix.\n // const uniformRowMajor = gl2.getActiveUniforms(program, uniformIndices, GL.UNIFORM_IS_ROW_MAJOR);\n for (let i = 0; i < blockInfo.uniformCount; ++i) {\n const activeInfo = gl2.getActiveUniform(program, uniformIndices[i]);\n if (!activeInfo) {\n throw new Error('activeInfo');\n }\n\n blockInfo.uniforms.push({\n name: activeInfo.name,\n format: decodeUniformType(uniformType[i]).format,\n type: uniformType[i],\n arrayLength: uniformArrayLength[i],\n byteOffset: uniformOffset[i],\n byteStride: uniformStride[i]\n // matrixStride: uniformStride[i],\n // rowMajor: uniformRowMajor[i]\n });\n }\n\n uniformBlocks.push(blockInfo);\n }\n\n uniformBlocks.sort((a, b) => a.location - b.location);\n return uniformBlocks;\n}\n\nconst SAMPLER_UNIFORMS_GL_TO_GPU: Record<\n number,\n [\n '1d' | '2d' | '2d-array' | 'cube' | 'cube-array' | '3d',\n 'float' | 'unfilterable-float' | 'depth' | 'sint' | 'uint'\n ]\n> = {\n [GL.SAMPLER_2D]: ['2d', 'float'],\n [GL.SAMPLER_CUBE]: ['cube', 'float'],\n [GL.SAMPLER_3D]: ['3d', 'float'],\n [GL.SAMPLER_2D_SHADOW]: ['3d', 'depth'],\n [GL.SAMPLER_2D_ARRAY]: ['2d-array', 'float'],\n [GL.SAMPLER_2D_ARRAY_SHADOW]: ['2d-array', 'depth'],\n [GL.SAMPLER_CUBE_SHADOW]: ['cube', 'float'],\n [GL.INT_SAMPLER_2D]: ['2d', 'sint'],\n [GL.INT_SAMPLER_3D]: ['3d', 'sint'],\n [GL.INT_SAMPLER_CUBE]: ['cube', 'sint'],\n [GL.INT_SAMPLER_2D_ARRAY]: ['2d-array', 'uint'],\n [GL.UNSIGNED_INT_SAMPLER_2D]: ['2d', 'uint'],\n [GL.UNSIGNED_INT_SAMPLER_3D]: ['3d', 'uint'],\n [GL.UNSIGNED_INT_SAMPLER_CUBE]: ['cube', 'uint'],\n [GL.UNSIGNED_INT_SAMPLER_2D_ARRAY]: ['2d-array', 'uint']\n};\n\ntype SamplerInfo = {\n viewDimension: '1d' | '2d' | '2d-array' | 'cube' | 'cube-array' | '3d';\n sampleType: 'float' | 'unfilterable-float' | 'depth' | 'sint' | 'uint';\n};\n\nfunction getSamplerInfo(type: GL): SamplerInfo {\n const sampler = SAMPLER_UNIFORMS_GL_TO_GPU[type];\n if (!sampler) {\n throw new Error('sampler');\n }\n const [viewDimension, sampleType] = sampler;\n return {viewDimension, sampleType};\n}\n\n// HELPERS\n\nfunction parseUniformName(name: string): {name: string; length: number; isArray: boolean} {\n // Shortcut to avoid redundant or bad matches\n if (name[name.length - 1] !== ']') {\n return {\n name,\n length: 1,\n isArray: false\n };\n }\n\n // if array name then clean the array brackets\n const UNIFORM_NAME_REGEXP = /([^[]*)(\\[[0-9]+\\])?/;\n const matches = UNIFORM_NAME_REGEXP.exec(name);\n if (!matches || matches.length < 2) {\n throw new Error(`Failed to parse GLSL uniform name ${name}`);\n }\n\n return {\n name: matches[1],\n length: matches[2] ? 1 : 0,\n isArray: Boolean(matches[2])\n };\n}\n\n/**\n * TODO - verify this is a copy of above and delete\n * import type {TextureFormat} from '@luma.gl/api';\n* Extract info about all \"active\" uniform blocks\n * (\"Active\" just means that unused (inactive) blocks may have been optimized away during linking)\n *\n function getUniformBlockBindings(gl: WebGLRenderingContext, program): Binding[] {\n if (!isWebGL2(gl)) {\n return;\n }\n const bindings: Binding[] = [];\n const count = gl.getProgramParameter(program, gl.ACTIVE_UNIFORM_BLOCKS);\n for (let blockIndex = 0; blockIndex < count; blockIndex++) {\n const vertex = gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER),\n const fragment = gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER),\n const visibility = (vertex) + (fragment);\n const binding: BufferBinding = {\n location: gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_BINDING),\n // name: gl.getActiveUniformBlockName(program, blockIndex),\n type: 'uniform',\n visibility,\n minBindingSize: gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_DATA_SIZE),\n // uniformCount: gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_ACTIVE_UNIFORMS),\n // uniformIndices: gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES),\n }\n bindings.push(binding);\n }\n return bindings;\n}\n\nfunction setBindings(gl2: WebGL2RenderingContext, program: WebGLProgram, bindings: Binding[][]): void {\n for (const bindGroup of bindings) {\n for (const binding of bindGroup) {\n\n }\n }\n\n // Set up indirection table\n // this.gl2.uniformBlockBinding(this.handle, blockIndex, blockBinding);\n}\n */\n"],"mappings":"AAaA,SAAQA,GAAG,QAAO,cAAc;AAChC,SAAQC,EAAE,QAAO,oBAAoB;AAAC,SAC9BC,QAAQ;AAAA,SACRC,QAAQ;AAAA,SACRC,iBAAiB,EAAEC,mBAAmB;AAAA,SACtCC,eAAe;AAAA,SACfC,gBAAgB;AAOxB,OAAO,SAASC,eAAeA,CAACC,EAAyB,EAAEC,OAAqB,EAAgB;EAC9F,MAAMC,YAA0B,GAAG;IACjCC,UAAU,EAAE,EAAE;IACdC,QAAQ,EAAE;EACZ,CAAC;EAED,MAAMD,UAA8B,GAAGE,qBAAqB,CAACL,EAAE,EAAEC,OAAO,CAAC;EACzE,KAAK,MAAMK,SAAS,IAAIH,UAAU,EAAE;IAElC,MAAMI,IAAI,GAAGC,IAAI,CAACC,GAAG,CAACH,SAAS,CAACI,QAAQ,CAACH,IAAI,EAAE,CAAC,CAAC;IACjD,MAAMI,MAAM,GAEVd,eAAe,CAACS,SAAS,CAACI,QAAQ,CAACE,IAAI,IAAIpB,EAAE,CAACqB,KAAK,EAAEN,IAAI,CAAC;IAC5DL,YAAY,CAACC,UAAU,CAACW,IAAI,CAAC;MAC3BC,IAAI,EAAET,SAAS,CAACS,IAAI;MACpBC,QAAQ,EAAEV,SAAS,CAAC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sH,OAAO,GAAGhB,0BAA0B,CAACtG,IAAI,CAAC;EAChD,IAAI,CAACsH,OAAO,EAAE;IACZ,MAAM,IAAInE,KAAK,CAAC,SAAS,CAAC;EAC5B;EACA,MAAM,CAAC5B,aAAa,EAAEC,UAAU,CAAC,GAAG8F,OAAO;EAC3C,OAAO;IAAC/F,aAAa;IAAEC;EAAU,CAAC;AACpC;AAIA,SAAS+C,gBAAgBA,CAACpE,IAAY,EAAoD;EAExF,IAAIA,IAAI,CAACA,IAAI,CAACuB,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;IACjC,OAAO;MACLvB,IAAI;MACJuB,MAAM,EAAE,CAAC;MACT4C,OAAO,EAAE;IACX,CAAC;EACH;EAGA,MAAMiD,mBAAmB,GAAG,sBAAsB;EAClD,MAAMC,OAAO,GAAGD,mBAAmB,CAACE,IAAI,CAACtH,IAAI,CAAC;EAC9C,IAAI,CAACqH,OAAO,IAAIA,OAAO,CAAC9F,MAAM,GAAG,CAAC,EAAE;IAClC,MAAM,IAAIyB,KAAK,sCAAAd,MAAA,CAAsClC,IAAI,CAAE,CAAC;EAC9D;EAEA,OAAO;IACLA,IAAI,EAAEqH,OAAO,CAAC,CAAC,CAAC;IAChB9F,MAAM,EAAE8F,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAC1BlD,OAAO,EAAEoD,OAAO,CAACF,OAAO,CAAC,CAAC,CAAC;EAC7B,CAAC;AACH"}
@@ -0,0 +1,12 @@
1
+ /// <reference types="dist" />
2
+ import type { ShaderLayout, BufferMapping } from '@luma.gl/api';
3
+ /**
4
+ * Build a WebGPU vertex buffer layout intended for use in a GPURenderPassDescriptor.
5
+ * Converts luma.gl attribute definitions to a WebGPU GPUVertexBufferLayout[] array
6
+ * @param layout
7
+ * @param bufferMap The buffer map is optional
8
+ * @returns WebGPU layout intended for a GPURenderPassDescriptor.
9
+ */
10
+ export declare function getVertexBufferLayout(layout: ShaderLayout, bufferMap: BufferMapping[]): GPUVertexBufferLayout[];
11
+ export declare function getBufferSlots(layout: ShaderLayout, bufferMap: BufferMapping[]): Record<string, number>;
12
+ //# sourceMappingURL=get-vertex-buffer-layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-vertex-buffer-layout.d.ts","sourceRoot":"","sources":["../../../src/adapter/helpers/get-vertex-buffer-layout.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAC,YAAY,EAAE,aAAa,EAAkB,MAAM,cAAc,CAAC;AAG/E;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,qBAAqB,EAAE,CAkE/G;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA2BvG"}
@@ -0,0 +1,84 @@
1
+ import { decodeVertexFormat } from '@luma.gl/api';
2
+ export function getVertexBufferLayout(layout, bufferMap) {
3
+ const vertexBufferLayouts = [];
4
+ const usedAttributes = new Set();
5
+ for (const mapping of bufferMap) {
6
+ const vertexAttributes = [];
7
+ let stepMode = 'vertex';
8
+ let byteStride = 0;
9
+ const byteOffset = mapping.byteOffset || 0;
10
+ if ('attributes' in mapping) {
11
+ for (const interleaved of mapping.attributes) {
12
+ const attributeLayout = findAttributeLayout(layout, interleaved.name, usedAttributes);
13
+ stepMode = attributeLayout.stepMode || 'vertex';
14
+ vertexAttributes.push({
15
+ format: attributeLayout.format,
16
+ offset: byteOffset + byteStride,
17
+ shaderLocation: attributeLayout.location
18
+ });
19
+ byteStride += decodeVertexFormat(attributeLayout.format).byteLength;
20
+ }
21
+ } else {
22
+ const attributeLayout = findAttributeLayout(layout, mapping.name, usedAttributes);
23
+ byteStride = decodeVertexFormat(attributeLayout.format).byteLength;
24
+ stepMode = attributeLayout.stepMode || 'vertex';
25
+ vertexAttributes.push({
26
+ format: attributeLayout.format,
27
+ offset: byteOffset,
28
+ shaderLocation: attributeLayout.location
29
+ });
30
+ }
31
+ vertexBufferLayouts.push({
32
+ arrayStride: mapping.byteStride || byteStride,
33
+ stepMode: stepMode || 'vertex',
34
+ attributes: vertexAttributes
35
+ });
36
+ }
37
+ for (const attribute of layout.attributes) {
38
+ if (!usedAttributes.has(attribute.name)) {
39
+ vertexBufferLayouts.push({
40
+ arrayStride: decodeVertexFormat(attribute.format).byteLength,
41
+ stepMode: attribute.stepMode || 'vertex',
42
+ attributes: [{
43
+ format: attribute.format,
44
+ offset: 0,
45
+ shaderLocation: attribute.location
46
+ }]
47
+ });
48
+ }
49
+ }
50
+ return vertexBufferLayouts;
51
+ }
52
+ export function getBufferSlots(layout, bufferMap) {
53
+ const usedAttributes = new Set();
54
+ let bufferSlot = 0;
55
+ const bufferSlots = {};
56
+ for (const mapping of bufferMap) {
57
+ if ('attributes' in mapping) {
58
+ for (const interleaved of mapping.attributes) {
59
+ usedAttributes.add(interleaved.name);
60
+ }
61
+ } else {
62
+ usedAttributes.add(mapping.name);
63
+ }
64
+ bufferSlots[mapping.name] = bufferSlot++;
65
+ }
66
+ for (const attribute of layout.attributes) {
67
+ if (!usedAttributes.has(attribute.name)) {
68
+ bufferSlots[attribute.name] = bufferSlot++;
69
+ }
70
+ }
71
+ return bufferSlots;
72
+ }
73
+ function findAttributeLayout(layout, name, attributeNames) {
74
+ const attribute = layout.attributes.find(attribute => attribute.name === name);
75
+ if (!attribute) {
76
+ throw new Error("Unknown attribute ".concat(name));
77
+ }
78
+ if (attributeNames.has(name)) {
79
+ throw new Error("Duplicate attribute ".concat(name));
80
+ }
81
+ attributeNames.add(name);
82
+ return attribute;
83
+ }
84
+ //# sourceMappingURL=get-vertex-buffer-layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-vertex-buffer-layout.js","names":["decodeVertexFormat","getVertexBufferLayout","layout","bufferMap","vertexBufferLayouts","usedAttributes","Set","mapping","vertexAttributes","stepMode","byteStride","byteOffset","interleaved","attributes","attributeLayout","findAttributeLayout","name","push","format","offset","shaderLocation","location","byteLength","arrayStride","attribute","has","getBufferSlots","bufferSlot","bufferSlots","add","attributeNames","find","Error","concat"],"sources":["../../../src/adapter/helpers/get-vertex-buffer-layout.ts"],"sourcesContent":["import type {ShaderLayout, BufferMapping, AttributeLayout} from '@luma.gl/api';\nimport {decodeVertexFormat} from '@luma.gl/api';\n\n/**\n * Build a WebGPU vertex buffer layout intended for use in a GPURenderPassDescriptor.\n * Converts luma.gl attribute definitions to a WebGPU GPUVertexBufferLayout[] array\n * @param layout\n * @param bufferMap The buffer map is optional\n * @returns WebGPU layout intended for a GPURenderPassDescriptor.\n */\nexport function getVertexBufferLayout(layout: ShaderLayout, bufferMap: BufferMapping[]): GPUVertexBufferLayout[] {\n const vertexBufferLayouts: GPUVertexBufferLayout[] = [];\n const usedAttributes = new Set<string>();\n\n // First handle any buffers mentioned in `bufferMapping`\n for (const mapping of bufferMap) {\n // Build vertex attributes for one buffer\n const vertexAttributes: GPUVertexAttribute[] = [];\n\n // TODO verify that all stepModes for one buffer are the same\n let stepMode: 'vertex' | 'instance' = 'vertex';\n let byteStride = 0;\n const byteOffset = mapping.byteOffset || 0;\n\n // interleaved mapping {..., attributes: [{...}, ...]}\n if ('attributes' in mapping) {\n // const arrayStride = mapping.byteStride; TODO \n for (const interleaved of mapping.attributes) {\n const attributeLayout = findAttributeLayout(layout, interleaved.name, usedAttributes);\n\n stepMode = attributeLayout.stepMode || 'vertex';\n vertexAttributes.push({\n format: attributeLayout.format,\n offset: byteOffset + byteStride,\n shaderLocation: attributeLayout.location\n });\n\n byteStride += decodeVertexFormat(attributeLayout.format).byteLength;\n }\n // non-interleaved mapping (just set offset and stride)\n } else {\n const attributeLayout = findAttributeLayout(layout, mapping.name, usedAttributes);\n byteStride = decodeVertexFormat(attributeLayout.format).byteLength;\n\n stepMode = attributeLayout.stepMode || 'vertex';\n vertexAttributes.push({\n format: attributeLayout.format,\n offset: byteOffset,\n shaderLocation: attributeLayout.location\n });\n }\n\n // Store all the attribute bindings for one buffer\n vertexBufferLayouts.push({\n arrayStride: mapping.byteStride || byteStride,\n stepMode: stepMode || 'vertex',\n attributes: vertexAttributes\n });\n }\n\n // Add any non-mapped attributes\n for (const attribute of layout.attributes) {\n if (!usedAttributes.has(attribute.name)) {\n vertexBufferLayouts.push({\n arrayStride: decodeVertexFormat(attribute.format).byteLength,\n stepMode: attribute.stepMode || 'vertex',\n attributes: [{\n format: attribute.format,\n offset: 0,\n shaderLocation: attribute.location\n }]\n });\n }\n }\n\n return vertexBufferLayouts;\n}\n\nexport function getBufferSlots(layout: ShaderLayout, bufferMap: BufferMapping[]): Record<string, number> {\n const usedAttributes = new Set<string>();\n let bufferSlot = 0;\n const bufferSlots: Record<string, number> = {};\n\n // First handle any buffers mentioned in `bufferMapping`\n for (const mapping of bufferMap) {\n // interleaved mapping {..., attributes: [{...}, ...]}\n if ('attributes' in mapping) {\n for (const interleaved of mapping.attributes) {\n usedAttributes.add(interleaved.name);\n }\n // non-interleaved mapping (just set offset and stride)\n } else {\n usedAttributes.add(mapping.name);\n }\n bufferSlots[mapping.name] = bufferSlot++;\n }\n\n // Add any non-mapped attributes\n for (const attribute of layout.attributes) {\n if (!usedAttributes.has(attribute.name)) {\n bufferSlots[attribute.name] = bufferSlot++;\n }\n }\n\n return bufferSlots;\n}\n\n/**\n * Looks up an attribute in the ShaderLayout.\n * @throws if name is not in ShaderLayout\n * @throws if name has already been referenced\n */\nfunction findAttributeLayout(layout: ShaderLayout, name: string, attributeNames: Set<string>): AttributeLayout {\n const attribute = layout.attributes.find(attribute => attribute.name === name);\n if (!attribute) {\n throw new Error(`Unknown attribute ${name}`);\n }\n if (attributeNames.has(name)) {\n throw new Error(`Duplicate attribute ${name}`);\n }\n attributeNames.add(name);\n return attribute;\n}\n"],"mappings":"AACA,SAAQA,kBAAkB,QAAO,cAAc;AAS/C,OAAO,SAASC,qBAAqBA,CAACC,MAAoB,EAAEC,SA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,CAACoB,GAAG,CAACD,SAAS,CAACR,IAAI,CAAC,EAAE;MACvCY,WAAW,CAACJ,SAAS,CAACR,IAAI,CAAC,GAAGW,UAAU,EAAE;IAC5C;EACF;EAEA,OAAOC,WAAW;AACpB;AAOA,SAASb,mBAAmBA,CAACb,MAAoB,EAAEc,IAAY,EAAEc,cAA2B,EAAmB;EAC7G,MAAMN,SAAS,GAAGtB,MAAM,CAACW,UAAU,CAACkB,IAAI,CAACP,SAAS,IAAIA,SAAS,CAACR,IAAI,KAAKA,IAAI,CAAC;EAC9E,IAAI,CAACQ,SAAS,EAAE;IACd,MAAM,IAAIQ,KAAK,sBAAAC,MAAA,CAAsBjB,IAAI,CAAE,CAAC;EAC9C;EACA,IAAIc,cAAc,CAACL,GAAG,CAACT,IAAI,CAAC,EAAE;IAC5B,MAAM,IAAIgB,KAAK,wBAAAC,MAAA,CAAwBjB,IAAI,CAAE,CAAC;EAChD;EACAc,cAAc,CAACD,GAAG,CAACb,IAAI,CAAC;EACxB,OAAOQ,SAAS;AAClB"}
@@ -1,27 +1,54 @@
1
- import { ResourceProps } from '@luma.gl/api';
2
- import { WebGLDevice } from '../webgl-device';
1
+ import type { Device, Buffer, ResourceProps, TypedArray } from '@luma.gl/api';
3
2
  import { WebGLResource } from './webgl-resource';
4
3
  import { WEBGLBuffer } from '../resources/webgl-buffer';
5
4
  /**
6
5
  * VertexArrayObject properties
6
+ * @param constantAttributeZero Attribute 0 can not be disable on most desktop OpenGL based browsers
7
+ * and on iOS Safari browser.
7
8
  */
8
- export type VertexArrayObjectProps = ResourceProps & {};
9
+ export type VertexArrayObjectProps = ResourceProps & {
10
+ constantAttributeZero?: boolean;
11
+ };
9
12
  /** VertexArrayObject wrapper */
10
13
  export declare class WEBGLVertexArrayObject extends WebGLResource<VertexArrayObjectProps> {
11
14
  get [Symbol.toStringTag](): string;
12
- constructor(device: WebGLDevice, props?: VertexArrayObjectProps);
15
+ /** Buffer constant */
16
+ private buffer;
17
+ private bufferValue;
18
+ static isConstantAttributeZeroSupported(device: Device): boolean;
19
+ constructor(device: Device, props?: VertexArrayObjectProps);
20
+ destroy(): void;
13
21
  _createHandle(): WebGLVertexArrayObject;
14
22
  _deleteHandle(): void;
15
23
  _bindHandle(handle: WEBGLVertexArrayObject): void;
16
- setElementBuffer(elementBuffer?: WEBGLBuffer | null, opts?: {}): this;
17
- /** Set a location in vertex attributes array to a buffer, enables the location, sets divisor */
18
- setBuffer(location: number, buffer: WEBGLBuffer, accessor: any): this;
19
24
  /**
20
25
  * Enabling an attribute location makes it reference the currently bound buffer
21
26
  * Disabling an attribute location makes it reference the global constant value
22
27
  * TODO - handle single values for size 1 attributes?
23
28
  * TODO - convert classic arrays based on known type?
24
29
  */
25
- enable(location: number, enable?: boolean): this;
30
+ enable(location: number, enable?: boolean): void;
31
+ setElementBuffer(elementBuffer?: WEBGLBuffer | null, opts?: {}): void;
32
+ /** Set a location in vertex attributes array to a buffer, enables the location, sets divisor */
33
+ setBuffer(location: number, buffer: WEBGLBuffer, accessor: any): void;
34
+ /**
35
+ * Set an attribute to a constant value
36
+ * @param device
37
+ * @param location
38
+ * @param array
39
+ *
40
+ * @note Constants are stored globally on the WebGL context, not the VAO
41
+ * so they need to be updated before every render
42
+ * @todo - use known type (in configuration or passed in) to allow non-typed arrays?
43
+ * @todo - remember/cache values to avoid setting them unnecessarily?
44
+ */
45
+ setConstant(location: any, array: TypedArray): void;
46
+ /**
47
+ * Provide a means to create a buffer that is equivalent to a constant.
48
+ * NOTE: Desktop OpenGL cannot disable attribute 0.
49
+ * https://stackoverflow.com/questions/20305231/webgl-warning-attribute-0-is-disabled-
50
+ * this-has-significant-performance-penalty
51
+ */
52
+ getConstantBuffer(elementCount: number, value: any): Buffer;
26
53
  }
27
54
  //# sourceMappingURL=webgl-vertex-array-object.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"webgl-vertex-array-object.d.ts","sourceRoot":"","sources":["../../../src/adapter/objects/webgl-vertex-array-object.ts"],"names":[],"m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