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

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

#ifndef GPU_IPC_COMMON_CAPABILITIES_MOJOM_H_
#define GPU_IPC_COMMON_CAPABILITIES_MOJOM_H_

#include <stdint.h>

#include <limits>
#include <optional>
#include <type_traits>
#include <utility>
#include "mojo/public/cpp/bindings/clone_traits.h"
#include "mojo/public/cpp/bindings/equals_traits.h"
#include "mojo/public/cpp/bindings/struct_ptr.h"
#include "mojo/public/cpp/bindings/struct_traits.h"
#include "mojo/public/cpp/bindings/union_traits.h"
#include "mojo/public/cpp/bindings/lib/serialization.h"

#include "third_party/perfetto/include/perfetto/tracing/traced_value_forward.h"

#include "gpu/ipc/common/capabilities.mojom-features.h"  // IWYU pragma: export
#include "gpu/ipc/common/capabilities.mojom-shared.h"  // IWYU pragma: export
#include "gpu/ipc/common/capabilities.mojom-forward.h"  // IWYU pragma: export
#include "services/viz/public/mojom/compositing/shared_image_format.mojom-forward.h"
#include <string>
#include <vector>




#include "gpu/ipc/common/capabilities_mojom_traits.h"
#include "gpu/gpu_export.h"




namespace gpu::mojom {






class GPU_EXPORT ShaderPrecision {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<ShaderPrecision, T>::value>;
  using DataView = ShaderPrecisionDataView;
  using Data_ = internal::ShaderPrecision_Data;

  template <typename... Args>
  static ShaderPrecisionPtr New(Args&&... args) {
    return ShaderPrecisionPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static ShaderPrecisionPtr From(const U& u) {
    return mojo::TypeConverter<ShaderPrecisionPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, ShaderPrecision>::Convert(*this);
  }


  ShaderPrecision();

  ShaderPrecision(
      int32_t min_range,
      int32_t max_range,
      int32_t precision);


  ~ShaderPrecision();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = ShaderPrecisionPtr>
  ShaderPrecisionPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, ShaderPrecision::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, ShaderPrecision::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, ShaderPrecision::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }
  size_t Hash(size_t seed) const;

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        ShaderPrecision::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        ShaderPrecision::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        ShaderPrecision::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::ShaderPrecision_UnserializedMessageContext<
            UserType, ShaderPrecision::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<ShaderPrecision::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return ShaderPrecision::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::ShaderPrecision_UnserializedMessageContext<
            UserType, ShaderPrecision::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<ShaderPrecision::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  int32_t min_range;
  
  int32_t max_range;
  
  int32_t precision;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, ShaderPrecision::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, ShaderPrecision::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, ShaderPrecision::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, ShaderPrecision::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}









class GPU_EXPORT Capabilities {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<Capabilities, T>::value>;
  using DataView = CapabilitiesDataView;
  using Data_ = internal::Capabilities_Data;

  template <typename... Args>
  static CapabilitiesPtr New(Args&&... args) {
    return CapabilitiesPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static CapabilitiesPtr From(const U& u) {
    return mojo::TypeConverter<CapabilitiesPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, Capabilities>::Convert(*this);
  }


  Capabilities();

  Capabilities(
      int32_t max_texture_size,
      bool egl_image_external,
      bool texture_format_bgra8888,
      bool texture_format_etc1_npot,
      bool disable_mac_swangle_rgbx,
      bool sync_query,
      bool texture_rg,
      bool texture_norm16,
      bool texture_half_float_linear,
      bool image_ar30,
      bool image_ab30,
      bool render_buffer_format_bgra8888,
      bool msaa_is_slow,
      bool avoid_stencil_buffers,
      bool supports_rgb_to_yuv_conversion,
      bool supports_yuv_readback,
      bool mesa_framebuffer_flip_y,
      bool context_supports_distance_field_text,
      bool using_vulkan_context,
      bool use_deferred_graphite_submit,
      const base::flat_map<uint32_t, std::vector<uint64_t>>& drm_formats_and_modifiers,
      uint64_t drm_device_id);


  ~Capabilities();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = CapabilitiesPtr>
  CapabilitiesPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, Capabilities::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, Capabilities::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, Capabilities::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        Capabilities::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        Capabilities::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        Capabilities::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::Capabilities_UnserializedMessageContext<
            UserType, Capabilities::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<Capabilities::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return Capabilities::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::Capabilities_UnserializedMessageContext<
            UserType, Capabilities::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<Capabilities::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  int32_t max_texture_size;
  
  bool egl_image_external;
  
  bool texture_format_bgra8888;
  
  bool texture_format_etc1_npot;
  
  bool disable_mac_swangle_rgbx;
  
  bool sync_query;
  
  bool texture_rg;
  
  bool texture_norm16;
  
  bool texture_half_float_linear;
  
  bool image_ar30;
  
  bool image_ab30;
  
  bool render_buffer_format_bgra8888;
  
  bool msaa_is_slow;
  
  bool avoid_stencil_buffers;
  
  bool supports_rgb_to_yuv_conversion;
  
  bool supports_yuv_readback;
  
  bool mesa_framebuffer_flip_y;
  
  bool context_supports_distance_field_text;
  
  bool using_vulkan_context;
  
  bool use_deferred_graphite_submit;
  
  base::flat_map<uint32_t, std::vector<uint64_t>> drm_formats_and_modifiers;
  
  uint64_t drm_device_id;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, Capabilities::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, Capabilities::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, Capabilities::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, Capabilities::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}






class GPU_EXPORT PerStagePrecisions {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<PerStagePrecisions, T>::value>;
  using DataView = PerStagePrecisionsDataView;
  using Data_ = internal::PerStagePrecisions_Data;

  template <typename... Args>
  static PerStagePrecisionsPtr New(Args&&... args) {
    return PerStagePrecisionsPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static PerStagePrecisionsPtr From(const U& u) {
    return mojo::TypeConverter<PerStagePrecisionsPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, PerStagePrecisions>::Convert(*this);
  }


  PerStagePrecisions();

  PerStagePrecisions(
      ShaderPrecisionPtr low_int,
      ShaderPrecisionPtr medium_int,
      ShaderPrecisionPtr high_int,
      ShaderPrecisionPtr low_float,
      ShaderPrecisionPtr medium_float,
      ShaderPrecisionPtr high_float);

PerStagePrecisions(const PerStagePrecisions&) = delete;
PerStagePrecisions& operator=(const PerStagePrecisions&) = delete;

  ~PerStagePrecisions();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = PerStagePrecisionsPtr>
  PerStagePrecisionsPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, PerStagePrecisions::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, PerStagePrecisions::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, PerStagePrecisions::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }
  size_t Hash(size_t seed) const;

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        PerStagePrecisions::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        PerStagePrecisions::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        PerStagePrecisions::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::PerStagePrecisions_UnserializedMessageContext<
            UserType, PerStagePrecisions::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<PerStagePrecisions::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return PerStagePrecisions::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::PerStagePrecisions_UnserializedMessageContext<
            UserType, PerStagePrecisions::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<PerStagePrecisions::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  ShaderPrecisionPtr low_int;
  
  ShaderPrecisionPtr medium_int;
  
  ShaderPrecisionPtr high_int;
  
  ShaderPrecisionPtr low_float;
  
  ShaderPrecisionPtr medium_float;
  
