@luma.gl/webgl 9.0.0-beta.5 → 9.0.0-beta.7

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 (192) hide show
  1. package/dist/adapter/converters/device-parameters.d.ts.map +1 -1
  2. package/dist/adapter/converters/device-parameters.js +128 -71
  3. package/dist/adapter/converters/sampler-parameters.d.ts.map +1 -1
  4. package/dist/adapter/converters/sampler-parameters.js +20 -19
  5. package/dist/adapter/converters/shader-formats.d.ts.map +1 -1
  6. package/dist/adapter/converters/shader-formats.js +40 -20
  7. package/dist/adapter/converters/texture-formats.d.ts +16 -11
  8. package/dist/adapter/converters/texture-formats.d.ts.map +1 -1
  9. package/dist/adapter/converters/texture-formats.js +224 -205
  10. package/dist/adapter/converters/vertex-formats.d.ts.map +1 -1
  11. package/dist/adapter/converters/vertex-formats.js +22 -21
  12. package/dist/adapter/device-helpers/webgl-device-features.d.ts +19 -5
  13. package/dist/adapter/device-helpers/webgl-device-features.d.ts.map +1 -1
  14. package/dist/adapter/device-helpers/webgl-device-features.js +89 -43
  15. package/dist/adapter/device-helpers/webgl-device-info.d.ts +2 -1
  16. package/dist/adapter/device-helpers/webgl-device-info.d.ts.map +1 -1
  17. package/dist/adapter/device-helpers/webgl-device-info.js +22 -19
  18. package/dist/adapter/device-helpers/webgl-device-limits.d.ts +33 -48
  19. package/dist/adapter/device-helpers/webgl-device-limits.d.ts.map +1 -1
  20. package/dist/adapter/device-helpers/webgl-device-limits.js +42 -87
  21. package/dist/adapter/helpers/decode-webgl-types.d.ts.map +1 -1
  22. package/dist/adapter/helpers/decode-webgl-types.js +47 -46
  23. package/dist/adapter/helpers/get-shader-layout.d.ts.map +1 -1
  24. package/dist/adapter/helpers/get-shader-layout.js +35 -34
  25. package/dist/adapter/helpers/parse-shader-compiler-log.d.ts.map +1 -1
  26. package/dist/adapter/helpers/parse-shader-compiler-log.js +3 -2
  27. package/dist/adapter/helpers/set-uniform.d.ts.map +1 -1
  28. package/dist/adapter/helpers/set-uniform.js +42 -41
  29. package/dist/adapter/helpers/webgl-topology-utils.d.ts.map +1 -1
  30. package/dist/adapter/helpers/webgl-topology-utils.js +40 -39
  31. package/dist/adapter/objects/constants-to-keys.d.ts.map +1 -1
  32. package/dist/adapter/objects/constants-to-keys.js +2 -1
  33. package/dist/adapter/objects/webgl-renderbuffer.d.ts +2 -2
  34. package/dist/adapter/objects/webgl-renderbuffer.d.ts.map +1 -1
  35. package/dist/adapter/objects/webgl-renderbuffer.js +30 -17
  36. package/dist/adapter/objects/webgl-resource.d.ts +2 -24
  37. package/dist/adapter/objects/webgl-resource.d.ts.map +1 -1
  38. package/dist/adapter/objects/webgl-resource.js +6 -101
  39. package/dist/adapter/resources/webgl-buffer.d.ts +1 -1
  40. package/dist/adapter/resources/webgl-buffer.d.ts.map +1 -1
  41. package/dist/adapter/resources/webgl-buffer.js +16 -15
  42. package/dist/adapter/resources/webgl-command-buffer.d.ts +1 -1
  43. package/dist/adapter/resources/webgl-command-buffer.d.ts.map +1 -1
  44. package/dist/adapter/resources/webgl-command-buffer.js +32 -31
  45. package/dist/adapter/resources/webgl-command-encoder.d.ts +8 -3
  46. package/dist/adapter/resources/webgl-command-encoder.d.ts.map +1 -1
  47. package/dist/adapter/resources/webgl-command-encoder.js +4 -2
  48. package/dist/adapter/resources/webgl-external-texture.js +6 -5
  49. package/dist/adapter/resources/webgl-framebuffer.d.ts +6 -10
  50. package/dist/adapter/resources/webgl-framebuffer.d.ts.map +1 -1
  51. package/dist/adapter/resources/webgl-framebuffer.js +60 -53
  52. package/dist/adapter/resources/webgl-query-set.d.ts +44 -0
  53. package/dist/adapter/resources/webgl-query-set.d.ts.map +1 -0
  54. package/dist/adapter/resources/webgl-query-set.js +136 -0
  55. package/dist/adapter/resources/webgl-render-pass.d.ts +3 -1
  56. package/dist/adapter/resources/webgl-render-pass.d.ts.map +1 -1
  57. package/dist/adapter/resources/webgl-render-pass.js +20 -12
  58. package/dist/adapter/resources/webgl-render-pipeline.d.ts +4 -5
  59. package/dist/adapter/resources/webgl-render-pipeline.d.ts.map +1 -1
  60. package/dist/adapter/resources/webgl-render-pipeline.js +52 -61
  61. package/dist/adapter/resources/webgl-sampler.d.ts +1 -1
  62. package/dist/adapter/resources/webgl-sampler.d.ts.map +1 -1
  63. package/dist/adapter/resources/webgl-sampler.js +5 -4
  64. package/dist/adapter/resources/webgl-shader.d.ts +3 -2
  65. package/dist/adapter/resources/webgl-shader.d.ts.map +1 -1
  66. package/dist/adapter/resources/webgl-shader.js +15 -9
  67. package/dist/adapter/resources/webgl-texture-view.d.ts +14 -0
  68. package/dist/adapter/resources/webgl-texture-view.d.ts.map +1 -0
  69. package/dist/adapter/resources/webgl-texture-view.js +18 -0
  70. package/dist/adapter/resources/webgl-texture.d.ts +6 -4
  71. package/dist/adapter/resources/webgl-texture.d.ts.map +1 -1
  72. package/dist/adapter/resources/webgl-texture.js +39 -32
  73. package/dist/adapter/resources/webgl-transform-feedback.d.ts +1 -1
  74. package/dist/adapter/resources/webgl-transform-feedback.d.ts.map +1 -1
  75. package/dist/adapter/resources/webgl-transform-feedback.js +10 -10
  76. package/dist/adapter/resources/webgl-vertex-array.d.ts +3 -3
  77. package/dist/adapter/resources/webgl-vertex-array.d.ts.map +1 -1
  78. package/dist/adapter/resources/webgl-vertex-array.js +10 -9
  79. package/dist/adapter/webgl-canvas-context.d.ts +2 -2
  80. package/dist/adapter/webgl-canvas-context.d.ts.map +1 -1
  81. package/dist/adapter/webgl-canvas-context.js +3 -2
  82. package/dist/adapter/webgl-device.d.ts +35 -30
  83. package/dist/adapter/webgl-device.d.ts.map +1 -1
  84. package/dist/adapter/webgl-device.js +110 -109
  85. package/dist/classic/accessor.d.ts.map +1 -1
  86. package/dist/classic/accessor.js +8 -7
  87. package/dist/classic/clear.d.ts.map +1 -1
  88. package/dist/classic/clear.js +5 -4
  89. package/dist/classic/copy-and-blit.d.ts +1 -1
  90. package/dist/classic/copy-and-blit.d.ts.map +1 -1
  91. package/dist/classic/copy-and-blit.js +19 -19
  92. package/dist/classic/format-utils.d.ts.map +1 -1
  93. package/dist/classic/format-utils.js +16 -15
  94. package/dist/classic/typed-array-utils.d.ts.map +1 -1
  95. package/dist/classic/typed-array-utils.js +20 -19
  96. package/dist/context/debug/spector.d.ts.map +1 -1
  97. package/dist/context/debug/spector.js +2 -1
  98. package/dist/context/debug/webgl-developer-tools.d.ts.map +1 -1
  99. package/dist/context/debug/webgl-developer-tools.js +7 -6
  100. package/dist/context/{context → helpers}/create-browser-context.d.ts.map +1 -1
  101. package/dist/context/{context → helpers}/create-browser-context.js +2 -1
  102. package/dist/context/{context/context-data.d.ts → helpers/webgl-context-data.d.ts} +2 -3
  103. package/dist/context/helpers/webgl-context-data.d.ts.map +1 -0
  104. package/dist/context/helpers/webgl-context-data.js +21 -0
  105. package/dist/context/helpers/webgl-extensions.d.ts +4 -0
  106. package/dist/context/helpers/webgl-extensions.d.ts.map +1 -0
  107. package/dist/context/helpers/webgl-extensions.js +10 -0
  108. package/dist/context/parameters/unified-parameter-api.d.ts +3 -4
  109. package/dist/context/parameters/unified-parameter-api.d.ts.map +1 -1
  110. package/dist/context/parameters/unified-parameter-api.js +7 -11
  111. package/dist/context/parameters/webgl-parameter-tables.d.ts +12 -13
  112. package/dist/context/parameters/webgl-parameter-tables.d.ts.map +1 -1
  113. package/dist/context/parameters/webgl-parameter-tables.js +302 -295
  114. package/dist/context/state-tracker/deep-array-equal.d.ts.map +1 -1
  115. package/dist/context/state-tracker/deep-array-equal.js +2 -1
  116. package/dist/context/state-tracker/track-context-state.d.ts.map +1 -1
  117. package/dist/context/state-tracker/track-context-state.js +5 -4
  118. package/dist/context/state-tracker/with-parameters.d.ts +2 -3
  119. package/dist/context/state-tracker/with-parameters.d.ts.map +1 -1
  120. package/dist/context/state-tracker/with-parameters.js +6 -8
  121. package/dist/dist.dev.js +1635 -1387
  122. package/dist/index.cjs +1766 -1534
  123. package/dist/index.cjs.map +4 -4
  124. package/dist/index.d.ts +25 -25
  125. package/dist/index.d.ts.map +1 -1
  126. package/dist/index.js +24 -23
  127. package/dist/types.d.ts.map +1 -1
  128. package/dist/types.js +2 -1
  129. package/dist.min.js +6 -6
  130. package/package.json +4 -4
  131. package/src/adapter/converters/device-parameters.ts +114 -27
  132. package/src/adapter/converters/sampler-parameters.ts +12 -3
  133. package/src/adapter/converters/shader-formats.ts +47 -22
  134. package/src/adapter/converters/texture-formats.ts +138 -114
  135. package/src/adapter/converters/vertex-formats.ts +3 -3
  136. package/src/adapter/device-helpers/webgl-device-features.ts +102 -50
  137. package/src/adapter/device-helpers/webgl-device-info.ts +28 -19
  138. package/src/adapter/device-helpers/webgl-device-limits.ts +46 -150
  139. package/src/adapter/helpers/decode-webgl-types.ts +13 -7
  140. package/src/adapter/helpers/get-shader-layout.ts +4 -3
  141. package/src/adapter/helpers/parse-shader-compiler-log.ts +10 -6
  142. package/src/adapter/helpers/set-uniform.ts +2 -1
  143. package/src/adapter/helpers/webgl-topology-utils.ts +10 -3
  144. package/src/adapter/objects/constants-to-keys.ts +2 -1
  145. package/src/adapter/objects/webgl-renderbuffer.ts +36 -14
  146. package/src/adapter/objects/webgl-resource.ts +7 -125
  147. package/src/adapter/resources/webgl-buffer.ts +4 -3
  148. package/src/adapter/resources/webgl-command-buffer.ts +5 -5
  149. package/src/adapter/resources/webgl-command-encoder.ts +14 -11
  150. package/src/adapter/resources/webgl-external-texture.ts +6 -5
  151. package/src/adapter/resources/webgl-framebuffer.ts +61 -53
  152. package/src/adapter/resources/webgl-query-set.ts +171 -0
  153. package/src/adapter/resources/webgl-render-pass.ts +20 -11
  154. package/src/adapter/resources/webgl-render-pipeline.ts +54 -54
  155. package/src/adapter/resources/webgl-sampler.ts +2 -1
  156. package/src/adapter/resources/webgl-shader.ts +12 -5
  157. package/src/adapter/resources/webgl-texture-view.ts +28 -0
  158. package/src/adapter/resources/webgl-texture.ts +14 -3
  159. package/src/adapter/resources/webgl-transform-feedback.ts +2 -7
  160. package/src/adapter/resources/webgl-vertex-array.ts +4 -3
  161. package/src/adapter/webgl-canvas-context.ts +6 -4
  162. package/src/adapter/webgl-device.ts +116 -107
  163. package/src/classic/accessor.ts +5 -4
  164. package/src/classic/clear.ts +14 -8
  165. package/src/classic/copy-and-blit.ts +11 -4
  166. package/src/classic/format-utils.ts +2 -1
  167. package/src/classic/typed-array-utils.ts +3 -7
  168. package/src/context/debug/spector.ts +9 -6
  169. package/src/context/debug/webgl-developer-tools.ts +27 -14
  170. package/src/context/{context → helpers}/create-browser-context.ts +3 -2
  171. package/src/context/helpers/webgl-context-data.ts +31 -0
  172. package/src/context/helpers/webgl-extensions.ts +17 -0
  173. package/src/context/parameters/unified-parameter-api.ts +6 -17
  174. package/src/context/parameters/webgl-parameter-tables.ts +69 -32
  175. package/src/context/state-tracker/deep-array-equal.ts +2 -1
  176. package/src/context/state-tracker/track-context-state.ts +11 -6
  177. package/src/context/state-tracker/with-parameters.ts +8 -8
  178. package/src/index.ts +7 -6
  179. package/src/types.ts +2 -1
  180. package/dist/adapter/device-helpers/device-features.d.ts +0 -6
  181. package/dist/adapter/device-helpers/device-features.d.ts.map +0 -1
  182. package/dist/adapter/device-helpers/device-features.js +0 -65
  183. package/dist/adapter/device-helpers/device-limits.d.ts +0 -50
  184. package/dist/adapter/device-helpers/device-limits.d.ts.map +0 -1
  185. package/dist/adapter/device-helpers/device-limits.js +0 -92
  186. package/dist/adapter/device-helpers/get-device-info.d.ts +0 -4
  187. package/dist/adapter/device-helpers/get-device-info.d.ts.map +0 -1
  188. package/dist/adapter/device-helpers/get-device-info.js +0 -87
  189. package/dist/context/context/context-data.d.ts.map +0 -1
  190. package/dist/context/context/context-data.js +0 -33
  191. package/src/context/context/context-data.ts +0 -44
  192. /package/dist/context/{context → helpers}/create-browser-context.d.ts +0 -0
