shadow$provide.module$node_modules$pixi_DOT_js$lib$rendering$renderers$gpu$GpuDeviceSystem = function(global, require, module, exports) {
  var adapter = require("module$node_modules$pixi_DOT_js$lib$environment$adapter");
  global = require("module$node_modules$pixi_DOT_js$lib$extensions$Extensions");
  "use strict";
  class GpuDeviceSystem {
    constructor(renderer) {
      this._renderer = renderer;
    }
    async init(options) {
      return this._initPromise ? this._initPromise : this._initPromise = (options.gpu ? Promise.resolve(options.gpu) : this._createDeviceAndAdaptor(options)).then(gpu => {
        this.gpu = gpu;
        this.extensions = {transientAttachment:"number" === typeof GPUTextureUsage.TRANSIENT_ATTACHMENT};
        this._renderer.runners.contextChange.emit(this.gpu);
      });
    }
    contextChange(gpu) {
      this._renderer.gpu = gpu;
    }
    async _createDeviceAndAdaptor(options) {
      const adapter$1 = await adapter.DOMAdapter.get().getNavigator().gpu.requestAdapter({powerPreference:options.powerPreference, forceFallbackAdapter:options.forceFallbackAdapter});
      options = ["texture-compression-bc", "texture-compression-astc", "texture-compression-etc2"].filter(feature => adapter$1.features.has(feature));
      options = await adapter$1.requestDevice({requiredFeatures:options});
      return {adapter:adapter$1, device:options};
    }
    destroy() {
      this._renderer = this.extensions = this.gpu = null;
    }
  }
  GpuDeviceSystem.extension = {type:[global.ExtensionType.WebGPUSystem], name:"device"};
  GpuDeviceSystem.defaultOptions = {powerPreference:void 0, forceFallbackAdapter:!1};
  exports.GpuDeviceSystem = GpuDeviceSystem;
};

//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$rendering$renderers$gpu$GpuDeviceSystem.js.map