  ShaderPrecisionPtr high_float;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, PerStagePrecisions::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, PerStagePrecisions::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, PerStagePrecisions::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, PerStagePrecisions::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}





class GPU_EXPORT GLCapabilities {
 public:
  template <typename T>
  using EnableIfSame = std::enable_if_t<std::is_same<GLCapabilities, T>::value>;
  using DataView = GLCapabilitiesDataView;
  using Data_ = internal::GLCapabilities_Data;

  template <typename... Args>
  static GLCapabilitiesPtr New(Args&&... args) {
    return GLCapabilitiesPtr(
        std::in_place, std::forward<Args>(args)...);
  }

  template <typename U>
  static GLCapabilitiesPtr From(const U& u) {
    return mojo::TypeConverter<GLCapabilitiesPtr, U>::Convert(u);
  }

  template <typename U>
  U To() const {
    return mojo::TypeConverter<U, GLCapabilities>::Convert(*this);
  }


  GLCapabilities();

  GLCapabilities(
      PerStagePrecisionsPtr vertex_shader_precisions,
      PerStagePrecisionsPtr fragment_shader_precisions,
      int32_t major_version,
      int32_t minor_version,
      int32_t max_combined_texture_image_units,
      int32_t max_cube_map_texture_size,
      int32_t max_fragment_uniform_vectors,
      int32_t max_renderbuffer_size,
      int32_t max_texture_image_units,
      int32_t max_varying_vectors,
      int32_t max_vertex_attribs,
      int32_t max_vertex_texture_image_units,
      int32_t max_vertex_uniform_vectors,
      int32_t max_viewport_width,
      int32_t max_viewport_height,
      int32_t num_compressed_texture_formats,
      int32_t num_shader_binary_formats,
      int32_t max_3d_texture_size,
      int32_t max_array_texture_layers,
      int32_t max_color_attachments,
      int64_t max_combined_fragment_uniform_components,
      int32_t max_combined_uniform_blocks,
      int64_t max_combined_vertex_uniform_components,
      int32_t max_draw_buffers,
      int64_t max_element_index,
      int32_t max_elements_indices,
      int32_t max_elements_vertices,
      int32_t max_fragment_input_components,
      int32_t max_fragment_uniform_blocks,
      int32_t max_fragment_uniform_components,
      int32_t max_program_texel_offset,
      int32_t max_samples,
      int64_t max_server_wait_timeout,
      float max_texture_lod_bias,
      int32_t max_transform_feedback_interleaved_components,
      int32_t max_transform_feedback_separate_attribs,
      int32_t max_transform_feedback_separate_components,
      int64_t max_uniform_block_size,
      int32_t max_uniform_buffer_bindings,
      int32_t max_varying_components,
      int32_t max_vertex_output_components,
      int32_t max_vertex_uniform_blocks,
      int32_t max_vertex_uniform_components,
      int32_t min_program_texel_offset,
      int32_t num_program_binary_formats,
      int32_t uniform_buffer_offset_alignment,
      bool occlusion_query_boolean,
      bool timer_queries,
      int32_t max_texture_size,
      bool sync_query);

GLCapabilities(const GLCapabilities&) = delete;
GLCapabilities& operator=(const GLCapabilities&) = delete;

  ~GLCapabilities();

  // Clone() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Clone() or copy
  // constructor/assignment are available for members.
  template <typename StructPtrType = GLCapabilitiesPtr>
  GLCapabilitiesPtr Clone() const;

  // Equals() is a template so it is only instantiated if it is used. Thus, the
  // bindings generator does not need to know whether Equals() or == operator
  // are available for members.
  template <typename T, GLCapabilities::EnableIfSame<T>* = nullptr>
  bool Equals(const T& other) const;

  template <typename T, GLCapabilities::EnableIfSame<T>* = nullptr>
  bool operator==(const T& rhs) const { return Equals(rhs); }

  template <typename T, GLCapabilities::EnableIfSame<T>* = nullptr>
  bool operator!=(const T& rhs) const { return !operator==(rhs); }

  template <mojo::internal::SendValidation send_validation, typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        GLCapabilities::DataView, std::vector<uint8_t>, send_validation>(input);
  }

  template <typename UserType>
  static std::vector<uint8_t> Serialize(UserType* input) {
    return mojo::internal::SerializeImpl<
        GLCapabilities::DataView, std::vector<uint8_t>>(input);
  }

  template <typename UserType>
  static mojo::Message SerializeAsMessage(UserType* input) {
    return mojo::internal::SerializeAsMessageImpl<
        GLCapabilities::DataView>(input);
  }

  // The returned Message is serialized only if the message is moved
  // cross-process or cross-language. Otherwise if the message is Deserialized
  // as the same UserType |input| will just be moved to |output| in
  // DeserializeFromMessage.
  template <typename UserType>
  static mojo::Message WrapAsMessage(UserType input) {
    return mojo::Message(std::make_unique<
        internal::GLCapabilities_UnserializedMessageContext<
            UserType, GLCapabilities::DataView>>(0, 0, std::move(input)),
        MOJO_CREATE_MESSAGE_FLAG_NONE);
  }

  template <typename UserType>
  static bool Deserialize(const void* data,
                          size_t data_num_bytes,
                          UserType* output) {
    mojo::Message message;
    return mojo::internal::DeserializeImpl<GLCapabilities::DataView>(
        message, data, data_num_bytes, output, Validate);
  }

  template <typename UserType>
  static bool Deserialize(base::span<const uint8_t> input,
                          UserType* output) {
    return GLCapabilities::Deserialize(
        input.empty() ? nullptr : input.data(), input.size(), output);
  }

  template <typename UserType>
  static bool DeserializeFromMessage(mojo::Message input,
                                     UserType* output) {
    auto context = input.TakeUnserializedContext<
        internal::GLCapabilities_UnserializedMessageContext<
            UserType, GLCapabilities::DataView>>();
    if (context) {
      *output = std::move(context->TakeData());
      return true;
    }
    input.SerializeIfNecessary();
    return mojo::internal::DeserializeImpl<GLCapabilities::DataView>(
        input, input.payload(), input.payload_num_bytes(), output, Validate);
  }

  
  PerStagePrecisionsPtr vertex_shader_precisions;
  
  PerStagePrecisionsPtr fragment_shader_precisions;
  
  int32_t major_version;
  
  int32_t minor_version;
  
  int32_t max_combined_texture_image_units;
  
  int32_t max_cube_map_texture_size;
  
  int32_t max_fragment_uniform_vectors;
  
  int32_t max_renderbuffer_size;
  
  int32_t max_texture_image_units;
  
  int32_t max_varying_vectors;
  
  int32_t max_vertex_attribs;
  
  int32_t max_vertex_texture_image_units;
  
  int32_t max_vertex_uniform_vectors;
  
  int32_t max_viewport_width;
  
  int32_t max_viewport_height;
  
  int32_t num_compressed_texture_formats;
  
  int32_t num_shader_binary_formats;
  
  int32_t max_3d_texture_size;
  
  int32_t max_array_texture_layers;
  
  int32_t max_color_attachments;
  
  int64_t max_combined_fragment_uniform_components;
  
  int32_t max_combined_uniform_blocks;
  
  int64_t max_combined_vertex_uniform_components;
  
  int32_t max_draw_buffers;
  
  int64_t max_element_index;
  
  int32_t max_elements_indices;
  