@@ -1,7 +1,7 @@
1
- import { Resource } from '@luma.gl/core';
2
1
  import type { Device, ResourceProps } from '@luma.gl/core';
2
+ import { Resource } from '@luma.gl/core';
3
3
  import { GL } from '@luma.gl/constants';
4
- import { WebGLDevice } from '../webgl-device';
4
+ import { WebGLDevice } from "../webgl-device.js";
5
5
  /**
6
6
  * Base class for WebGL object wrappers
7
7
  */
@@ -20,28 +20,6 @@ export declare abstract class WebGLResource<Props extends ResourceProps> extends
20
20
  }): this;
21
21
  bind(funcOrHandle?: any): any;
22
22
  unbind(): void;
23
- /**
24
- * Query a Resource parameter
25
- *
26
- * @param name
27
- * @return param
28
- */
29
- getParameter(pname: number, props?: any): any;
30
- getParameters(options?: {
31
- parameters?: any;
32
- keys?: any;
33
- }): Record<string, any>;
34
- /**
35
- * Update a Resource setting
36
- *
37
- * @todo - cache parameter to avoid issuing WebGL calls?
38
- *
39
- * @param pname - parameter (GL constant, value or key)
40
- * @param value {GLint|GLfloat|GLenum}
41
- * @return returns self to enable chaining
42
- */
43
- setParameter(pname: GL | string, value: any): this;
44
- setParameters(parameters: Record<GL, any>): this;
45
23
  stubRemovedMethods(className: string, version: string, methodNames: string[]): void;
