Repository: playcanvas/engine
Pull request #4009 (2022-02-10 09:20:54)

Move GraphicsDevice to webgl subfolder
This PR moves GraphicsDevice class from /graphics to /graphics/webgl folder, and fixes import paths for this to work. This is a first step of #3993 where further refactoring is done on order to preserve the file move history, as that's quite important file to have a history for.

When this is merged, the rest of #3993 changes will be done in follow up PR.



Patch:
diff --git a/src/deprecated/deprecated.js b/src/deprecated/deprecated.js
index 93033db14..bda9cfeea 100644
--- a/src/deprecated/deprecated.js
+++ b/src/deprecated/deprecated.js
@@ -37,7 +37,7 @@ import {
 import { drawQuadWithShader } from '../graphics/simple-post-effect.js';
 import { programlib } from '../graphics/program-lib/program-lib.js';
 import { shaderChunks } from '../graphics/program-lib/chunks/chunks.js';
-import { GraphicsDevice } from '../graphics/graphics-device.js';
+import { GraphicsDevice } from '../graphics/webgl/graphics-device.js';
 import { IndexBuffer } from '../graphics/index-buffer.js';
 import { createFullscreenQuad, drawFullscreenQuad, PostEffect } from '../graphics/post-effect.js';
 import { PostEffectQueue } from '../framework/components/camera/post-effect-queue.js';
diff --git a/src/framework/application.js b/src/framework/application.js
index d3088ff9f..fa2382f53 100644
--- a/src/framework/application.js
+++ b/src/framework/application.js
@@ -20,7 +20,7 @@ import {
     PRIMITIVE_TRIANGLES, PRIMITIVE_TRIFAN, PRIMITIVE_TRISTRIP
 } from '../graphics/constants.js';
 import { destroyPostEffectQuad } from '../graphics/simple-post-effect.js';
-import { GraphicsDevice } from '../graphics/graphics-device.js';
+import { GraphicsDevice } from '../graphics/webgl/graphics-device.js';
 
 import {
     LAYERID_DEPTH, LAYERID_IMMEDIATE, LAYERID_SKYBOX, LAYERID_UI, LAYERID_WORLD,
diff --git a/src/framework/stats.js b/src/framework/stats.js
index a6835f219..a9d72d81f 100644
--- a/src/framework/stats.js
+++ b/src/framework/stats.js
@@ -1,6 +1,6 @@
 import { getApplication } from './globals.js';
 
-/** @typedef {import('../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../graphics/webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 
 /**
  * Records performance-related statistics related to the application.
diff --git a/src/graphics/debug-graphics.js b/src/graphics/debug-graphics.js
index ee569aaf4..c3cd5cc86 100644
--- a/src/graphics/debug-graphics.js
+++ b/src/graphics/debug-graphics.js
@@ -1,4 +1,4 @@
-/** @typedef {import('./graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('./webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 
 /**
  * Internal graphics debug system - gpu markers and similar. Note that the functions only execute in the
diff --git a/src/graphics/index-buffer.js b/src/graphics/index-buffer.js
index 41418ec1a..909a8bb1c 100644
--- a/src/graphics/index-buffer.js
+++ b/src/graphics/index-buffer.js
@@ -3,7 +3,7 @@ import {
     BUFFER_STATIC, INDEXFORMAT_UINT16, INDEXFORMAT_UINT32, typedArrayIndexFormatsByteSize
 } from './constants.js';
 
-/** @typedef {import('./graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('./webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 
 /**
  * An index buffer stores index values into a {@link VertexBuffer}. Indexed graphical primitives
diff --git a/src/graphics/post-effect.js b/src/graphics/post-effect.js
index a11d01162..c95a59a0c 100644
--- a/src/graphics/post-effect.js
+++ b/src/graphics/post-effect.js
@@ -4,7 +4,7 @@ import { VertexFormat } from './vertex-format.js';
 import { VertexIterator } from './vertex-iterator.js';
 
 /** @typedef {import('../math/vec4.js').Vec4} Vec4 */
-/** @typedef {import('./graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('./webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 /** @typedef {import('./render-target.js').RenderTarget} RenderTarget */
 /** @typedef {import('./shader.js').Shader} Shader */
 
diff --git a/src/graphics/program-lib/programs/standard.js b/src/graphics/program-lib/programs/standard.js
index 6b8bed6b4..177476232 100644
--- a/src/graphics/program-lib/programs/standard.js
+++ b/src/graphics/program-lib/programs/standard.js
@@ -25,7 +25,7 @@ import { LightsBuffer } from '../../../scene/lighting/lights-buffer.js';
 
 import { begin, end, fogCode, gammaCode, precisionCode, skinCode, tonemapCode, versionCode } from './common.js';
 
-/** @typedef {import('../../graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../../webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 
 const _matTex2D = [];
 
diff --git a/src/graphics/render-target.js b/src/graphics/render-target.js
index e5582b7c7..ad9ec66b4 100644
--- a/src/graphics/render-target.js
+++ b/src/graphics/render-target.js
@@ -1,7 +1,7 @@
 import { Debug } from '../core/debug.js';
 import { PIXELFORMAT_DEPTH, PIXELFORMAT_DEPTHSTENCIL } from './constants.js';
 
-import { GraphicsDevice } from './graphics-device.js';
+import { GraphicsDevice } from './webgl/graphics-device.js';
 
 /** @typedef {import('./texture.js').Texture} Texture */
 
diff --git a/src/graphics/reproject-texture.js b/src/graphics/reproject-texture.js
index 0b758892d..eb7844142 100644
--- a/src/graphics/reproject-texture.js
+++ b/src/graphics/reproject-texture.js
@@ -11,7 +11,7 @@ import { createShaderFromCode } from './program-lib/utils.js';
 import { drawQuadWithShader } from './simple-post-effect.js';
 import { shaderChunks } from './program-lib/chunks/chunks.js';
 import { RenderTarget } from './render-target.js';
-import { GraphicsDevice } from './graphics-device.js';
+import { GraphicsDevice } from './webgl/graphics-device.js';
 import { Texture } from './texture.js';
 import { DebugGraphics } from './debug-graphics.js';
 
diff --git a/src/graphics/shader-input.js b/src/graphics/shader-input.js
index 98393d396..60eb2c042 100644
--- a/src/graphics/shader-input.js
+++ b/src/graphics/shader-input.js
@@ -2,7 +2,7 @@ import { UNIFORMTYPE_FLOAT, UNIFORMTYPE_FLOATARRAY, UNIFORMTYPE_VEC2, UNIFORMTYP
     UNIFORMTYPE_VEC2ARRAY, UNIFORMTYPE_VEC3ARRAY, UNIFORMTYPE_VEC4ARRAY } from './constants.js';
 import { Version } from './version.js';
 
-/** @typedef {import('./graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('./webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 
 /**
  * Representation of a shader uniform.
diff --git a/src/graphics/shader.js b/src/graphics/shader.js
index bdd39d0e1..83c8462c2 100644
--- a/src/graphics/shader.js
+++ b/src/graphics/shader.js
@@ -1,4 +1,4 @@
-/** @typedef {import('./graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('./webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 
 /**
  * A shader is a program that is responsible for rendering graphical primitives on a device's
diff --git a/src/graphics/simple-post-effect.js b/src/graphics/simple-post-effect.js
index 75ddf483d..a02650ab7 100644
--- a/src/graphics/simple-post-effect.js
+++ b/src/graphics/simple-post-effect.js
@@ -4,7 +4,7 @@ import { VertexFormat } from './vertex-format.js';
 import { DebugGraphics } from './debug-graphics.js';
 
 /** @typedef {import('../math/vec4.js').Vec4} Vec4 */
-/** @typedef {import('./graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('./webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 /** @typedef {import('./render-target.js').RenderTarget} RenderTarget */
 /** @typedef {import('./shader.js').Shader} Shader */
 /** @typedef {import('./texture.js').Texture} Texture */
diff --git a/src/graphics/texture.js b/src/graphics/texture.js
index 14506be27..5332d46a4 100644
--- a/src/graphics/texture.js
+++ b/src/graphics/texture.js
@@ -17,7 +17,7 @@ import {
     TEXTURETYPE_DEFAULT, TEXTURETYPE_RGBM, TEXTURETYPE_RGBE, TEXTURETYPE_SWIZZLEGGGR
 } from './constants.js';
 
-/** @typedef {import('./graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('./webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 
 let _pixelSizeTable = null;
 let _blockSizeTable = null;
diff --git a/src/graphics/transform-feedback.js b/src/graphics/transform-feedback.js
index be40a3b0d..3d4366515 100644
--- a/src/graphics/transform-feedback.js
+++ b/src/graphics/transform-feedback.js
@@ -4,7 +4,7 @@ import { createShaderFromCode } from './program-lib/utils.js';
 import { VertexBuffer } from './vertex-buffer.js';
 import { DebugGraphics } from './debug-graphics.js';
 
-/** @typedef {import('./graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('./webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 /** @typedef {import('./shader.js').Shader} Shader */
 
 /**
diff --git a/src/graphics/vertex-buffer.js b/src/graphics/vertex-buffer.js
index e1fd98e60..65e3163ea 100644
--- a/src/graphics/vertex-buffer.js
+++ b/src/graphics/vertex-buffer.js
@@ -1,7 +1,7 @@
 import { Debug } from '../core/debug.js';
 import { BUFFER_STATIC } from './constants.js';
 
-/** @typedef {import('./graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('./webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 /** @typedef {import('./vertex-format.js').VertexFormat} VertexFormat */
 
 let id = 0;
diff --git a/src/graphics/vertex-format.js b/src/graphics/vertex-format.js
index 50b0a71e7..a6ac928de 100644
--- a/src/graphics/vertex-format.js
+++ b/src/graphics/vertex-format.js
@@ -8,7 +8,7 @@ import {
     SEMANTIC_COLOR, SEMANTIC_TANGENT, TYPE_FLOAT32, typedArrayTypesByteSize
 } from './constants.js';
 
-/** @typedef {import('./graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('./webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 
 /**
  * A vertex format is a descriptor that defines the layout of vertex data inside a
diff --git a/src/graphics/graphics-device.js b/src/graphics/webgl/graphics-device.js
similarity index 99%
rename from src/graphics/graphics-device.js
rename to src/graphics/webgl/graphics-device.js
index 60399de00..a4e89cb98 100644
--- a/src/graphics/graphics-device.js
+++ b/src/graphics/webgl/graphics-device.js
@@ -1,10 +1,10 @@
-import { setupVertexArrayObject } from '../polyfill/OESVertexArrayObject.js';
-import { EventHandler } from '../core/event-handler.js';
-import { now } from '../core/time.js';
-import { Debug } from '../core/debug.js';
-import { platform } from '../core/platform.js';
-import { WebglVertexBuffer } from './webgl/webgl-vertex-buffer.js';
-import { WebglIndexBuffer } from './webgl/webgl-index-buffer.js';
+import { setupVertexArrayObject } from '../../polyfill/OESVertexArrayObject.js';
+import { EventHandler } from '../../core/event-handler.js';
+import { now } from '../../core/time.js';
+import { Debug } from '../../core/debug.js';
+import { platform } from '../../core/platform.js';
+import { WebglVertexBuffer } from './webgl-vertex-buffer.js';
+import { WebglIndexBuffer } from './webgl-index-buffer.js';
 
 import {
     ADDRESS_CLAMP_TO_EDGE,
@@ -32,23 +32,23 @@ import {
     UNIFORMTYPE_TEXTURE2D, UNIFORMTYPE_TEXTURECUBE, UNIFORMTYPE_FLOATARRAY, UNIFORMTYPE_TEXTURE2D_SHADOW,
     UNIFORMTYPE_TEXTURECUBE_SHADOW, UNIFORMTYPE_TEXTURE3D, UNIFORMTYPE_VEC2ARRAY, UNIFORMTYPE_VEC3ARRAY, UNIFORMTYPE_VEC4ARRAY,
     semanticToLocation
-} from './constants.js';
-
-import { createShaderFromCode } from './program-lib/utils.js';
-import { drawQuadWithShader } from './simple-post-effect.js';
-import { programlib } from './program-lib/program-lib.js';
-import { shaderChunks } from './program-lib/chunks/chunks.js';
-import { RenderTarget } from './render-target.js';
-import { ProgramLibrary } from './program-library.js';
-import { ScopeSpace } from './scope-space.js';
-import { ShaderInput } from './shader-input.js';
-import { Texture } from './texture.js';
-import { VertexFormat } from './vertex-format.js';
-import { GrabPass } from './grab-pass.js';
-
-/** @typedef {import('./index-buffer.js').IndexBuffer} IndexBuffer */
-/** @typedef {import('./shader.js').Shader} Shader */
-/** @typedef {import('./vertex-buffer.js').VertexBuffer} VertexBuffer */
+} from '../constants.js';
+
+import { createShaderFromCode } from '../program-lib/utils.js';
+import { drawQuadWithShader } from '../simple-post-effect.js';
+import { programlib } from '../program-lib/program-lib.js';
+import { shaderChunks } from '../program-lib/chunks/chunks.js';
+import { RenderTarget } from '../render-target.js';
+import { ProgramLibrary } from '../program-library.js';
+import { ScopeSpace } from '../scope-space.js';
+import { ShaderInput } from '../shader-input.js';
+import { Texture } from '../texture.js';
+import { VertexFormat } from '../vertex-format.js';
+import { GrabPass } from '../grab-pass.js';
+
+/** @typedef {import('../index-buffer.js').IndexBuffer} IndexBuffer */
+/** @typedef {import('../shader.js').Shader} Shader */
+/** @typedef {import('../vertex-buffer.js').VertexBuffer} VertexBuffer */
 
 const EVENT_RESIZE = 'resizecanvas';
 
diff --git a/src/index.js b/src/index.js
index 749eae3e3..7b7b81a22 100644
--- a/src/index.js
+++ b/src/index.js
@@ -58,7 +58,7 @@ export { shFromCubemap } from './graphics/prefilter-cubemap.js';
 export { reprojectTexture } from './graphics/reproject-texture.js';
 export { programlib } from './graphics/program-lib/program-lib.js';
 export { shaderChunks } from './graphics/program-lib/chunks/chunks.js';
-export { GraphicsDevice } from './graphics/graphics-device.js';
+export { GraphicsDevice } from './graphics/webgl/graphics-device.js';
 export { EnvLighting } from './graphics/env-lighting.js';
 export { IndexBuffer } from './graphics/index-buffer.js';
 export { PostEffect, drawFullscreenQuad } from './graphics/post-effect.js';
diff --git a/src/resources/basis.js b/src/resources/basis.js
index 7ed310fbb..95deb1d2a 100644
--- a/src/resources/basis.js
+++ b/src/resources/basis.js
@@ -3,7 +3,7 @@ import { PIXELFORMAT_R5_G6_B5, PIXELFORMAT_R4_G4_B4_A4 } from '../graphics/const
 import { BasisWorker } from './basis-worker.js';
 import { http } from '../net/http.js';
 
-/** @typedef {import('../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../graphics/webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 
 // get the list of the device's supported compression formats
 const getCompressionFormats = (device) => {
diff --git a/src/resources/container.js b/src/resources/container.js
index 08d8053e1..dd27a0466 100644
--- a/src/resources/container.js
+++ b/src/resources/container.js
@@ -3,7 +3,7 @@ import { GlbParser } from './parser/glb-parser.js';
 
 /** @typedef {import('../asset/asset-registry.js').AssetRegistry} AssetRegistry */
 /** @typedef {import('../framework/entity.js').Entity} Entity */
-/** @typedef {import('../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../graphics/webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 /** @typedef {import('./handler.js').ResourceHandler} ResourceHandler */
 
 /**
diff --git a/src/resources/cubemap.js b/src/resources/cubemap.js
index 7aea0599e..31d616126 100644
--- a/src/resources/cubemap.js
+++ b/src/resources/cubemap.js
@@ -7,7 +7,7 @@ import { Asset } from '../asset/asset.js';
 import { Texture } from '../graphics/texture.js';
 
 /** @typedef {import('../asset/asset-registry.js').AssetRegistry} AssetRegistry */
-/** @typedef {import('../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../graphics/webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 /** @typedef {import('./handler.js').ResourceHandler} ResourceHandler */
 /** @typedef {import('./loader.js').ResourceLoader} ResourceLoader */
 
diff --git a/src/resources/model.js b/src/resources/model.js
index ec43ca31b..977fa6cf7 100644
--- a/src/resources/model.js
+++ b/src/resources/model.js
@@ -8,7 +8,7 @@ import { JsonModelParser } from './parser/json-model.js';
 
 import { DefaultMaterial } from '../scene/materials/default-material.js';
 
-/** @typedef {import('../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../graphics/webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 /** @typedef {import('./handler.js').ResourceHandler} ResourceHandler */
 
 /**
diff --git a/src/resources/sprite.js b/src/resources/sprite.js
index be02afbc4..d6a0df5f5 100644
--- a/src/resources/sprite.js
+++ b/src/resources/sprite.js
@@ -5,7 +5,7 @@ import { http } from '../net/http.js';
 import { Sprite } from '../scene/sprite.js';
 
 /** @typedef {import('../asset/asset-registry.js').AssetRegistry} AssetRegistry */
-/** @typedef {import('../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../graphics/webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 /** @typedef {import('./handler.js').ResourceHandler} ResourceHandler */
 
 // The scope of this function is the sprite asset
diff --git a/src/resources/texture.js b/src/resources/texture.js
index 1ebd08687..041240a45 100644
--- a/src/resources/texture.js
+++ b/src/resources/texture.js
@@ -17,7 +17,7 @@ import { HdrParser } from './parser/texture/hdr.js';
 
 /** @typedef {import('../asset/asset.js').Asset} Asset */
 /** @typedef {import('../asset/asset-registry.js').AssetRegistry} AssetRegistry */
-/** @typedef {import('../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../graphics/webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 /** @typedef {import('./handler.js').ResourceHandler} ResourceHandler */
 /** @typedef {import('./handler.js').resourceHandlerCallback} resourceHandlerCallback */
 /** @typedef {import('./loader.js').ResourceLoader} ResourceLoader */
diff --git a/src/scene/batching/batch-manager.js b/src/scene/batching/batch-manager.js
index bfef611f4..8865daf90 100644
--- a/src/scene/batching/batch-manager.js
+++ b/src/scene/batching/batch-manager.js
@@ -24,7 +24,7 @@ import { BatchGroup } from './batch-group.js';
 import { SkinBatchInstance } from './skin-batch-instance.js';
 
 /** @typedef {import('../../framework/entity.js').Entity} Entity */
-/** @typedef {import('../../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../../graphics/webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 /** @typedef {import('../scene.js').Scene} Scene */
 
 function paramsIdentical(a, b) {
diff --git a/src/scene/composition/layer-composition.js b/src/scene/composition/layer-composition.js
index f979d289d..7fe198988 100644
--- a/src/scene/composition/layer-composition.js
+++ b/src/scene/composition/layer-composition.js
@@ -12,7 +12,7 @@ import { RenderAction } from './render-action.js';
 import { WorldClusters } from '../lighting/world-clusters.js';
 import { LightCompositionData } from './light-composition-data.js';
 
-/** @typedef {import('../../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../../graphics/webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 /** @typedef {import('../layer.js').Layer} Layer */
 
 const tempSet = new Set();
diff --git a/src/scene/lightmapper/lightmapper.js b/src/scene/lightmapper/lightmapper.js
index b1f3023ca..eb8c16035 100644
--- a/src/scene/lightmapper/lightmapper.js
+++ b/src/scene/lightmapper/lightmapper.js
@@ -29,7 +29,7 @@ import { WorldClusters } from '../lighting/world-clusters.js';
 /** @typedef {import('../../asset/asset-registry.js').AssetRegistry} AssetRegistry */
 /** @typedef {import('../../framework/entity.js').Entity} Entity */
 /** @typedef {import('../renderer/forward-renderer.js').ForwardRenderer} ForwardRenderer */
-/** @typedef {import('../../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../../graphics/webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 /** @typedef {import('../scene.js').Scene} Scene */
 
 import {
diff --git a/src/scene/mesh.js b/src/scene/mesh.js
index 54ea936f8..669ad316e 100644
--- a/src/scene/mesh.js
+++ b/src/scene/mesh.js
@@ -21,7 +21,7 @@ import { RENDERSTYLE_SOLID, RENDERSTYLE_WIREFRAME, RENDERSTYLE_POINTS } from './
 
 import { getApplication } from '../framework/globals.js';
 
-/** @typedef {import('../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../graphics/webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 /** @typedef {import('./morph.js').Morph} Morph */
 /** @typedef {import('./skin.js').Skin} Skin */
 
diff --git a/src/scene/morph.js b/src/scene/morph.js
index 5b01fef72..328683f6d 100644
--- a/src/scene/morph.js
+++ b/src/scene/morph.js
@@ -9,7 +9,7 @@ import { getApplication } from '../framework/globals.js';
 
 import { BUFFER_STATIC, TYPE_FLOAT32, SEMANTIC_ATTR15, ADDRESS_CLAMP_TO_EDGE, FILTER_NEAREST, PIXELFORMAT_RGBA16F, PIXELFORMAT_RGB32F } from '../graphics/constants.js';
 
-/** @typedef {import('../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../graphics/webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 /** @typedef {import('./morph-target.js').MorphTarget} MorphTarget */
 
 // value added to floats which are used as ints on the shader side to avoid values being rounded to one less occasionally
diff --git a/src/scene/picker.js b/src/scene/picker.js
index 2df21662e..c411d0a06 100644
--- a/src/scene/picker.js
+++ b/src/scene/picker.js
@@ -1,7 +1,7 @@
 import { Color } from '../math/color.js';
 
 import { ADDRESS_CLAMP_TO_EDGE, CLEARFLAG_DEPTH, FILTER_NEAREST, PIXELFORMAT_R8_G8_B8_A8 } from '../graphics/constants.js';
-import { GraphicsDevice } from '../graphics/graphics-device.js';
+import { GraphicsDevice } from '../graphics/webgl/graphics-device.js';
 import { RenderTarget } from '../graphics/render-target.js';
 import { Texture } from '../graphics/texture.js';
 
diff --git a/src/scene/procedural.js b/src/scene/procedural.js
index 13345558f..ba135f22b 100644
--- a/src/scene/procedural.js
+++ b/src/scene/procedural.js
@@ -9,7 +9,7 @@ import {
 
 import { Mesh } from './mesh.js';
 
-/** @typedef {import('../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../graphics/webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 
 const primitiveUv1Padding = 4.0 / 64;
 const primitiveUv1PaddingScale = 1.0 - primitiveUv1Padding * 2;
diff --git a/src/scene/renderer/forward-renderer.js b/src/scene/renderer/forward-renderer.js
index 3d6e4c98b..6a224724e 100644
--- a/src/scene/renderer/forward-renderer.js
+++ b/src/scene/renderer/forward-renderer.js
@@ -39,7 +39,7 @@ import { CookieRenderer } from './cookie-renderer.js';
 import { LightCamera } from './light-camera.js';
 import { WorldClustersDebug } from '../lighting/world-clusters-debug.js';
 
-/** @typedef {import('../../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../../graphics/webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 
 const viewInvMat = new Mat4();
 const viewMat = new Mat4();
diff --git a/src/scene/scene.js b/src/scene/scene.js
index 4afab39f6..69a4b7b0b 100644
--- a/src/scene/scene.js
+++ b/src/scene/scene.js
@@ -22,7 +22,7 @@ import { EnvLighting } from '../graphics/env-lighting.js';
 import { getApplication } from '../framework/globals.js';
 
 /** @typedef {import('../framework/entity.js').Entity} Entity */
-/** @typedef {import('../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../graphics/webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 /** @typedef {import('../graphics/texture.js').Texture} Texture */
 /** @typedef {import('./composition/layer-composition.js').LayerComposition} LayerComposition */
 /** @typedef {import('./layer.js').Layer} Layer */
diff --git a/src/scene/skin.js b/src/scene/skin.js
index ec68a84e6..8272e055c 100644
--- a/src/scene/skin.js
+++ b/src/scene/skin.js
@@ -1,4 +1,4 @@
-/** @typedef {import('../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../graphics/webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 /** @typedef {import('../math/mat4.js').Mat4} Mat4 */
 
 /**
diff --git a/src/scene/sprite.js b/src/scene/sprite.js
index cbbc5ca3b..df96e7470 100644
--- a/src/scene/sprite.js
+++ b/src/scene/sprite.js
@@ -5,7 +5,7 @@ import { Vec2 } from '../math/vec2.js';
 import { SPRITE_RENDERMODE_SIMPLE, SPRITE_RENDERMODE_SLICED, SPRITE_RENDERMODE_TILED } from './constants.js';
 import { createMesh } from './procedural.js';
 
-/** @typedef {import('../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../graphics/webgl/graphics-device.js').GraphicsDevice} GraphicsDevice */
 /** @typedef {import('./mesh.js').Mesh} Mesh */
 /** @typedef {import('./texture-atlas.js').TextureAtlas} TextureAtlas */
 


Test patch:
diff --git a/test/framework/application.test.mjs b/test/framework/application.test.mjs
index 871426537..b0b65f64f 100644
--- a/test/framework/application.test.mjs
+++ b/test/framework/application.test.mjs
@@ -4,7 +4,7 @@ import { AssetRegistry } from '../../src/asset/asset-registry.js';
 import { BatchManager } from '../../src/scene/batching/batch-manager.js';
 import { ComponentSystemRegistry } from '../../src/framework/components/registry.js';
 import { Entity } from '../../src/framework/entity.js';
-import { GraphicsDevice } from '../../src/graphics/graphics-device.js';
+import { GraphicsDevice } from '../../src/graphics/webgl/graphics-device.js';
 import { I18n } from '../../src/i18n/i18n.js';
 import { Lightmapper } from '../../src/scene/lightmapper/lightmapper.js';
 import { ResourceLoader } from '../../src/resources/loader.js';
diff --git a/test/graphics/graphics-device.test.mjs b/test/graphics/graphics-device.test.mjs
index 4f82c75dd..b0328625b 100644
--- a/test/graphics/graphics-device.test.mjs
+++ b/test/graphics/graphics-device.test.mjs
@@ -1,4 +1,4 @@
-import { GraphicsDevice } from '../../src/graphics/graphics-device.js';
+import { GraphicsDevice } from '../../src/graphics/webgl/graphics-device.js';
 
 import { HTMLCanvasElement } from '@playcanvas/canvas-mock';