  int32_t max_elements_vertices;
  
  int32_t max_fragment_input_components;
  
  int32_t max_fragment_uniform_blocks;
  
  int32_t max_fragment_uniform_components;
  
  int32_t max_program_texel_offset;
  
  int32_t max_samples;
  
  int64_t max_server_wait_timeout;
  
  float max_texture_lod_bias;
  
  int32_t max_transform_feedback_interleaved_components;
  
  int32_t max_transform_feedback_separate_attribs;
  
  int32_t max_transform_feedback_separate_components;
  
  int64_t max_uniform_block_size;
  
  int32_t max_uniform_buffer_bindings;
  
  int32_t max_varying_components;
  
  int32_t max_vertex_output_components;
  
  int32_t max_vertex_uniform_blocks;
  
  int32_t max_vertex_uniform_components;
  
  int32_t min_program_texel_offset;
  
  int32_t num_program_binary_formats;
  
  int32_t uniform_buffer_offset_alignment;
  
  bool occlusion_query_boolean;
  
  bool timer_queries;
  
  int32_t max_texture_size;
  
  bool sync_query;

  // Serialise this struct into a trace.
  void WriteIntoTrace(perfetto::TracedValue traced_context) const;

 private:
  static bool Validate(const void* data,
                       mojo::internal::ValidationContext* validation_context);
};

// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, GLCapabilities::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);

template <typename T, GLCapabilities::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
  return !(rhs < lhs);
}

template <typename T, GLCapabilities::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
  return rhs < lhs;
}

template <typename T, GLCapabilities::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
  return !(lhs < rhs);
}

template <typename StructPtrType>
CapabilitiesPtr Capabilities::Clone() const {
  return New(
      mojo::Clone(max_texture_size),
      mojo::Clone(egl_image_external),
      mojo::Clone(texture_format_bgra8888),
      mojo::Clone(texture_format_etc1_npot),
      mojo::Clone(disable_mac_swangle_rgbx),
      mojo::Clone(sync_query),
      mojo::Clone(texture_rg),
      mojo::Clone(texture_norm16),
      mojo::Clone(texture_half_float_linear),
      mojo::Clone(image_ar30),
      mojo::Clone(image_ab30),
      mojo::Clone(render_buffer_format_bgra8888),
      mojo::Clone(msaa_is_slow),
      mojo::Clone(avoid_stencil_buffers),
      mojo::Clone(supports_rgb_to_yuv_conversion),
      mojo::Clone(supports_yuv_readback),
      mojo::Clone(mesa_framebuffer_flip_y),
      mojo::Clone(context_supports_distance_field_text),
      mojo::Clone(using_vulkan_context),
      mojo::Clone(use_deferred_graphite_submit),
      mojo::Clone(drm_formats_and_modifiers),
      mojo::Clone(drm_device_id)
  );
}

template <typename T, Capabilities::EnableIfSame<T>*>
bool Capabilities::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->max_texture_size, other_struct.max_texture_size))
    return false;
  if (!mojo::Equals(this->egl_image_external, other_struct.egl_image_external))
    return false;
  if (!mojo::Equals(this->texture_format_bgra8888, other_struct.texture_format_bgra8888))
    return false;
  if (!mojo::Equals(this->texture_format_etc1_npot, other_struct.texture_format_etc1_npot))
    return false;
  if (!mojo::Equals(this->disable_mac_swangle_rgbx, other_struct.disable_mac_swangle_rgbx))
    return false;
  if (!mojo::Equals(this->sync_query, other_struct.sync_query))
    return false;
  if (!mojo::Equals(this->texture_rg, other_struct.texture_rg))
    return false;
  if (!mojo::Equals(this->texture_norm16, other_struct.texture_norm16))
    return false;
  if (!mojo::Equals(this->texture_half_float_linear, other_struct.texture_half_float_linear))
    return false;
  if (!mojo::Equals(this->image_ar30, other_struct.image_ar30))
    return false;
  if (!mojo::Equals(this->image_ab30, other_struct.image_ab30))
    return false;
  if (!mojo::Equals(this->render_buffer_format_bgra8888, other_struct.render_buffer_format_bgra8888))
    return false;
  if (!mojo::Equals(this->msaa_is_slow, other_struct.msaa_is_slow))
    return false;
  if (!mojo::Equals(this->avoid_stencil_buffers, other_struct.avoid_stencil_buffers))
    return false;
  if (!mojo::Equals(this->supports_rgb_to_yuv_conversion, other_struct.supports_rgb_to_yuv_conversion))
    return false;
  if (!mojo::Equals(this->supports_yuv_readback, other_struct.supports_yuv_readback))
    return false;
  if (!mojo::Equals(this->mesa_framebuffer_flip_y, other_struct.mesa_framebuffer_flip_y))
    return false;
  if (!mojo::Equals(this->context_supports_distance_field_text, other_struct.context_supports_distance_field_text))
    return false;
  if (!mojo::Equals(this->using_vulkan_context, other_struct.using_vulkan_context))
    return false;
  if (!mojo::Equals(this->use_deferred_graphite_submit, other_struct.use_deferred_graphite_submit))
    return false;
  if (!mojo::Equals(this->drm_formats_and_modifiers, other_struct.drm_formats_and_modifiers))
    return false;
  if (!mojo::Equals(this->drm_device_id, other_struct.drm_device_id))
    return false;
  return true;
}

