@geastack/native-webgl-angle 0.1.16 → 0.1.17

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.
@@ -16,6 +16,9 @@ export const nativeUploadFunctions = [
16
16
  ['threeWebGLTexImage3D', 'gea_three_webgl_tex_image_3d_native', ['target', 'level', 'internalFormat', 'width', 'height', 'depth', 'format', 'type'], 'gea_three_webgl_tex_image_3d_bytes', ['target', 'level', 'internalFormat', 'width', 'height', 'depth', 'format', 'type'], textureElementKind],
17
17
  ['threeWebGLTexSubImage3D', 'gea_three_webgl_tex_sub_image_3d_native', ['target', 'level', 'xoffset', 'yoffset', 'zoffset', 'width', 'height', 'depth', 'format', 'type'], 'gea_three_webgl_tex_sub_image_3d_bytes', ['target', 'level', 'xoffset', 'yoffset', 'zoffset', 'width', 'height', 'depth', 'format', 'type'], textureElementKind],
18
18
  ['threeWebGLTexSubImage2D', 'gea_three_webgl_tex_sub_image_2d_native', ['target', 'level', 'xoffset', 'yoffset', 'width', 'height', 'format', 'type'], 'gea_three_webgl_tex_sub_image_2d_bytes', ['target', 'level', 'xoffset', 'yoffset', 'width', 'height', 'format', 'type'], textureElementKind],
19
+ // Compressed blocks are opaque bytes.
20
+ ['threeWebGLCompressedTexImage2D', 'gea_three_webgl_compressed_tex_image_2d_native', ['target', 'level', 'internalFormat', 'width', 'height'], 'gea_three_webgl_compressed_tex_image_2d_bytes', ['target', 'level', 'internalFormat', 'width', 'height'], '4'],
21
+ ['threeWebGLCompressedTexSubImage2D', 'gea_three_webgl_compressed_tex_sub_image_2d_native', ['target', 'level', 'xoffset', 'yoffset', 'width', 'height', 'format'], 'gea_three_webgl_compressed_tex_sub_image_2d_bytes', ['target', 'level', 'xoffset', 'yoffset', 'width', 'height', 'format'], '4'],
19
22
  ].map(([name, binding, parameters, raw, rawParameters, kind, range]) => {
20
23
  const declaration = `extern "C" void ${raw}(${rawParameters.map(p => `double ${p}`).join(', ')}, const void* bytes, double byteLength);
21
24
  template <typename Source> inline void ${binding}(${parameters.map(p => `double ${p}`).join(', ')}, const Source& values${range ? ', double sourceOffset, double length' : ''}) {
package/geatsc-plugin.mjs CHANGED
@@ -138,6 +138,18 @@ inline double gea_three_resource_read_native(std::string name, const gea::Ref<ge
138
138
  ['threeWebGLTimerEnd','gea_three_webgl_timer_end','void','extern "C" void gea_three_webgl_timer_end();'],
139
139
  ['threeWebGLTimerResult','gea_three_webgl_timer_result','double','extern "C" double gea_three_webgl_timer_result(double);'],
140
140
  ['threeWebGLRenderbufferStorageMultisample','gea_three_webgl_renderbuffer_storage_multisample','void','extern "C" void gea_three_webgl_renderbuffer_storage_multisample(double,double,double,double,double);'],
141
+ [
142
+ "threeWebGLPushDebugGroup",
143
+ "gea_three_webgl_push_debug_group",
144
+ "void",
145
+ 'extern "C" void gea_three_webgl_push_debug_group(std::string label);',
146
+ ],
147
+ [
148
+ "threeWebGLPopDebugGroup",
149
+ "gea_three_webgl_pop_debug_group",
150
+ "void",
151
+ 'extern "C" void gea_three_webgl_pop_debug_group();',
152
+ ],
141
153
  [
142
154
  "threeNativeProfilePhase",
143
155
  "gea_three_native_profile_phase",
@@ -2123,8 +2135,29 @@ const transformSource = ({ fileName, text }) => {
2123
2135
  if (normalized.endsWith("/three/src/renderers/WebGLRenderer.js")) {
2124
2136
  transformed =
2125
2137
  // Forward slashes: a Windows path's backslashes would be escapes in this literal.
2126
- `import { nativeProfilePhase } from '${fileURLToPath(new URL("./src/nativeWebGLHost.ts", import.meta.url)).replaceAll("\\", "/")}';\n` +
2138
+ `import { nativeProfilePhase, nativePushDebugGroup, nativePopDebugGroup } from '${fileURLToPath(new URL("./src/nativeWebGLHost.ts", import.meta.url)).replaceAll("\\", "/")}';\n` +
2127
2139
  transformed;
2140
+ transformed = replaceOne(
2141
+ transformed,
2142
+ "\t\t\tif ( _isContextLost === true ) return;\n",
2143
+ "\t\t\tif ( _isContextLost === true ) return;\n\n\t\t\tnativePushDebugGroup( scene.name !== '' ? scene.name : ( camera.name !== '' ? camera.name : scene.type ) );\n",
2144
+ fileName,
2145
+ "WebGLRenderer render debug group begin",
2146
+ );
2147
+ transformed = replaceOne(
2148
+ transformed,
2149
+ "\t\t\t\t_nodesHandler.renderEnd();\n\n\t\t\t}\n\n\t\t};",
2150
+ "\t\t\t\t_nodesHandler.renderEnd();\n\n\t\t\t}\n\n\t\t\tnativePopDebugGroup();\n\n\t\t};",
2151
+ fileName,
2152
+ "WebGLRenderer render debug group end",
2153
+ );
2154
+ transformed = replaceOne(
2155
+ transformed,
2156
+ "\t\t\tif ( opaqueObjects.length > 0 ) renderObjects( opaqueObjects, scene, camera );\n\t\t\tif ( transmissiveObjects.length > 0 ) renderObjects( transmissiveObjects, scene, camera );\n\t\t\tif ( transparentObjects.length > 0 ) renderObjects( transparentObjects, scene, camera );\n",
2157
+ "\t\t\tif ( opaqueObjects.length > 0 ) {\n\n\t\t\t\tnativePushDebugGroup( 'opaque' );\n\t\t\t\trenderObjects( opaqueObjects, scene, camera );\n\t\t\t\tnativePopDebugGroup();\n\n\t\t\t}\n\n\t\t\tif ( transmissiveObjects.length > 0 ) {\n\n\t\t\t\tnativePushDebugGroup( 'transmissive' );\n\t\t\t\trenderObjects( transmissiveObjects, scene, camera );\n\t\t\t\tnativePopDebugGroup();\n\n\t\t\t}\n\n\t\t\tif ( transparentObjects.length > 0 ) {\n\n\t\t\t\tnativePushDebugGroup( 'transparent' );\n\t\t\t\trenderObjects( transparentObjects, scene, camera );\n\t\t\t\tnativePopDebugGroup();\n\n\t\t\t}\n",
2158
+ fileName,
2159
+ "WebGLRenderer render list debug groups",
2160
+ );
2128
2161
  transformed = replaceOne(
2129
2162
  transformed,
2130
2163
  "if ( scene.matrixWorldAutoUpdate === true ) scene.updateMatrixWorld();",
@@ -6426,6 +6459,23 @@ ${wiringText.replace(/\t\t\t\t/g, "\t\t\t\t")}
6426
6459
  );
6427
6460
  }
6428
6461
  if (normalized.endsWith("/three/src/renderers/webgl/WebGLShadowMap.js")) {
6462
+ transformed =
6463
+ `import { nativePushDebugGroup, nativePopDebugGroup } from '${fileURLToPath(new URL("./src/nativeWebGLHost.ts", import.meta.url)).replaceAll("\\", "/")}';\n` +
6464
+ transformed;
6465
+ transformed = replaceOne(
6466
+ transformed,
6467
+ "\t\tif ( lights.length === 0 ) return;\n",
6468
+ "\t\tif ( lights.length === 0 ) return;\n\n\t\tnativePushDebugGroup( 'shadow map' );\n",
6469
+ fileName,
6470
+ "WebGLShadowMap debug group begin",
6471
+ );
6472
+ transformed = replaceOne(
6473
+ transformed,
6474
+ "\t\tscope.needsUpdate = false;\n\n\t\trenderer.setRenderTarget( currentRenderTarget, activeCubeFace, activeMipmapLevel );\n",
6475
+ "\t\tscope.needsUpdate = false;\n\n\t\trenderer.setRenderTarget( currentRenderTarget, activeCubeFace, activeMipmapLevel );\n\n\t\tnativePopDebugGroup();\n",
6476
+ fileName,
6477
+ "WebGLShadowMap debug group end",
6478
+ );
6429
6479
  // An app that replaces `shadowMap.render` (the browser's cached sun shadow)
6430
6480
  // cannot do so natively: the field holds a `this`-bound function expression
6431
6481
  // no app function converts to. This hook is an ordinary function-typed
@@ -433,6 +433,8 @@ using PFNGLTEXSUBIMAGE3DPROC = void (*)(GLenum, GLint, GLint, GLint, GLint, GLsi
433
433
  using PFNGLTEXSTORAGE3DPROC = void (*)(GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLsizei);
434
434
  using PFNGLFRAMEBUFFERTEXTURELAYERPROC = void (*)(GLenum, GLenum, GLuint, GLint, GLint);
435
435
  using PFNGLTEXSTORAGE2DPROC = void (*)(GLenum, GLsizei, GLenum, GLsizei, GLsizei);
436
+ using PFNGLCOMPRESSEDTEXIMAGE2DPROC = void (*)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const void *);
437
+ using PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC = void (*)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const void *);
436
438
  using PFNGLUNIFORM1FPROC = void (*)(GLint, GLfloat);
437
439
  using PFNGLUNIFORM1FVPROC = void (*)(GLint, GLsizei, const GLfloat *);
438
440
  using PFNGLUNIFORM1IPROC = void (*)(GLint, GLint);
@@ -503,6 +505,8 @@ struct AngleWebGLState {
503
505
  PFNGLBINDBUFFERRANGEPROC glBindBufferRange = nullptr;
504
506
  PFNGLGETUNIFORMBLOCKINDEXPROC glGetUniformBlockIndex = nullptr;
505
507
  PFNGLUNIFORMBLOCKBINDINGPROC glUniformBlockBinding = nullptr;
508
+ void (*glPushGroupMarkerEXT)(GLsizei, const GLchar *) = nullptr;
509
+ void (*glPopGroupMarkerEXT)() = nullptr;
506
510
  PFNGLBINDFRAMEBUFFERPROC glBindFramebuffer = nullptr;
507
511
  PFNGLBINDRENDERBUFFERPROC glBindRenderbuffer = nullptr;
508
512
  PFNGLBINDTEXTUREPROC glBindTexture = nullptr;
@@ -587,6 +591,9 @@ struct AngleWebGLState {
587
591
  PFNGLTEXPARAMETERIPROC glTexParameteri = nullptr;
588
592
  PFNGLTEXSUBIMAGE2DPROC glTexSubImage2D = nullptr;
589
593
  PFNGLTEXSTORAGE2DPROC glTexStorage2D = nullptr;
594
+ // Compressed uploads are optional too: a GLES without them drops the call.
595
+ PFNGLCOMPRESSEDTEXIMAGE2DPROC glCompressedTexImage2D = nullptr;
596
+ PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glCompressedTexSubImage2D = nullptr;
590
597
  // Array/3D entry points are optional: a GLES without them still starts,
591
598
  // and uploads to those targets report GL_INVALID_OPERATION in the log.
592
599
  PFNGLTEXIMAGE3DPROC glTexImage3D = nullptr;
@@ -1038,10 +1045,15 @@ static bool loadGlSymbols() {
1038
1045
  LOAD_GL(glActiveTexture, PFNGLACTIVETEXTUREPROC)
1039
1046
  LOAD_GL(glAttachShader, PFNGLATTACHSHADERPROC)
1040
1047
  LOAD_GL(glBindBuffer, PFNGLBINDBUFFERPROC)
1041
- LOAD_GL(glBindBufferBase, PFNGLBINDBUFFERBASEPROC)
1042
- LOAD_GL(glBindBufferRange, PFNGLBINDBUFFERRANGEPROC)
1043
- LOAD_GL(glGetUniformBlockIndex, PFNGLGETUNIFORMBLOCKINDEXPROC)
1044
- LOAD_GL(glUniformBlockBinding, PFNGLUNIFORMBLOCKBINDINGPROC)
1048
+ // Uniform-buffer entry points are optional like the array/3D ones: a GLES
1049
+ // without them (threejs-rendozer exports none) still starts, and only a
1050
+ // program that uses uniform groups loses them, with a log line per call.
1051
+ gWebGL.glBindBufferBase = loadGl<PFNGLBINDBUFFERBASEPROC>("glBindBufferBase");
1052
+ gWebGL.glBindBufferRange = loadGl<PFNGLBINDBUFFERRANGEPROC>("glBindBufferRange");
1053
+ gWebGL.glGetUniformBlockIndex = loadGl<PFNGLGETUNIFORMBLOCKINDEXPROC>("glGetUniformBlockIndex");
1054
+ gWebGL.glUniformBlockBinding = loadGl<PFNGLUNIFORMBLOCKBINDINGPROC>("glUniformBlockBinding");
1055
+ gWebGL.glPushGroupMarkerEXT = loadGl<decltype(gWebGL.glPushGroupMarkerEXT)>("glPushGroupMarkerEXT");
1056
+ gWebGL.glPopGroupMarkerEXT = loadGl<decltype(gWebGL.glPopGroupMarkerEXT)>("glPopGroupMarkerEXT");
1045
1057
  LOAD_GL(glBindFramebuffer, PFNGLBINDFRAMEBUFFERPROC)
1046
1058
  LOAD_GL(glBindRenderbuffer, PFNGLBINDRENDERBUFFERPROC)
1047
1059
  LOAD_GL(glBindTexture, PFNGLBINDTEXTUREPROC)
@@ -1129,6 +1141,8 @@ static bool loadGlSymbols() {
1129
1141
  LOAD_GL(glTexParameteri, PFNGLTEXPARAMETERIPROC)
1130
1142
  LOAD_GL(glTexSubImage2D, PFNGLTEXSUBIMAGE2DPROC)
1131
1143
  LOAD_GL(glTexStorage2D, PFNGLTEXSTORAGE2DPROC)
1144
+ gWebGL.glCompressedTexImage2D = loadGl<PFNGLCOMPRESSEDTEXIMAGE2DPROC>("glCompressedTexImage2D");
1145
+ gWebGL.glCompressedTexSubImage2D = loadGl<PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC>("glCompressedTexSubImage2D");
1132
1146
  gWebGL.glTexImage3D = loadGl<PFNGLTEXIMAGE3DPROC>("glTexImage3D");
1133
1147
  gWebGL.glTexSubImage3D = loadGl<PFNGLTEXSUBIMAGE3DPROC>("glTexSubImage3D");
1134
1148
  gWebGL.glTexStorage3D = loadGl<PFNGLTEXSTORAGE3DPROC>("glTexStorage3D");
@@ -2414,23 +2428,35 @@ extern "C" void gea_three_webgl_draw_arrays(double mode, double first, double co
2414
2428
  extern "C" void gea_three_webgl_vertex_attrib_divisor(double index, double divisor) {
2415
2429
  geaTrapCheck("gea_three_webgl_vertex_attrib_divisor"); GEA_WEBGL_VOID("vertexAttribDivisor");
2416
2430
  gWebGL.glVertexAttribDivisor(asGLuint(index), asGLuint(divisor)); }
2431
+ static bool requireGl(const void *fn, const char *name);
2417
2432
  // Indexed binds also set the target's generic binding. The host shadows only the
2418
2433
  // ARRAY_BUFFER and COPY_READ/WRITE bindings (bindNativeBuffer), and the uniform
2419
2434
  // staging path queries UNIFORM_BUFFER_BINDING instead of shadowing it, so neither
2420
2435
  // call needs to update a shadow.
2421
2436
  extern "C" void gea_three_webgl_bind_buffer_base(double target, double index, double buffer) {
2422
2437
  geaTrapCheck("gea_three_webgl_bind_buffer_base"); GEA_WEBGL_VOID("bindBufferBase");
2438
+ if (!requireGl(reinterpret_cast<const void *>(gWebGL.glBindBufferBase), "glBindBufferBase")) return;
2423
2439
  gWebGL.glBindBufferBase(asGLenum(target), asGLuint(index), asGLuint(buffer)); }
2424
2440
  extern "C" void gea_three_webgl_bind_buffer_range(double target, double index, double buffer, double offset, double size) {
2425
2441
  geaTrapCheck("gea_three_webgl_bind_buffer_range"); GEA_WEBGL_VOID("bindBufferRange");
2442
+ if (!requireGl(reinterpret_cast<const void *>(gWebGL.glBindBufferRange), "glBindBufferRange")) return;
2426
2443
  gWebGL.glBindBufferRange(asGLenum(target), asGLuint(index), asGLuint(buffer),
2427
2444
  static_cast<GLintptr>(offset), static_cast<GLsizeiptr>(size)); }
2428
2445
  extern "C" double gea_three_webgl_get_uniform_block_index(double program, std::string name) {
2429
2446
  geaTrapCheck("gea_three_webgl_get_uniform_block_index"); GEA_WEBGL_DOUBLE("getUniformBlockIndex");
2447
+ // GL_INVALID_INDEX: the block is reported as absent.
2448
+ if (!requireGl(reinterpret_cast<const void *>(gWebGL.glGetUniformBlockIndex), "glGetUniformBlockIndex")) return 4294967295.0;
2430
2449
  return gWebGL.glGetUniformBlockIndex(asGLuint(program), name.c_str()); }
2431
2450
  extern "C" void gea_three_webgl_uniform_block_binding(double program, double blockIndex, double binding) {
2432
2451
  geaTrapCheck("gea_three_webgl_uniform_block_binding"); GEA_WEBGL_VOID("uniformBlockBinding");
2452
+ if (!requireGl(reinterpret_cast<const void *>(gWebGL.glUniformBlockBinding), "glUniformBlockBinding")) return;
2433
2453
  gWebGL.glUniformBlockBinding(asGLuint(program), asGLuint(blockIndex), asGLuint(binding)); }
2454
+ extern "C" void gea_three_webgl_push_debug_group(std::string label) {
2455
+ geaTrapCheck("gea_three_webgl_push_debug_group"); GEA_WEBGL_VOID("pushDebugGroup");
2456
+ if (gWebGL.glPushGroupMarkerEXT) gWebGL.glPushGroupMarkerEXT(static_cast<GLsizei>(label.size()), label.c_str()); }
2457
+ extern "C" void gea_three_webgl_pop_debug_group() {
2458
+ geaTrapCheck("gea_three_webgl_pop_debug_group"); GEA_WEBGL_VOID("popDebugGroup");
2459
+ if (gWebGL.glPopGroupMarkerEXT) gWebGL.glPopGroupMarkerEXT(); }
2434
2460
  extern "C" void gea_three_webgl_draw_elements_instanced(double mode, double count, double type, double offset, double instanceCount) {
2435
2461
  geaTrapCheck("gea_three_webgl_draw_elements_instanced"); GEA_WEBGL_VOID("drawElementsInstanced");
2436
2462
  gWebGL.glDrawElementsInstanced(asGLenum(mode), asGLsizei(count), asGLenum(type),
@@ -2679,6 +2705,18 @@ extern "C" void gea_three_webgl_tex_sub_image_3d_bytes(double target, double lev
2679
2705
  gWebGL.glTexSubImage3D(asGLenum(target), asGLint(level), asGLint(xoffset), asGLint(yoffset), asGLint(zoffset), asGLsizei(width), asGLsizei(height), asGLsizei(depth), asGLenum(format), asGLenum(type), bytes);
2680
2706
  }
2681
2707
 
2708
+ extern "C" void gea_three_webgl_compressed_tex_image_2d_bytes(double target, double level, double internalFormat, double width, double height, const void* bytes, double byteLength) {
2709
+ GEA_WEBGL_VOID("compressedTexImage2DBytes");
2710
+ if (!requireGl(reinterpret_cast<const void *>(gWebGL.glCompressedTexImage2D), "glCompressedTexImage2D")) return;
2711
+ gWebGL.glCompressedTexImage2D(asGLenum(target), asGLint(level), asGLenum(internalFormat), asGLsizei(width), asGLsizei(height), 0, asGLsizei(byteLength), bytes);
2712
+ }
2713
+
2714
+ extern "C" void gea_three_webgl_compressed_tex_sub_image_2d_bytes(double target, double level, double xoffset, double yoffset, double width, double height, double format, const void* bytes, double byteLength) {
2715
+ GEA_WEBGL_VOID("compressedTexSubImage2DBytes");
2716
+ if (!requireGl(reinterpret_cast<const void *>(gWebGL.glCompressedTexSubImage2D), "glCompressedTexSubImage2D")) return;
2717
+ gWebGL.glCompressedTexSubImage2D(asGLenum(target), asGLint(level), asGLint(xoffset), asGLint(yoffset), asGLsizei(width), asGLsizei(height), asGLenum(format), asGLsizei(byteLength), bytes);
2718
+ }
2719
+
2682
2720
  extern "C" void gea_three_webgl_tex_storage_3d(double target, double levels, double internalFormat, double width, double height, double depth) {
2683
2721
  GEA_WEBGL_VOID("texStorage3D");
2684
2722
  if (!requireGl(reinterpret_cast<const void *>(gWebGL.glTexStorage3D), "glTexStorage3D")) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geastack/native-webgl-angle",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "Typed native WebGL compatibility layer backed by ANGLE/Metal",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -277,6 +277,10 @@ declare function threeWebGLTexImage2D(target: number, level: number, internalFor
277
277
  /** @gea-host-inert Reads its arguments, writes GL state only; never calls back into script. */
278
278
  declare function threeWebGLTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, values: BufferSourceLike): void
279
279
  /** @gea-host-inert Reads its arguments, writes GL state only; never calls back into script. */
280
+ declare function threeWebGLCompressedTexImage2D(target: number, level: number, internalFormat: number, width: number, height: number, values: BufferSourceLike): void
281
+ /** @gea-host-inert Reads its arguments, writes GL state only; never calls back into script. */
282
+ declare function threeWebGLCompressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, values: BufferSourceLike): void
283
+ /** @gea-host-inert Reads its arguments, writes GL state only; never calls back into script. */
280
284
  declare function threeWebGLTexStorage2D(target: number, levels: number, internalFormat: number, width: number, height: number): void
281
285
  /** @gea-host-inert Reads its arguments, writes GL state only; never calls back into script. */
282
286
  declare function threeWebGLTexImage3D(target: number, level: number, internalFormat: number, width: number, height: number, depth: number, format: number, type: number, values: BufferSourceLike): void
@@ -943,7 +947,10 @@ export class NativeWebGL2RenderingContext {
943
947
  }
944
948
 
945
949
  isContextLost(): boolean { return false }
946
- getSupportedExtensions(): string[] { return ['EXT_texture_filter_anisotropic', 'OES_texture_float_linear', 'EXT_color_buffer_float'] }
950
+ getSupportedExtensions(): string[] {
951
+ return ['EXT_texture_filter_anisotropic', 'OES_texture_float_linear', 'EXT_color_buffer_float', 'WEBGL_compressed_texture_s3tc',
952
+ 'WEBGL_compressed_texture_s3tc_srgb', 'EXT_texture_compression_rgtc', 'EXT_texture_compression_bptc']
953
+ }
947
954
 
948
955
  getExtension(name: string): WebGLExtension | null {
949
956
  // One shared shape for every supported name -- see `WebGLExtension`. The
@@ -955,7 +962,11 @@ export class NativeWebGL2RenderingContext {
955
962
  name === 'WEBGL_debug_renderer_info' ||
956
963
  name === 'OES_texture_float_linear' ||
957
964
  name === 'EXT_color_buffer_float' ||
958
- name === 'EXT_color_buffer_half_float'
965
+ name === 'EXT_color_buffer_half_float' ||
966
+ name === 'WEBGL_compressed_texture_s3tc' ||
967
+ name === 'WEBGL_compressed_texture_s3tc_srgb' ||
968
+ name === 'EXT_texture_compression_rgtc' ||
969
+ name === 'EXT_texture_compression_bptc'
959
970
  ) {
960
971
  return new WebGLExtension()
961
972
  }
@@ -1154,8 +1165,12 @@ export class NativeWebGL2RenderingContext {
1154
1165
  texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: BufferSourceLike): void {
1155
1166
  threeWebGLTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels)
1156
1167
  }
1157
- compressedTexImage2D(_target: number, _level: number, _internalFormat: number, _width: number, _height: number, _border: number, _data: BufferSourceLike): void {}
1158
- compressedTexSubImage2D(_target: number, _level: number, _xoffset: number, _yoffset: number, _width: number, _height: number, _format: number, _data: BufferSourceLike): void {}
1168
+ compressedTexImage2D(target: number, level: number, internalFormat: number, width: number, height: number, _border: number, data: BufferSourceLike): void {
1169
+ threeWebGLCompressedTexImage2D(target, level, internalFormat, width, height, data)
1170
+ }
1171
+ compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: BufferSourceLike): void {
1172
+ threeWebGLCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, data)
1173
+ }
1159
1174
  compressedTexImage3D(_target: number, _level: number, _internalFormat: number, _width: number, _height: number, _depth: number, _border: number, _data: BufferSourceLike): void {}
1160
1175
  compressedTexSubImage3D(_target: number, _level: number, _xoffset: number, _yoffset: number, _zoffset: number, _width: number, _height: number, _depth: number, _format: number, _data: BufferSourceLike): void {}
1161
1176
  texStorage2D(target: number, levels: number, internalFormat: number, width: number, height: number): void {
@@ -366,6 +366,13 @@ declare function threeWebGLGetError(): number
366
366
  declare function threeNativeProfilePhase(phase: number): void
367
367
  export function nativeProfilePhase(phase: number): void { threeNativeProfilePhase(phase) }
368
368
 
369
+ export function nativePushDebugGroup(label: string): void { threeWebGLPushDebugGroup(label) }
370
+ /** @gea-host-inert Native state only; retains no script references and invokes no script. */
371
+ declare function threeWebGLPushDebugGroup(label: string): void
372
+ export function nativePopDebugGroup(): void { threeWebGLPopDebugGroup() }
373
+ /** @gea-host-inert Native state only; retains no script references and invokes no script. */
374
+ declare function threeWebGLPopDebugGroup(): void
375
+
369
376
  export function nativeWebGLBindBufferBase(target: number, index: number, buffer: number): void { threeWebGLBindBufferBase(target, index, buffer) }
370
377
  /** @gea-host-inert Native state only; retains no script references and invokes no script. */
371
378
  declare function threeWebGLBindBufferBase(target: number, index: number, buffer: number): void