message: EN: Add capability logging routine to Capabilities class.
diff: @@ -34,6 +34,10 @@ import { SkyBoxPrimitive, SkySpherePrimitive } from "./Primitive";
  import { ClipPlanesVolume, ClipMaskVolume } from "./ClipVolume";
  import { HalfEdgeGraph, HalfEdge, HalfEdgeMask } from "@bentley/geometry-core/lib/topology/Graph";
  +function debugPrint(_str: string): void {
  + // console.log(_str); // tslint:disable-line:no-console
  +}
  +
  export const enum ContextState {
  Uninitialized,
  Success,
  @@ -148,6 +152,8 @@ export class Capabilities {
  // this._maxDepthType = this.queryExtensionObject("WEBGL_depth_texture") !== undefined ? DepthType.TextureUnsignedInt32 : DepthType.RenderBufferUnsignedShort16;
  this._maxDepthType = this.queryExtensionObject("WEBGL_depth_texture") !== undefined ? DepthType.TextureUnsignedInt24Stencil8 : DepthType.RenderBufferUnsignedShort16;
  + this.debugPrint(gl); // uses debugPrint at top of file; uncomment console.log in there to activate this.
  +
  // Return based on currently-required features. This must change if the amount used is increased or decreased.
  return this._hasRequiredFeatures && this._hasRequiredTextureUnits;
  }
  @@ -186,6 +192,54 @@ export class Capabilities {
  private get _hasRequiredTextureUnits(): boolean {
  return this.maxFragTextureUnits > 4 && this.maxVertTextureUnits > 5;
  }
  +
  + private debugPrint(gl: WebGLRenderingContext) {
  + debugPrint("GLES Capabilities Information:");
  + debugPrint(" hasRequiredFeatures : " + this._hasRequiredFeatures);
  + debugPrint(" hasRequiredTextureUnits : " + this._hasRequiredTextureUnits);
  + debugPrint(" GL_VERSION : " + gl.getParameter(gl.VERSION));
  + debugPrint(" GL_VENDOR : " + gl.getParameter(gl.VENDOR));
  + debugPrint(" GL_RENDERER : " + gl.getParameter(gl.RENDERER));
  + debugPrint(" maxTextureSize : " + this.maxTextureSize);
  + debugPrint(" maxColorAttachments : " + this.maxColorAttachments);
  + debugPrint(" maxDrawBuffers : " + this.maxDrawBuffers);
  + debugPrint(" maxFragTextureUnits : " + this.maxFragTextureUnits);
  + debugPrint(" maxVertTextureUnits : " + this.maxVertTextureUnits);
  + debugPrint(" nonPowerOf2Textures : " + (this.supportsNonPowerOf2Textures ? "yes" : "no"));
  + debugPrint(" drawBuffers : " + (this.supportsDrawBuffers ? "yes" : "no"));
  + debugPrint(" 32BitElementIndex : " + (this.supports32BitElementIndex ? "yes" : "no"));
  + debugPrint(" textureFloat : " + (this.supportsTextureFloat ? "yes" : "no"));
  + debugPrint(" textureHalfFloat : " + (this.supportsTextureHalfFloat ? "yes" : "no"));
  + debugPrint(" shaderTextureLOD : " + (this.supportsShaderTextureLOD ? "yes" : "no"));
  +
  + switch (this.maxRenderType) {
  + case RenderType.TextureUnsignedByte:
  + debugPrint(" maxRenderType : TextureUnsigedByte");
  + break;
  + case RenderType.TextureHalfFloat:
  + debugPrint(" maxRenderType : TextureHalfFloat");
  + break;
  + case RenderType.TextureFloat:
  + debugPrint(" maxRenderType : TextureFloat");
  + break;
  + default:
  + debugPrint(" maxRenderType : Unknown");
  + }
  +
  + switch (this.maxDepthType) {
  + case DepthType.RenderBufferUnsignedShort16:
  + debugPrint(" maxDepthType : RenderBufferUnsignedShort16");
  + break;
  + case DepthType.TextureUnsignedInt24Stencil8:
  + debugPrint(" maxDepthType : TextureUnsignedInt24Stencil8");
  + break;
  + case DepthType.TextureUnsignedInt32:
  + debugPrint(" maxDepthType : TextureUnsignedInt32");
  + break;
  + default:
  + debugPrint(" maxDepthType : Unknown");
  + }
  + }
  }
  /** Id map holds key value pairs for both materials and textures, useful for caching such objects. */
  