template <typename T, Capabilities::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.max_texture_size < rhs.max_texture_size)
    return true;
  if (rhs.max_texture_size < lhs.max_texture_size)
    return false;
  if (lhs.egl_image_external < rhs.egl_image_external)
    return true;
  if (rhs.egl_image_external < lhs.egl_image_external)
    return false;
  if (lhs.texture_format_bgra8888 < rhs.texture_format_bgra8888)
    return true;
  if (rhs.texture_format_bgra8888 < lhs.texture_format_bgra8888)
    return false;
  if (lhs.texture_format_etc1_npot < rhs.texture_format_etc1_npot)
    return true;
  if (rhs.texture_format_etc1_npot < lhs.texture_format_etc1_npot)
    return false;
  if (lhs.disable_mac_swangle_rgbx < rhs.disable_mac_swangle_rgbx)
    return true;
  if (rhs.disable_mac_swangle_rgbx < lhs.disable_mac_swangle_rgbx)
    return false;
  if (lhs.sync_query < rhs.sync_query)
    return true;
  if (rhs.sync_query < lhs.sync_query)
    return false;
  if (lhs.texture_rg < rhs.texture_rg)
    return true;
  if (rhs.texture_rg < lhs.texture_rg)
    return false;
  if (lhs.texture_norm16 < rhs.texture_norm16)
    return true;
  if (rhs.texture_norm16 < lhs.texture_norm16)
    return false;
  if (lhs.texture_half_float_linear < rhs.texture_half_float_linear)
    return true;
  if (rhs.texture_half_float_linear < lhs.texture_half_float_linear)
    return false;
  if (lhs.image_ar30 < rhs.image_ar30)
    return true;
  if (rhs.image_ar30 < lhs.image_ar30)
    return false;
  if (lhs.image_ab30 < rhs.image_ab30)
    return true;
  if (rhs.image_ab30 < lhs.image_ab30)
    return false;
  if (lhs.render_buffer_format_bgra8888 < rhs.render_buffer_format_bgra8888)
    return true;
  if (rhs.render_buffer_format_bgra8888 < lhs.render_buffer_format_bgra8888)
    return false;
  if (lhs.msaa_is_slow < rhs.msaa_is_slow)
    return true;
  if (rhs.msaa_is_slow < lhs.msaa_is_slow)
    return false;
  if (lhs.avoid_stencil_buffers < rhs.avoid_stencil_buffers)
    return true;
  if (rhs.avoid_stencil_buffers < lhs.avoid_stencil_buffers)
    return false;
  if (lhs.supports_rgb_to_yuv_conversion < rhs.supports_rgb_to_yuv_conversion)
    return true;
  if (rhs.supports_rgb_to_yuv_conversion < lhs.supports_rgb_to_yuv_conversion)
    return false;
  if (lhs.supports_yuv_readback < rhs.supports_yuv_readback)
    return true;
  if (rhs.supports_yuv_readback < lhs.supports_yuv_readback)
    return false;
  if (lhs.mesa_framebuffer_flip_y < rhs.mesa_framebuffer_flip_y)
    return true;
  if (rhs.mesa_framebuffer_flip_y < lhs.mesa_framebuffer_flip_y)
    return false;
  if (lhs.context_supports_distance_field_text < rhs.context_supports_distance_field_text)
    return true;
  if (rhs.context_supports_distance_field_text < lhs.context_supports_distance_field_text)
    return false;
  if (lhs.using_vulkan_context < rhs.using_vulkan_context)
    return true;
  if (rhs.using_vulkan_context < lhs.using_vulkan_context)
    return false;
  if (lhs.use_deferred_graphite_submit < rhs.use_deferred_graphite_submit)
    return true;
  if (rhs.use_deferred_graphite_submit < lhs.use_deferred_graphite_submit)
    return false;
  if (lhs.drm_formats_and_modifiers < rhs.drm_formats_and_modifiers)
    return true;
  if (rhs.drm_formats_and_modifiers < lhs.drm_formats_and_modifiers)
    return false;
  if (lhs.drm_device_id < rhs.drm_device_id)
    return true;
  if (rhs.drm_device_id < lhs.drm_device_id)
    return false;
  return false;
}
template <typename StructPtrType>
ShaderPrecisionPtr ShaderPrecision::Clone() const {
  return New(
      mojo::Clone(min_range),
      mojo::Clone(max_range),
      mojo::Clone(precision)
  );
}

template <typename T, ShaderPrecision::EnableIfSame<T>*>
bool ShaderPrecision::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->min_range, other_struct.min_range))
    return false;
  if (!mojo::Equals(this->max_range, other_struct.max_range))
    return false;
  if (!mojo::Equals(this->precision, other_struct.precision))
    return false;
  return true;
}

template <typename T, ShaderPrecision::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.min_range < rhs.min_range)
    return true;
  if (rhs.min_range < lhs.min_range)
    return false;
  if (lhs.max_range < rhs.max_range)
    return true;
  if (rhs.max_range < lhs.max_range)
    return false;
  if (lhs.precision < rhs.precision)
    return true;
  if (rhs.precision < lhs.precision)
    return false;
  return false;
}
template <typename StructPtrType>
PerStagePrecisionsPtr PerStagePrecisions::Clone() const {
  return New(
      mojo::Clone(low_int),
      mojo::Clone(medium_int),
      mojo::Clone(high_int),
      mojo::Clone(low_float),
      mojo::Clone(medium_float),
      mojo::Clone(high_float)
  );
}

template <typename T, PerStagePrecisions::EnableIfSame<T>*>
bool PerStagePrecisions::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->low_int, other_struct.low_int))
    return false;
  if (!mojo::Equals(this->medium_int, other_struct.medium_int))
    return false;
  if (!mojo::Equals(this->high_int, other_struct.high_int))
    return false;
  if (!mojo::Equals(this->low_float, other_struct.low_float))
    return false;
  if (!mojo::Equals(this->medium_float, other_struct.medium_float))
    return false;
  if (!mojo::Equals(this->high_float, other_struct.high_float))
    return false;
  return true;
}

template <typename T, PerStagePrecisions::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.low_int < rhs.low_int)
    return true;
  if (rhs.low_int < lhs.low_int)
    return false;
  if (lhs.medium_int < rhs.medium_int)
    return true;
  if (rhs.medium_int < lhs.medium_int)
    return false;
  if (lhs.high_int < rhs.high_int)
    return true;
  if (rhs.high_int < lhs.high_int)
    return false;
  if (lhs.low_float < rhs.low_float)
    return true;
  if (rhs.low_float < lhs.low_float)
    return false;
  if (lhs.medium_float < rhs.medium_float)
    return true;
  if (rhs.medium_float < lhs.medium_float)
    return false;
  if (lhs.high_float < rhs.high_float)
    return true;
  if (rhs.high_float < lhs.high_float)
    return false;
  return false;
}
template <typename StructPtrType>
GLCapabilitiesPtr GLCapabilities::Clone() const {
  return New(
      mojo::Clone(vertex_shader_precisions),
      mojo::Clone(fragment_shader_precisions),
      mojo::Clone(major_version),
      mojo::Clone(minor_version),
      mojo::Clone(max_combined_texture_image_units),
      mojo::Clone(max_cube_map_texture_size),
      mojo::Clone(max_fragment_uniform_vectors),
      mojo::Clone(max_renderbuffer_size),
      mojo::Clone(max_texture_image_units),
      mojo::Clone(max_varying_vectors),
      mojo::Clone(max_vertex_attribs),
      mojo::Clone(max_vertex_texture_image_units),
      mojo::Clone(max_vertex_uniform_vectors),
      mojo::Clone(max_viewport_width),
      mojo::Clone(max_viewport_height),
      mojo::Clone(num_compressed_texture_formats),
      mojo::Clone(num_shader_binary_formats),
      mojo::Clone(max_3d_texture_size),
      mojo::Clone(max_array_texture_layers),
      mojo::Clone(max_color_attachments),
      mojo::Clone(max_combined_fragment_uniform_components),
      mojo::Clone(max_combined_uniform_blocks),
      mojo::Clone(max_combined_vertex_uniform_components),
      mojo::Clone(max_draw_buffers),
      mojo::Clone(max_element_index),
      mojo::Clone(max_elements_indices),
      mojo::Clone(max_elements_vertices),
      mojo::Clone(max_fragment_input_components),
      mojo::Clone(max_fragment_uniform_blocks),
      mojo::Clone(max_fragment_uniform_components),
      mojo::Clone(max_program_texel_offset),
      mojo::Clone(max_samples),
      mojo::Clone(max_server_wait_timeout),
      mojo::Clone(max_texture_lod_bias),
      mojo::Clone(max_transform_feedback_interleaved_components),
      mojo::Clone(max_transform_feedback_separate_attribs),
      mojo::Clone(max_transform_feedback_separate_components),
      mojo::Clone(max_uniform_block_size),
      mojo::Clone(max_uniform_buffer_bindings),
      mojo::Clone(max_varying_components),
      mojo::Clone(max_vertex_output_components),
      mojo::Clone(max_vertex_uniform_blocks),
      mojo::Clone(max_vertex_uniform_components),
      mojo::Clone(min_program_texel_offset),
      mojo::Clone(num_program_binary_formats),
      mojo::Clone(uniform_buffer_offset_alignment),
      mojo::Clone(occlusion_query_boolean),
      mojo::Clone(timer_queries),
      mojo::Clone(max_texture_size),
      mojo::Clone(sync_query)
  );
}

