UNPKG

pixi.js

Version:

<p align="center"> <a href="https://pixijs.com" target="_blank" rel="noopener noreferrer"> <img height="150" src="https://files.pixijs.download/branding/pixijs-logo-transparent-dark.svg?v=1" alt="PixiJS logo"> </a> </p> <br/> <p align="center">

1 lines 24.6 kB
{"version":3,"file":"GlContextSystem.mjs","sources":["../../../../../src/rendering/renderers/gl/context/GlContextSystem.ts"],"sourcesContent":["import { DOMAdapter } from '../../../../environment/adapter';\nimport { ExtensionType } from '../../../../extensions/Extensions';\nimport { warn } from '../../../../utils/logging/warn';\nimport { type GpuPowerPreference } from '../../types';\n\nimport type { ICanvas } from '../../../../environment/canvas/ICanvas';\nimport type { System } from '../../shared/system/System';\nimport type { WebGLRenderer } from '../WebGLRenderer';\nimport type { WebGLExtensions } from './WebGLExtensions';\n\n/**\n * Options for the context system.\n * @category rendering\n * @advanced\n * @property {WebGL2RenderingContext | null} [context=null] - User-provided WebGL rendering context object.\n * @property {GpuPowerPreference} [powerPreference='default'] - An optional hint indicating what configuration\n * of GPU is suitable for the WebGL context, can be `'high-performance'` or `'low-power'`. Setting to `'high-performance'`\n * will prioritize rendering performance over power consumption, while setting to `'low-power'` will prioritize power saving\n * over rendering performance.\n * @property {boolean} [premultipliedAlpha=true] - Whether the compositor will assume the drawing buffer contains\n * colors with premultiplied alpha.\n * @property {boolean} [preserveDrawingBuffer=false] - Whether to enable drawing buffer preservation.\n * If enabled, the drawing buffer will preserve\n * its value until cleared or overwritten. Enable this if you need to call `toDataUrl` on the WebGL context.\n * @property {boolean} [antialias] - Whether to enable antialiasing.\n * @property {1 | 2} [preferWebGLVersion=2] - The preferred WebGL version to use.\n */\nexport interface ContextSystemOptions\n{\n /**\n * User-provided WebGL rendering context object.\n * @default null\n */\n context: WebGL2RenderingContext | null;\n /**\n * An optional hint indicating what configuration of GPU is suitable for the WebGL context,\n * can be `'high-performance'` or `'low-power'`.\n * Setting to `'high-performance'` will prioritize rendering performance over power consumption,\n * while setting to `'low-power'` will prioritize power saving over rendering performance.\n * @default undefined\n */\n powerPreference?: GpuPowerPreference;\n\n /**\n * Whether the compositor will assume the drawing buffer contains colors with premultiplied alpha.\n * @default true\n */\n premultipliedAlpha: boolean;\n /**\n * Whether to enable drawing buffer preservation. If enabled, the drawing buffer will preserve\n * its value until cleared or overwritten. Enable this if you need to call `toDataUrl` on the WebGL context.\n * @default false\n */\n preserveDrawingBuffer: boolean;\n\n antialias?: boolean;\n\n /**\n * The preferred WebGL version to use.\n * @default 2\n */\n preferWebGLVersion?: 1 | 2;\n\n /**\n * Whether to enable multi-view rendering. Set to true when rendering to multiple\n * canvases on the dom.\n * @default false\n */\n multiView: boolean;\n}\n\n/**\n * System plugin to the renderer to manage the context\n * @category rendering\n * @advanced\n */\nexport class GlContextSystem implements System<ContextSystemOptions>\n{\n /** @ignore */\n public static extension = {\n type: [\n ExtensionType.WebGLSystem,\n ],\n name: 'context',\n } as const;\n\n /** The default options for the system. */\n public static defaultOptions: ContextSystemOptions = {\n /**\n * {@link WebGLOptions.context}\n * @default null\n */\n context: null,\n /**\n * {@link WebGLOptions.premultipliedAlpha}\n * @default true\n */\n premultipliedAlpha: true,\n /**\n * {@link WebGLOptions.preserveDrawingBuffer}\n * @default false\n */\n preserveDrawingBuffer: false,\n /**\n * {@link WebGLOptions.powerPreference}\n * @default default\n */\n powerPreference: undefined,\n /**\n * {@link WebGLOptions.webGLVersion}\n * @default 2\n */\n preferWebGLVersion: 2,\n /**\n * {@link WebGLOptions.multiView}\n * @default false\n */\n multiView: false\n };\n\n protected CONTEXT_UID: number;\n protected gl: WebGL2RenderingContext;\n\n /**\n * Features supported by current renderer.\n * @type {object}\n * @readonly\n */\n public supports = {\n /** Support for 32-bit indices buffer. */\n uint32Indices: true,\n /** Support for UniformBufferObjects */\n uniformBufferObject: true,\n /** Support for VertexArrayObjects */\n vertexArrayObject: true,\n /** Support for SRGB texture format */\n srgbTextures: true,\n /** Support for wrapping modes if a texture is non-power of two */\n nonPowOf2wrapping: true,\n /** Support for MSAA (antialiasing of dynamic textures) */\n msaa: true,\n /** Support for mipmaps if a texture is non-power of two */\n nonPowOf2mipmaps: true,\n };\n\n /**\n * Extensions available.\n * @type {object}\n * @readonly\n * @property {WEBGL_draw_buffers} drawBuffers - WebGL v1 extension\n * @property {WEBGL_depth_texture} depthTexture - WebGL v1 extension\n * @property {OES_texture_float} floatTexture - WebGL v1 extension\n * @property {WEBGL_lose_context} loseContext - WebGL v1 extension\n * @property {OES_vertex_array_object} vertexArrayObject - WebGL v1 extension\n * @property {EXT_texture_filter_anisotropic} anisotropicFiltering - WebGL v1 and v2 extension\n */\n public extensions: WebGLExtensions;\n\n public webGLVersion: 1 | 2;\n\n /**\n * Whether to enable multi-view rendering. Set to true when rendering to multiple\n * canvases on the dom.\n * @default false\n */\n public multiView: boolean;\n\n /**\n * The canvas that the WebGL Context is rendering to.\n * This will be the view canvas. But if multiView is enabled, this canvas will not be attached to the DOM.\n * It will be rendered to and then copied to the target canvas.\n * @readonly\n */\n public canvas: ICanvas;\n\n private _renderer: WebGLRenderer;\n private _contextLossForced: boolean;\n\n /** @param renderer - The renderer this System works for. */\n constructor(renderer: WebGLRenderer)\n {\n this._renderer = renderer;\n\n this.extensions = Object.create(null);\n\n // Bind functions\n this.handleContextLost = this.handleContextLost.bind(this);\n this.handleContextRestored = this.handleContextRestored.bind(this);\n }\n\n /**\n * `true` if the context is lost\n * @readonly\n */\n get isLost(): boolean\n {\n return (!this.gl || this.gl.isContextLost());\n }\n\n /**\n * Handles the context change event.\n * @param {WebGLRenderingContext} gl - New WebGL context.\n */\n protected contextChange(gl: WebGL2RenderingContext): void\n {\n this.gl = gl;\n this._renderer.gl = gl;\n }\n\n public init(options: ContextSystemOptions): void\n {\n options = { ...GlContextSystem.defaultOptions, ...options };\n\n // TODO add to options\n let multiView = this.multiView = options.multiView;\n\n if (options.context && multiView)\n {\n // eslint-disable-next-line max-len\n warn('Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together.');\n\n multiView = false;\n }\n\n if (multiView)\n {\n this.canvas = DOMAdapter.get()\n .createCanvas(this._renderer.canvas.width, this._renderer.canvas.height);\n }\n else\n {\n this.canvas = this._renderer.view.canvas;\n }\n /*\n * The options passed in to create a new WebGL context.\n */\n if (options.context)\n {\n this.initFromContext(options.context);\n }\n else\n {\n const alpha = this._renderer.background.alpha < 1;\n const premultipliedAlpha = options.premultipliedAlpha ?? true;\n const antialias = options.antialias && !this._renderer.backBuffer.useBackBuffer;\n\n this.createContext(options.preferWebGLVersion, {\n alpha,\n premultipliedAlpha,\n antialias,\n stencil: true,\n preserveDrawingBuffer: options.preserveDrawingBuffer,\n powerPreference: options.powerPreference ?? 'default',\n });\n }\n }\n\n public ensureCanvasSize(targetCanvas: ICanvas): void\n {\n if (!this.multiView)\n {\n if (targetCanvas !== this.canvas)\n {\n warn('multiView is disabled, but targetCanvas is not the main canvas');\n }\n\n return;\n }\n\n const { canvas } = this;\n\n if (canvas.width < targetCanvas.width || canvas.height < targetCanvas.height)\n {\n canvas.width = Math.max(targetCanvas.width, targetCanvas.width);\n canvas.height = Math.max(targetCanvas.height, targetCanvas.height);\n }\n }\n\n /**\n * Initializes the context.\n * @protected\n * @param {WebGLRenderingContext} gl - WebGL context\n */\n protected initFromContext(gl: WebGL2RenderingContext): void\n {\n this.gl = gl;\n\n this.webGLVersion = gl instanceof DOMAdapter.get().getWebGLRenderingContext() ? 1 : 2;\n\n this.getExtensions();\n\n this.validateContext(gl);\n\n this._renderer.runners.contextChange.emit(gl);\n\n const element = this._renderer.view.canvas;\n\n (element as any).addEventListener('webglcontextlost', this.handleContextLost, false);\n element.addEventListener('webglcontextrestored', this.handleContextRestored, false);\n }\n\n /**\n * Initialize from context options\n * @protected\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext\n * @param preferWebGLVersion\n * @param {object} options - context attributes\n */\n protected createContext(preferWebGLVersion: 1 | 2, options: WebGLContextAttributes): void\n {\n let gl: WebGL2RenderingContext | WebGLRenderingContext;\n\n const canvas = this.canvas;\n\n if (preferWebGLVersion === 2)\n {\n gl = canvas.getContext('webgl2', options);\n }\n\n if (!gl)\n {\n gl = canvas.getContext('webgl', options);\n\n if (!gl)\n {\n // fail, not able to get a context\n throw new Error('This browser does not support WebGL. Try using the canvas renderer');\n }\n }\n\n this.gl = gl as WebGL2RenderingContext;\n\n this.initFromContext(this.gl);\n }\n\n /** Auto-populate the {@link GlContextSystem.extensions extensions}. */\n protected getExtensions(): void\n {\n // time to set up default extensions that Pixi uses.\n const { gl } = this;\n\n const common = {\n anisotropicFiltering: gl.getExtension('EXT_texture_filter_anisotropic'),\n floatTextureLinear: gl.getExtension('OES_texture_float_linear'),\n\n s3tc: gl.getExtension('WEBGL_compressed_texture_s3tc'),\n s3tc_sRGB: gl.getExtension('WEBGL_compressed_texture_s3tc_srgb'), // eslint-disable-line camelcase\n etc: gl.getExtension('WEBGL_compressed_texture_etc'),\n etc1: gl.getExtension('WEBGL_compressed_texture_etc1'),\n pvrtc: gl.getExtension('WEBGL_compressed_texture_pvrtc')\n || gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'),\n atc: gl.getExtension('WEBGL_compressed_texture_atc'),\n astc: gl.getExtension('WEBGL_compressed_texture_astc'),\n bptc: gl.getExtension('EXT_texture_compression_bptc'),\n rgtc: gl.getExtension('EXT_texture_compression_rgtc'),\n loseContext: gl.getExtension('WEBGL_lose_context'),\n };\n\n if (this.webGLVersion === 1)\n {\n this.extensions = {\n ...common,\n\n drawBuffers: gl.getExtension('WEBGL_draw_buffers'),\n depthTexture: gl.getExtension('WEBGL_depth_texture'),\n vertexArrayObject: gl.getExtension('OES_vertex_array_object')\n || gl.getExtension('MOZ_OES_vertex_array_object')\n || gl.getExtension('WEBKIT_OES_vertex_array_object'),\n uint32ElementIndex: gl.getExtension('OES_element_index_uint'),\n // Floats and half-floats\n floatTexture: gl.getExtension('OES_texture_float'),\n floatTextureLinear: gl.getExtension('OES_texture_float_linear'),\n textureHalfFloat: gl.getExtension('OES_texture_half_float'),\n textureHalfFloatLinear: gl.getExtension('OES_texture_half_float_linear'),\n vertexAttribDivisorANGLE: gl.getExtension('ANGLE_instanced_arrays'),\n srgb: gl.getExtension('EXT_sRGB'),\n };\n }\n else\n {\n this.extensions = {\n ...common,\n colorBufferFloat: gl.getExtension('EXT_color_buffer_float'),\n };\n\n const provokeExt = gl.getExtension('WEBGL_provoking_vertex');\n\n if (provokeExt)\n {\n provokeExt.provokingVertexWEBGL(provokeExt.FIRST_VERTEX_CONVENTION_WEBGL);\n }\n }\n }\n\n /**\n * Handles a lost webgl context\n * @param {WebGLContextEvent} event - The context lost event.\n */\n protected handleContextLost(event: WebGLContextEvent): void\n {\n event.preventDefault();\n\n // only restore if we purposefully nuked it\n if (this._contextLossForced)\n {\n this._contextLossForced = false;\n // Restore the context after this event has exited\n setTimeout(() =>\n {\n if (this.gl.isContextLost())\n {\n this.extensions.loseContext?.restoreContext();\n }\n }, 0);\n }\n }\n\n /** Handles a restored webgl context. */\n protected handleContextRestored(): void\n {\n this.getExtensions(); // restore extensions state\n this._renderer.runners.contextChange.emit(this.gl);\n }\n\n public destroy(): void\n {\n const element = this._renderer.view.canvas;\n\n this._renderer = null;\n\n // remove listeners\n (element as any).removeEventListener('webglcontextlost', this.handleContextLost);\n element.removeEventListener('webglcontextrestored', this.handleContextRestored);\n\n this.gl.useProgram(null);\n\n this.extensions.loseContext?.loseContext();\n }\n\n /**\n * this function can be called to force a webGL context loss\n * this will release all resources on the GPU.\n * Useful if you need to put Pixi to sleep, and save some GPU memory\n *\n * As soon as render is called - all resources will be created again.\n */\n public forceContextLoss(): void\n {\n this.extensions.loseContext?.loseContext();\n this._contextLossForced = true;\n }\n /**\n * Validate context.\n * @param {WebGLRenderingContext} gl - Render context.\n */\n protected validateContext(gl: WebGL2RenderingContext): void\n {\n const attributes = gl.getContextAttributes();\n\n // this is going to be fairly simple for now.. but at least we have room to grow!\n if (attributes && !attributes.stencil)\n {\n // #if _DEBUG\n warn('Provided WebGL context does not have a stencil buffer, masks may not render correctly');\n // #endif\n }\n\n // support\n const supports = this.supports;\n\n const isWebGl2 = this.webGLVersion === 2;\n const extensions = this.extensions;\n\n supports.uint32Indices = isWebGl2 || !!extensions.uint32ElementIndex;\n supports.uniformBufferObject = isWebGl2;\n supports.vertexArrayObject = isWebGl2 || !!extensions.vertexArrayObject;\n supports.srgbTextures = isWebGl2 || !!extensions.srgb;\n supports.nonPowOf2wrapping = isWebGl2;\n supports.nonPowOf2mipmaps = isWebGl2;\n supports.msaa = isWebGl2;\n\n if (!supports.uint32Indices)\n {\n // #if _DEBUG\n warn('Provided WebGL context does not support 32 index buffer, large scenes may not render correctly');\n // #endif\n }\n }\n}\n"],"names":[],"mappings":";;;;;AA4EO,MAAM,gBAAA,GAAN,MAAM,gBAAA,CACb;AAAA;AAAA,EAsGI,YAAY,QAAA,EACZ;AApDA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAA,IAAA,CAAO,QAAA,GAAW;AAAA;AAAA,MAEd,aAAA,EAAe,IAAA;AAAA;AAAA,MAEf,mBAAA,EAAqB,IAAA;AAAA;AAAA,MAErB,iBAAA,EAAmB,IAAA;AAAA;AAAA,MAEnB,YAAA,EAAc,IAAA;AAAA;AAAA,MAEd,iBAAA,EAAmB,IAAA;AAAA;AAAA,MAEnB,IAAA,EAAM,IAAA;AAAA;AAAA,MAEN,gBAAA,EAAkB;AAAA,KACtB;AAsCI,IAAA,IAAA,CAAK,SAAA,GAAY,QAAA;AAEjB,IAAA,IAAA,CAAK,UAAA,mBAAa,MAAA,CAAO,MAAA,CAAO,IAAI,CAAA;AAGpC,IAAA,IAAA,CAAK,iBAAA,GAAoB,IAAA,CAAK,iBAAA,CAAkB,IAAA,CAAK,IAAI,CAAA;AACzD,IAAA,IAAA,CAAK,qBAAA,GAAwB,IAAA,CAAK,qBAAA,CAAsB,IAAA,CAAK,IAAI,CAAA;AAAA,EACrE;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,MAAA,GACJ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