46
24
  initialize(props: ResourceProps): void;
47
25
  _createHandle(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"webgl-resource.d.ts","sourceRoot":"","sources":["../../../src/adapter/objects/webgl-resource.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,QAAQ,EAAkC,MAAM,eAAe,CAAC;AACxE,OAAO,KAAK,EAAC,MAAM,EAAE,aAAa,EAAC,MAAM,eAAe,CAAC;AACzD,OAAO,EAAC,EAAE,EAAC,MAAM,oBAAoB,CAAC;AACtC,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAO5C;;GAEG;AACH,8BAAsB,aAAa,CAAC,KAAK,SAAS,aAAa,CAAE,SAAQ,QAAQ,CAAC,KAAK,CAAC;IACtF,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,EAAE,EAAE,sBAAsB,CAAC;IACpC,QAAQ,CAAC,GAAG,EAAE,sBAAsB,CAAC;IACrC,OAAO,CAAC,O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evice } from '../webgl-device';
5
- // Requires full GL enum to be bundled... Make these bindings dependent on dynamic import (debug)?
6
- import { getKeyValue } from './constants-to-keys';
4
+ import { Resource, uid, stubRemovedMethods } from '@luma.gl/core';
7
5
  const ERR_RESOURCE_METHOD_UNDEFINED = 'Resource subclass must define virtual methods';
8
6
  /**
9
7
  * Base class for WebGL object wrappers
@@ -18,9 +16,9 @@ export class WebGLResource extends Resource {
18
16
  byteLength = 0;
19
17
  constructor(device, props, defaultProps) {
20
18
  super(device, props, defaultProps);
21
- this.device = WebGLDevice.attach(device);
19
+ this.device = device;
22
20
  const gl = this.device.gl;
23
- // extends
21
+ // extends
24
22
  const { id } = props || {};
25
23
  this.gl = gl;
26
24
  this.gl2 = gl;
@@ -63,7 +61,7 @@ export class WebGLResource extends Resource {
63
61
  // @ts-expect-error
64
62
  if (children && deleteChildren) {
65
63
  // @ts-expect-error
66
- children.filter(Boolean).forEach((child) => child.destroy());
64
+ children.filter(Boolean).forEach(child => child.destroy());
67
65
  }
68
66
  return this;
69
67
  }
@@ -88,99 +86,6 @@ export class WebGLResource extends Resource {
88
86
  unbind() {
89
87
  this.bind(null);
90
88
  }
91
- /**
92
- * Query a Resource parameter
93
- *
94
- * @param name
95
- * @return param
96
- */
97
- getParameter(pname, props = {}) {
98
- pname = getKeyValue(this.gl, pname);
99
- assert(pname);
100
- // @ts-expect-error
101
- const parameters = this.constructor.PARAMETERS || {};
102
- // Use parameter definitions to handle unsupported parameters
103
- const parameter = parameters[pname];
104
- if (parameter) {
105
- // Check if we can query for this parameter
106
- const parameterAvailable = (!('extension' in parameter) || this.gl.getExtension(parameter.extension));
107
- if (!parameterAvailable) {
108
- return parameter.webgl2;
109
- }
110
- }
111
- // If unknown parameter - Could be a valid parameter not covered by PARAMS
112
- // Attempt to query for it and let WebGL report errors
113
- return this._getParameter(pname, props);
114
- }
115
- // Many resources support a getParameter call -
116
- // getParameters will get all parameters - slow but useful for debugging
117
- // eslint-disable-next-line complexity
118
- getParameters(options = {}) {
119
- const { parameters, keys } = options;
120
- // Get parameter definitions for this Resource
121
- // @ts-expect-error
122
- const PARAMETERS = this.constructor.PARAMETERS || {};
123
- const values = {};
124
- // Query all parameters if no list provided
125
- const parameterKeys = parameters || Object.keys(PARAMETERS);
126
- // WEBGL limits
127
- for (const pname of parameterKeys) {
128
- const parameter = PARAMETERS[pname];
129
- // Check if this parameter is available on this platform
130
- const parameterAvailable = parameter &&
131
- (!('extension' in parameter) || this.gl.getExtension(parameter.extension));
132
- if (parameterAvailable) {
133
- const key = keys ? this.device.getGLKey(pname) : pname;
134
- values[key] = this.getParameter(pname, options);
135
- if (keys && parameter.type === 'GLenum') {
136
- values[key] = this.device.getGLKey(values[key]);
137
- }
138
- }
139
- }
140
- return values;
141
- }
142
- /**
143
- * Update a Resource setting
144
- *
145
- * @todo - cache parameter to avoid issuing WebGL calls?
146
- *
147
- * @param pname - parameter (GL constant, value or key)
148
- * @param value {GLint|GLfloat|GLenum}
149
- * @return returns self to enable chaining
150
- */
151
- setParameter(pname, value) {
152
- pname = getKeyValue(this.gl, pname);
153
- assert(pname);
154
- // @ts-expect-error
155
- const parameters = this.constructor.PARAMETERS || {};
156
- const parameter = parameters[pname];
157
- if (parameter) {
158
- // Check if this parameter is available on this platform
159
- const parameterAvailable = (!('extension' in parameter) || this.gl.getExtension(parameter.extension));
160
- if (!parameterAvailable) {
161
- throw new Error('Parameter not available on this platform');
162
- }
163
- // Handle string keys
164
- if (parameter.type === 'GLenum') {
165
- // @ts-expect-error
166
- value = getKeyValue(value);
167
- }
168
- }
169
- // If unknown parameter - Could be a valid parameter not covered by PARAMS
170
- // attempt to set it and let WebGL report errors
171
- this._setParameter(pname, value);
172
- return this;
173
- }
174
- /*
175
- * Batch update resource parameters
176
- * Assumes the subclass supports a setParameter call
177
- */
178
- setParameters(parameters) {
179
- for (const pname in parameters) {
180
- this.setParameter(pname, parameters[pname]);
181
- }
182
- return this;
183
- }
184
89
  // Install stubs for removed methods
185
90
  stubRemovedMethods(className, version, methodNames) {
186
91
  return stubRemovedMethods(this, className, version, methodNames);
@@ -1,7 +1,7 @@
1
1
  import type { BufferProps } from '@luma.gl/core';
2
2
  import { Buffer } from '@luma.gl/core';
3
3
  import { GL } from '@luma.gl/constants';
4
- import { WebGLDevice } from '../webgl-device';
4
+ import { WebGLDevice } from "../webgl-device.js";
5
5
  /** WebGL Buffer interface */
6
6
  export declare class WEBGLBuffer extends Buffer {
7
7
  readonly device: WebGLDevice;
@@ -1 +1 @@
1
- {"version":3,"file":"webgl-buffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgl-buffer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAC,MAAM,EAAS,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAC,EAAE,EAAC,MAAM,oBAAoB,CAAC;AACtC,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAE5C,6BAA6B;AAC7B,qBAAa,WAAY,SAAQ,MAAM;IACrC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,EAAE,EAAE,sBAAsB,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAE7B,kDAAkD;IAClD,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,YAAY,GAAG,EAAE,CAAC,oBAAoB,GAAG,EAAE,CAAC,cAAc,CAAC;IACjF,mEAAmE;IACnE,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,GAAG,EAAE,CAAC,YAAY,CAAC;IACnD,yEAAyE;IACzE,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC,cAAc,GAAG,EAAE,CAAC,YAAY,CAAqB;IAE9E,2DAA2D;IAC3D,UAAU,EAAE,MAAM,CAAC;IACnB,2BAA2B;IAC3B,SAAS,EAAE,MAAM,CAAC;gBAEN,MAAM,EAAE,WAAW,EAAE,KAAK,GAAE,W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GAAG,EAAE,CAAC,YAAY,CAAqB;IAE9E,2DAA2D;IAC3D,UAAU,EAAE,MAAM,CAAC;IACnB,2BAA2B;IAC3B,SAAS,EAAE,MAAM,CAAC;gBAEN,MAAM,EAAE,WAAW,EAAE,KAAK,GAAE,WAAgB;IA2BxD,sEAAsE;IACtE,aAAa,CACX,IAAI,EAAE,WAAW,GAAG,eAAe,EACnC,UAAU,GAAE,MAAU,EACtB,UAAU,GAAE,MAAqC,GAChD,IAAI;IAgBP,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IA2BpC,OAAO,IAAI,IAAI;IAWf,KAAK,CAAC,IAAI,EAAE,eAAe,EAAE,UAAU,GAAE,MAAU,GAAG,IAAI;IAmBnE,+CAA+C;IAChC,SAAS,CAAC,UAAU,SAAI,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAIlF,2DAA2D;IAClD,aAAa,CAAC,UAAU,SAAI,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,UAAU;CAexE"}
@@ -1,4 +1,5 @@
1
- // luma.gl, MIT license
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
2
3
  // Copyright (c) vis.gl contributors
3
4
  import { Buffer, assert } from '@luma.gl/core';
4
5
  import { GL } from '@luma.gl/constants';
@@ -12,7 +13,7 @@ export class WEBGLBuffer extends Buffer {
12
13
  /** Usage is a hint on how frequently the buffer will be updates */
13
14
  glUsage;
14
15
  /** Index type is needed when issuing draw calls, so we pre-compute it */
15
- glIndexType = GL.UNSIGNED_SHORT;
16
+ glIndexType = 5123;
16
17
  /** Number of bytes allocated on the GPU for this buffer */
17
18
  byteLength;
18
19
  /** Number of bytes used */
@@ -29,7 +30,7 @@ export class WEBGLBuffer extends Buffer {
29
30
  // - In WebGL2, we can use GL.COPY_READ_BUFFER which avoids locking the type here
30
31
  this.glTarget = getWebGLTarget(this.props.usage);
31
32
  this.glUsage = getWebGLUsage(this.props.usage);
32
- this.glIndexType = this.props.indexType === 'uint32' ? GL.UNSIGNED_INT : GL.UNSIGNED_SHORT;
33
+ this.glIndexType = this.props.indexType === 'uint32' ? 5125 : 5123;
33
34
  // Set data: (re)initializes the buffer
34
35
  if (props.data) {
35
36
  this._initWithData(props.data, props.byteOffset, props.byteLength);
@@ -88,7 +89,7 @@ export class WEBGLBuffer extends Buffer {
88
89
  const byteLength = undefined; // data.byteLength;
89
90
  // Create the buffer - binding it here for the first time locks the type
90
91
  // In WebGL2, use GL.COPY_WRITE_BUFFER to avoid locking the type
91
- const glTarget = GL.COPY_WRITE_BUFFER;
92
+ const glTarget = 36663;
92
93
  this.gl.bindBuffer(glTarget, this.handle);
93
94
  // WebGL2: subData supports additional srcOffset and length parameters
94
95
  if (srcOffset !== 0 || byteLength !== undefined) {
@@ -110,9 +111,9 @@ export class WEBGLBuffer extends Buffer {
110
111
  const data = new Uint8Array(byteLength);
111
112
  const dstOffset = 0;
112
113
  // Use GL.COPY_READ_BUFFER to avoid disturbing other targets and locking type
113
- this.gl.bindBuffer(GL.COPY_READ_BUFFER, this.handle);
114
- this.gl.getBufferSubData(GL.COPY_READ_BUFFER, byteOffset, data, dstOffset, byteLength);
115
- this.gl.bindBuffer(GL.COPY_READ_BUFFER, null);
114
+ this.gl.bindBuffer(36662, this.handle);
115
+ this.gl.getBufferSubData(36662, byteOffset, data, dstOffset, byteLength);
116
+ this.gl.bindBuffer(36662, null);
116
117
  // Update local `data` if offsets are 0
117
118
  this._setDebugData(data, byteOffset, byteLength);
118
119
  return data;
@@ -144,28 +145,28 @@ export class WEBGLBuffer extends Buffer {
144
145
  */
145
146
  function getWebGLTarget(usage) {
146
147
  if (usage & Buffer.INDEX) {
147
- return GL.ELEMENT_ARRAY_BUFFER;
148
+ return 34963;
148
149
  }
149
150
  if (usage & Buffer.VERTEX) {
150
- return GL.ARRAY_BUFFER;
151
+ return 34962;
151
152
  }
152
153
  if (usage & Buffer.UNIFORM) {
153
- return GL.UNIFORM_BUFFER;
154
+ return 35345;
154
155
  }
155
156
  // Binding a buffer for the first time locks the type
156
157
  // In WebGL2, we can use GL.COPY_WRITE_BUFFER to avoid locking the type
157
- return GL.ARRAY_BUFFER;
158
+ return 34962;
158
159
  }
159
160
  /** @todo usage is not passed correctly */
160
161
  function getWebGLUsage(usage) {
161
162
  if (usage & Buffer.INDEX) {
162
- return GL.STATIC_DRAW;
163
+ return 35044;
163
164
  }
164
165
  if (usage & Buffer.VERTEX) {
165
- return GL.STATIC_DRAW;
166
+ return 35044;
166
167
  }
167
168
  if (usage & Buffer.UNIFORM) {
168
- return GL.DYNAMIC_DRAW;
169
+ return 35048;
169
170
  }
170
- return GL.STATIC_DRAW;
171
+ return 35044;
171
172
  }
@@ -1,7 +1,7 @@
1
1
  import type { CopyBufferToBufferOptions, CopyBufferToTextureOptions, CopyTextureToBufferOptions, CopyTextureToTextureOptions } from '@luma.gl/core';
2
2
  import { CommandBuffer } from '@luma.gl/core';
3
3
  import { GL } from '@luma.gl/constants';
4
- import { WebGLDevice } from '../webgl-device';
4
+ import { WebGLDevice } from "../webgl-device.js";
5
5
  type CopyBufferToBufferCommand = {
6
6
  name: 'copy-buffer-to-buffer';
7
7
  options: CopyBufferToBufferOptions;
@@ -1 +1 @@
1
- {"version":3,"file":"webgl-command-buffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgl-command-buffer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,aAAa,EAAuB,MAAM,eAAe,CAAC;AAClE,OAAO,EAAC,EAAE,EAAC,MAAM,oBAAoB,CAAC;AAEtC,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAU5C,KAAK,yBAAyB,GAAG;IAC/B,IAAI,EAAE,uBAAuB,CAAC;IAC9B,OAAO,EAAE,yBAAyB,CAAC;CACpC,CAAC;AAEF,KAAK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,IAAI,EAAE,wBAAwB,CAAC;IAC/B,OAAO,EAAE,0BAA0B,CAAC;CACrC,CAAC;AAEF,KAAK,0BAA0B,GAAG;IAChC,IAAI,EAAE,wBAAwB,CAAC;IAC/B,OAAO,EAAE,0BAA0B,CAAC;CACrC,CAAC;AAEF,KAAK,2BAA2B,GAAG;IACjC,IAAI,EAAE,yBAAyB,CAAC;IAChC,OAAO,EAAE,2BAA2B,CAAC;CACtC,CAAC;AAEF,KAAK,OAAO,GACR,yBAAyB,GACzB,0BAA0B,GAC1B,0BAA0B,GAC1B,2BAA2B,CAAC;AAEhC,qBAAa,kBAAmB,SAAQ,aAAa;IACnD,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,OAAO,EAAE,CAAM;gBAEb,MAAM,EAAE,WAAW;IAK/B,cAAc,CAAC,QAAQ,GAAE,OAAO,EAAkB;CAkBnD;AA6PD,wBAAgB,oBAAoB,CAAC,MAAM,KAAA,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAmB1D;AAGD,wBAAgB,aAAa,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAcjD"}
@@ -1,9 +1,10 @@
1
- // luma.gl, MIT license
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
2
3
  // Copyright (c) vis.gl contributors
3
4
  import { CommandBuffer, Texture } from '@luma.gl/core';
4
5
  import { GL } from '@luma.gl/constants';
5
- import { WEBGLTexture } from './webgl-texture';
6
- import { getWebGLTextureParameters } from '../converters/texture-formats';
6
+ import { WEBGLTexture } from "./webgl-texture.js";
7
+ import { getWebGLTextureParameters } from "../converters/texture-formats.js";
7
8
  function cast(value) {
8
9
  return value;
9
10
  }
@@ -38,11 +39,11 @@ function _copyBufferToBuffer(device, options) {
38
39
  const destination = cast(options.destination);
39
40
  // {In WebGL2 we can p}erform the copy on the GPU
40
41
  // Use GL.COPY_READ_BUFFER+GL.COPY_WRITE_BUFFER avoid disturbing other targets and locking type
41
- device.gl.bindBuffer(GL.COPY_READ_BUFFER, source.handle);
42
- device.gl.bindBuffer(GL.COPY_WRITE_BUFFER, destination.handle);
43
- device.gl.copyBufferSubData(GL.COPY_READ_BUFFER, GL.COPY_WRITE_BUFFER, options.sourceOffset ?? 0, options.destinationOffset ?? 0, options.size);
44
- device.gl.bindBuffer(GL.COPY_READ_BUFFER, null);
45
- device.gl.bindBuffer(GL.COPY_WRITE_BUFFER, null);
42
+ device.gl.bindBuffer(36662, source.handle);
43
+ device.gl.bindBuffer(36663, destination.handle);
44
+ device.gl.copyBufferSubData(36662, 36663, options.sourceOffset ?? 0, options.destinationOffset ?? 0, options.size);
45
+ device.gl.bindBuffer(36662, null);
46
+ device.gl.bindBuffer(36663, null);
46
47
  }
47
48
  /**
48
49
  * Copies data from a Buffer object into a Texture object
@@ -98,7 +99,7 @@ function _copyTextureToBuffer(device, options) {
98
99
  const webglBuffer = destination;
99
100
  const sourceWidth = width || framebuffer.width;
100
101
  const sourceHeight = height || framebuffer.height;
101
- const sourceParams = getWebGLTextureParameters(framebuffer.texture.format);
102
+ const sourceParams = getWebGLTextureParameters(framebuffer.texture.props.format);
102
103
  const sourceFormat = sourceParams.dataFormat;
103
104
  const sourceType = sourceParams.type;
104
105
  // if (!target) {
@@ -108,13 +109,13 @@ function _copyTextureToBuffer(device, options) {
108
109
  // const byteLength = byteOffset + sourceWidth * sourceHeight * components * byteCount;
109
110
  // target = device.createBuffer({byteLength});
110
111
  // }
111
- device.gl.bindBuffer(GL.PIXEL_PACK_BUFFER, webglBuffer.handle);
112
- device.gl.bindFramebuffer(GL.FRAMEBUFFER, framebuffer.handle);
112
+ device.gl.bindBuffer(35051, webglBuffer.handle);
113
+ device.gl.bindFramebuffer(36160, framebuffer.handle);
113
114
  device.gl.readPixels(origin[0], origin[1], sourceWidth, sourceHeight, sourceFormat, sourceType, byteOffset);
114
115
  }
115
116
  finally {
116
- device.gl.bindBuffer(GL.PIXEL_PACK_BUFFER, null);
117
- device.gl.bindFramebuffer(GL.FRAMEBUFFER, null);
117
+ device.gl.bindBuffer(35051, null);
118
+ device.gl.bindFramebuffer(36160, null);
118
119
  if (destroyFramebuffer) {
119
120
  framebuffer.destroy();
120
121
  }
@@ -153,7 +154,7 @@ function _copyTextureToTexture(device, options) {
153
154
  /** Defines the origin of the copy - the minimum corner of the texture sub-region to copy to/from. */
154
155
  origin = [0, 0],
155
156
  /** Texture to copy to/from. */
156
- destination,
157
+ destination
157
158
  /** Mip-map level of the texture to copy to/from. (Default 0) */
158
159
  // destinationMipLevel = options.mipLevel,
159
160
  /** Defines the origin of the copy - the minimum corner of the texture sub-region to copy to/from. */
@@ -161,11 +162,11 @@ function _copyTextureToTexture(device, options) {
161
162
  /** Defines which aspects of the texture to copy to/from. */
162
163
  // destinationAspect = options.aspect,
163
164
  } = options;
164
- let { width = options.destination.width, height = options.destination.width,
165
+ let { width = options.destination.width, height = options.destination.width
165
166
  // depthOrArrayLayers = 0
166
167
  } = options;
167
168
  const destinationMipmaplevel = 0;
168
- const destinationInternalFormat = GL.RGBA;
169
+ const destinationInternalFormat = 6408;
169
170
  const { framebuffer, destroyFramebuffer } = getFramebuffer(source);
170
171
  const [sourceX, sourceY] = origin;
171
172
  const isSubCopy = false;
@@ -175,7 +176,7 @@ function _copyTextureToTexture(device, options) {
175
176
  // destinationX = destinationX || 0;
176
177
  // destinationY = destinationY || 0;
177
178
  // destinationZ = destinationZ || 0;
178
- device.gl.bindFramebuffer(GL.FRAMEBUFFER, framebuffer.handle);
179
+ device.gl.bindFramebuffer(36160, framebuffer.handle);
179
180
  // TODO - support gl.readBuffer (WebGL2 only)
180
181
  // const prevBuffer = gl.readBuffer(attachment);
181
182
  let texture = null;
@@ -239,18 +240,18 @@ function _copyTextureToTexture(device, options) {
239
240
  // Returns number of components in a specific readPixels WebGL format
240
241
  export function glFormatToComponents(format) {
241
242
  switch (format) {
242
- case GL.ALPHA:
243
- case GL.R32F:
244
- case GL.RED:
243
+ case 6406:
244
+ case 33326:
245
+ case 6403:
245
246
  return 1;
246
- case GL.RG32F:
247
- case GL.RG:
247
+ case 33328:
248
+ case 33319:
248
249
  return 2;
249
- case GL.RGB:
250
- case GL.RGB32F:
250
+ case 6407:
251
+ case 34837:
251
252
  return 3;
252
- case GL.RGBA:
253
- case GL.RGBA32F:
253
+ case 6408:
254
+ case 34836:
254
255
  return 4;
255
256
  // TODO: Add support for additional WebGL2 formats
256
257
  default:
@@ -260,13 +261,13 @@ export function glFormatToComponents(format) {
260
261
  // Return byte count for given readPixels WebGL type
261
262
  export function glTypeToBytes(type) {
262
263
  switch (type) {
263
- case GL.UNSIGNED_BYTE:
264
+ case 5121:
264
265
  return 1;
265
- case GL.UNSIGNED_SHORT_5_6_5:
266
- case GL.UNSIGNED_SHORT_4_4_4_4:
267
- case GL.UNSIGNED_SHORT_5_5_5_1:
266
+ case 33635:
267
+ case 32819:
268
+ case 32820:
268
269
  return 2;
269
- case GL.FLOAT:
270
+ case 5126:
270
271
  return 4;
271
272
  // TODO: Add support for additional WebGL2 types
272
273
  default:
@@ -1,7 +1,7 @@
1
1
  import { CommandEncoder, CommandEncoderProps } from '@luma.gl/core';
2
- import type { CopyBufferToBufferOptions, CopyBufferToTextureOptions, CopyTextureToBufferOptions, CopyTextureToTextureOptions } from '@luma.gl/core';
3
- import { WEBGLCommandBuffer } from './webgl-command-buffer';
4
- import { WebGLDevice } from '../webgl-device';
2
+ import type { CopyBufferToBufferOptions, CopyBufferToTextureOptions, CopyTextureToBufferOptions, CopyTextureToTextureOptions, QuerySet, Buffer } from '@luma.gl/core';
3
+ import { WEBGLCommandBuffer } from "./webgl-command-buffer.js";
4
+ import { WebGLDevice } from "../webgl-device.js";
5
5
  export declare class WEBGLCommandEncoder extends CommandEncoder {
6
6
  readonly device: WebGLDevice;
7
7
  readonly commandBuffer: WEBGLCommandBuffer;
@@ -15,5 +15,10 @@ export declare class WEBGLCommandEncoder extends CommandEncoder {
15
15
  pushDebugGroup(groupLabel: string): void;
16
16
  popDebugGroup(): void;
17
17
  insertDebugMarker(markerLabel: string): void;
18
+ resolveQuerySet(querySet: QuerySet, destination: Buffer, options?: {
19
+ firstQuery?: number;
20
+ queryCount?: number;
21
+ destinationOffset?: number;
22
+ }): void;
18
23
  }
19
24
  //# sourceMappingURL=webgl-command-encoder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"webgl-command-encoder.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgl-command-encoder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,cAAc,EAAE,mBAAmB,EAAC,MAAM,eAAe,CAAC;AAClE,OAAO,KAAK,EACV,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAC,kBAAkB,EAAC,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAE5C,qBAAa,mBAAoB,SAAQ,cAAc;IACrD,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAE7B,QAAQ,CAAC,aAAa,EAAE,kBAAkB,CAAC;gBAE/B,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,mBAAmB;IAMlD,OAAO,IAAI,IAAI;IAEf,MAAM,IAAI,IAAI;IAQvB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,IAAI;IAI5D,mBAAmB,CAAC,OAAO,EAAE,0BAA0B;IAIvD,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,IAAI;IAI9D,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,GAAG,IAAI;IAIvD,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IACxC,aAAa;IAEb,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;CAWtD"}
1
+ {"version":3,"file":"webgl-command-encoder.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgl-command-encoder.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,cAAc,EAAE,mBAAmB,EAAC,MAAM,eAAe,CAAC;AAClE,OAAO,KAAK,EACV,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,2BAA2B,EAC3B,QAAQ,EACR,MAAM,EACP,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAC,kBAAkB,EAAC,kCAA+B;AAC1D,OAAO,EAAC,WAAW,EAAC,2BAAwB;AAE5C,qBAAa,mBAAoB,SAAQ,cAAc;IACrD,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAE7B,QAAQ,CAAC,aAAa,EAAE,kBAAkB,CAAC;gBAE/B,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,mBAAmB;IAMlD,OAAO,IAAI,IAAI;IAEf,MAAM,IAAI,IAAI;IAQvB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,IAAI;IAI5D,mBAAmB,CAAC,OAAO,EAAE,0BAA0B;IAIvD,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,IAAI;IAI9D,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,GAAG,IAAI;IAIvD,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IACxC,aAAa;IAEb,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAE5C,eAAe,CACtB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE;QACR,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B,GACA,IAAI;CACR"}
@@ -1,7 +1,8 @@
1
- // luma.gl, MIT license
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
2
3
  // Copyright (c) vis.gl contributors
3
4
  import { CommandEncoder } from '@luma.gl/core';
4
- import { WEBGLCommandBuffer } from './webgl-command-buffer';
5
+ import { WEBGLCommandBuffer } from "./webgl-command-buffer.js";
5
6
  export class WEBGLCommandEncoder extends CommandEncoder {
6
7
  device;
7
8
  commandBuffer;
@@ -32,4 +33,5 @@ export class WEBGLCommandEncoder extends CommandEncoder {
32
33
  pushDebugGroup(groupLabel) { }
33
34
  popDebugGroup() { }
34
35
  insertDebugMarker(markerLabel) { }
36
+ resolveQuerySet(querySet, destination, options) { }
35
37
  }
@@ -1,4 +1,5 @@
1
- // luma.gl, MIT license
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
2
3
  // Copyright (c) vis.gl contributors
3
4
  /*
4
5
  export class WEBGLExternalTexture extends WEBGLTexture {
@@ -51,12 +52,12 @@ export class WEBGLExternalTexture extends WEBGLTexture {
51
52
  }
52
53
 
53
54
  // eslint-disable-next-line max-statements
54
- constructor(device: Device | WebGL2RenderingContext, props: TextureProps) {
55
- super(WebGLDevice.attach(device), {id: uid('texture'), ...props});
55
+ constructor(device: Device , props: TextureProps) {
56
+ super(device as WebGLDevice, {id: uid('texture'), ...props});
56
57
 
57
58
  this.glTarget = getWebGLTextureTarget(props);
58
59
 
59
- this.device = WebGLDevice.attach(device);
60
+ this.device = device as WebGLDevice;
60
61
  this.gl = this.device.gl;
61
62
  this.gl2 = this.device.gl2;
62
63
  this.handle = this.props.handle || this.gl.createTexture();
@@ -90,4 +91,4 @@ export class WEBGLExternalTexture extends WEBGLTexture {
90
91
  }
91
92
 
92
93
 
93
- */
94
+ */
@@ -1,22 +1,19 @@
1
1
  import type { FramebufferProps, TextureFormat } from '@luma.gl/core';
2
2
  import { Framebuffer, Texture } from '@luma.gl/core';
3
3
  import { GL } from '@luma.gl/constants';
4
- import { WebGLDevice } from '../webgl-device';
5
- import { WEBGLTexture } from './webgl-texture';
6
- import { WEBGLRenderbuffer } from '../objects/webgl-renderbuffer';
7
- export type TextureAttachment = [Texture, number?, number?];
8
- export type Attachment = WEBGLTexture | WEBGLRenderbuffer | TextureAttachment;
4
+ import { WebGLDevice } from "../webgl-device.js";
5
+ import { WEBGLTexture } from "./webgl-texture.js";
6
+ import { WEBGLTextureView } from "./webgl-texture-view.js";
7
+ export type Attachment = WEBGLTextureView | WEBGLTexture;
9
8
  /** luma.gl Framebuffer, WebGL implementation */
10
9
  export declare class WEBGLFramebuffer extends Framebuffer {
11
10
  device: WebGLDevice;
12
11
  gl: WebGL2RenderingContext;
13
12
  handle: WebGLFramebuffer;
14
- get texture(): Texture<import("@luma.gl/core").TextureProps>;
13
+ get texture(): import("@luma.gl/core").TextureView;
15
14
  constructor(device: WebGLDevice, props: FramebufferProps);
16
15
  /** destroys any auto created resources etc. */
17
16
  destroy(): void;
18
- /** Check the status */
19
- protected _checkStatus(): void;
20
17
  /** In WebGL we must use renderbuffers for depth/stencil attachments (unless we have extensions) */
21
18
  protected createDepthStencilTexture(format: TextureFormat): Texture;
22
19
  /**
@@ -24,8 +21,7 @@ export declare class WEBGLFramebuffer extends Framebuffer {
24
21
  */
25
22
  protected resizeAttachments(width: number, height: number): this;
26
23
  /** Attach one attachment */
27
- protected _attachOne(attachmentPoint: GL, attachment: Attachment): WEBGLTexture | WEBGLRenderbuffer;
28
- protected _attachWEBGLRenderbuffer(attachment: GL, renderbuffer: WEBGLRenderbuffer): void;
24
+ protected _attachOne(attachmentPoint: GL, attachment: Attachment): WEBGLTexture;
29
25
  /**
30
26
  * @param attachment
31
27
  * @param texture
@@ -1 +1 @@
1
- {"version":3,"file":"webgl-framebuffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/webgl-framebuffer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,eAAe,CAAC;AACnE,OAAO,EAAC,WAAW,EAAE,OAAO,EAAS,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,EAAE,EAAC,MAAM,oBAAoB,CAAC;AACtC,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;A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