template <typename T, GLCapabilities::EnableIfSame<T>*>
bool GLCapabilities::Equals(const T& other_struct) const {
  if (!mojo::Equals(this->vertex_shader_precisions, other_struct.vertex_shader_precisions))
    return false;
  if (!mojo::Equals(this->fragment_shader_precisions, other_struct.fragment_shader_precisions))
    return false;
  if (!mojo::Equals(this->major_version, other_struct.major_version))
    return false;
  if (!mojo::Equals(this->minor_version, other_struct.minor_version))
    return false;
  if (!mojo::Equals(this->max_combined_texture_image_units, other_struct.max_combined_texture_image_units))
    return false;
  if (!mojo::Equals(this->max_cube_map_texture_size, other_struct.max_cube_map_texture_size))
    return false;
  if (!mojo::Equals(this->max_fragment_uniform_vectors, other_struct.max_fragment_uniform_vectors))
    return false;
  if (!mojo::Equals(this->max_renderbuffer_size, other_struct.max_renderbuffer_size))
    return false;
  if (!mojo::Equals(this->max_texture_image_units, other_struct.max_texture_image_units))
    return false;
  if (!mojo::Equals(this->max_varying_vectors, other_struct.max_varying_vectors))
    return false;
  if (!mojo::Equals(this->max_vertex_attribs, other_struct.max_vertex_attribs))
    return false;
  if (!mojo::Equals(this->max_vertex_texture_image_units, other_struct.max_vertex_texture_image_units))
    return false;
  if (!mojo::Equals(this->max_vertex_uniform_vectors, other_struct.max_vertex_uniform_vectors))
    return false;
  if (!mojo::Equals(this->max_viewport_width, other_struct.max_viewport_width))
    return false;
  if (!mojo::Equals(this->max_viewport_height, other_struct.max_viewport_height))
    return false;
  if (!mojo::Equals(this->num_compressed_texture_formats, other_struct.num_compressed_texture_formats))
    return false;
  if (!mojo::Equals(this->num_shader_binary_formats, other_struct.num_shader_binary_formats))
    return false;
  if (!mojo::Equals(this->max_3d_texture_size, other_struct.max_3d_texture_size))
    return false;
  if (!mojo::Equals(this->max_array_texture_layers, other_struct.max_array_texture_layers))
    return false;
  if (!mojo::Equals(this->max_color_attachments, other_struct.max_color_attachments))
    return false;
  if (!mojo::Equals(this->max_combined_fragment_uniform_components, other_struct.max_combined_fragment_uniform_components))
    return false;
  if (!mojo::Equals(this->max_combined_uniform_blocks, other_struct.max_combined_uniform_blocks))
    return false;
  if (!mojo::Equals(this->max_combined_vertex_uniform_components, other_struct.max_combined_vertex_uniform_components))
    return false;
  if (!mojo::Equals(this->max_draw_buffers, other_struct.max_draw_buffers))
    return false;
  if (!mojo::Equals(this->max_element_index, other_struct.max_element_index))
    return false;
  if (!mojo::Equals(this->max_elements_indices, other_struct.max_elements_indices))
    return false;
  if (!mojo::Equals(this->max_elements_vertices, other_struct.max_elements_vertices))
    return false;
  if (!mojo::Equals(this->max_fragment_input_components, other_struct.max_fragment_input_components))
    return false;
  if (!mojo::Equals(this->max_fragment_uniform_blocks, other_struct.max_fragment_uniform_blocks))
    return false;
  if (!mojo::Equals(this->max_fragment_uniform_components, other_struct.max_fragment_uniform_components))
    return false;
  if (!mojo::Equals(this->max_program_texel_offset, other_struct.max_program_texel_offset))
    return false;
  if (!mojo::Equals(this->max_samples, other_struct.max_samples))
    return false;
  if (!mojo::Equals(this->max_server_wait_timeout, other_struct.max_server_wait_timeout))
    return false;
  if (!mojo::Equals(this->max_texture_lod_bias, other_struct.max_texture_lod_bias))
    return false;
  if (!mojo::Equals(this->max_transform_feedback_interleaved_components, other_struct.max_transform_feedback_interleaved_components))
    return false;
  if (!mojo::Equals(this->max_transform_feedback_separate_attribs, other_struct.max_transform_feedback_separate_attribs))
    return false;
  if (!mojo::Equals(this->max_transform_feedback_separate_components, other_struct.max_transform_feedback_separate_components))
    return false;
  if (!mojo::Equals(this->max_uniform_block_size, other_struct.max_uniform_block_size))
    return false;
  if (!mojo::Equals(this->max_uniform_buffer_bindings, other_struct.max_uniform_buffer_bindings))
    return false;
  if (!mojo::Equals(this->max_varying_components, other_struct.max_varying_components))
    return false;
  if (!mojo::Equals(this->max_vertex_output_components, other_struct.max_vertex_output_components))
    return false;
  if (!mojo::Equals(this->max_vertex_uniform_blocks, other_struct.max_vertex_uniform_blocks))
    return false;
  if (!mojo::Equals(this->max_vertex_uniform_components, other_struct.max_vertex_uniform_components))
    return false;
  if (!mojo::Equals(this->min_program_texel_offset, other_struct.min_program_texel_offset))
    return false;
  if (!mojo::Equals(this->num_program_binary_formats, other_struct.num_program_binary_formats))
    return false;
  if (!mojo::Equals(this->uniform_buffer_offset_alignment, other_struct.uniform_buffer_offset_alignment))
    return false;
  if (!mojo::Equals(this->occlusion_query_boolean, other_struct.occlusion_query_boolean))
    return false;
  if (!mojo::Equals(this->timer_queries, other_struct.timer_queries))
    return false;
  if (!mojo::Equals(this->max_texture_size, other_struct.max_texture_size))
    return false;
  if (!mojo::Equals(this->sync_query, other_struct.sync_query))
    return false;
  return true;
}

