// gpu/ipc/common/capabilities.mojom.js is auto generated by mojom_bindings_generator.py, do not edit

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

'use strict';

(function() {
  var mojomId = 'gpu/ipc/common/capabilities.mojom';
  if (mojo.internal.isMojomLoaded(mojomId)) {
    console.warn('The following mojom is loaded multiple times: ' + mojomId);
    return;
  }
  mojo.internal.markMojomLoaded(mojomId);
  var bindings = mojo;
  var associatedBindings = mojo;
  var codec = mojo.internal;
  var validator = mojo.internal;

  var exports = mojo.internal.exposeNamespace('gpu.mojom');
  var shared_image_format$ =
      mojo.internal.exposeNamespace('viz.mojom');
  if (mojo.config.autoLoadMojomDeps) {
    mojo.internal.loadMojomIfNecessary(
        'services/viz/public/mojom/compositing/shared_image_format.mojom', '../../../services/viz/public/mojom/compositing/shared_image_format.mojom.js');
  }



  function Capabilities(values) {
    this.initDefaults_();
    this.initFields_(values);
  }


  Capabilities.prototype.initDefaults_ = function() {
    this.maxTextureSize = 0;
    this.eglImageExternal = false;
    this.textureFormatBgra8888 = false;
    this.textureFormatEtc1Npot = false;
    this.disableMacSwangleRgbx = false;
    this.syncQuery = false;
    this.textureRg = false;
    this.textureNorm16 = false;
    this.textureHalfFloatLinear = false;
    this.imageYcbcr420v = false;
    this.imageAr30 = false;
    this.imageAb30 = false;
    this.imageYcbcrP010 = false;
    this.renderBufferFormatBgra8888 = false;
    this.msaaIsSlow = false;
    this.avoidStencilBuffers = false;
    this.disable2dCanvasCopyOnWrite = false;
    this.supportsRgbToYuvConversion = false;
    this.supportsYuvReadback = false;
    this.chromiumGpuFence = false;
    this.mesaFramebufferFlipY = false;
    this.contextSupportsDistanceFieldText = false;
    this.usingVulkanContext = false;
    this.mappableFormats = null;
    this.drmFormatsAndModifiers = null;
    this.drmDeviceId = 0;
  };
  Capabilities.prototype.initFields_ = function(fields) {
    for(var field in fields) {
        if (this.hasOwnProperty(field))
          this[field] = fields[field];
    }
  };

  Capabilities.validate = function(messageValidator, offset) {
    var err;
    err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
    if (err !== validator.validationError.NONE)
        return err;

    var kVersionSizes = [
      {version: 0, numBytes: 40}
    ];
    err = messageValidator.validateStructVersion(offset, kVersionSizes);
    if (err !== validator.validationError.NONE)
        return err;

























    // validate Capabilities.mappableFormats
    err = messageValidator.validateArrayPointer(offset + codec.kStructHeaderSize + 8, 16, shared_image_format$.SharedImageFormat, false, [0], 0);
    if (err !== validator.validationError.NONE)
        return err;


    // validate Capabilities.drmFormatsAndModifiers
    err = messageValidator.validateMapPointer(offset + codec.kStructHeaderSize + 16, false, codec.Uint32, new codec.ArrayOf(codec.Uint64), false);
    if (err !== validator.validationError.NONE)
        return err;


    return validator.validationError.NONE;
  };

  Capabilities.encodedSize = codec.kStructHeaderSize + 32;

  Capabilities.decode = function(decoder) {
    var packed;
    var val = new Capabilities();
    var numberOfBytes = decoder.readUint32();
    var version = decoder.readUint32();
    val.maxTextureSize =
        decoder.decodeStruct(codec.Int32);
    packed = decoder.readUint8();
    val.eglImageExternal = (packed >> 0) & 1 ? true : false;
    val.textureFormatBgra8888 = (packed >> 1) & 1 ? true : false;
    val.textureFormatEtc1Npot = (packed >> 2) & 1 ? true : false;
    val.disableMacSwangleRgbx = (packed >> 3) & 1 ? true : false;
    val.syncQuery = (packed >> 4) & 1 ? true : false;
    val.textureRg = (packed >> 5) & 1 ? true : false;
    val.textureNorm16 = (packed >> 6) & 1 ? true : false;
    val.textureHalfFloatLinear = (packed >> 7) & 1 ? true : false;
    packed = decoder.readUint8();
    val.imageYcbcr420v = (packed >> 0) & 1 ? true : false;
    val.imageAr30 = (packed >> 1) & 1 ? true : false;
    val.imageAb30 = (packed >> 2) & 1 ? true : false;
    val.imageYcbcrP010 = (packed >> 3) & 1 ? true : false;
    val.renderBufferFormatBgra8888 = (packed >> 4) & 1 ? true : false;
    val.msaaIsSlow = (packed >> 5) & 1 ? true : false;
    val.avoidStencilBuffers = (packed >> 6) & 1 ? true : false;
    val.disable2dCanvasCopyOnWrite = (packed >> 7) & 1 ? true : false;
    packed = decoder.readUint8();
    val.supportsRgbToYuvConversion = (packed >> 0) & 1 ? true : false;
    val.supportsYuvReadback = (packed >> 1) & 1 ? true : false;
    val.chromiumGpuFence = (packed >> 2) & 1 ? true : false;
    val.mesaFramebufferFlipY = (packed >> 3) & 1 ? true : false;
    val.contextSupportsDistanceFieldText = (packed >> 4) & 1 ? true : false;
    val.usingVulkanContext = (packed >> 5) & 1 ? true : false;
    decoder.skip(1);
    val.mappableFormats =
        decoder.decodeArrayPointer(shared_image_format$.SharedImageFormat);
    val.drmFormatsAndModifiers =
        decoder.decodeMapPointer(codec.Uint32, new codec.ArrayOf(codec.Uint64));
    val.drmDeviceId =
        decoder.decodeStruct(codec.Uint64);
    return val;
  };

  Capabilities.encode = function(encoder, val) {
    var packed;
    encoder.writeUint32(Capabilities.encodedSize);
    encoder.writeUint32(0);
    encoder.encodeStruct(codec.Int32, val.maxTextureSize);
    packed = 0;
    packed |= (val.eglImageExternal & 1) << 0
    packed |= (val.textureFormatBgra8888 & 1) << 1
    packed |= (val.textureFormatEtc1Npot & 1) << 2
    packed |= (val.disableMacSwangleRgbx & 1) << 3
    packed |= (val.syncQuery & 1) << 4
    packed |= (val.textureRg & 1) << 5
    packed |= (val.textureNorm16 & 1) << 6
    packed |= (val.textureHalfFloatLinear & 1) << 7
    encoder.writeUint8(packed);
    packed = 0;
    packed |= (val.imageYcbcr420v & 1) << 0
    packed |= (val.imageAr30 & 1) << 1
    packed |= (val.imageAb30 & 1) << 2
    packed |= (val.imageYcbcrP010 & 1) << 3
    packed |= (val.renderBufferFormatBgra8888 & 1) << 4
    packed |= (val.msaaIsSlow & 1) << 5
    packed |= (val.avoidStencilBuffers & 1) << 6
    packed |= (val.disable2dCanvasCopyOnWrite & 1) << 7
    encoder.writeUint8(packed);
    packed = 0;
    packed |= (val.supportsRgbToYuvConversion & 1) << 0
    packed |= (val.supportsYuvReadback & 1) << 1
    packed |= (val.chromiumGpuFence & 1) << 2
    packed |= (val.mesaFramebufferFlipY & 1) << 3
    packed |= (val.contextSupportsDistanceFieldText & 1) << 4
    packed |= (val.usingVulkanContext & 1) << 5
    encoder.writeUint8(packed);
    encoder.skip(1);
    encoder.encodeArrayPointer(shared_image_format$.SharedImageFormat, val.mappableFormats);
    encoder.encodeMapPointer(codec.Uint32, new codec.ArrayOf(codec.Uint64), val.drmFormatsAndModifiers);
    encoder.encodeStruct(codec.Uint64, val.drmDeviceId);
  };
  function ShaderPrecision(values) {
    this.initDefaults_();
    this.initFields_(values);
  }


  ShaderPrecision.prototype.initDefaults_ = function() {
    this.minRange = 0;
    this.maxRange = 0;
    this.precision = 0;
  };
  ShaderPrecision.prototype.initFields_ = function(fields) {
    for(var field in fields) {
        if (this.hasOwnProperty(field))
          this[field] = fields[field];
    }
  };

  ShaderPrecision.validate = function(messageValidator, offset) {
    var err;
    err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
    if (err !== validator.validationError.NONE)
        return err;

    var kVersionSizes = [
      {version: 0, numBytes: 24}
    ];
    err = messageValidator.validateStructVersion(offset, kVersionSizes);
    if (err !== validator.validationError.NONE)
        return err;




    return validator.validationError.NONE;
  };

  ShaderPrecision.encodedSize = codec.kStructHeaderSize + 16;

  ShaderPrecision.decode = function(decoder) {
    var packed;
    var val = new ShaderPrecision();
    var numberOfBytes = decoder.readUint32();
    var version = decoder.readUint32();
    val.minRange =
        decoder.decodeStruct(codec.Int32);
    val.maxRange =
        decoder.decodeStruct(codec.Int32);
    val.precision =
        decoder.decodeStruct(codec.Int32);
    decoder.skip(1);
    decoder.skip(1);
    decoder.skip(1);
    decoder.skip(1);
    return val;
  };

  ShaderPrecision.encode = function(encoder, val) {
    var packed;
    encoder.writeUint32(ShaderPrecision.encodedSize);
    encoder.writeUint32(0);
    encoder.encodeStruct(codec.Int32, val.minRange);
    encoder.encodeStruct(codec.Int32, val.maxRange);
    encoder.encodeStruct(codec.Int32, val.precision);
    encoder.skip(1);
    encoder.skip(1);
    encoder.skip(1);
    encoder.skip(1);
  };
  function PerStagePrecisions(values) {
    this.initDefaults_();
    this.initFields_(values);
  }


  PerStagePrecisions.prototype.initDefaults_ = function() {
    this.lowInt = null;
    this.mediumInt = null;
    this.highInt = null;
    this.lowFloat = null;
    this.mediumFloat = null;
    this.highFloat = null;
  };
  PerStagePrecisions.prototype.initFields_ = function(fields) {
    for(var field in fields) {
        if (this.hasOwnProperty(field))
          this[field] = fields[field];
    }
  };

  PerStagePrecisions.validate = function(messageValidator, offset) {
    var err;
    err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
    if (err !== validator.validationError.NONE)
        return err;

    var kVersionSizes = [
      {version: 0, numBytes: 56}
    ];
    err = messageValidator.validateStructVersion(offset, kVersionSizes);
    if (err !== validator.validationError.NONE)
        return err;


    // validate PerStagePrecisions.lowInt
    err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, ShaderPrecision, false);
    if (err !== validator.validationError.NONE)
        return err;


    // validate PerStagePrecisions.mediumInt
    err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 8, ShaderPrecision, false);
    if (err !== validator.validationError.NONE)
        return err;


    // validate PerStagePrecisions.highInt
    err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 16, ShaderPrecision, false);
    if (err !== validator.validationError.NONE)
        return err;


    // validate PerStagePrecisions.lowFloat
    err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 24, ShaderPrecision, false);
    if (err !== validator.validationError.NONE)
        return err;


    // validate PerStagePrecisions.mediumFloat
    err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 32, ShaderPrecision, false);
    if (err !== validator.validationError.NONE)
        return err;


    // validate PerStagePrecisions.highFloat
    err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 40, ShaderPrecision, false);
    if (err !== validator.validationError.NONE)
        return err;

    return validator.validationError.NONE;
  };

  PerStagePrecisions.encodedSize = codec.kStructHeaderSize + 48;

  PerStagePrecisions.decode = function(decoder) {
    var packed;
    var val = new PerStagePrecisions();
    var numberOfBytes = decoder.readUint32();
    var version = decoder.readUint32();
    val.lowInt =
        decoder.decodeStructPointer(ShaderPrecision);
    val.mediumInt =
        decoder.decodeStructPointer(ShaderPrecision);
    val.highInt =
        decoder.decodeStructPointer(ShaderPrecision);
    val.lowFloat =
        decoder.decodeStructPointer(ShaderPrecision);
    val.mediumFloat =
        decoder.decodeStructPointer(ShaderPrecision);
    val.highFloat =
        decoder.decodeStructPointer(ShaderPrecision);
    return val;
  };

  PerStagePrecisions.encode = function(encoder, val) {
    var packed;
    encoder.writeUint32(PerStagePrecisions.encodedSize);
    encoder.writeUint32(0);
    encoder.encodeStructPointer(ShaderPrecision, val.lowInt);
    encoder.encodeStructPointer(ShaderPrecision, val.mediumInt);
    encoder.encodeStructPointer(ShaderPrecision, val.highInt);
    encoder.encodeStructPointer(ShaderPrecision, val.lowFloat);
    encoder.encodeStructPointer(ShaderPrecision, val.mediumFloat);
    encoder.encodeStructPointer(ShaderPrecision, val.highFloat);
  };
  function GLCapabilities(values) {
    this.initDefaults_();
    this.initFields_(values);
  }


  GLCapabilities.prototype.initDefaults_ = function() {
    this.vertexShaderPrecisions = null;
    this.fragmentShaderPrecisions = null;
    this.majorVersion = 0;
    this.minorVersion = 0;
    this.maxCombinedTextureImageUnits = 0;
    this.maxCubeMapTextureSize = 0;
    this.maxFragmentUniformVectors = 0;
    this.maxRenderbufferSize = 0;
    this.maxTextureImageUnits = 0;
    this.maxVaryingVectors = 0;
    this.maxVertexAttribs = 0;
    this.maxVertexTextureImageUnits = 0;
    this.maxVertexUniformVectors = 0;
    this.maxViewportWidth = 0;
    this.maxViewportHeight = 0;
    this.numCompressedTextureFormats = 0;
    this.numShaderBinaryFormats = 0;
    this.max3dTextureSize = 0;
    this.maxArrayTextureLayers = 0;
    this.maxColorAttachments = 0;
    this.maxCombinedFragmentUniformComponents = 0;
    this.maxCombinedUniformBlocks = 0;
    this.maxDrawBuffers = 0;
    this.maxCombinedVertexUniformComponents = 0;
    this.maxElementIndex = 0;
    this.maxElementsIndices = 0;
    this.maxElementsVertices = 0;
    this.maxFragmentInputComponents = 0;
    this.maxFragmentUniformBlocks = 0;
    this.maxFragmentUniformComponents = 0;
    this.maxProgramTexelOffset = 0;
    this.maxSamples = 0;
    this.maxTextureLodBias = 0;
    this.maxServerWaitTimeout = 0;
    this.maxTransformFeedbackInterleavedComponents = 0;
    this.maxTransformFeedbackSeparateAttribs = 0;
    this.maxTransformFeedbackSeparateComponents = 0;
    this.maxUniformBufferBindings = 0;
    this.maxUniformBlockSize = 0;
    this.maxVaryingComponents = 0;
    this.maxVertexOutputComponents = 0;
    this.maxVertexUniformBlocks = 0;
    this.maxVertexUniformComponents = 0;
    this.minProgramTexelOffset = 0;
    this.numProgramBinaryFormats = 0;
    this.uniformBufferOffsetAlignment = 0;
    this.occlusionQueryBoolean = false;
    this.timerQueries = false;
    this.syncQuery = false;
    this.maxTextureSize = 0;
  };
  GLCapabilities.prototype.initFields_ = function(fields) {
    for(var field in fields) {
        if (this.hasOwnProperty(field))
          this[field] = fields[field];
    }
  };

  GLCapabilities.validate = function(messageValidator, offset) {
    var err;
    err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
    if (err !== validator.validationError.NONE)
        return err;

    var kVersionSizes = [
      {version: 0, numBytes: 232}
    ];
    err = messageValidator.validateStructVersion(offset, kVersionSizes);
    if (err !== validator.validationError.NONE)
        return err;


    // validate GLCapabilities.vertexShaderPrecisions
    err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, PerStagePrecisions, false);
    if (err !== validator.validationError.NONE)
        return err;


    // validate GLCapabilities.fragmentShaderPrecisions
    err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 8, PerStagePrecisions, false);
    if (err !== validator.validationError.NONE)
        return err;

















































    return validator.validationError.NONE;
  };

  GLCapabilities.encodedSize = codec.kStructHeaderSize + 224;

  GLCapabilities.decode = function(decoder) {
    var packed;
    var val = new GLCapabilities();
    var numberOfBytes = decoder.readUint32();
    var version = decoder.readUint32();
    val.vertexShaderPrecisions =
        decoder.decodeStructPointer(PerStagePrecisions);
    val.fragmentShaderPrecisions =
        decoder.decodeStructPointer(PerStagePrecisions);
    val.majorVersion =
        decoder.decodeStruct(codec.Int32);
    val.minorVersion =
        decoder.decodeStruct(codec.Int32);
    val.maxCombinedTextureImageUnits =
        decoder.decodeStruct(codec.Int32);
    val.maxCubeMapTextureSize =
        decoder.decodeStruct(codec.Int32);
    val.maxFragmentUniformVectors =
        decoder.decodeStruct(codec.Int32);
    val.maxRenderbufferSize =
        decoder.decodeStruct(codec.Int32);
    val.maxTextureImageUnits =
        decoder.decodeStruct(codec.Int32);
    val.maxVaryingVectors =
        decoder.decodeStruct(codec.Int32);
    val.maxVertexAttribs =
        decoder.decodeStruct(codec.Int32);
    val.maxVertexTextureImageUnits =
        decoder.decodeStruct(codec.Int32);
    val.maxVertexUniformVectors =
        decoder.decodeStruct(codec.Int32);
    val.maxViewportWidth =
        decoder.decodeStruct(codec.Int32);
    val.maxViewportHeight =
        decoder.decodeStruct(codec.Int32);
    val.numCompressedTextureFormats =
        decoder.decodeStruct(codec.Int32);
    val.numShaderBinaryFormats =
        decoder.decodeStruct(codec.Int32);
    val.max3dTextureSize =
        decoder.decodeStruct(codec.Int32);
    val.maxArrayTextureLayers =
        decoder.decodeStruct(codec.Int32);
    val.maxColorAttachments =
        decoder.decodeStruct(codec.Int32);
    val.maxCombinedFragmentUniformComponents =
        decoder.decodeStruct(codec.Int64);
    val.maxCombinedUniformBlocks =
        decoder.decodeStruct(codec.Int32);
    val.maxDrawBuffers =
        decoder.decodeStruct(codec.Int32);
    val.maxCombinedVertexUniformComponents =
        decoder.decodeStruct(codec.Int64);
    val.maxElementIndex =
        decoder.decodeStruct(codec.Int64);
    val.maxElementsIndices =
        decoder.decodeStruct(codec.Int32);
    val.maxElementsVertices =
        decoder.decodeStruct(codec.Int32);
    val.maxFragmentInputComponents =
        decoder.decodeStruct(codec.Int32);
    val.maxFragmentUniformBlocks =
        decoder.decodeStruct(codec.Int32);
    val.maxFragmentUniformComponents =
        decoder.decodeStruct(codec.Int32);
    val.maxProgramTexelOffset =
        decoder.decodeStruct(codec.Int32);
    val.maxSamples =
        decoder.decodeStruct(codec.Int32);
    val.maxTextureLodBias =
        decoder.decodeStruct(codec.Float);
    val.maxServerWaitTimeout =
        decoder.decodeStruct(codec.Int64);
    val.maxTransformFeedbackInterleavedComponents =
        decoder.decodeStruct(codec.Int32);
    val.maxTransformFeedbackSeparateAttribs =
        decoder.decodeStruct(codec.Int32);
    val.maxTransformFeedbackSeparateComponents =
        decoder.decodeStruct(codec.Int32);
    val.maxUniformBufferBindings =
        decoder.decodeStruct(codec.Int32);
    val.maxUniformBlockSize =
        decoder.decodeStruct(codec.Int64);
    val.maxVaryingComponents =
        decoder.decodeStruct(codec.Int32);
    val.maxVertexOutputComponents =
        decoder.decodeStruct(codec.Int32);
    val.maxVertexUniformBlocks =
        decoder.decodeStruct(codec.Int32);
    val.maxVertexUniformComponents =
        decoder.decodeStruct(codec.Int32);
    val.minProgramTexelOffset =
        decoder.decodeStruct(codec.Int32);
    val.numProgramBinaryFormats =
        decoder.decodeStruct(codec.Int32);
    val.uniformBufferOffsetAlignment =
        decoder.decodeStruct(codec.Int32);
    packed = decoder.readUint8();
    val.occlusionQueryBoolean = (packed >> 0) & 1 ? true : false;
    val.timerQueries = (packed >> 1) & 1 ? true : false;
    val.syncQuery = (packed >> 2) & 1 ? true : false;
    decoder.skip(1);
    decoder.skip(1);
    decoder.skip(1);
    val.maxTextureSize =
        decoder.decodeStruct(codec.Int32);
    decoder.skip(1);
    decoder.skip(1);
    decoder.skip(1);
    decoder.skip(1);
    return val;
  };

  GLCapabilities.encode = function(encoder, val) {
    var packed;
    encoder.writeUint32(GLCapabilities.encodedSize);
    encoder.writeUint32(0);
    encoder.encodeStructPointer(PerStagePrecisions, val.vertexShaderPrecisions);
    encoder.encodeStructPointer(PerStagePrecisions, val.fragmentShaderPrecisions);
    encoder.encodeStruct(codec.Int32, val.majorVersion);
    encoder.encodeStruct(codec.Int32, val.minorVersion);
    encoder.encodeStruct(codec.Int32, val.maxCombinedTextureImageUnits);
    encoder.encodeStruct(codec.Int32, val.maxCubeMapTextureSize);
    encoder.encodeStruct(codec.Int32, val.maxFragmentUniformVectors);
    encoder.encodeStruct(codec.Int32, val.maxRenderbufferSize);
    encoder.encodeStruct(codec.Int32, val.maxTextureImageUnits);
    encoder.encodeStruct(codec.Int32, val.maxVaryingVectors);
    encoder.encodeStruct(codec.Int32, val.maxVertexAttribs);
    encoder.encodeStruct(codec.Int32, val.maxVertexTextureImageUnits);
    encoder.encodeStruct(codec.Int32, val.maxVertexUniformVectors);
    encoder.encodeStruct(codec.Int32, val.maxViewportWidth);
    encoder.encodeStruct(codec.Int32, val.maxViewportHeight);
    encoder.encodeStruct(codec.Int32, val.numCompressedTextureFormats);
    encoder.encodeStruct(codec.Int32, val.numShaderBinaryFormats);
    encoder.encodeStruct(codec.Int32, val.max3dTextureSize);
    encoder.encodeStruct(codec.Int32, val.maxArrayTextureLayers);
    encoder.encodeStruct(codec.Int32, val.maxColorAttachments);
    encoder.encodeStruct(codec.Int64, val.maxCombinedFragmentUniformComponents);
    encoder.encodeStruct(codec.Int32, val.maxCombinedUniformBlocks);
    encoder.encodeStruct(codec.Int32, val.maxDrawBuffers);
    encoder.encodeStruct(codec.Int64, val.maxCombinedVertexUniformComponents);
    encoder.encodeStruct(codec.Int64, val.maxElementIndex);
    encoder.encodeStruct(codec.Int32, val.maxElementsIndices);
    encoder.encodeStruct(codec.Int32, val.maxElementsVertices);
    encoder.encodeStruct(codec.Int32, val.maxFragmentInputComponents);
    encoder.encodeStruct(codec.Int32, val.maxFragmentUniformBlocks);
    encoder.encodeStruct(codec.Int32, val.maxFragmentUniformComponents);
    encoder.encodeStruct(codec.Int32, val.maxProgramTexelOffset);
    encoder.encodeStruct(codec.Int32, val.maxSamples);
    encoder.encodeStruct(codec.Float, val.maxTextureLodBias);
    encoder.encodeStruct(codec.Int64, val.maxServerWaitTimeout);
    encoder.encodeStruct(codec.Int32, val.maxTransformFeedbackInterleavedComponents);
    encoder.encodeStruct(codec.Int32, val.maxTransformFeedbackSeparateAttribs);
    encoder.encodeStruct(codec.Int32, val.maxTransformFeedbackSeparateComponents);
    encoder.encodeStruct(codec.Int32, val.maxUniformBufferBindings);
    encoder.encodeStruct(codec.Int64, val.maxUniformBlockSize);
    encoder.encodeStruct(codec.Int32, val.maxVaryingComponents);
    encoder.encodeStruct(codec.Int32, val.maxVertexOutputComponents);
    encoder.encodeStruct(codec.Int32, val.maxVertexUniformBlocks);
    encoder.encodeStruct(codec.Int32, val.maxVertexUniformComponents);
    encoder.encodeStruct(codec.Int32, val.minProgramTexelOffset);
    encoder.encodeStruct(codec.Int32, val.numProgramBinaryFormats);
    encoder.encodeStruct(codec.Int32, val.uniformBufferOffsetAlignment);
    packed = 0;
    packed |= (val.occlusionQueryBoolean & 1) << 0
    packed |= (val.timerQueries & 1) << 1
    packed |= (val.syncQuery & 1) << 2
    encoder.writeUint8(packed);
    encoder.skip(1);
    encoder.skip(1);
    encoder.skip(1);
    encoder.encodeStruct(codec.Int32, val.maxTextureSize);
    encoder.skip(1);
    encoder.skip(1);
    encoder.skip(1);
    encoder.skip(1);
  };
  exports.Capabilities = Capabilities;
  exports.ShaderPrecision = ShaderPrecision;
  exports.PerStagePrecisions = PerStagePrecisions;
  exports.GLCapabilities = GLCapabilities;
})();