template <typename T, GLCapabilities::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
  if (lhs.vertex_shader_precisions < rhs.vertex_shader_precisions)
    return true;
  if (rhs.vertex_shader_precisions < lhs.vertex_shader_precisions)
    return false;
  if (lhs.fragment_shader_precisions < rhs.fragment_shader_precisions)
    return true;
  if (rhs.fragment_shader_precisions < lhs.fragment_shader_precisions)
    return false;
  if (lhs.major_version < rhs.major_version)
    return true;
  if (rhs.major_version < lhs.major_version)
    return false;
  if (lhs.minor_version < rhs.minor_version)
    return true;
  if (rhs.minor_version < lhs.minor_version)
    return false;
  if (lhs.max_combined_texture_image_units < rhs.max_combined_texture_image_units)
    return true;
  if (rhs.max_combined_texture_image_units < lhs.max_combined_texture_image_units)
    return false;
  if (lhs.max_cube_map_texture_size < rhs.max_cube_map_texture_size)
    return true;
  if (rhs.max_cube_map_texture_size < lhs.max_cube_map_texture_size)
    return false;
  if (lhs.max_fragment_uniform_vectors < rhs.max_fragment_uniform_vectors)
    return true;
  if (rhs.max_fragment_uniform_vectors < lhs.max_fragment_uniform_vectors)
    return false;
  if (lhs.max_renderbuffer_size < rhs.max_renderbuffer_size)
    return true;
  if (rhs.max_renderbuffer_size < lhs.max_renderbuffer_size)
    return false;
  if (lhs.max_texture_image_units < rhs.max_texture_image_units)
    return true;
  if (rhs.max_texture_image_units < lhs.max_texture_image_units)
    return false;
  if (lhs.max_varying_vectors < rhs.max_varying_vectors)
    return true;
  if (rhs.max_varying_vectors < lhs.max_varying_vectors)
    return false;
  if (lhs.max_vertex_attribs < rhs.max_vertex_attribs)
    return true;
  if (rhs.max_vertex_attribs < lhs.max_vertex_attribs)
    return false;
  if (lhs.max_vertex_texture_image_units < rhs.max_vertex_texture_image_units)
    return true;
  if (rhs.max_vertex_texture_image_units < lhs.max_vertex_texture_image_units)
    return false;
  if (lhs.max_vertex_uniform_vectors < rhs.max_vertex_uniform_vectors)
    return true;
  if (rhs.max_vertex_uniform_vectors < lhs.max_vertex_uniform_vectors)
    return false;
  if (lhs.max_viewport_width < rhs.max_viewport_width)
    return true;
  if (rhs.max_viewport_width < lhs.max_viewport_width)
    return false;
  if (lhs.max_viewport_height < rhs.max_viewport_height)
    return true;
  if (rhs.max_viewport_height < lhs.max_viewport_height)
    return false;
  if (lhs.num_compressed_texture_formats < rhs.num_compressed_texture_formats)
    return true;
  if (rhs.num_compressed_texture_formats < lhs.num_compressed_texture_formats)
    return false;
  if (lhs.num_shader_binary_formats < rhs.num_shader_binary_formats)
    return true;
  if (rhs.num_shader_binary_formats < lhs.num_shader_binary_formats)
    return false;
  if (lhs.max_3d_texture_size < rhs.max_3d_texture_size)
    return true;
  if (rhs.max_3d_texture_size < lhs.max_3d_texture_size)
    return false;
  if (lhs.max_array_texture_layers < rhs.max_array_texture_layers)
    return true;
  if (rhs.max_array_texture_layers < lhs.max_array_texture_layers)
    return false;
  if (lhs.max_color_attachments < rhs.max_color_attachments)
    return true;
  if (rhs.max_color_attachments < lhs.max_color_attachments)
    return false;
  if (lhs.max_combined_fragment_uniform_components < rhs.max_combined_fragment_uniform_components)
    return true;
  if (rhs.max_combined_fragment_uniform_components < lhs.max_combined_fragment_uniform_components)
    return false;
  if (lhs.max_combined_uniform_blocks < rhs.max_combined_uniform_blocks)
    return true;
  if (rhs.max_combined_uniform_blocks < lhs.max_combined_uniform_blocks)
    return false;
  if (lhs.max_combined_vertex_uniform_components < rhs.max_combined_vertex_uniform_components)
    return true;
  if (rhs.max_combined_vertex_uniform_components < lhs.max_combined_vertex_uniform_components)
    return false;
  if (lhs.max_draw_buffers < rhs.max_draw_buffers)
    return true;
  if (rhs.max_draw_buffers < lhs.max_draw_buffers)
    return false;
  if (lhs.max_element_index < rhs.max_element_index)
    return true;
  if (rhs.max_element_index < lhs.max_element_index)
    return false;
  if (lhs.max_elements_indices < rhs.max_elements_indices)
    return true;
  if (rhs.max_elements_indices < lhs.max_elements_indices)
    return false;
  if (lhs.max_elements_vertices < rhs.max_elements_vertices)
    return true;
  if (rhs.max_elements_vertices < lhs.max_elements_vertices)
    return false;
  if (lhs.max_fragment_input_components < rhs.max_fragment_input_components)
    return true;
  if (rhs.max_fragment_input_components < lhs.max_fragment_input_components)
    return false;
  if (lhs.max_fragment_uniform_blocks < rhs.max_fragment_uniform_blocks)
    return true;
  if (rhs.max_fragment_uniform_blocks < lhs.max_fragment_uniform_blocks)
    return false;
  if (lhs.max_fragment_uniform_components < rhs.max_fragment_uniform_components)
    return true;
  if (rhs.max_fragment_uniform_components < lhs.max_fragment_uniform_components)
    return false;
  if (lhs.max_program_texel_offset < rhs.max_program_texel_offset)
    return true;
  if (rhs.max_program_texel_offset < lhs.max_program_texel_offset)
    return false;
  if (lhs.max_samples < rhs.max_samples)
    return true;
  if (rhs.max_samples < lhs.max_samples)
    return false;
  if (lhs.max_server_wait_timeout < rhs.max_server_wait_timeout)
    return true;
  if (rhs.max_server_wait_timeout < lhs.max_server_wait_timeout)
    return false;
  if (lhs.max_texture_lod_bias < rhs.max_texture_lod_bias)
    return true;
  if (rhs.max_texture_lod_bias < lhs.max_texture_lod_bias)
    return false;
  if (lhs.max_transform_feedback_interleaved_components < rhs.max_transform_feedback_interleaved_components)
    return true;
  if (rhs.max_transform_feedback_interleaved_components < lhs.max_transform_feedback_interleaved_components)
    return false;
  if (lhs.max_transform_feedback_separate_attribs < rhs.max_transform_feedback_separate_attribs)
    return true;
  if (rhs.max_transform_feedback_separate_attribs < lhs.max_transform_feedback_separate_attribs)
    return false;
  if (lhs.max_transform_feedback_separate_components < rhs.max_transform_feedback_separate_components)
    return true;
  if (rhs.max_transform_feedback_separate_components < lhs.max_transform_feedback_separate_components)
    return false;
  if (lhs.max_uniform_block_size < rhs.max_uniform_block_size)
    return true;
  if (rhs.max_uniform_block_size < lhs.max_uniform_block_size)
    return false;
  if (lhs.max_uniform_buffer_bindings < rhs.max_uniform_buffer_bindings)
    return true;
  if (rhs.max_uniform_buffer_bindings < lhs.max_uniform_buffer_bindings)
    return false;
  if (lhs.max_varying_components < rhs.max_varying_components)
    return true;
  if (rhs.max_varying_components < lhs.max_varying_components)
    return false;
  if (lhs.max_vertex_output_components < rhs.max_vertex_output_components)
    return true;
  if (rhs.max_vertex_output_components < lhs.max_vertex_output_components)
    return false;
  if (lhs.max_vertex_uniform_blocks < rhs.max_vertex_uniform_blocks)
    return true;
  if (rhs.max_vertex_uniform_blocks < lhs.max_vertex_uniform_blocks)
    return false;
  if (lhs.max_vertex_uniform_components < rhs.max_vertex_uniform_components)
    return true;
  if (rhs.max_vertex_uniform_components < lhs.max_vertex_uniform_components)
    return false;
  if (lhs.min_program_texel_offset < rhs.min_program_texel_offset)
    return true;
  if (rhs.min_program_texel_offset < lhs.min_program_texel_offset)
    return false;
  if (lhs.num_program_binary_formats < rhs.num_program_binary_formats)
    return true;
  if (rhs.num_program_binary_formats < lhs.num_program_binary_formats)
    return false;
  if (lhs.uniform_buffer_offset_alignment < rhs.uniform_buffer_offset_alignment)
    return true;
  if (rhs.uniform_buffer_offset_alignment < lhs.uniform_buffer_offset_alignment)
    return false;
  if (lhs.occlusion_query_boolean < rhs.occlusion_query_boolean)
    return true;
  if (rhs.occlusion_query_boolean < lhs.occlusion_query_boolean)
    return false;
  if (lhs.timer_queries < rhs.timer_queries)
    return true;
  if (rhs.timer_queries < lhs.timer_queries)
    return false;
  if (lhs.max_texture_size < rhs.max_texture_size)
    return true;
  if (rhs.max_texture_size < lhs.max_texture_size)
    return false;
  if (lhs.sync_query < rhs.sync_query)
    return true;
  if (rhs.sync_query < lhs.sync_query)
    return false;
  return false;
}


}  // gpu::mojom

namespace mojo {


template <>
struct GPU_EXPORT StructTraits<::gpu::mojom::Capabilities::DataView,
                                         ::gpu::mojom::CapabilitiesPtr> {
  static bool IsNull(const ::gpu::mojom::CapabilitiesPtr& input) { return !input; }
  static void SetToNull(::gpu::mojom::CapabilitiesPtr* output) { output->reset(); }

  static decltype(::gpu::mojom::Capabilities::max_texture_size) max_texture_size(
      const ::gpu::mojom::CapabilitiesPtr& input) {
    return input->max_texture_size;
  }

  static decltype(::gpu::mojom::Capabilities::egl_image_external) egl_image_external(
      const ::gpu::mojom::CapabilitiesPtr& input) {
    return input->egl_image_external;
  }

  static decltype(::gpu::mojom::Capabilities::texture_format_bgra8888) texture_format_bgra8888(
      const ::gpu::mojom::CapabilitiesPtr& input) {
    return input->texture_format_bgra8888;
  }

  static decltype(::gpu::mojom::Capabilities::texture_format_etc1_npot) texture_format_etc1_npot(
      const ::gpu::mojom::CapabilitiesPtr& input) {
    return input->texture_format_etc1_npot;
  }

  static decltype(::gpu::mojom::Capabilities::disable_mac_swangle_rgbx) disable_mac_swangle_rgbx(
      const ::gpu::mojom::CapabilitiesPtr& input) {
    return input->disable_mac_swangle_rgbx;
  }

  static decltype(::gpu::mojom::Capabilities::sync_query) sync_query(
      const ::gpu::mojom::CapabilitiesPtr& input) {
    return input->sync_query;
  }

  static decltype(::gpu::mojom::Capabilities::texture_rg) texture_rg(
      const ::gpu::mojom::CapabilitiesPtr& input) {
    return input->texture_rg;
  }

  static decltype(::gpu::mojom::Capabilities::texture_norm16) texture_norm16(
      const ::gpu::mojom::CapabilitiesPtr& input) {
    return input->texture_norm16;
  }

  static decltype(::gpu::mojom::Capabilities::texture_half_float_linear) texture_half_float_linear(
      const ::gpu::mojom::CapabilitiesPtr& input) {
    return input->texture_half_float_linear;
  }

  static decltype(::gpu::mojom::Capabilities::image_ar30) image_ar30(
      const ::gpu::mojom::CapabilitiesPtr& input) {
    return input->image_ar30;
  }

  static decltype(::gpu::mojom::Capabilities::image_ab30) image_ab30(
      const ::gpu::mojom::CapabilitiesPtr& input) {
    return input->image_ab30;
  }

  static decltype(::gpu::mojom::Capabilities::render_buffer_format_bgra8888) render_buffer_format_bgra8888(
      const ::gpu::mojom::CapabilitiesPtr& input) {
    return input->render_buffer_format_bgra8888;
  }

  static decltype(::gpu::mojom::Capabilities::msaa_is_slow) msaa_is_slow(
      const ::gpu::mojom::CapabilitiesPtr& input) {
    return input->msaa_is_slow;
  }

  static decltype(::gpu::mojom::Capabilities::avoid_stencil_buffers) avoid_stencil_buffers(
      const ::gpu::mojom::CapabilitiesPtr& input) {
    return input->avoid_stencil_buffers;
  }

  static decltype(::gpu::mojom::Capabilities::supports_rgb_to_yuv_conversion) supports_rgb_to_yuv_conversion(
      const ::gpu::mojom::CapabilitiesPtr& input) {
    return input->supports_rgb_to_yuv_conversion;
  }

  static decltype(::gpu::mojom::Capabilities::supports_yuv_readback) supports_yuv_readback(
      const ::gpu::mojom::CapabilitiesPtr& input) {
    return input->supports_yuv_readback;
  }

  static decltype(::gpu::mojom::Capabilities::mesa_framebuffer_flip_y) mesa_framebuffer_flip_y(
      const ::gpu::mojom::CapabilitiesPtr& input) {
    return input->mesa_framebuffer_flip_y;
  }

  static decltype(::gpu::mojom::Capabilities::context_supports_distance_field_text) context_supports_distance_field_text(
      const ::gpu::mojom::CapabilitiesPtr& input) {
    return input->context_supports_distance_field_text;
  }

  static decltype(::gpu::mojom::Capabilities::using_vulkan_context) using_vulkan_context(
      const ::gpu::mojom::CapabilitiesPtr& input) {
    return input->using_vulkan_context;
  }

  static decltype(::gpu::mojom::Capabilities::use_deferred_graphite_submit) use_deferred_graphite_submit(
      const ::gpu::mojom::CapabilitiesPtr& input) {
    return input->use_deferred_graphite_submit;
  }

  static const decltype(::gpu::mojom::Capabilities::drm_formats_and_modifiers)& drm_formats_and_modifiers(
      const ::gpu::mojom::CapabilitiesPtr& input) {
    return input->drm_formats_and_modifiers;
  }

  static decltype(::gpu::mojom::Capabilities::drm_device_id) drm_device_id(
      const ::gpu::mojom::CapabilitiesPtr& input) {
    return input->drm_device_id;
  }

  static bool Read(::gpu::mojom::Capabilities::DataView input, ::gpu::mojom::CapabilitiesPtr* output);
};


template <>
struct GPU_EXPORT StructTraits<::gpu::mojom::ShaderPrecision::DataView,
                                         ::gpu::mojom::ShaderPrecisionPtr> {
  static bool IsNull(const ::gpu::mojom::ShaderPrecisionPtr& input) { return !input; }
  static void SetToNull(::gpu::mojom::ShaderPrecisionPtr* output) { output->reset(); }

  static decltype(::gpu::mojom::ShaderPrecision::min_range) min_range(
      const ::gpu::mojom::ShaderPrecisionPtr& input) {
    return input->min_range;
  }

  static decltype(::gpu::mojom::ShaderPrecision::max_range) max_range(
      const ::gpu::mojom::ShaderPrecisionPtr& input) {
    return input->max_range;
  }

  static decltype(::gpu::mojom::ShaderPrecision::precision) precision(
      const ::gpu::mojom::ShaderPrecisionPtr& input) {
    return input->precision;
  }

  static bool Read(::gpu::mojom::ShaderPrecision::DataView input, ::gpu::mojom::ShaderPrecisionPtr* output);
};


template <>
struct GPU_EXPORT StructTraits<::gpu::mojom::PerStagePrecisions::DataView,
                                         ::gpu::mojom::PerStagePrecisionsPtr> {
  static bool IsNull(const ::gpu::mojom::PerStagePrecisionsPtr& input) { return !input; }
  static void SetToNull(::gpu::mojom::PerStagePrecisionsPtr* output) { output->reset(); }

  static const decltype(::gpu::mojom::PerStagePrecisions::low_int)& low_int(
      const ::gpu::mojom::PerStagePrecisionsPtr& input) {
    return input->low_int;
  }

  static const decltype(::gpu::mojom::PerStagePrecisions::medium_int)& medium_int(
      const ::gpu::mojom::PerStagePrecisionsPtr& input) {
    return input->medium_int;
  }

  static const decltype(::gpu::mojom::PerStagePrecisions::high_int)& high_int(
      const ::gpu::mojom::PerStagePrecisionsPtr& input) {
    return input->high_int;
  }

  static const decltype(::gpu::mojom::PerStagePrecisions::low_float)& low_float(
      const ::gpu::mojom::PerStagePrecisionsPtr& input) {
    return input->low_float;
  }

  static const decltype(::gpu::mojom::PerStagePrecisions::medium_float)& medium_float(
      const ::gpu::mojom::PerStagePrecisionsPtr& input) {
    return input->medium_float;
  }

  static const decltype(::gpu::mojom::PerStagePrecisions::high_float)& high_float(
      const ::gpu::mojom::PerStagePrecisionsPtr& input) {
    return input->high_float;
  }

  static bool Read(::gpu::mojom::PerStagePrecisions::DataView input, ::gpu::mojom::PerStagePrecisionsPtr* output);
};


template <>
struct GPU_EXPORT StructTraits<::gpu::mojom::GLCapabilities::DataView,
                                         ::gpu::mojom::GLCapabilitiesPtr> {
  static bool IsNull(const ::gpu::mojom::GLCapabilitiesPtr& input) { return !input; }
  static void SetToNull(::gpu::mojom::GLCapabilitiesPtr* output) { output->reset(); }

  static const decltype(::gpu::mojom::GLCapabilities::vertex_shader_precisions)& vertex_shader_precisions(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->vertex_shader_precisions;
  }

  static const decltype(::gpu::mojom::GLCapabilities::fragment_shader_precisions)& fragment_shader_precisions(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->fragment_shader_precisions;
  }

  static decltype(::gpu::mojom::GLCapabilities::major_version) major_version(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->major_version;
  }

  static decltype(::gpu::mojom::GLCapabilities::minor_version) minor_version(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->minor_version;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_combined_texture_image_units) max_combined_texture_image_units(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_combined_texture_image_units;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_cube_map_texture_size) max_cube_map_texture_size(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_cube_map_texture_size;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_fragment_uniform_vectors) max_fragment_uniform_vectors(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_fragment_uniform_vectors;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_renderbuffer_size) max_renderbuffer_size(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_renderbuffer_size;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_texture_image_units) max_texture_image_units(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_texture_image_units;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_varying_vectors) max_varying_vectors(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_varying_vectors;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_vertex_attribs) max_vertex_attribs(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_vertex_attribs;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_vertex_texture_image_units) max_vertex_texture_image_units(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_vertex_texture_image_units;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_vertex_uniform_vectors) max_vertex_uniform_vectors(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_vertex_uniform_vectors;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_viewport_width) max_viewport_width(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_viewport_width;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_viewport_height) max_viewport_height(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_viewport_height;
  }

  static decltype(::gpu::mojom::GLCapabilities::num_compressed_texture_formats) num_compressed_texture_formats(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->num_compressed_texture_formats;
  }

  static decltype(::gpu::mojom::GLCapabilities::num_shader_binary_formats) num_shader_binary_formats(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->num_shader_binary_formats;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_3d_texture_size) max_3d_texture_size(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_3d_texture_size;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_array_texture_layers) max_array_texture_layers(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_array_texture_layers;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_color_attachments) max_color_attachments(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_color_attachments;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_combined_fragment_uniform_components) max_combined_fragment_uniform_components(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_combined_fragment_uniform_components;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_combined_uniform_blocks) max_combined_uniform_blocks(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_combined_uniform_blocks;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_combined_vertex_uniform_components) max_combined_vertex_uniform_components(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_combined_vertex_uniform_components;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_draw_buffers) max_draw_buffers(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_draw_buffers;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_element_index) max_element_index(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_element_index;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_elements_indices) max_elements_indices(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_elements_indices;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_elements_vertices) max_elements_vertices(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_elements_vertices;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_fragment_input_components) max_fragment_input_components(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_fragment_input_components;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_fragment_uniform_blocks) max_fragment_uniform_blocks(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_fragment_uniform_blocks;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_fragment_uniform_components) max_fragment_uniform_components(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_fragment_uniform_components;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_program_texel_offset) max_program_texel_offset(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_program_texel_offset;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_samples) max_samples(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_samples;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_server_wait_timeout) max_server_wait_timeout(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_server_wait_timeout;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_texture_lod_bias) max_texture_lod_bias(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_texture_lod_bias;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_transform_feedback_interleaved_components) max_transform_feedback_interleaved_components(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_transform_feedback_interleaved_components;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_transform_feedback_separate_attribs) max_transform_feedback_separate_attribs(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_transform_feedback_separate_attribs;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_transform_feedback_separate_components) max_transform_feedback_separate_components(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_transform_feedback_separate_components;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_uniform_block_size) max_uniform_block_size(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_uniform_block_size;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_uniform_buffer_bindings) max_uniform_buffer_bindings(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_uniform_buffer_bindings;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_varying_components) max_varying_components(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_varying_components;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_vertex_output_components) max_vertex_output_components(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_vertex_output_components;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_vertex_uniform_blocks) max_vertex_uniform_blocks(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_vertex_uniform_blocks;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_vertex_uniform_components) max_vertex_uniform_components(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_vertex_uniform_components;
  }

  static decltype(::gpu::mojom::GLCapabilities::min_program_texel_offset) min_program_texel_offset(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->min_program_texel_offset;
  }

  static decltype(::gpu::mojom::GLCapabilities::num_program_binary_formats) num_program_binary_formats(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->num_program_binary_formats;
  }

  static decltype(::gpu::mojom::GLCapabilities::uniform_buffer_offset_alignment) uniform_buffer_offset_alignment(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->uniform_buffer_offset_alignment;
  }

  static decltype(::gpu::mojom::GLCapabilities::occlusion_query_boolean) occlusion_query_boolean(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->occlusion_query_boolean;
  }

  static decltype(::gpu::mojom::GLCapabilities::timer_queries) timer_queries(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->timer_queries;
  }

  static decltype(::gpu::mojom::GLCapabilities::max_texture_size) max_texture_size(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->max_texture_size;
  }

  static decltype(::gpu::mojom::GLCapabilities::sync_query) sync_query(
      const ::gpu::mojom::GLCapabilitiesPtr& input) {
    return input->sync_query;
  }

  static bool Read(::gpu::mojom::GLCapabilities::DataView input, ::gpu::mojom::GLCapabilitiesPtr* output);
};

}  // namespace mojo

#endif  // GPU_IPC_COMMON_CAPABILITIES_MOJOM_H_