diff --git a/examples/webgpu-temp/index.html b/examples/webgpu-temp/index.html
index ce9c1a28ab2..a81d7d9e99c 100644
--- a/examples/webgpu-temp/index.html
+++ b/examples/webgpu-temp/index.html
@@ -24,14 +24,14 @@
import { AssetListLoader } from "../../src/asset/asset-list-loader.js";
import { AppBase } from "../../src/framework/app-base.js";
import { AppOptions } from "../../src/framework/app-options.js";
- import { WebgpuGraphicsDevice } from '../../src/graphics/webgpu/webgpu-graphics-device.js';
- import { Shader } from '../../src/graphics/shader.js';
- import { Texture } from '../../src/graphics/texture.js';
- import { RenderTarget } from '../../src/graphics/render-target.js';
+ import { WebgpuGraphicsDevice } from '../../src/platform/graphics/webgpu/webgpu-graphics-device.js';
+ import { Shader } from '../../src/platform/graphics/shader.js';
+ import { Texture } from '../../src/platform/graphics/texture.js';
+ import { RenderTarget } from '../../src/platform/graphics/render-target.js';
import {
SEMANTIC_TEXCOORD0, SEMANTIC_POSITION, CULLFACE_NONE,
PIXELFORMAT_R8_G8_B8_A8, FILTER_LINEAR, ADDRESS_CLAMP_TO_EDGE
- } from '../../src/graphics/constants.js';
+ } from '../../src/platform/graphics/constants.js';
import { Entity } from "../../src/framework/entity.js";
import { Tracing } from "../../src/core/tracing.js";
import {
diff --git a/src/deprecated/deprecated.js b/src/deprecated/deprecated.js
index 28d07165f60..bea1393180b 100644
--- a/src/deprecated/deprecated.js
+++ b/src/deprecated/deprecated.js
@@ -33,24 +33,24 @@ import {
TEXTURELOCK_READ, TEXTURELOCK_WRITE,
TEXTURETYPE_DEFAULT, TEXTURETYPE_RGBM, TEXTURETYPE_SWIZZLEGGGR,
TYPE_INT8, TYPE_UINT8, TYPE_INT16, TYPE_UINT16, TYPE_INT32, TYPE_UINT32, TYPE_FLOAT32
-} from '../graphics/constants.js';
+} from '../platform/graphics/constants.js';
import { begin, dummyFragmentCode, end, fogCode, gammaCode, precisionCode, skinCode, tonemapCode, versionCode } from '../scene/shader-lib/programs/common.js';
-import { drawQuadWithShader } from '../graphics/simple-post-effect.js';
+import { drawQuadWithShader } from '../platform/graphics/simple-post-effect.js';
import { shaderChunks } from '../scene/shader-lib/chunks/chunks.js';
-import { GraphicsDevice } from '../graphics/graphics-device.js';
-import { IndexBuffer } from '../graphics/index-buffer.js';
+import { GraphicsDevice } from '../platform/graphics/graphics-device.js';
+import { IndexBuffer } from '../platform/graphics/index-buffer.js';
import { createFullscreenQuad, drawFullscreenQuad, PostEffect } from '../scene/graphics/post-effect.js';
import { PostEffectQueue } from '../framework/components/camera/post-effect-queue.js';
import { ProgramLibrary } from '../scene/shader-lib/program-library.js';
import { getProgramLibrary, setProgramLibrary } from '../scene/shader-lib/get-program-library.js';
-import { RenderTarget } from '../graphics/render-target.js';
-import { ScopeId } from '../graphics/scope-id.js';
-import { Shader } from '../graphics/shader.js';
-import { ShaderInput } from '../graphics/shader-input.js';
-import { Texture } from '../graphics/texture.js';
-import { VertexBuffer } from '../graphics/vertex-buffer.js';
-import { VertexFormat } from '../graphics/vertex-format.js';
-import { VertexIterator } from '../graphics/vertex-iterator.js';
+import { RenderTarget } from '../platform/graphics/render-target.js';
+import { ScopeId } from '../platform/graphics/scope-id.js';
+import { Shader } from '../platform/graphics/shader.js';
+import { ShaderInput } from '../platform/graphics/shader-input.js';
+import { Texture } from '../platform/graphics/texture.js';
+import { VertexBuffer } from '../platform/graphics/vertex-buffer.js';
+import { VertexFormat } from '../platform/graphics/vertex-format.js';
+import { VertexIterator } from '../platform/graphics/vertex-iterator.js';
import { PROJECTION_ORTHOGRAPHIC, PROJECTION_PERSPECTIVE, LAYERID_IMMEDIATE, LINEBATCH_OVERLAY, LAYERID_WORLD } from '../scene/constants.js';
import { calculateTangents, createBox, createCapsule, createCone, createCylinder, createMesh, createPlane, createSphere, createTorus } from '../scene/procedural.js';
diff --git a/src/font/canvas-font.js b/src/font/canvas-font.js
index 83d027de6b7..73673001e2b 100644
--- a/src/font/canvas-font.js
+++ b/src/font/canvas-font.js
@@ -7,8 +7,8 @@ import {
ADDRESS_CLAMP_TO_EDGE,
FILTER_LINEAR, FILTER_LINEAR_MIPMAP_LINEAR,
PIXELFORMAT_R8_G8_B8_A8
-} from '../graphics/constants.js';
-import { Texture } from '../graphics/texture.js';
+} from '../platform/graphics/constants.js';
+import { Texture } from '../platform/graphics/texture.js';
/** @typedef {import('../framework/app-base.js').AppBase} AppBase */
diff --git a/src/font/font.js b/src/font/font.js
index de069128d7c..b9cdef3ed84 100644
--- a/src/font/font.js
+++ b/src/font/font.js
@@ -1,6 +1,6 @@
import { FONT_MSDF } from './constants.js';
-/** @typedef {import('../graphics/texture.js').Texture} Texture */
+/** @typedef {import('../platform/graphics/texture.js').Texture} Texture */
/**
* Represents the resource of a font asset.
diff --git a/src/framework/app-base.js b/src/framework/app-base.js
index 60530f1381a..9ca1e5f6367 100644
--- a/src/framework/app-base.js
+++ b/src/framework/app-base.js
@@ -19,7 +19,7 @@ import { http } from '../platform/net/http.js';
import {
PRIMITIVE_TRIANGLES, PRIMITIVE_TRIFAN, PRIMITIVE_TRISTRIP
-} from '../graphics/constants.js';
+} from '../platform/graphics/constants.js';
import { setProgramLibrary } from '../scene/shader-lib/get-program-library.js';
import { ProgramLibrary } from '../scene/shader-lib/program-library.js';
@@ -67,8 +67,8 @@ import {
setApplication
} from './globals.js';
-/** @typedef {import('../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
-/** @typedef {import('../graphics/texture.js').Texture} Texture */
+/** @typedef {import('../platform/graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../platform/graphics/texture.js').Texture} Texture */
/** @typedef {import('../platform/input/element-input.js').ElementInput} ElementInput */
/** @typedef {import('../platform/input/game-pads.js').GamePads} GamePads */
/** @typedef {import('../platform/input/keyboard.js').Keyboard} Keyboard */
diff --git a/src/framework/app-options.js b/src/framework/app-options.js
index 7b435e971ed..d22531113af 100644
--- a/src/framework/app-options.js
+++ b/src/framework/app-options.js
@@ -1,5 +1,5 @@
/** @typedef {import('../resources/handler.js').ResourceHandler} ResourceHandler */
-/** @typedef {import('../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../platform/graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
/** @typedef {import('../platform/input/element-input.js').ElementInput} ElementInput */
/** @typedef {import('../platform/input/game-pads.js').GamePads} GamePads */
/** @typedef {import('../platform/input/keyboard.js').Keyboard} Keyboard */
diff --git a/src/framework/application.js b/src/framework/application.js
index d33eb2a532d..4d6b452d91d 100644
--- a/src/framework/application.js
+++ b/src/framework/application.js
@@ -1,6 +1,6 @@
import { platform } from '../core/platform.js';
-import { WebglGraphicsDevice } from '../graphics/webgl/webgl-graphics-device.js';
+import { WebglGraphicsDevice } from '../platform/graphics/webgl/webgl-graphics-device.js';
import { SoundManager } from '../platform/sound/manager.js';
diff --git a/src/framework/components/camera/component.js b/src/framework/components/camera/component.js
index 12538f4d9df..c6f84809634 100644
--- a/src/framework/components/camera/component.js
+++ b/src/framework/components/camera/component.js
@@ -6,7 +6,7 @@ import { Component } from '../component.js';
import { PostEffectQueue } from './post-effect-queue.js';
import { Debug } from '../../../core/debug.js';
-/** @typedef {import('../../../graphics/render-target.js').RenderTarget} RenderTarget */
+/** @typedef {import('../../../platform/graphics/render-target.js').RenderTarget} RenderTarget */
/** @typedef {import('../../../core/math/color.js').Color} Color */
/** @typedef {import('../../../core/math/mat4.js').Mat4} Mat4 */
/** @typedef {import('../../../core/math/vec3.js').Vec3} Vec3 */
diff --git a/src/framework/components/camera/post-effect-queue.js b/src/framework/components/camera/post-effect-queue.js
index 9e0c6d31250..9e8d29a043c 100644
--- a/src/framework/components/camera/post-effect-queue.js
+++ b/src/framework/components/camera/post-effect-queue.js
@@ -1,7 +1,7 @@
-import { ADDRESS_CLAMP_TO_EDGE, FILTER_NEAREST, PIXELFORMAT_R8_G8_B8_A8 } from '../../../graphics/constants.js';
-import { DebugGraphics } from '../../../graphics/debug-graphics.js';
-import { RenderTarget } from '../../../graphics/render-target.js';
-import { Texture } from '../../../graphics/texture.js';
+import { ADDRESS_CLAMP_TO_EDGE, FILTER_NEAREST, PIXELFORMAT_R8_G8_B8_A8 } from '../../../platform/graphics/constants.js';
+import { DebugGraphics } from '../../../platform/graphics/debug-graphics.js';
+import { RenderTarget } from '../../../platform/graphics/render-target.js';
+import { Texture } from '../../../platform/graphics/texture.js';
import { LAYERID_DEPTH } from '../../../scene/constants.js';
diff --git a/src/framework/components/collision/system.js b/src/framework/components/collision/system.js
index 4458de1a83d..06d0e96e8ac 100644
--- a/src/framework/components/collision/system.js
+++ b/src/framework/components/collision/system.js
@@ -4,7 +4,7 @@ import { Mat4 } from '../../../core/math/mat4.js';
import { Quat } from '../../../core/math/quat.js';
import { Vec3 } from '../../../core/math/vec3.js';
-import { SEMANTIC_POSITION } from '../../../graphics/constants.js';
+import { SEMANTIC_POSITION } from '../../../platform/graphics/constants.js';
import { GraphNode } from '../../../scene/graph-node.js';
import { Model } from '../../../scene/model.js';
diff --git a/src/framework/components/element/component.js b/src/framework/components/element/component.js
index d7e3bb26d13..819396d4270 100644
--- a/src/framework/components/element/component.js
+++ b/src/framework/components/element/component.js
@@ -5,7 +5,7 @@ import { Vec2 } from '../../../core/math/vec2.js';
import { Vec3 } from '../../../core/math/vec3.js';
import { Vec4 } from '../../../core/math/vec4.js';
-import { FUNC_ALWAYS, FUNC_EQUAL, STENCILOP_INCREMENT, STENCILOP_REPLACE } from '../../../graphics/constants.js';
+import { FUNC_ALWAYS, FUNC_EQUAL, STENCILOP_INCREMENT, STENCILOP_REPLACE } from '../../../platform/graphics/constants.js';
import { LAYERID_UI } from '../../../scene/constants.js';
import { BatchGroup } from '../../../scene/batching/batch-group.js';
@@ -22,7 +22,7 @@ import { TextElement } from './text-element.js';
/** @typedef {import('../../../core/math/color.js').Color} Color */
/** @typedef {import('../../../font/canvas-font.js').CanvasFont} CanvasFont */
/** @typedef {import('../../../font/font.js').Font} Font */
-/** @typedef {import('../../../graphics/texture.js').Texture} Texture */
+/** @typedef {import('../../../platform/graphics/texture.js').Texture} Texture */
/** @typedef {import('../../../scene/materials/material.js').Material} Material */
/** @typedef {import('../../../scene/sprite.js').Sprite} Sprite */
/** @typedef {import('./system.js').ElementComponentSystem} ElementComponentSystem */
diff --git a/src/framework/components/element/image-element.js b/src/framework/components/element/image-element.js
index a2ed9d6b5ab..851b7f7203c 100644
--- a/src/framework/components/element/image-element.js
+++ b/src/framework/components/element/image-element.js
@@ -13,9 +13,9 @@ import {
SEMANTIC_POSITION, SEMANTIC_NORMAL, SEMANTIC_TEXCOORD0,
STENCILOP_DECREMENT,
TYPE_FLOAT32
-} from '../../../graphics/constants.js';
-import { VertexBuffer } from '../../../graphics/vertex-buffer.js';
-import { VertexFormat } from '../../../graphics/vertex-format.js';
+} from '../../../platform/graphics/constants.js';
+import { VertexBuffer } from '../../../platform/graphics/vertex-buffer.js';
+import { VertexFormat } from '../../../platform/graphics/vertex-format.js';
import {
LAYER_HUD, LAYER_WORLD,
diff --git a/src/framework/components/element/system.js b/src/framework/components/element/system.js
index 85680c100bd..85d81b636f6 100644
--- a/src/framework/components/element/system.js
+++ b/src/framework/components/element/system.js
@@ -4,8 +4,8 @@ import { Vec4 } from '../../../core/math/vec4.js';
import {
PIXELFORMAT_R8_G8_B8_A8
-} from '../../../graphics/constants.js';
-import { Texture } from '../../../graphics/texture.js';
+} from '../../../platform/graphics/constants.js';
+import { Texture } from '../../../platform/graphics/texture.js';
import { BLEND_PREMULTIPLIED, SPRITE_RENDERMODE_SLICED, SPRITE_RENDERMODE_TILED } from '../../../scene/constants.js';
import { StandardMaterial } from '../../../scene/materials/standard-material.js';
diff --git a/src/framework/components/element/text-element.js b/src/framework/components/element/text-element.js
index eaabe2bdd73..56cefacc990 100644
--- a/src/framework/components/element/text-element.js
+++ b/src/framework/components/element/text-element.js
@@ -7,8 +7,8 @@ import { Vec2 } from '../../../core/math/vec2.js';
import { BoundingBox } from '../../../core/shape/bounding-box.js';
-import { SEMANTIC_POSITION, SEMANTIC_TEXCOORD0, SEMANTIC_COLOR, SEMANTIC_ATTR8, SEMANTIC_ATTR9, TYPE_FLOAT32 } from '../../../graphics/constants.js';
-import { VertexIterator } from '../../../graphics/vertex-iterator.js';
+import { SEMANTIC_POSITION, SEMANTIC_TEXCOORD0, SEMANTIC_COLOR, SEMANTIC_ATTR8, SEMANTIC_ATTR9, TYPE_FLOAT32 } from '../../../platform/graphics/constants.js';
+import { VertexIterator } from '../../../platform/graphics/vertex-iterator.js';
import { GraphNode } from '../../../scene/graph-node.js';
import { MeshInstance } from '../../../scene/mesh-instance.js';
import { Model } from '../../../scene/model.js';
diff --git a/src/framework/components/sprite/system.js b/src/framework/components/sprite/system.js
index aa6a2d88427..dad780a9ed5 100644
--- a/src/framework/components/sprite/system.js
+++ b/src/framework/components/sprite/system.js
@@ -3,8 +3,8 @@ import { Color } from '../../../core/math/color.js';
import {
CULLFACE_NONE,
PIXELFORMAT_R8_G8_B8_A8
-} from '../../../graphics/constants.js';
-import { Texture } from '../../../graphics/texture.js';
+} from '../../../platform/graphics/constants.js';
+import { Texture } from '../../../platform/graphics/texture.js';
import { BLEND_PREMULTIPLIED, SPRITE_RENDERMODE_SLICED, SPRITE_RENDERMODE_TILED } from '../../../scene/constants.js';
import { StandardMaterial } from '../../../scene/materials/standard-material.js';
diff --git a/src/framework/scene-grab.js b/src/framework/scene-grab.js
index 226140b0787..3fdcf002171 100644
--- a/src/framework/scene-grab.js
+++ b/src/framework/scene-grab.js
@@ -2,11 +2,11 @@ import {
ADDRESS_CLAMP_TO_EDGE,
FILTER_NEAREST, FILTER_LINEAR, FILTER_LINEAR_MIPMAP_LINEAR,
PIXELFORMAT_DEPTHSTENCIL, PIXELFORMAT_R8_G8_B8_A8, PIXELFORMAT_R8_G8_B8
-} from '../graphics/constants.js';
+} from '../platform/graphics/constants.js';
-import { RenderTarget } from '../graphics/render-target.js';
-import { Texture } from '../graphics/texture.js';
-import { DebugGraphics } from '../graphics/debug-graphics.js';
+import { RenderTarget } from '../platform/graphics/render-target.js';
+import { Texture } from '../platform/graphics/texture.js';
+import { DebugGraphics } from '../platform/graphics/debug-graphics.js';
import {
LAYERID_DEPTH, LAYERID_WORLD,
@@ -15,7 +15,7 @@ import {
import { Layer } from '../scene/layer.js';
-/** @typedef {import('../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../platform/graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
/** @typedef {import('./components/camera/component.js').CameraComponent} CameraComponent */
// uniform names (first is current name, second one is deprecated name for compatibility)
diff --git a/src/framework/stats.js b/src/framework/stats.js
index caa288dcd2b..08f4cd611fb 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('../platform/graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
/**
* Records performance-related statistics related to the application.
diff --git a/src/index.js b/src/index.js
index 644ba0683ef..ca950af3bc3 100644
--- a/src/index.js
+++ b/src/index.js
@@ -56,30 +56,30 @@ export { Plane } from './core/shape/plane.js';
export { Ray } from './core/shape/ray.js';
// GRAPHICS
-export * from './graphics/constants.js';
-export { drawQuadWithShader, drawTexture } from './graphics/simple-post-effect.js';
+export * from './platform/graphics/constants.js';
+export { drawQuadWithShader, drawTexture } from './platform/graphics/simple-post-effect.js';
export { shFromCubemap } from './scene/graphics/prefilter-cubemap.js';
export { reprojectTexture } from './scene/graphics/reproject-texture.js';
export { createShader, createShaderFromCode } from './scene/shader-lib/utils.js';
export { shaderChunks } from './scene/shader-lib/chunks/chunks.js';
export { shaderChunksLightmapper } from './scene/shader-lib/chunks/chunks-lightmapper.js';
-export { GraphicsDevice } from './graphics/graphics-device.js';
+export { GraphicsDevice } from './platform/graphics/graphics-device.js';
export { EnvLighting } from './scene/graphics/env-lighting.js';
-export { IndexBuffer } from './graphics/index-buffer.js';
+export { IndexBuffer } from './platform/graphics/index-buffer.js';
export { PostEffect, drawFullscreenQuad } from './scene/graphics/post-effect.js';
export { ProgramLibrary } from './scene/shader-lib/program-library.js';
-export { RenderTarget } from './graphics/render-target.js';
-export { ScopeId } from './graphics/scope-id.js';
-export { ScopeSpace } from './graphics/scope-space.js';
-export { Shader } from './graphics/shader.js';
-export { Texture } from './graphics/texture.js';
-export { TransformFeedback } from './graphics/transform-feedback.js';
-export { VertexBuffer } from './graphics/vertex-buffer.js';
-export { VertexFormat } from './graphics/vertex-format.js';
-export { VertexIterator } from './graphics/vertex-iterator.js';
+export { RenderTarget } from './platform/graphics/render-target.js';
+export { ScopeId } from './platform/graphics/scope-id.js';
+export { ScopeSpace } from './platform/graphics/scope-space.js';
+export { Shader } from './platform/graphics/shader.js';
+export { Texture } from './platform/graphics/texture.js';
+export { TransformFeedback } from './platform/graphics/transform-feedback.js';
+export { VertexBuffer } from './platform/graphics/vertex-buffer.js';
+export { VertexFormat } from './platform/graphics/vertex-format.js';
+export { VertexIterator } from './platform/graphics/vertex-iterator.js';
// GRAPHICS / webgl
-export { WebglGraphicsDevice } from './graphics/webgl/webgl-graphics-device.js';
+export { WebglGraphicsDevice } from './platform/graphics/webgl/webgl-graphics-device.js';
// SCENE
export * from './scene/constants.js';
diff --git a/src/graphics/bind-group-format.js b/src/platform/graphics/bind-group-format.js
similarity index 100%
rename from src/graphics/bind-group-format.js
rename to src/platform/graphics/bind-group-format.js
diff --git a/src/graphics/bind-group.js b/src/platform/graphics/bind-group.js
similarity index 98%
rename from src/graphics/bind-group.js
rename to src/platform/graphics/bind-group.js
index b468f103717..8b2c258072f 100644
--- a/src/graphics/bind-group.js
+++ b/src/platform/graphics/bind-group.js
@@ -5,7 +5,7 @@ import { UNIFORM_BUFFER_DEFAULT_SLOT_NAME } from './constants.js';
/** @typedef {import('./bind-group-format.js').BindGroupFormat} BindGroupFormat */
/** @typedef {import('./uniform-buffer.js').UniformBuffer} UniformBuffer */
-import { Debug } from '../core/debug.js';
+import { Debug } from '../../core/debug.js';
/**
* A bind group represents an collection of {@link UniformBuffer} and {@link Texture} instance,
diff --git a/src/graphics/constants.js b/src/platform/graphics/constants.js
similarity index 100%
rename from src/graphics/constants.js
rename to src/platform/graphics/constants.js
diff --git a/src/graphics/debug-graphics.js b/src/platform/graphics/debug-graphics.js
similarity index 100%
rename from src/graphics/debug-graphics.js
rename to src/platform/graphics/debug-graphics.js
diff --git a/src/graphics/device-cache.js b/src/platform/graphics/device-cache.js
similarity index 100%
rename from src/graphics/device-cache.js
rename to src/platform/graphics/device-cache.js
diff --git a/src/graphics/graphics-device.js b/src/platform/graphics/graphics-device.js
similarity index 98%
rename from src/graphics/graphics-device.js
rename to src/platform/graphics/graphics-device.js
index af3c79d9482..10c1ff5e37f 100644
--- a/src/graphics/graphics-device.js
+++ b/src/platform/graphics/graphics-device.js
@@ -1,13 +1,13 @@
-import { EventHandler } from '../core/event-handler.js';
-import { platform } from '../core/platform.js';
-import { now } from '../core/time.js';
+import { EventHandler } from '../../core/event-handler.js';
+import { platform } from '../../core/platform.js';
+import { now } from '../../core/time.js';
import { ScopeSpace } from './scope-space.js';
import {
PRIMITIVE_POINTS, PRIMITIVE_TRIFAN
} from './constants.js';
-import { Debug } from '../core/debug.js';
+import { Debug } from '../../core/debug.js';
const EVENT_RESIZE = 'resizecanvas';
diff --git a/src/graphics/index-buffer.js b/src/platform/graphics/index-buffer.js
similarity index 98%
rename from src/graphics/index-buffer.js
rename to src/platform/graphics/index-buffer.js
index feca33675c8..0af01b98187 100644
--- a/src/graphics/index-buffer.js
+++ b/src/platform/graphics/index-buffer.js
@@ -1,5 +1,5 @@
-import { Debug } from '../core/debug.js';
-import { TRACEID_VRAM_IB } from '../core/constants.js';
+import { Debug } from '../../core/debug.js';
+import { TRACEID_VRAM_IB } from '../../core/constants.js';
import {
BUFFER_STATIC, INDEXFORMAT_UINT16, INDEXFORMAT_UINT32, typedArrayIndexFormatsByteSize
} from './constants.js';
diff --git a/src/graphics/render-pass.js b/src/platform/graphics/render-pass.js
similarity index 99%
rename from src/graphics/render-pass.js
rename to src/platform/graphics/render-pass.js
index cf4e65ae590..c78d1477fa5 100644
--- a/src/graphics/render-pass.js
+++ b/src/platform/graphics/render-pass.js
@@ -1,4 +1,4 @@
-import { Color } from '../core/math/color.js';
+import { Color } from '../../core/math/color.js';
import { DebugGraphics } from '../graphics/debug-graphics.js';
/** @typedef {import('../graphics/render-target.js').RenderTarget} RenderTarget */
diff --git a/src/graphics/render-target.js b/src/platform/graphics/render-target.js
similarity index 99%
rename from src/graphics/render-target.js
rename to src/platform/graphics/render-target.js
index 22b0448923f..84ea92f2531 100644
--- a/src/graphics/render-target.js
+++ b/src/platform/graphics/render-target.js
@@ -1,5 +1,5 @@
-import { Debug } from '../core/debug.js';
-import { TRACEID_RENDER_TARGET_ALLOC } from '../core/constants.js';
+import { Debug } from '../../core/debug.js';
+import { TRACEID_RENDER_TARGET_ALLOC } from '../../core/constants.js';
import { PIXELFORMAT_DEPTH, PIXELFORMAT_DEPTHSTENCIL } from './constants.js';
import { DebugGraphics } from './debug-graphics.js';
import { GraphicsDevice } from './graphics-device.js';
diff --git a/src/graphics/scope-id.js b/src/platform/graphics/scope-id.js
similarity index 100%
rename from src/graphics/scope-id.js
rename to src/platform/graphics/scope-id.js
diff --git a/src/graphics/scope-space.js b/src/platform/graphics/scope-space.js
similarity index 100%
rename from src/graphics/scope-space.js
rename to src/platform/graphics/scope-space.js
diff --git a/src/graphics/shader-input.js b/src/platform/graphics/shader-input.js
similarity index 100%
rename from src/graphics/shader-input.js
rename to src/platform/graphics/shader-input.js
diff --git a/src/graphics/shader-processor-options.js b/src/platform/graphics/shader-processor-options.js
similarity index 100%
rename from src/graphics/shader-processor-options.js
rename to src/platform/graphics/shader-processor-options.js
diff --git a/src/graphics/shader-processor.js b/src/platform/graphics/shader-processor.js
similarity index 99%
rename from src/graphics/shader-processor.js
rename to src/platform/graphics/shader-processor.js
index 95dcd467a1b..80e78b3cdb3 100644
--- a/src/graphics/shader-processor.js
+++ b/src/platform/graphics/shader-processor.js
@@ -1,4 +1,4 @@
-import { Debug } from '../core/debug.js';
+import { Debug } from '../../core/debug.js';
import {
BINDGROUP_MESH, uniformTypeToName, semanticToLocation,
SHADERSTAGE_VERTEX, SHADERSTAGE_FRAGMENT,
diff --git a/src/graphics/shader.js b/src/platform/graphics/shader.js
similarity index 96%
rename from src/graphics/shader.js
rename to src/platform/graphics/shader.js
index 0b19b5b8f91..18043d57f19 100644
--- a/src/graphics/shader.js
+++ b/src/platform/graphics/shader.js
@@ -1,6 +1,6 @@
-import { TRACEID_SHADER_ALLOC } from '../core/constants.js';
-import { Debug } from '../core/debug.js';
-import { Preprocessor } from '../core/preprocessor.js';
+import { TRACEID_SHADER_ALLOC } from '../../core/constants.js';
+import { Debug } from '../../core/debug.js';
+import { Preprocessor } from '../../core/preprocessor.js';
/** @typedef {import('./graphics-device.js').GraphicsDevice} GraphicsDevice */
/** @typedef {import('../bind-group-format.js').BindGroupFormat} BindGroupFormat */
diff --git a/src/graphics/simple-post-effect.js b/src/platform/graphics/simple-post-effect.js
similarity index 100%
rename from src/graphics/simple-post-effect.js
rename to src/platform/graphics/simple-post-effect.js
diff --git a/src/graphics/texture.js b/src/platform/graphics/texture.js
similarity index 99%
rename from src/graphics/texture.js
rename to src/platform/graphics/texture.js
index 8a9a686955a..e9fcc7c68d0 100644
--- a/src/graphics/texture.js
+++ b/src/platform/graphics/texture.js
@@ -1,6 +1,6 @@
-import { Debug } from '../core/debug.js';
-import { TRACEID_TEXTURE_ALLOC, TRACEID_VRAM_TEXTURE } from '../core/constants.js';
-import { math } from '../core/math/math.js';
+import { Debug } from '../../core/debug.js';
+import { TRACEID_TEXTURE_ALLOC, TRACEID_VRAM_TEXTURE } from '../../core/constants.js';
+import { math } from '../../core/math/math.js';
import {
ADDRESS_REPEAT,
diff --git a/src/graphics/transform-feedback.js b/src/platform/graphics/transform-feedback.js
similarity index 98%
rename from src/graphics/transform-feedback.js
rename to src/platform/graphics/transform-feedback.js
index dee5cafe387..8eb7b43a805 100644
--- a/src/graphics/transform-feedback.js
+++ b/src/platform/graphics/transform-feedback.js
@@ -1,6 +1,7 @@
-import { Debug } from '../core/debug.js';
+import { Debug } from '../../core/debug.js';
+import { createShaderFromCode } from '../../scene/shader-lib/utils.js';
+
import { BUFFER_GPUDYNAMIC, PRIMITIVE_POINTS } from './constants.js';
-import { createShaderFromCode } from '../scene/shader-lib/utils.js';
import { VertexBuffer } from './vertex-buffer.js';
import { DebugGraphics } from './debug-graphics.js';
diff --git a/src/graphics/uniform-buffer-format.js b/src/platform/graphics/uniform-buffer-format.js
similarity index 98%
rename from src/graphics/uniform-buffer-format.js
rename to src/platform/graphics/uniform-buffer-format.js
index fe7fcd9742f..2611ee9eab1 100644
--- a/src/graphics/uniform-buffer-format.js
+++ b/src/platform/graphics/uniform-buffer-format.js
@@ -1,5 +1,5 @@
-import { Debug } from '../core/debug.js';
-import { math } from '../core/math/math.js';
+import { Debug } from '../../core/debug.js';
+import { math } from '../../core/math/math.js';
import {
uniformTypeToName, bindGroupNames,
UNIFORMTYPE_BOOL, UNIFORMTYPE_INT, UNIFORMTYPE_FLOAT, UNIFORMTYPE_VEC2, UNIFORMTYPE_VEC3,
diff --git a/src/graphics/uniform-buffer.js b/src/platform/graphics/uniform-buffer.js
similarity index 99%
rename from src/graphics/uniform-buffer.js
rename to src/platform/graphics/uniform-buffer.js
index ac8046a3023..011c9147459 100644
--- a/src/graphics/uniform-buffer.js
+++ b/src/platform/graphics/uniform-buffer.js
@@ -1,4 +1,4 @@
-import { Debug } from '../core/debug.js';
+import { Debug } from '../../core/debug.js';
import {
uniformTypeToName,
UNIFORMTYPE_INT, UNIFORMTYPE_FLOAT, UNIFORMTYPE_VEC2, UNIFORMTYPE_VEC3,
diff --git a/src/graphics/version.js b/src/platform/graphics/version.js
similarity index 100%
rename from src/graphics/version.js
rename to src/platform/graphics/version.js
diff --git a/src/graphics/versioned-object.js b/src/platform/graphics/versioned-object.js
similarity index 100%
rename from src/graphics/versioned-object.js
rename to src/platform/graphics/versioned-object.js
diff --git a/src/graphics/vertex-buffer.js b/src/platform/graphics/vertex-buffer.js
similarity index 97%
rename from src/graphics/vertex-buffer.js
rename to src/platform/graphics/vertex-buffer.js
index b61a40a0236..5d2815c3e22 100644
--- a/src/graphics/vertex-buffer.js
+++ b/src/platform/graphics/vertex-buffer.js
@@ -1,5 +1,5 @@
-import { Debug } from '../core/debug.js';
-import { TRACEID_VRAM_VB } from '../core/constants.js';
+import { Debug } from '../../core/debug.js';
+import { TRACEID_VRAM_VB } from '../../core/constants.js';
import { BUFFER_STATIC } from './constants.js';
/** @typedef {import('./graphics-device.js').GraphicsDevice} GraphicsDevice */
diff --git a/src/graphics/vertex-format.js b/src/platform/graphics/vertex-format.js
similarity index 98%
rename from src/graphics/vertex-format.js
rename to src/platform/graphics/vertex-format.js
index 85aae6f4097..a735d94a1b3 100644
--- a/src/graphics/vertex-format.js
+++ b/src/platform/graphics/vertex-format.js
@@ -1,7 +1,7 @@
-import { Debug } from '../core/debug.js';
-import { hashCode } from '../core/hash.js';
+import { Debug } from '../../core/debug.js';
+import { hashCode } from '../../core/hash.js';
-import { math } from '../core/math/math.js';
+import { math } from '../../core/math/math.js';
import {
SEMANTIC_TEXCOORD0, SEMANTIC_TEXCOORD1, SEMANTIC_ATTR12, SEMANTIC_ATTR13, SEMANTIC_ATTR14, SEMANTIC_ATTR15,
diff --git a/src/graphics/vertex-iterator.js b/src/platform/graphics/vertex-iterator.js
similarity index 99%
rename from src/graphics/vertex-iterator.js
rename to src/platform/graphics/vertex-iterator.js
index 2f9c8ca649b..3b64eceaeef 100644
--- a/src/graphics/vertex-iterator.js
+++ b/src/platform/graphics/vertex-iterator.js
@@ -1,4 +1,4 @@
-import { Debug } from '../core/debug.js';
+import { Debug } from '../../core/debug.js';
import { typedArrayTypes } from './constants.js';
/** @typedef {import('./scope-id.js').ScopeId} ScopeId */
diff --git a/src/graphics/webgl/webgl-buffer.js b/src/platform/graphics/webgl/webgl-buffer.js
similarity index 100%
rename from src/graphics/webgl/webgl-buffer.js
rename to src/platform/graphics/webgl/webgl-buffer.js
diff --git a/src/graphics/webgl/webgl-graphics-device.js b/src/platform/graphics/webgl/webgl-graphics-device.js
similarity index 99%
rename from src/graphics/webgl/webgl-graphics-device.js
rename to src/platform/graphics/webgl/webgl-graphics-device.js
index aa3dfeab2e6..0fb5151e270 100644
--- a/src/graphics/webgl/webgl-graphics-device.js
+++ b/src/platform/graphics/webgl/webgl-graphics-device.js
@@ -1,6 +1,7 @@
-import { setupVertexArrayObject } from '../../polyfill/OESVertexArrayObject.js';
-import { Debug } from '../../core/debug.js';
-import { platform } from '../../core/platform.js';
+import { setupVertexArrayObject } from '../../../polyfill/OESVertexArrayObject.js';
+import { Debug } from '../../../core/debug.js';
+import { platform } from '../../../core/platform.js';
+import { Color } from '../../../core/math/color.js';
import {
DEVICETYPE_WEBGL,
@@ -23,7 +24,7 @@ import {
} from '../constants.js';
import { GraphicsDevice } from '../graphics-device.js';
-import { createShaderFromCode } from '../../scene/shader-lib/utils.js';
+import { createShaderFromCode } from '../../../scene/shader-lib/utils.js';
import { drawQuadWithShader } from '../simple-post-effect.js';
import { RenderTarget } from '../render-target.js';
import { Texture } from '../texture.js';
@@ -34,7 +35,6 @@ import { WebglIndexBuffer } from './webgl-index-buffer.js';
import { WebglShader } from './webgl-shader.js';
import { WebglTexture } from './webgl-texture.js';
import { WebglRenderTarget } from './webgl-render-target.js';
-import { Color } from '../../core/math/color.js';
/** @typedef {import('../index-buffer.js').IndexBuffer} IndexBuffer */
/** @typedef {import('../shader.js').Shader} Shader */
diff --git a/src/graphics/webgl/webgl-index-buffer.js b/src/platform/graphics/webgl/webgl-index-buffer.js
similarity index 100%
rename from src/graphics/webgl/webgl-index-buffer.js
rename to src/platform/graphics/webgl/webgl-index-buffer.js
diff --git a/src/graphics/webgl/webgl-render-target.js b/src/platform/graphics/webgl/webgl-render-target.js
similarity index 100%
rename from src/graphics/webgl/webgl-render-target.js
rename to src/platform/graphics/webgl/webgl-render-target.js
diff --git a/src/graphics/webgl/webgl-shader.js b/src/platform/graphics/webgl/webgl-shader.js
similarity index 99%
rename from src/graphics/webgl/webgl-shader.js
rename to src/platform/graphics/webgl/webgl-shader.js
index 72a706fb80c..5cc52fb2c28 100644
--- a/src/graphics/webgl/webgl-shader.js
+++ b/src/platform/graphics/webgl/webgl-shader.js
@@ -1,5 +1,5 @@
-import { Debug } from '../../core/debug.js';
-import { now } from '../../core/time.js';
+import { Debug } from '../../../core/debug.js';
+import { now } from '../../../core/time.js';
import { ShaderInput } from '../shader-input.js';
import { SHADERTAG_MATERIAL, semanticToLocation } from '../constants.js';
diff --git a/src/graphics/webgl/webgl-texture.js b/src/platform/graphics/webgl/webgl-texture.js
similarity index 99%
rename from src/graphics/webgl/webgl-texture.js
rename to src/platform/graphics/webgl/webgl-texture.js
index 8c4f2cd24d8..ae8b8a42c85 100644
--- a/src/graphics/webgl/webgl-texture.js
+++ b/src/platform/graphics/webgl/webgl-texture.js
@@ -1,4 +1,4 @@
-import { Debug } from '../../core/debug.js';
+import { Debug } from '../../../core/debug.js';
import {
PIXELFORMAT_A8, PIXELFORMAT_L8, PIXELFORMAT_L8_A8, PIXELFORMAT_R5_G6_B5, PIXELFORMAT_R5_G5_B5_A1, PIXELFORMAT_R4_G4_B4_A4,
diff --git a/src/graphics/webgl/webgl-vertex-buffer.js b/src/platform/graphics/webgl/webgl-vertex-buffer.js
similarity index 100%
rename from src/graphics/webgl/webgl-vertex-buffer.js
rename to src/platform/graphics/webgl/webgl-vertex-buffer.js
diff --git a/src/graphics/webgpu/webgpu-bind-group-format.js b/src/platform/graphics/webgpu/webgpu-bind-group-format.js
similarity index 99%
rename from src/graphics/webgpu/webgpu-bind-group-format.js
rename to src/platform/graphics/webgpu/webgpu-bind-group-format.js
index a94f59d117c..2036cf2fe91 100644
--- a/src/graphics/webgpu/webgpu-bind-group-format.js
+++ b/src/platform/graphics/webgpu/webgpu-bind-group-format.js
@@ -1,4 +1,4 @@
-import { Debug } from '../../core/debug.js';
+import { Debug } from '../../../core/debug.js';
import { SAMPLETYPE_FLOAT, SAMPLETYPE_UNFILTERABLE_FLOAT, SAMPLETYPE_DEPTH } from '../constants.js';
/** @typedef {import('../bind-group-format.js').BindGroupFormat} BindGroupFormat */
diff --git a/src/graphics/webgpu/webgpu-bind-group.js b/src/platform/graphics/webgpu/webgpu-bind-group.js
similarity index 98%
rename from src/graphics/webgpu/webgpu-bind-group.js
rename to src/platform/graphics/webgpu/webgpu-bind-group.js
index c74b4740240..7404ecbaf23 100644
--- a/src/graphics/webgpu/webgpu-bind-group.js
+++ b/src/platform/graphics/webgpu/webgpu-bind-group.js
@@ -1,4 +1,4 @@
-import { Debug } from '../../core/debug.js';
+import { Debug } from '../../../core/debug.js';
/** @typedef {import('../bind-group.js').BindGroup} BindGroup */
/** @typedef {import('./webgpu-graphics-device.js').WebgpuGraphicsDevice} WebgpuGraphicsDevice */
diff --git a/src/graphics/webgpu/webgpu-buffer.js b/src/platform/graphics/webgpu/webgpu-buffer.js
similarity index 100%
rename from src/graphics/webgpu/webgpu-buffer.js
rename to src/platform/graphics/webgpu/webgpu-buffer.js
diff --git a/src/graphics/webgpu/webgpu-graphics-device.js b/src/platform/graphics/webgpu/webgpu-graphics-device.js
similarity index 99%
rename from src/graphics/webgpu/webgpu-graphics-device.js
rename to src/platform/graphics/webgpu/webgpu-graphics-device.js
index fe2ebab3af0..9fc8a38cf2d 100644
--- a/src/graphics/webgpu/webgpu-graphics-device.js
+++ b/src/platform/graphics/webgpu/webgpu-graphics-device.js
@@ -1,4 +1,4 @@
-import { Debug } from '../../core/debug.js';
+import { Debug } from '../../../core/debug.js';
import {
DEVICETYPE_WEBGPU
diff --git a/src/graphics/webgpu/webgpu-index-buffer.js b/src/platform/graphics/webgpu/webgpu-index-buffer.js
similarity index 93%
rename from src/graphics/webgpu/webgpu-index-buffer.js
rename to src/platform/graphics/webgpu/webgpu-index-buffer.js
index 273d165b9ca..7ffd076bfe5 100644
--- a/src/graphics/webgpu/webgpu-index-buffer.js
+++ b/src/platform/graphics/webgpu/webgpu-index-buffer.js
@@ -1,4 +1,4 @@
-import { Debug } from '../../core/debug.js';
+import { Debug } from '../../../core/debug.js';
import { INDEXFORMAT_UINT8, INDEXFORMAT_UINT16 } from '../constants.js';
import { WebgpuBuffer } from "./webgpu-buffer.js";
diff --git a/src/graphics/webgpu/webgpu-render-pipeline.js b/src/platform/graphics/webgpu/webgpu-render-pipeline.js
similarity index 99%
rename from src/graphics/webgpu/webgpu-render-pipeline.js
rename to src/platform/graphics/webgpu/webgpu-render-pipeline.js
index 0037d1e382d..6f204b8f53f 100644
--- a/src/graphics/webgpu/webgpu-render-pipeline.js
+++ b/src/platform/graphics/webgpu/webgpu-render-pipeline.js
@@ -1,4 +1,4 @@
-import { Debug } from "../../core/debug.js";
+import { Debug } from "../../../core/debug.js";
import { WebgpuVertexBufferLayout } from "./webgpu-vertex-buffer-layout.js";
/** @typedef {import('./webgpu-graphics-device.js').WebgpuGraphicsDevice} WebgpuGraphicsDevice */
diff --git a/src/graphics/webgpu/webgpu-render-state.js b/src/platform/graphics/webgpu/webgpu-render-state.js
similarity index 100%
rename from src/graphics/webgpu/webgpu-render-state.js
rename to src/platform/graphics/webgpu/webgpu-render-state.js
diff --git a/src/graphics/webgpu/webgpu-render-target.js b/src/platform/graphics/webgpu/webgpu-render-target.js
similarity index 99%
rename from src/graphics/webgpu/webgpu-render-target.js
rename to src/platform/graphics/webgpu/webgpu-render-target.js
index a32946f2908..fa2770c4263 100644
--- a/src/graphics/webgpu/webgpu-render-target.js
+++ b/src/platform/graphics/webgpu/webgpu-render-target.js
@@ -1,4 +1,4 @@
-import { Debug } from '../../core/debug.js';
+import { Debug } from '../../../core/debug.js';
/** @typedef {import('../render-pass.js').RenderPass} RenderPass */
/** @typedef {import('../render-target.js').RenderTarget} RenderTarget */
diff --git a/src/graphics/webgpu/webgpu-shader.js b/src/platform/graphics/webgpu/webgpu-shader.js
similarity index 98%
rename from src/graphics/webgpu/webgpu-shader.js
rename to src/platform/graphics/webgpu/webgpu-shader.js
index ada508fa2cf..810ee0ae0ce 100644
--- a/src/graphics/webgpu/webgpu-shader.js
+++ b/src/platform/graphics/webgpu/webgpu-shader.js
@@ -1,4 +1,4 @@
-import { Debug } from '../../core/debug.js';
+import { Debug } from '../../../core/debug.js';
import { ShaderProcessor } from '../shader-processor.js';
/** @typedef {import('../graphics-device.js').GraphicsDevice} GraphicsDevice */
diff --git a/src/graphics/webgpu/webgpu-texture.js b/src/platform/graphics/webgpu/webgpu-texture.js
similarity index 99%
rename from src/graphics/webgpu/webgpu-texture.js
rename to src/platform/graphics/webgpu/webgpu-texture.js
index 61c406e73a0..2022eb8df1d 100644
--- a/src/graphics/webgpu/webgpu-texture.js
+++ b/src/platform/graphics/webgpu/webgpu-texture.js
@@ -1,4 +1,4 @@
-import { Debug, DebugHelper } from '../../core/debug.js';
+import { Debug, DebugHelper } from '../../../core/debug.js';
import {
PIXELFORMAT_A8, PIXELFORMAT_L8, PIXELFORMAT_L8_A8, PIXELFORMAT_R5_G6_B5, PIXELFORMAT_R5_G5_B5_A1, PIXELFORMAT_R4_G4_B4_A4,
PIXELFORMAT_R8_G8_B8, PIXELFORMAT_R8_G8_B8_A8, PIXELFORMAT_DXT1, PIXELFORMAT_DXT3, PIXELFORMAT_DXT5,
diff --git a/src/graphics/webgpu/webgpu-uniform-buffer.js b/src/platform/graphics/webgpu/webgpu-uniform-buffer.js
similarity index 100%
rename from src/graphics/webgpu/webgpu-uniform-buffer.js
rename to src/platform/graphics/webgpu/webgpu-uniform-buffer.js
diff --git a/src/graphics/webgpu/webgpu-utils.js b/src/platform/graphics/webgpu/webgpu-utils.js
similarity index 100%
rename from src/graphics/webgpu/webgpu-utils.js
rename to src/platform/graphics/webgpu/webgpu-utils.js
diff --git a/src/graphics/webgpu/webgpu-vertex-buffer-layout.js b/src/platform/graphics/webgpu/webgpu-vertex-buffer-layout.js
similarity index 98%
rename from src/graphics/webgpu/webgpu-vertex-buffer-layout.js
rename to src/platform/graphics/webgpu/webgpu-vertex-buffer-layout.js
index b88fe316476..25e2bbedaaa 100644
--- a/src/graphics/webgpu/webgpu-vertex-buffer-layout.js
+++ b/src/platform/graphics/webgpu/webgpu-vertex-buffer-layout.js
@@ -1,4 +1,4 @@
-import { Debug } from "../../core/debug.js";
+import { Debug } from "../../../core/debug.js";
import { semanticToLocation, TYPE_FLOAT32 } from '../constants.js';
/** @typedef {import('../vertex-format.js').VertexFormat} VertexFormat */
diff --git a/src/graphics/webgpu/webgpu-vertex-buffer.js b/src/platform/graphics/webgpu/webgpu-vertex-buffer.js
similarity index 100%
rename from src/graphics/webgpu/webgpu-vertex-buffer.js
rename to src/platform/graphics/webgpu/webgpu-vertex-buffer.js
diff --git a/src/resources/basis.js b/src/resources/basis.js
index 34c473f31c6..c5e6677fb1b 100644
--- a/src/resources/basis.js
+++ b/src/resources/basis.js
@@ -1,9 +1,9 @@
import { Debug } from '../core/debug.js';
-import { PIXELFORMAT_R5_G6_B5, PIXELFORMAT_R4_G4_B4_A4 } from '../graphics/constants.js';
+import { PIXELFORMAT_R5_G6_B5, PIXELFORMAT_R4_G4_B4_A4 } from '../platform/graphics/constants.js';
import { BasisWorker } from './basis-worker.js';
import { http } from '../platform/net/http.js';
-/** @typedef {import('../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../platform/graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
// get the list of the device's supported compression formats
const getCompressionFormats = (device) => {
diff --git a/src/resources/cubemap.js b/src/resources/cubemap.js
index d9fd630cc0f..edc24a4edfc 100644
--- a/src/resources/cubemap.js
+++ b/src/resources/cubemap.js
@@ -1,10 +1,10 @@
import {
ADDRESS_CLAMP_TO_EDGE, PIXELFORMAT_R8_G8_B8, PIXELFORMAT_R8_G8_B8_A8,
TEXTURETYPE_DEFAULT, TEXTURETYPE_RGBM
-} from '../graphics/constants.js';
+} from '../platform/graphics/constants.js';
import { Asset } from '../asset/asset.js';
-import { Texture } from '../graphics/texture.js';
+import { Texture } from '../platform/graphics/texture.js';
/** @typedef {import('./handler.js').ResourceHandler} ResourceHandler */
/** @typedef {import('../framework/app-base.js').AppBase} AppBase */
diff --git a/src/resources/material.js b/src/resources/material.js
index 227b4ee1035..91cbb730023 100644
--- a/src/resources/material.js
+++ b/src/resources/material.js
@@ -1,7 +1,7 @@
import { http } from '../platform/net/http.js';
-import { PIXELFORMAT_R8_G8_B8_A8 } from '../graphics/constants.js';
-import { Texture } from '../graphics/texture.js';
+import { PIXELFORMAT_R8_G8_B8_A8 } from '../platform/graphics/constants.js';
+import { Texture } from '../platform/graphics/texture.js';
import { SPECULAR_PHONG } from '../scene/constants.js';
import { standardMaterialCubemapParameters, standardMaterialTextureParameters } from '../scene/materials/standard-material-parameters.js';
diff --git a/src/resources/parser/glb-parser.js b/src/resources/parser/glb-parser.js
index dd9334ae3fa..fac49492824 100644
--- a/src/resources/parser/glb-parser.js
+++ b/src/resources/parser/glb-parser.js
@@ -22,11 +22,11 @@ import {
SEMANTIC_POSITION, SEMANTIC_NORMAL, SEMANTIC_TANGENT, SEMANTIC_COLOR, SEMANTIC_BLENDINDICES, SEMANTIC_BLENDWEIGHT,
SEMANTIC_TEXCOORD0, SEMANTIC_TEXCOORD1, SEMANTIC_TEXCOORD2, SEMANTIC_TEXCOORD3, SEMANTIC_TEXCOORD4, SEMANTIC_TEXCOORD5, SEMANTIC_TEXCOORD6, SEMANTIC_TEXCOORD7,
TYPE_INT8, TYPE_UINT8, TYPE_INT16, TYPE_UINT16, TYPE_INT32, TYPE_UINT32, TYPE_FLOAT32, CHUNKAPI_1_57
-} from '../../graphics/constants.js';
-import { IndexBuffer } from '../../graphics/index-buffer.js';
-import { Texture } from '../../graphics/texture.js';
-import { VertexBuffer } from '../../graphics/vertex-buffer.js';
-import { VertexFormat } from '../../graphics/vertex-format.js';
+} from '../../platform/graphics/constants.js';
+import { IndexBuffer } from '../../platform/graphics/index-buffer.js';
+import { Texture } from '../../platform/graphics/texture.js';
+import { VertexBuffer } from '../../platform/graphics/vertex-buffer.js';
+import { VertexFormat } from '../../platform/graphics/vertex-format.js';
import {
BLEND_NONE, BLEND_NORMAL, LIGHTFALLOFF_INVERSESQUARED,
diff --git a/src/resources/parser/json-model.js b/src/resources/parser/json-model.js
index ad3d8737750..4b3c94a9141 100644
--- a/src/resources/parser/json-model.js
+++ b/src/resources/parser/json-model.js
@@ -11,11 +11,11 @@ import {
SEMANTIC_POSITION, SEMANTIC_NORMAL, SEMANTIC_TANGENT, SEMANTIC_COLOR, SEMANTIC_BLENDINDICES, SEMANTIC_BLENDWEIGHT, SEMANTIC_TEXCOORD0, SEMANTIC_TEXCOORD1,
SEMANTIC_TEXCOORD2, SEMANTIC_TEXCOORD3, SEMANTIC_TEXCOORD4, SEMANTIC_TEXCOORD5, SEMANTIC_TEXCOORD6, SEMANTIC_TEXCOORD7,
TYPE_INT8, TYPE_UINT8, TYPE_INT16, TYPE_UINT16, TYPE_INT32, TYPE_UINT32, TYPE_FLOAT32
-} from '../../graphics/constants.js';
-import { IndexBuffer } from '../../graphics/index-buffer.js';
-import { VertexBuffer } from '../../graphics/vertex-buffer.js';
-import { VertexFormat } from '../../graphics/vertex-format.js';
-import { VertexIterator } from '../../graphics/vertex-iterator.js';
+} from '../../platform/graphics/constants.js';
+import { IndexBuffer } from '../../platform/graphics/index-buffer.js';
+import { VertexBuffer } from '../../platform/graphics/vertex-buffer.js';
+import { VertexFormat } from '../../platform/graphics/vertex-format.js';
+import { VertexIterator } from '../../platform/graphics/vertex-iterator.js';
import { partitionSkin } from '../../scene/skin-partition.js';
import { GraphNode } from '../../scene/graph-node.js';
diff --git a/src/resources/parser/material/json-standard-material.js b/src/resources/parser/material/json-standard-material.js
index 24a35fd8b09..4128c9b53b4 100644
--- a/src/resources/parser/material/json-standard-material.js
+++ b/src/resources/parser/material/json-standard-material.js
@@ -2,7 +2,7 @@ import { Color } from '../../../core/math/color.js';
import { Vec2 } from '../../../core/math/vec2.js';
import { Vec3 } from '../../../core/math/vec3.js';
-import { Texture } from '../../../graphics/texture.js';
+import { Texture } from '../../../platform/graphics/texture.js';
import { BoundingBox } from '../../../core/shape/bounding-box.js';
diff --git a/src/resources/parser/texture/basis.js b/src/resources/parser/texture/basis.js
index 6a8384ad3f6..e76ce3f3702 100644
--- a/src/resources/parser/texture/basis.js
+++ b/src/resources/parser/texture/basis.js
@@ -1,7 +1,7 @@
import { Asset } from '../../../asset/asset.js';
-import { Texture } from '../../../graphics/texture.js';
+import { Texture } from '../../../platform/graphics/texture.js';
import { basisTranscode } from '../../basis.js';
-import { ADDRESS_CLAMP_TO_EDGE, ADDRESS_REPEAT, TEXHINT_ASSET } from '../../../graphics/constants.js';
+import { ADDRESS_CLAMP_TO_EDGE, ADDRESS_REPEAT, TEXHINT_ASSET } from '../../../platform/graphics/constants.js';
/** @typedef {import('../../texture.js').TextureParser} TextureParser */
diff --git a/src/resources/parser/texture/dds.js b/src/resources/parser/texture/dds.js
index bc824e78cbc..9eb58964a6e 100644
--- a/src/resources/parser/texture/dds.js
+++ b/src/resources/parser/texture/dds.js
@@ -1,6 +1,6 @@
import { Debug } from '../../../core/debug.js';
import { Asset } from '../../../asset/asset.js';
-import { Texture } from '../../../graphics/texture.js';
+import { Texture } from '../../../platform/graphics/texture.js';
import {
ADDRESS_CLAMP_TO_EDGE, ADDRESS_REPEAT,
PIXELFORMAT_DXT1, PIXELFORMAT_DXT5,
@@ -9,7 +9,7 @@ import {
PIXELFORMAT_R8_G8_B8, PIXELFORMAT_R8_G8_B8_A8,
PIXELFORMAT_RGBA16F, PIXELFORMAT_RGBA32F,
TEXHINT_ASSET
-} from '../../../graphics/constants.js';
+} from '../../../platform/graphics/constants.js';
/** @typedef {import('../../texture.js').TextureParser} TextureParser */
diff --git a/src/resources/parser/texture/hdr.js b/src/resources/parser/texture/hdr.js
index 4db9af627b8..2e4b189542f 100644
--- a/src/resources/parser/texture/hdr.js
+++ b/src/resources/parser/texture/hdr.js
@@ -1,14 +1,14 @@
import { ReadStream } from '../../../core/read-stream.js';
import { Debug } from '../../../core/debug.js';
-import { Texture } from '../../../graphics/texture.js';
+import { Texture } from '../../../platform/graphics/texture.js';
import {
TEXHINT_ASSET,
ADDRESS_REPEAT, ADDRESS_CLAMP_TO_EDGE,
FILTER_NEAREST,
PIXELFORMAT_R8_G8_B8_A8,
TEXTURETYPE_RGBE
-} from '../../../graphics/constants.js';
+} from '../../../platform/graphics/constants.js';
import { Asset } from '../../../asset/asset.js';
diff --git a/src/resources/parser/texture/img.js b/src/resources/parser/texture/img.js
index f1990dfa074..8657b9d7b55 100644
--- a/src/resources/parser/texture/img.js
+++ b/src/resources/parser/texture/img.js
@@ -3,8 +3,8 @@ import { http } from '../../../platform/net/http.js';
import {
PIXELFORMAT_R8_G8_B8, PIXELFORMAT_R8_G8_B8_A8, TEXHINT_ASSET
-} from '../../../graphics/constants.js';
-import { Texture } from '../../../graphics/texture.js';
+} from '../../../platform/graphics/constants.js';
+import { Texture } from '../../../platform/graphics/texture.js';
import { ABSOLUTE_URL } from '../../../asset/constants.js';
diff --git a/src/resources/parser/texture/ktx.js b/src/resources/parser/texture/ktx.js
index f9d85dfe614..b5c76affeeb 100644
--- a/src/resources/parser/texture/ktx.js
+++ b/src/resources/parser/texture/ktx.js
@@ -1,6 +1,6 @@
import { Debug } from '../../../core/debug.js';
import { Asset } from '../../../asset/asset.js';
-import { Texture } from '../../../graphics/texture.js';
+import { Texture } from '../../../platform/graphics/texture.js';
import {
ADDRESS_CLAMP_TO_EDGE, ADDRESS_REPEAT,
PIXELFORMAT_DXT1, PIXELFORMAT_DXT3, PIXELFORMAT_DXT5,
@@ -9,7 +9,7 @@ import {
PIXELFORMAT_R8_G8_B8, PIXELFORMAT_R8_G8_B8_A8, PIXELFORMAT_SRGB, PIXELFORMAT_SRGBA,
PIXELFORMAT_111110F, PIXELFORMAT_RGB16F, PIXELFORMAT_RGBA16F,
TEXHINT_ASSET
-} from '../../../graphics/constants.js';
+} from '../../../platform/graphics/constants.js';
/** @typedef {import('../../texture.js').TextureParser} TextureParser */
diff --git a/src/resources/parser/texture/ktx2.js b/src/resources/parser/texture/ktx2.js
index 61577096d9a..3fa086138f1 100644
--- a/src/resources/parser/texture/ktx2.js
+++ b/src/resources/parser/texture/ktx2.js
@@ -1,9 +1,9 @@
import { Debug } from '../../../core/debug.js';
import { Asset } from '../../../asset/asset.js';
-import { Texture } from '../../../graphics/texture.js';
+import { Texture } from '../../../platform/graphics/texture.js';
import { basisTranscode } from '../../basis.js';
import { ReadStream } from '../../../core/read-stream.js';
-import { ADDRESS_CLAMP_TO_EDGE, ADDRESS_REPEAT, TEXHINT_ASSET } from '../../../graphics/constants.js';
+import { ADDRESS_CLAMP_TO_EDGE, ADDRESS_REPEAT, TEXHINT_ASSET } from '../../../platform/graphics/constants.js';
/** @typedef {import('../../texture.js').TextureParser} TextureParser */
diff --git a/src/resources/texture-atlas.js b/src/resources/texture-atlas.js
index cd70825ff11..5084e2b98d6 100644
--- a/src/resources/texture-atlas.js
+++ b/src/resources/texture-atlas.js
@@ -9,7 +9,7 @@ import {
ADDRESS_CLAMP_TO_EDGE, ADDRESS_MIRRORED_REPEAT, ADDRESS_REPEAT,
FILTER_LINEAR, FILTER_NEAREST, FILTER_NEAREST_MIPMAP_NEAREST, FILTER_NEAREST_MIPMAP_LINEAR, FILTER_LINEAR_MIPMAP_NEAREST, FILTER_LINEAR_MIPMAP_LINEAR,
TEXTURETYPE_DEFAULT, TEXTURETYPE_RGBM
-} from '../graphics/constants.js';
+} from '../platform/graphics/constants.js';
import { TextureAtlas } from '../scene/texture-atlas.js';
diff --git a/src/resources/texture.js b/src/resources/texture.js
index ac50a14c18a..13346ffce15 100644
--- a/src/resources/texture.js
+++ b/src/resources/texture.js
@@ -5,8 +5,8 @@ import {
FILTER_LINEAR, FILTER_NEAREST, FILTER_NEAREST_MIPMAP_NEAREST, FILTER_NEAREST_MIPMAP_LINEAR, FILTER_LINEAR_MIPMAP_NEAREST, FILTER_LINEAR_MIPMAP_LINEAR,
PIXELFORMAT_R8_G8_B8, PIXELFORMAT_R8_G8_B8_A8, PIXELFORMAT_RGBA32F,
TEXTURETYPE_DEFAULT, TEXTURETYPE_RGBE, TEXTURETYPE_RGBM, TEXTURETYPE_SWIZZLEGGGR, TEXTURETYPE_RGBP
-} from '../graphics/constants.js';
-import { Texture } from '../graphics/texture.js';
+} from '../platform/graphics/constants.js';
+import { Texture } from '../platform/graphics/texture.js';
import { BasisParser } from './parser/texture/basis.js';
import { ImgParser } from './parser/texture/img.js';
diff --git a/src/scene/area-light-luts.js b/src/scene/area-light-luts.js
index 5626993204c..3d1cb996b1c 100644
--- a/src/scene/area-light-luts.js
+++ b/src/scene/area-light-luts.js
@@ -1,13 +1,13 @@
import { FloatPacking } from '../core/math/float-packing.js';
-import { Texture } from '../graphics/texture.js';
-import { DeviceCache } from '../graphics/device-cache.js';
+import { Texture } from '../platform/graphics/texture.js';
+import { DeviceCache } from '../platform/graphics/device-cache.js';
import {
ADDRESS_CLAMP_TO_EDGE,
FILTER_LINEAR, FILTER_NEAREST,
PIXELFORMAT_R8_G8_B8_A8, PIXELFORMAT_RGBA16F, PIXELFORMAT_RGBA32F,
TEXTURETYPE_DEFAULT
-} from '../graphics/constants.js';
+} from '../platform/graphics/constants.js';
// class used to hold LUT textures in the device cache
class AreaLightCacheEntry {
diff --git a/src/scene/batching/batch-manager.js b/src/scene/batching/batch-manager.js
index 3037a58fa49..a098aaf39e4 100644
--- a/src/scene/batching/batch-manager.js
+++ b/src/scene/batching/batch-manager.js
@@ -11,7 +11,7 @@ import {
SEMANTIC_POSITION, SEMANTIC_NORMAL, SEMANTIC_TANGENT, SEMANTIC_BLENDINDICES,
TYPE_FLOAT32,
typedArrayIndexFormats, typedArrayTypes, typedArrayTypesByteSize
-} from '../../graphics/constants.js';
+} from '../../platform/graphics/constants.js';
import { shaderChunks } from '../../scene/shader-lib/chunks/chunks.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('../../platform/graphics/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 b75b84bf352..116bd6e4fa3 100644
--- a/src/scene/composition/layer-composition.js
+++ b/src/scene/composition/layer-composition.js
@@ -15,7 +15,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('../../platform/graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
/** @typedef {import('../../framework/components/camera/component.js').CameraComponent} CameraComponent */
/** @typedef {import('../layer.js').Layer} Layer */
diff --git a/src/scene/composition/render-action.js b/src/scene/composition/render-action.js
index fddbf66bb55..3485b918104 100644
--- a/src/scene/composition/render-action.js
+++ b/src/scene/composition/render-action.js
@@ -2,8 +2,8 @@ import {
LIGHTTYPE_DIRECTIONAL
} from '../constants.js';
-/** @typedef {import('../../graphics/bind-group.js').BindGroup} BindGroup */
-/** @typedef {import('../../graphics/render-target.js').RenderTarget} RenderTarget */
+/** @typedef {import('../../platform/graphics/bind-group.js').BindGroup} BindGroup */
+/** @typedef {import('../../platform/graphics/render-target.js').RenderTarget} RenderTarget */
/** @typedef {import('./layer-composition.js').LayerComposition} LayerComposition */
/**
diff --git a/src/scene/frame-graph.js b/src/scene/frame-graph.js
index 287ebe42434..e1201027f7d 100644
--- a/src/scene/frame-graph.js
+++ b/src/scene/frame-graph.js
@@ -2,9 +2,9 @@ import { TRACEID_RENDER_PASS, TRACEID_RENDER_PASS_DETAIL } from '../core/constan
import { Debug } from '../core/debug.js';
import { Tracing } from '../core/tracing.js';
-/** @typedef {import('../graphics/render-pass.js').RenderPass} RenderPass */
-/** @typedef {import('../graphics/render-target.js').RenderTarget} RenderTarget */
-/** @typedef {import('../graphics/texture.js').Texture} Texture */
+/** @typedef {import('../platform/graphics/render-pass.js').RenderPass} RenderPass */
+/** @typedef {import('../platform/graphics/render-target.js').RenderTarget} RenderTarget */
+/** @typedef {import('../platform/graphics/texture.js').Texture} Texture */
/**
* A frame graph represents a single rendering frame as a sequence of render passes.
diff --git a/src/scene/graphics/env-lighting.js b/src/scene/graphics/env-lighting.js
index 66afa8de972..f20ae2c8754 100644
--- a/src/scene/graphics/env-lighting.js
+++ b/src/scene/graphics/env-lighting.js
@@ -1,13 +1,13 @@
import { Vec4 } from '../../core/math/vec4.js';
-import { Texture } from '../../graphics/texture.js';
+import { Texture } from '../../platform/graphics/texture.js';
import { reprojectTexture } from './reproject-texture.js';
import {
TEXTURETYPE_DEFAULT, TEXTURETYPE_RGBM,
TEXTUREPROJECTION_EQUIRECT,
ADDRESS_CLAMP_TO_EDGE,
PIXELFORMAT_R8_G8_B8_A8, PIXELFORMAT_RGBA16F, PIXELFORMAT_RGBA32F
-} from '../../graphics/constants.js';
-import { DebugGraphics } from '../../graphics/debug-graphics.js';
+} from '../../platform/graphics/constants.js';
+import { DebugGraphics } from '../../platform/graphics/debug-graphics.js';
const fixCubemapSeams = true;
const RGBA8_TYPE = TEXTURETYPE_RGBM;
diff --git a/src/scene/graphics/post-effect.js b/src/scene/graphics/post-effect.js
index 652390a8317..05e5235f1be 100644
--- a/src/scene/graphics/post-effect.js
+++ b/src/scene/graphics/post-effect.js
@@ -1,11 +1,11 @@
-import { CULLFACE_NONE, PRIMITIVE_TRISTRIP, SEMANTIC_POSITION, TYPE_FLOAT32, BUFFER_STATIC } from '../../graphics/constants.js';
-import { VertexBuffer } from '../../graphics/vertex-buffer.js';
-import { VertexFormat } from '../../graphics/vertex-format.js';
-
-/** @typedef {import('../math/vec4.js').Vec4} Vec4 */
-/** @typedef {import('../core/math/vec4.jsce.js').GraphicsDevice} GraphicsDevice */
-/** @typedef {import('../../graphics/render-target.js').RenderTarget} RenderTarget */
-/** @typedef {import('../../graphics/shader.js').Shader} Shader */
+import { CULLFACE_NONE, PRIMITIVE_TRISTRIP, SEMANTIC_POSITION, TYPE_FLOAT32, BUFFER_STATIC } from '../../platform/graphics/constants.js';
+import { VertexBuffer } from '../../platform/graphics/vertex-buffer.js';
+import { VertexFormat } from '../../platform/graphics/vertex-format.js';
+
+/** @typedef {import('../../core/math/vec4.js').Vec4} Vec4 */
+/** @typedef {import('../../platform//graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../../platform/graphics/render-target.js').RenderTarget} RenderTarget */
+/** @typedef {import('../../platform//graphics/shader.js').Shader} Shader */
// Primitive for drawFullscreenQuad
const primitive = {
diff --git a/src/scene/graphics/prefilter-cubemap.js b/src/scene/graphics/prefilter-cubemap.js
index 6915752a0b4..73b9f25f3fd 100644
--- a/src/scene/graphics/prefilter-cubemap.js
+++ b/src/scene/graphics/prefilter-cubemap.js
@@ -3,12 +3,12 @@ import { Vec3 } from '../../core/math/vec3.js';
import {
PIXELFORMAT_R8_G8_B8_A8, TEXTURETYPE_DEFAULT, TEXTURETYPE_RGBM
-} from '../../graphics/constants.js';
+} from '../../platform/graphics/constants.js';
import { createShaderFromCode } from '../shader-lib/utils.js';
-import { drawQuadWithShader } from '../../graphics/simple-post-effect.js';
+import { drawQuadWithShader } from '../../platform/graphics/simple-post-effect.js';
import { shaderChunks } from '../shader-lib/chunks/chunks.js';
-import { RenderTarget } from '../../graphics/render-target.js';
-import { Texture } from '../../graphics/texture.js';
+import { RenderTarget } from '../../platform/graphics/render-target.js';
+import { Texture } from '../../platform/graphics/texture.js';
// https://seblagarde.wordpress.com/2012/06/10/amd-cubemapgen-for-physically-based-rendering/
function areaElement(x, y) {
diff --git a/src/scene/graphics/reproject-texture.js b/src/scene/graphics/reproject-texture.js
index cdc063af3e7..25a410dfa1b 100644
--- a/src/scene/graphics/reproject-texture.js
+++ b/src/scene/graphics/reproject-texture.js
@@ -2,19 +2,19 @@ import { Debug } from '../../core/debug.js';
import {
FILTER_NEAREST,
TEXTUREPROJECTION_OCTAHEDRAL, TEXTUREPROJECTION_CUBE
-} from '../../graphics/constants.js';
+} from '../../platform/graphics/constants.js';
import { Vec3 } from '../../core/math/vec3.js';
import { random } from '../../core/math/random.js';
import { createShaderFromCode } from '../shader-lib/utils.js';
-import { drawQuadWithShader } from '../../graphics/simple-post-effect.js';
+import { drawQuadWithShader } from '../../platform/graphics/simple-post-effect.js';
import { ChunkUtils } from '../shader-lib/chunk-utils.js';
import { shaderChunks } from '../shader-lib/chunks/chunks.js';
-import { RenderTarget } from '../../graphics/render-target.js';
-import { GraphicsDevice } from '../../graphics/graphics-device.js';
+import { RenderTarget } from '../../platform/graphics/render-target.js';
+import { GraphicsDevice } from '../../platform/graphics/graphics-device.js';
import { getProgramLibrary } from '../shader-lib/get-program-library.js';
-import { Texture } from '../../graphics/texture.js';
-import { DebugGraphics } from '../../graphics/debug-graphics.js';
-import { DeviceCache } from '../../graphics/device-cache.js';
+import { Texture } from '../../platform/graphics/texture.js';
+import { DebugGraphics } from '../../platform/graphics/debug-graphics.js';
+import { DeviceCache } from '../../platform/graphics/device-cache.js';
/** @typedef {import('../../core/math/vec4.js').Vec4} Vec4 */
diff --git a/src/scene/immediate/immediate-batch.js b/src/scene/immediate/immediate-batch.js
index 92dca939f57..bae5d7a13c8 100644
--- a/src/scene/immediate/immediate-batch.js
+++ b/src/scene/immediate/immediate-batch.js
@@ -1,6 +1,6 @@
import { Mat4 } from '../../core/math/mat4.js';
-import { PRIMITIVE_LINES } from '../../graphics/constants.js';
+import { PRIMITIVE_LINES } from '../../platform/graphics/constants.js';
import { Mesh } from '../../scene/mesh.js';
import { MeshInstance } from '../../scene/mesh-instance.js';
import { GraphNode } from '../../scene/graph-node.js';
diff --git a/src/scene/immediate/immediate.js b/src/scene/immediate/immediate.js
index 38475d0d470..a5f1681bbbc 100644
--- a/src/scene/immediate/immediate.js
+++ b/src/scene/immediate/immediate.js
@@ -1,4 +1,4 @@
-import { PRIMITIVE_TRISTRIP } from '../../graphics/constants.js';
+import { PRIMITIVE_TRISTRIP } from '../../platform/graphics/constants.js';
import { shaderChunks } from '../../scene/shader-lib/chunks/chunks.js';
import { createShaderFromCode } from '../../scene/shader-lib/utils.js';
diff --git a/src/scene/lighting/light-texture-atlas.js b/src/scene/lighting/light-texture-atlas.js
index 3c74a1bbfae..0c6d738fea7 100644
--- a/src/scene/lighting/light-texture-atlas.js
+++ b/src/scene/lighting/light-texture-atlas.js
@@ -1,7 +1,7 @@
import { Vec2 } from '../../core/math/vec2.js';
import { Vec4 } from '../../core/math/vec4.js';
-import { RenderTarget } from '../../graphics/render-target.js';
+import { RenderTarget } from '../../platform/graphics/render-target.js';
import { LIGHTTYPE_OMNI, LIGHTTYPE_SPOT, SHADOW_PCF3 } from '../constants.js';
import { CookieRenderer } from '../renderer/cookie-renderer.js';
diff --git a/src/scene/lighting/lights-buffer.js b/src/scene/lighting/lights-buffer.js
index 91a40208d70..f648807ab7e 100644
--- a/src/scene/lighting/lights-buffer.js
+++ b/src/scene/lighting/lights-buffer.js
@@ -1,8 +1,8 @@
import { Vec3 } from '../../core/math/vec3.js';
-import { PIXELFORMAT_R8_G8_B8_A8, PIXELFORMAT_RGBA32F, ADDRESS_CLAMP_TO_EDGE, TEXTURETYPE_DEFAULT, FILTER_NEAREST } from '../../graphics/constants.js';
+import { PIXELFORMAT_R8_G8_B8_A8, PIXELFORMAT_RGBA32F, ADDRESS_CLAMP_TO_EDGE, TEXTURETYPE_DEFAULT, FILTER_NEAREST } from '../../platform/graphics/constants.js';
import { FloatPacking } from '../../core/math/float-packing.js';
import { LIGHTSHAPE_PUNCTUAL, LIGHTTYPE_SPOT, MASK_AFFECT_LIGHTMAPPED, MASK_AFFECT_DYNAMIC } from '../constants.js';
-import { Texture } from '../../graphics/texture.js';
+import { Texture } from '../../platform/graphics/texture.js';
import { LightCamera } from '../renderer/light-camera.js';
const epsilon = 0.000001;
diff --git a/src/scene/lighting/world-clusters-debug.js b/src/scene/lighting/world-clusters-debug.js
index a6a2218ea6c..c4f7a25a4da 100644
--- a/src/scene/lighting/world-clusters-debug.js
+++ b/src/scene/lighting/world-clusters-debug.js
@@ -2,7 +2,7 @@ import { Color } from '../../core/math/color.js';
import { Mat4 } from '../../core/math/mat4.js';
import { Vec3 } from '../../core/math/vec3.js';
-import { PRIMITIVE_TRIANGLES } from '../../graphics/constants.js';
+import { PRIMITIVE_TRIANGLES } from '../../platform/graphics/constants.js';
import { BLEND_ADDITIVEALPHA } from '../../scene/constants.js';
import { GraphNode } from '../graph-node.js';
diff --git a/src/scene/lighting/world-clusters.js b/src/scene/lighting/world-clusters.js
index 675a89e363e..1937791d1da 100644
--- a/src/scene/lighting/world-clusters.js
+++ b/src/scene/lighting/world-clusters.js
@@ -1,7 +1,7 @@
import { Vec3 } from '../../core/math/vec3.js';
import { math } from '../../core/math/math.js';
import { BoundingBox } from '../../core/shape/bounding-box.js';
-import { PIXELFORMAT_R8_G8_B8_A8 } from '../../graphics/constants.js';
+import { PIXELFORMAT_R8_G8_B8_A8 } from '../../platform/graphics/constants.js';
import { LIGHTTYPE_DIRECTIONAL, MASK_AFFECT_DYNAMIC, MASK_AFFECT_LIGHTMAPPED } from '../constants.js';
import { LightsBuffer } from './lights-buffer.js';
import { Debug } from '../../core/debug.js';
diff --git a/src/scene/lightmapper/lightmapper.js b/src/scene/lightmapper/lightmapper.js
index 99a5de2db99..8afed6ac166 100644
--- a/src/scene/lightmapper/lightmapper.js
+++ b/src/scene/lightmapper/lightmapper.js
@@ -15,13 +15,13 @@ import {
PIXELFORMAT_R8_G8_B8_A8,
TEXHINT_LIGHTMAP,
TEXTURETYPE_DEFAULT, TEXTURETYPE_RGBM
-} from '../../graphics/constants.js';
+} from '../../platform/graphics/constants.js';
import { shaderChunks } from '../../scene/shader-lib/chunks/chunks.js';
import { shaderChunksLightmapper } from '../../scene/shader-lib/chunks/chunks-lightmapper.js';
-import { drawQuadWithShader } from '../../graphics/simple-post-effect.js';
-import { RenderTarget } from '../../graphics/render-target.js';
-import { Texture } from '../../graphics/texture.js';
-import { DebugGraphics } from '../../graphics/debug-graphics.js';
+import { drawQuadWithShader } from '../../platform/graphics/simple-post-effect.js';
+import { RenderTarget } from '../../platform/graphics/render-target.js';
+import { Texture } from '../../platform/graphics/texture.js';
+import { DebugGraphics } from '../../platform/graphics/debug-graphics.js';
import { MeshInstance } from '../mesh-instance.js';
@@ -31,7 +31,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('../../platform/graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
/** @typedef {import('../scene.js').Scene} Scene */
import {
diff --git a/src/scene/materials/basic-material.js b/src/scene/materials/basic-material.js
index a7b73157226..67ada7b8ca8 100644
--- a/src/scene/materials/basic-material.js
+++ b/src/scene/materials/basic-material.js
@@ -6,11 +6,11 @@ import {
} from '../constants.js';
import { basic } from '../../scene/shader-lib/programs/basic.js';
-import { ShaderProcessorOptions } from '../../graphics/shader-processor-options.js';
+import { ShaderProcessorOptions } from '../../platform/graphics/shader-processor-options.js';
import { getProgramLibrary } from '../shader-lib/get-program-library.js';
import { Material } from './material.js';
-/** @typedef {import('../../graphics/texture.js').Texture} Texture */
+/** @typedef {import('../../platform/graphics/texture.js').Texture} Texture */
/**
* A BasicMaterial is for rendering unlit geometry, either using a constant color or a color map
diff --git a/src/scene/materials/default-material.js b/src/scene/materials/default-material.js
index 922fa02a6a6..8e812c38b2f 100644
--- a/src/scene/materials/default-material.js
+++ b/src/scene/materials/default-material.js
@@ -1,7 +1,7 @@
import { Debug } from '../../core/debug.js';
-import { DeviceCache } from '../../graphics/device-cache.js';
+import { DeviceCache } from '../../platform/graphics/device-cache.js';
-/** @typedef {import('../../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../../platform/graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
/** @typedef {import('./standard-material.js').StandardMaterial} StandardMaterial */
// device cache storing default material
diff --git a/src/scene/materials/material.js b/src/scene/materials/material.js
index 6ffd3c912c4..dbaf8bc9ef9 100644
--- a/src/scene/materials/material.js
+++ b/src/scene/materials/material.js
@@ -6,7 +6,7 @@ import {
BLENDEQUATION_MIN, BLENDEQUATION_MAX,
CULLFACE_BACK,
FUNC_LESSEQUAL
-} from '../../graphics/constants.js';
+} from '../../platform/graphics/constants.js';
import {
BLEND_ADDITIVE, BLEND_NORMAL, BLEND_NONE, BLEND_PREMULTIPLIED,
@@ -15,11 +15,11 @@ import {
} from '../constants.js';
import { Debug } from '../../core/debug.js';
import { getDefaultMaterial } from './default-material.js';
-import { ShaderProcessorOptions } from '../../graphics/shader-processor-options.js';
+import { ShaderProcessorOptions } from '../../platform/graphics/shader-processor-options.js';
import { getProgramLibrary } from '../shader-lib/get-program-library.js';
-/** @typedef {import('../../graphics/texture.js').Texture} Texture */
-/** @typedef {import('../../graphics/shader.js').Shader} Shader */
+/** @typedef {import('../../platform/graphics/texture.js').Texture} Texture */
+/** @typedef {import('../../platform/graphics/shader.js').Shader} Shader */
/** @typedef {import('../mesh-instance.js').MeshInstance} MeshInstance */
let id = 0;
diff --git a/src/scene/materials/standard-material-options-builder.js b/src/scene/materials/standard-material-options-builder.js
index 1fbad6cbc8d..4a3a529a18e 100644
--- a/src/scene/materials/standard-material-options-builder.js
+++ b/src/scene/materials/standard-material-options-builder.js
@@ -2,7 +2,7 @@ import { _matTex2D } from '../../scene/shader-lib/programs/standard.js';
import {
PIXELFORMAT_DXT5, TEXTURETYPE_SWIZZLEGGGR
-} from '../../graphics/constants.js';
+} from '../../platform/graphics/constants.js';
import {
BLEND_NONE,
GAMMA_NONE, GAMMA_SRGBHDR,
diff --git a/src/scene/materials/standard-material-validator.js b/src/scene/materials/standard-material-validator.js
index c3b4ebfde8b..7822f899151 100644
--- a/src/scene/materials/standard-material-validator.js
+++ b/src/scene/materials/standard-material-validator.js
@@ -3,8 +3,8 @@ import {
CULLFACE_BACK, CULLFACE_FRONT, CULLFACE_FRONTANDBACK, CULLFACE_NONE,
FUNC_NEVER, FUNC_LESS, FUNC_EQUAL, FUNC_LESSEQUAL, FUNC_GREATER, FUNC_NOTEQUAL,
FUNC_GREATEREQUAL, FUNC_ALWAYS
-} from '../../graphics/constants.js';
-import { Texture } from '../../graphics/texture.js';
+} from '../../platform/graphics/constants.js';
+import { Texture } from '../../platform/graphics/texture.js';
import {
SPECOCC_AO, SPECOCC_GLOSSDEPENDENT, SPECOCC_NONE,
diff --git a/src/scene/materials/standard-material.js b/src/scene/materials/standard-material.js
index fa680fe6359..192627b96bd 100644
--- a/src/scene/materials/standard-material.js
+++ b/src/scene/materials/standard-material.js
@@ -19,12 +19,12 @@ import {
import { ShaderPass } from '../shader-pass.js';
import { Material } from './material.js';
import { StandardMaterialOptionsBuilder } from './standard-material-options-builder.js';
-import { ShaderProcessorOptions } from '../../graphics/shader-processor-options.js';
+import { ShaderProcessorOptions } from '../../platform/graphics/shader-processor-options.js';
import { getProgramLibrary } from '../shader-lib/get-program-library.js';
import { standardMaterialCubemapParameters, standardMaterialTextureParameters } from './standard-material-parameters.js';
-/** @typedef {import('../../graphics/texture.js').Texture} Texture */
+/** @typedef {import('../../platform/graphics/texture.js').Texture} Texture */
/** @typedef {import('../../core/shape/bounding-box.js').BoundingBox} BoundingBox */
// properties that get created on a standard material
diff --git a/src/scene/mesh-instance.js b/src/scene/mesh-instance.js
index b66385e4be8..721594bf10a 100644
--- a/src/scene/mesh-instance.js
+++ b/src/scene/mesh-instance.js
@@ -3,8 +3,8 @@ import { Debug } from '../core/debug.js';
import { BoundingBox } from '../core/shape/bounding-box.js';
import { BoundingSphere } from '../core/shape/bounding-sphere.js';
-import { BindGroup } from '../graphics/bind-group.js';
-import { UniformBuffer } from '../graphics/uniform-buffer.js';
+import { BindGroup } from '../platform/graphics/bind-group.js';
+import { UniformBuffer } from '../platform/graphics/uniform-buffer.js';
import {
BLEND_NONE, BLEND_NORMAL,
@@ -22,12 +22,12 @@ import { GraphNode } from './graph-node.js';
import { getDefaultMaterial } from './materials/default-material.js';
import { LightmapCache } from './lightmapper/lightmap-cache.js';
-/** @typedef {import('../graphics/texture.js').Texture} Texture */
-/** @typedef {import('../graphics/shader.js').Shader} Shader */
-/** @typedef {import('../graphics/vertex-buffer.js').VertexBuffer} VertexBuffer */
-/** @typedef {import('../graphics/bind-group-format.js').BindGroupFormat} BindGroupFormat */
-/** @typedef {import('../graphics/uniform-buffer-format.js').UniformBufferFormat} UniformBufferFormat */
-/** @typedef {import('../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../platform/graphics/texture.js').Texture} Texture */
+/** @typedef {import('../platform/graphics/shader.js').Shader} Shader */
+/** @typedef {import('../platform/graphics/vertex-buffer.js').VertexBuffer} VertexBuffer */
+/** @typedef {import('../platform/graphics/bind-group-format.js').BindGroupFormat} BindGroupFormat */
+/** @typedef {import('../platform/graphics/uniform-buffer-format.js').UniformBufferFormat} UniformBufferFormat */
+/** @typedef {import('../platform/graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
/** @typedef {import('../core/math/vec3.js').Vec3} Vec3 */
/** @typedef {import('./materials/material.js').Material} Material */
/** @typedef {import('./mesh.js').Mesh} Mesh */
diff --git a/src/scene/mesh.js b/src/scene/mesh.js
index b5bbbb154aa..fbb90d61e6a 100644
--- a/src/scene/mesh.js
+++ b/src/scene/mesh.js
@@ -11,17 +11,17 @@ import {
SEMANTIC_BLENDINDICES, SEMANTIC_BLENDWEIGHT, SEMANTIC_COLOR, SEMANTIC_NORMAL, SEMANTIC_POSITION, SEMANTIC_TEXCOORD,
TYPE_FLOAT32, TYPE_UINT8, TYPE_INT8, TYPE_INT16, TYPE_UINT16,
typedArrayIndexFormats
-} from '../graphics/constants.js';
-import { IndexBuffer } from '../graphics/index-buffer.js';
-import { VertexBuffer } from '../graphics/vertex-buffer.js';
-import { VertexFormat } from '../graphics/vertex-format.js';
-import { VertexIterator } from '../graphics/vertex-iterator.js';
+} from '../platform/graphics/constants.js';
+import { IndexBuffer } from '../platform/graphics/index-buffer.js';
+import { VertexBuffer } from '../platform/graphics/vertex-buffer.js';
+import { VertexFormat } from '../platform/graphics/vertex-format.js';
+import { VertexIterator } from '../platform/graphics/vertex-iterator.js';
import { RENDERSTYLE_SOLID, RENDERSTYLE_WIREFRAME, RENDERSTYLE_POINTS } from './constants.js';
import { getApplication } from '../framework/globals.js';
-/** @typedef {import('../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../platform/graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
/** @typedef {import('./morph.js').Morph} Morph */
/** @typedef {import('./skin.js').Skin} Skin */
diff --git a/src/scene/morph-instance.js b/src/scene/morph-instance.js
index c3d6221431f..2ce4768fdb2 100644
--- a/src/scene/morph-instance.js
+++ b/src/scene/morph-instance.js
@@ -1,13 +1,13 @@
-import { BLENDEQUATION_ADD, BLENDMODE_ONE, PIXELFORMAT_RGBA32F, PIXELFORMAT_RGBA16F } from '../graphics/constants.js';
+import { BLENDEQUATION_ADD, BLENDMODE_ONE, PIXELFORMAT_RGBA32F, PIXELFORMAT_RGBA16F } from '../platform/graphics/constants.js';
import { createShaderFromCode } from '../scene/shader-lib/utils.js';
-import { drawQuadWithShader } from '../graphics/simple-post-effect.js';
-import { RenderTarget } from '../graphics/render-target.js';
-import { DebugGraphics } from '../graphics/debug-graphics.js';
+import { drawQuadWithShader } from '../platform/graphics/simple-post-effect.js';
+import { RenderTarget } from '../platform/graphics/render-target.js';
+import { DebugGraphics } from '../platform/graphics/debug-graphics.js';
import { Debug } from '../core/debug.js';
import { Morph } from './morph.js';
-/** @typedef {import('../graphics/shader.js').Shader} Shader */
+/** @typedef {import('../platform/graphics/shader.js').Shader} Shader */
// vertex shader used to add morph targets from textures into render target
const textureMorphVertexShader = `
diff --git a/src/scene/morph-target.js b/src/scene/morph-target.js
index 52e855cb591..5e938f1e2b1 100644
--- a/src/scene/morph-target.js
+++ b/src/scene/morph-target.js
@@ -1,9 +1,9 @@
import { Debug } from '../core/debug.js';
import { BoundingBox } from '../core/shape/bounding-box.js';
-import { BUFFER_STATIC, SEMANTIC_ATTR0, TYPE_FLOAT32 } from '../graphics/constants.js';
-import { VertexBuffer } from '../graphics/vertex-buffer.js';
-import { VertexFormat } from '../graphics/vertex-format.js';
+import { BUFFER_STATIC, SEMANTIC_ATTR0, TYPE_FLOAT32 } from '../platform/graphics/constants.js';
+import { VertexBuffer } from '../platform/graphics/vertex-buffer.js';
+import { VertexFormat } from '../platform/graphics/vertex-format.js';
/**
* A Morph Target (also known as Blend Shape) contains deformation data to apply to existing mesh.
diff --git a/src/scene/morph.js b/src/scene/morph.js
index 99ccf0cb15c..6df0aba68b2 100644
--- a/src/scene/morph.js
+++ b/src/scene/morph.js
@@ -3,14 +3,17 @@ import { RefCountedObject } from '../core/ref-counted-object.js';
import { Vec3 } from '../core/math/vec3.js';
import { FloatPacking } from '../core/math/float-packing.js';
import { BoundingBox } from '../core/shape/bounding-box.js';
-import { Texture } from '../graphics/texture.js';
-import { VertexBuffer } from '../graphics/vertex-buffer.js';
-import { VertexFormat } from '../graphics/vertex-format.js';
+import { Texture } from '../platform/graphics/texture.js';
+import { VertexBuffer } from '../platform/graphics/vertex-buffer.js';
+import { VertexFormat } from '../platform/graphics/vertex-format.js';
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';
+import {
+ BUFFER_STATIC, TYPE_FLOAT32, SEMANTIC_ATTR15, ADDRESS_CLAMP_TO_EDGE, FILTER_NEAREST,
+ PIXELFORMAT_RGBA16F, PIXELFORMAT_RGB32F
+} from '../platform/graphics/constants.js';
-/** @typedef {import('../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../platform/graphics/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/particle-system/gpu-updater.js b/src/scene/particle-system/gpu-updater.js
index a110bca8538..e3ccd77ed64 100644
--- a/src/scene/particle-system/gpu-updater.js
+++ b/src/scene/particle-system/gpu-updater.js
@@ -3,9 +3,9 @@ import { Mat3 } from '../../core/math/mat3.js';
import { Mat4 } from '../../core/math/mat4.js';
import { Vec3 } from '../../core/math/vec3.js';
-import { CULLFACE_NONE } from '../../graphics/constants.js';
-import { drawQuadWithShader } from '../../graphics/simple-post-effect.js';
-import { DebugGraphics } from '../../graphics/debug-graphics.js';
+import { CULLFACE_NONE } from '../../platform/graphics/constants.js';
+import { drawQuadWithShader } from '../../platform/graphics/simple-post-effect.js';
+import { DebugGraphics } from '../../platform/graphics/debug-graphics.js';
import { EMITTERSHAPE_BOX } from '../../scene/constants.js';
diff --git a/src/scene/particle-system/particle-emitter.js b/src/scene/particle-system/particle-emitter.js
index 9814cde981d..c0c43c962db 100644
--- a/src/scene/particle-system/particle-emitter.js
+++ b/src/scene/particle-system/particle-emitter.js
@@ -21,15 +21,15 @@ import {
PRIMITIVE_TRIANGLES,
SEMANTIC_ATTR0, SEMANTIC_ATTR1, SEMANTIC_ATTR2, SEMANTIC_ATTR3, SEMANTIC_ATTR4, SEMANTIC_TEXCOORD0,
TYPE_FLOAT32
-} from '../../graphics/constants.js';
+} from '../../platform/graphics/constants.js';
import { createShaderFromCode } from '../../scene/shader-lib/utils.js';
import { shaderChunks } from '../../scene/shader-lib/chunks/chunks.js';
-import { IndexBuffer } from '../../graphics/index-buffer.js';
-import { RenderTarget } from '../../graphics/render-target.js';
-import { Texture } from '../../graphics/texture.js';
-import { VertexBuffer } from '../../graphics/vertex-buffer.js';
-import { VertexFormat } from '../../graphics/vertex-format.js';
-import { DeviceCache } from '../../graphics/device-cache.js';
+import { IndexBuffer } from '../../platform/graphics/index-buffer.js';
+import { RenderTarget } from '../../platform/graphics/render-target.js';
+import { Texture } from '../../platform/graphics/texture.js';
+import { VertexBuffer } from '../../platform/graphics/vertex-buffer.js';
+import { VertexFormat } from '../../platform/graphics/vertex-format.js';
+import { DeviceCache } from '../../platform/graphics/device-cache.js';
import { particle } from '../../scene/shader-lib/programs/particle.js';
import { getProgramLibrary } from '../shader-lib/get-program-library.js';
diff --git a/src/scene/picker.js b/src/scene/picker.js
index 98737a0d68f..19063002706 100644
--- a/src/scene/picker.js
+++ b/src/scene/picker.js
@@ -1,10 +1,10 @@
import { Color } from '../core/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 { RenderTarget } from '../graphics/render-target.js';
-import { Texture } from '../graphics/texture.js';
-import { DebugGraphics } from '../graphics/debug-graphics.js';
+import { ADDRESS_CLAMP_TO_EDGE, CLEARFLAG_DEPTH, FILTER_NEAREST, PIXELFORMAT_R8_G8_B8_A8 } from '../platform/graphics/constants.js';
+import { GraphicsDevice } from '../platform/graphics/graphics-device.js';
+import { RenderTarget } from '../platform/graphics/render-target.js';
+import { Texture } from '../platform/graphics/texture.js';
+import { DebugGraphics } from '../platform/graphics/debug-graphics.js';
import { SHADER_PICK, SORTMODE_NONE } from './constants.js';
import { Camera } from './camera.js';
diff --git a/src/scene/procedural.js b/src/scene/procedural.js
index 8f1e8b9b600..174beb6dd0f 100644
--- a/src/scene/procedural.js
+++ b/src/scene/procedural.js
@@ -5,11 +5,11 @@ import { Debug } from '../core/debug.js';
import {
SEMANTIC_TANGENT, SEMANTIC_BLENDWEIGHT, SEMANTIC_BLENDINDICES,
TYPE_UINT8
-} from '../graphics/constants.js';
+} from '../platform/graphics/constants.js';
import { Mesh } from './mesh.js';
-/** @typedef {import('../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../platform/graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
const primitiveUv1Padding = 4.0 / 64;
const primitiveUv1PaddingScale = 1.0 - primitiveUv1Padding * 2;
diff --git a/src/scene/renderer/cookie-renderer.js b/src/scene/renderer/cookie-renderer.js
index 167d37d09fd..1fcfb515224 100644
--- a/src/scene/renderer/cookie-renderer.js
+++ b/src/scene/renderer/cookie-renderer.js
@@ -1,11 +1,11 @@
import { Vec4 } from '../../core/math/vec4.js';
import { Mat4 } from '../../core/math/mat4.js';
-import { ADDRESS_CLAMP_TO_EDGE, FILTER_NEAREST, PIXELFORMAT_R8_G8_B8_A8 } from '../../graphics/constants.js';
-import { Texture } from '../../graphics/texture.js';
+import { ADDRESS_CLAMP_TO_EDGE, FILTER_NEAREST, PIXELFORMAT_R8_G8_B8_A8 } from '../../platform/graphics/constants.js';
+import { Texture } from '../../platform/graphics/texture.js';
import { createShaderFromCode } from '../../scene/shader-lib/utils.js';
-import { drawQuadWithShader } from '../../graphics/simple-post-effect.js';
-import { DebugGraphics } from '../../graphics/debug-graphics.js';
+import { drawQuadWithShader } from '../../platform/graphics/simple-post-effect.js';
+import { DebugGraphics } from '../../platform/graphics/debug-graphics.js';
import { LIGHTTYPE_OMNI } from '../constants.js';
import { LightCamera } from './light-camera.js';
diff --git a/src/scene/renderer/forward-renderer.js b/src/scene/renderer/forward-renderer.js
index 29942ef342f..bccaf3f6d2a 100644
--- a/src/scene/renderer/forward-renderer.js
+++ b/src/scene/renderer/forward-renderer.js
@@ -18,13 +18,13 @@ import {
SHADERSTAGE_VERTEX, SHADERSTAGE_FRAGMENT,
BINDGROUP_VIEW, BINDGROUP_MESH, UNIFORM_BUFFER_DEFAULT_SLOT_NAME,
TEXTUREDIMENSION_2D, SAMPLETYPE_UNFILTERABLE_FLOAT
-} from '../../graphics/constants.js';
-import { DebugGraphics } from '../../graphics/debug-graphics.js';
-import { UniformBuffer } from '../../graphics/uniform-buffer.js';
-import { UniformFormat, UniformBufferFormat } from '../../graphics/uniform-buffer-format.js';
-import { BindGroupFormat, BindBufferFormat, BindTextureFormat } from '../../graphics/bind-group-format.js';
-import { BindGroup } from '../../graphics/bind-group.js';
-import { RenderPass } from '../../graphics/render-pass.js';
+} from '../../platform/graphics/constants.js';
+import { DebugGraphics } from '../../platform/graphics/debug-graphics.js';
+import { UniformBuffer } from '../../platform/graphics/uniform-buffer.js';
+import { UniformFormat, UniformBufferFormat } from '../../platform/graphics/uniform-buffer-format.js';
+import { BindGroupFormat, BindBufferFormat, BindTextureFormat } from '../../platform/graphics/bind-group-format.js';
+import { BindGroup } from '../../platform/graphics/bind-group.js';
+import { RenderPass } from '../../platform/graphics/render-pass.js';
import {
COMPUPDATED_INSTANCES, COMPUPDATED_LIGHTS,
@@ -46,8 +46,8 @@ import { LightCamera } from './light-camera.js';
import { WorldClustersDebug } from '../lighting/world-clusters-debug.js';
/** @typedef {import('../composition/render-action.js').RenderAction} RenderAction */
-/** @typedef {import('../../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
-/** @typedef {import('../../graphics/render-target.js').RenderTarget} RenderTarget */
+/** @typedef {import('../../platform/graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../../platform/graphics/render-target.js').RenderTarget} RenderTarget */
/** @typedef {import('../../framework/components/camera/component.js').CameraComponent} CameraComponent */
/** @typedef {import('../layer.js').Layer} Layer */
/** @typedef {import('../scene.js').Scene} Scene */
diff --git a/src/scene/renderer/shadow-map.js b/src/scene/renderer/shadow-map.js
index f801742e1fc..a0d3154e255 100644
--- a/src/scene/renderer/shadow-map.js
+++ b/src/scene/renderer/shadow-map.js
@@ -4,9 +4,9 @@ import {
FUNC_LESS,
PIXELFORMAT_DEPTH, PIXELFORMAT_R8_G8_B8_A8, PIXELFORMAT_RGBA16F, PIXELFORMAT_RGBA32F,
TEXHINT_SHADOWMAP
-} from '../../graphics/constants.js';
-import { RenderTarget } from '../../graphics/render-target.js';
-import { Texture } from '../../graphics/texture.js';
+} from '../../platform/graphics/constants.js';
+import { RenderTarget } from '../../platform/graphics/render-target.js';
+import { Texture } from '../../platform/graphics/texture.js';
import {
LIGHTTYPE_OMNI,
diff --git a/src/scene/renderer/shadow-renderer.js b/src/scene/renderer/shadow-renderer.js
index 23a2b113eae..219982a9907 100644
--- a/src/scene/renderer/shadow-renderer.js
+++ b/src/scene/renderer/shadow-renderer.js
@@ -18,11 +18,11 @@ import {
} from '../constants.js';
import { LightCamera } from './light-camera.js';
-import { FUNC_LESSEQUAL } from '../../graphics/constants.js';
-import { drawQuadWithShader } from '../../graphics/simple-post-effect.js';
+import { FUNC_LESSEQUAL } from '../../platform/graphics/constants.js';
+import { drawQuadWithShader } from '../../platform/graphics/simple-post-effect.js';
import { shaderChunks } from '../../scene/shader-lib/chunks/chunks.js';
import { createShaderFromCode } from '../../scene/shader-lib/utils.js';
-import { DebugGraphics } from '../../graphics/debug-graphics.js';
+import { DebugGraphics } from '../../platform/graphics/debug-graphics.js';
import { ShadowMap } from './shadow-map.js';
import { ShadowMapCache } from './shadow-map-cache.js';
import { Frustum } from '../../core/shape/frustum.js';
diff --git a/src/scene/renderer/static-meshes.js b/src/scene/renderer/static-meshes.js
index 6338192b36f..822a12556f6 100644
--- a/src/scene/renderer/static-meshes.js
+++ b/src/scene/renderer/static-meshes.js
@@ -5,8 +5,8 @@ import { Mat4 } from '../../core/math/mat4.js';
import { BoundingBox } from '../../core/shape/bounding-box.js';
import { BoundingSphere } from '../../core/shape/bounding-sphere.js';
-import { PRIMITIVE_TRIANGLES, SEMANTIC_POSITION } from '../../graphics/constants.js';
-import { IndexBuffer } from '../../graphics/index-buffer.js';
+import { PRIMITIVE_TRIANGLES, SEMANTIC_POSITION } from '../../platform/graphics/constants.js';
+import { IndexBuffer } from '../../platform/graphics/index-buffer.js';
import { LIGHTTYPE_OMNI, LIGHTTYPE_SPOT } from '../constants.js';
import { Mesh } from '../mesh.js';
diff --git a/src/scene/scene.js b/src/scene/scene.js
index 506ab0a8d03..d6d01e33ffd 100644
--- a/src/scene/scene.js
+++ b/src/scene/scene.js
@@ -14,8 +14,8 @@ 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/texture.js').Texture} Texture */
+/** @typedef {import('../platform/graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../platform/graphics/texture.js').Texture} Texture */
/** @typedef {import('./composition/layer-composition.js').LayerComposition} LayerComposition */
/** @typedef {import('./layer.js').Layer} Layer */
diff --git a/src/scene/shader-lib/chunks/chunk-validation.js b/src/scene/shader-lib/chunks/chunk-validation.js
index 441188d7ad7..1d9c5c936d9 100644
--- a/src/scene/shader-lib/chunks/chunk-validation.js
+++ b/src/scene/shader-lib/chunks/chunk-validation.js
@@ -1,4 +1,4 @@
-import { CHUNKAPI_1_51, CHUNKAPI_1_55, CHUNKAPI_1_56, CHUNKAPI_1_57 } from '../../../graphics/constants.js';
+import { CHUNKAPI_1_51, CHUNKAPI_1_55, CHUNKAPI_1_56, CHUNKAPI_1_57 } from '../../../platform/graphics/constants.js';
import { Debug } from '../../../core/debug.js';
import { shaderChunks } from './chunks.js';
diff --git a/src/scene/shader-lib/get-program-library.js b/src/scene/shader-lib/get-program-library.js
index 64c790ab363..cbebf9835c3 100644
--- a/src/scene/shader-lib/get-program-library.js
+++ b/src/scene/shader-lib/get-program-library.js
@@ -1,7 +1,7 @@
import { Debug } from '../../core/debug.js';
-import { DeviceCache } from '../../graphics/device-cache.js';
+import { DeviceCache } from '../../platform/graphics/device-cache.js';
-/** @typedef {import('../../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../../platform/graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
/** @typedef {import('./program-library.js').ProgramLibrary} ProgramLibrary */
// Device cache storing a program library
diff --git a/src/scene/shader-lib/program-library.js b/src/scene/shader-lib/program-library.js
index 4617b108810..412455501ab 100644
--- a/src/scene/shader-lib/program-library.js
+++ b/src/scene/shader-lib/program-library.js
@@ -1,7 +1,7 @@
import { Debug } from '../../core/debug.js';
import { version, revision } from '../../core/core.js';
-import { Shader } from '../../graphics/shader.js';
+import { Shader } from '../../platform/graphics/shader.js';
import { SHADER_FORWARD, SHADER_DEPTH, SHADER_PICK, SHADER_SHADOW } from '../constants.js';
import { ShaderPass } from '../shader-pass.js';
diff --git a/src/scene/shader-lib/programs/basic.js b/src/scene/shader-lib/programs/basic.js
index 0b87cb77695..ea4cfdd75bc 100644
--- a/src/scene/shader-lib/programs/basic.js
+++ b/src/scene/shader-lib/programs/basic.js
@@ -1,6 +1,6 @@
import {
SEMANTIC_BLENDINDICES, SEMANTIC_BLENDWEIGHT, SEMANTIC_COLOR, SEMANTIC_POSITION, SEMANTIC_TEXCOORD0
-} from '../../../graphics/constants.js';
+} from '../../../platform/graphics/constants.js';
import { shaderChunks } from '../chunks/chunks.js';
import {
diff --git a/src/scene/shader-lib/programs/common.js b/src/scene/shader-lib/programs/common.js
index 0a0403b3cc5..80ac46bb882 100644
--- a/src/scene/shader-lib/programs/common.js
+++ b/src/scene/shader-lib/programs/common.js
@@ -1,6 +1,6 @@
import {
DEVICETYPE_WEBGPU, DEVICETYPE_WEBGL
-} from '../../../graphics/constants.js';
+} from '../../../platform/graphics/constants.js';
import {
GAMMA_SRGB, GAMMA_SRGBFAST, GAMMA_SRGBHDR,
diff --git a/src/scene/shader-lib/programs/lit-shader.js b/src/scene/shader-lib/programs/lit-shader.js
index bbb8c90dce2..2a0069dfb20 100644
--- a/src/scene/shader-lib/programs/lit-shader.js
+++ b/src/scene/shader-lib/programs/lit-shader.js
@@ -4,7 +4,7 @@ import {
SEMANTIC_TEXCOORD0, SEMANTIC_TEXCOORD1,
SHADERTAG_MATERIAL,
PIXELFORMAT_R8_G8_B8_A8
-} from '../../../graphics/constants.js';
+} from '../../../platform/graphics/constants.js';
import { shaderChunks } from '../chunks/chunks.js';
import { ChunkUtils } from '../chunk-utils.js';
diff --git a/src/scene/shader-lib/programs/skybox.js b/src/scene/shader-lib/programs/skybox.js
index 4bc8c9e595d..023f8081a8f 100644
--- a/src/scene/shader-lib/programs/skybox.js
+++ b/src/scene/shader-lib/programs/skybox.js
@@ -1,4 +1,4 @@
-import { SEMANTIC_POSITION } from '../../../graphics/constants.js';
+import { SEMANTIC_POSITION } from '../../../platform/graphics/constants.js';
import { shaderChunks } from '../chunks/chunks.js';
import { ChunkUtils } from '../chunk-utils.js';
diff --git a/src/scene/shader-lib/programs/standard.js b/src/scene/shader-lib/programs/standard.js
index 7064c777b96..eb3813a5f52 100644
--- a/src/scene/shader-lib/programs/standard.js
+++ b/src/scene/shader-lib/programs/standard.js
@@ -11,7 +11,7 @@ import { LitShader } from './lit-shader.js';
import { ChunkBuilder } from '../chunk-builder.js';
import { ChunkUtils } from '../chunk-utils.js';
-/** @typedef {import('../../../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../../../platform/graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
const _matTex2D = [];
diff --git a/src/scene/shader-lib/utils.js b/src/scene/shader-lib/utils.js
index 832dabb0559..1c58ca31580 100644
--- a/src/scene/shader-lib/utils.js
+++ b/src/scene/shader-lib/utils.js
@@ -3,8 +3,8 @@ import {
SEMANTIC_POSITION, SEMANTIC_NORMAL, SEMANTIC_TANGENT, SEMANTIC_TEXCOORD0, SEMANTIC_TEXCOORD1, SEMANTIC_TEXCOORD2,
SEMANTIC_TEXCOORD3, SEMANTIC_TEXCOORD4, SEMANTIC_TEXCOORD5, SEMANTIC_TEXCOORD6, SEMANTIC_TEXCOORD7,
SEMANTIC_COLOR, SEMANTIC_BLENDINDICES, SEMANTIC_BLENDWEIGHT
-} from '../../graphics/constants.js';
-import { Shader } from '../../graphics/shader.js';
+} from '../../platform/graphics/constants.js';
+import { Shader } from '../../platform/graphics/shader.js';
import { shaderChunks } from './chunks/chunks.js';
import { getProgramLibrary } from './get-program-library.js';
diff --git a/src/scene/skin-instance.js b/src/scene/skin-instance.js
index 9fb7f7e11fa..fed919f51fe 100644
--- a/src/scene/skin-instance.js
+++ b/src/scene/skin-instance.js
@@ -2,8 +2,8 @@ import { Debug } from '../core/debug.js';
import { math } from '../core/math/math.js';
import { Mat4 } from '../core/math/mat4.js';
-import { FILTER_NEAREST, PIXELFORMAT_RGBA32F } from '../graphics/constants.js';
-import { Texture } from '../graphics/texture.js';
+import { FILTER_NEAREST, PIXELFORMAT_RGBA32F } from '../platform/graphics/constants.js';
+import { Texture } from '../platform/graphics/texture.js';
/** @typedef {import('./graph-node.js').GraphNode} GraphNode */
/** @typedef {import('./skin.js').Skin} Skin */
diff --git a/src/scene/skin.js b/src/scene/skin.js
index d5e74a533fe..bae410b7c43 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('../platform/graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
/** @typedef {import('../core/math/mat4.js').Mat4} Mat4 */
/**
diff --git a/src/scene/sky.js b/src/scene/sky.js
index 5191ef1b9d7..6c3a200d1b4 100644
--- a/src/scene/sky.js
+++ b/src/scene/sky.js
@@ -3,7 +3,7 @@ import { Mat4 } from '../core/math/mat4.js';
import { Vec3 } from '../core/math/vec3.js';
import { Quat } from '../core/math/quat.js';
-import { CULLFACE_FRONT } from '../graphics/constants.js';
+import { CULLFACE_FRONT } from '../platform/graphics/constants.js';
import { GAMMA_NONE, GAMMA_SRGBHDR, LAYERID_SKYBOX, SHADER_FORWARDHDR, TONEMAP_LINEAR } from './constants.js';
import { createBox } from './procedural.js';
@@ -13,8 +13,8 @@ import { MeshInstance } from './mesh-instance.js';
import { skybox } from '../scene/shader-lib/programs/skybox.js';
import { getProgramLibrary } from './shader-lib/get-program-library.js';
-/** @typedef {import('../graphics/texture.js').Texture} Texture */
-/** @typedef {import('../graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
+/** @typedef {import('../platform/graphics/texture.js').Texture} Texture */
+/** @typedef {import('../platform/graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
/** @typedef {import('./scene.js').Scene} Scene */
/** @type {Mat4} */
diff --git a/src/scene/sprite.js b/src/scene/sprite.js
index 00ade81fc3a..056c4feccb9 100644
--- a/src/scene/sprite.js
+++ b/src/scene/sprite.js
@@ -5,7 +5,7 @@ import { Vec2 } from '../core/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('../platform/graphics/graphics-device.js').GraphicsDevice} GraphicsDevice */
/** @typedef {import('./mesh.js').Mesh} Mesh */
/** @typedef {import('./texture-atlas.js').TextureAtlas} TextureAtlas */
diff --git a/src/scene/stencil-parameters.js b/src/scene/stencil-parameters.js
index 746128b8456..926a6596660 100644
--- a/src/scene/stencil-parameters.js
+++ b/src/scene/stencil-parameters.js
@@ -1,4 +1,4 @@
-import { FUNC_ALWAYS, STENCILOP_KEEP } from '../graphics/constants.js';
+import { FUNC_ALWAYS, STENCILOP_KEEP } from '../platform/graphics/constants.js';
/**
* Holds stencil test settings.
diff --git a/src/scene/texture-atlas.js b/src/scene/texture-atlas.js
index 269fe99ee71..631ac7f6c4d 100644
--- a/src/scene/texture-atlas.js
+++ b/src/scene/texture-atlas.js
@@ -2,7 +2,7 @@ import { EventHandler } from '../core/event-handler.js';
/** @typedef {import('../core/math/vec2.js').Vec2} Vec2 */
/** @typedef {import('../core/math/vec4.js').Vec4} Vec4 */
-/** @typedef {import('../graphics/texture.js').Texture} Texture */
+/** @typedef {import('../platform/graphics/texture.js').Texture} Texture */
/**
* A TextureAtlas contains a number of frames from a texture. Each frame defines a region in a
diff --git a/src/xr/xr-depth-sensing.js b/src/xr/xr-depth-sensing.js
index d295fdd4618..7a7303e257f 100644
--- a/src/xr/xr-depth-sensing.js
+++ b/src/xr/xr-depth-sensing.js
@@ -1,8 +1,8 @@
import { platform } from '../core/platform.js';
import { EventHandler } from '../core/event-handler.js';
import { Mat4 } from '../core/math/mat4.js';
-import { Texture } from '../graphics/texture.js';
-import { ADDRESS_CLAMP_TO_EDGE, PIXELFORMAT_L8_A8, FILTER_LINEAR } from '../graphics/constants.js';
+import { Texture } from '../platform/graphics/texture.js';
+import { ADDRESS_CLAMP_TO_EDGE, PIXELFORMAT_L8_A8, FILTER_LINEAR } from '../platform/graphics/constants.js';
import { XRDEPTHSENSINGUSAGE_CPU, XRDEPTHSENSINGUSAGE_GPU } from './constants.js';
/** @typedef {import('./xr-manager.js').XrManager} XrManager */
diff --git a/test/framework/application.test.mjs b/test/framework/application.test.mjs
index 80c8004f87e..df40edcacba 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/platform/graphics/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/webgl-index.buffer.js/webgl-graphics-device.test.mjs b/test/graphics/webgl-index.buffer.js/webgl-graphics-device.test.mjs
index 1f34ecf7cfc..8660f19b4e7 100644
--- a/test/graphics/webgl-index.buffer.js/webgl-graphics-device.test.mjs
+++ b/test/graphics/webgl-index.buffer.js/webgl-graphics-device.test.mjs
@@ -1,4 +1,4 @@
-import { WebglGraphicsDevice } from '../../../src/graphics/webgl/webgl-graphics-device.js';
+import { WebglGraphicsDevice } from '../../../src/platform/graphics/webgl/webgl-graphics-device.js';
import { HTMLCanvasElement } from '@playcanvas/canvas-mock';
diff --git a/test/scene/materials/material.test.mjs b/test/scene/materials/material.test.mjs
index 6ccee7a88b5..1a739baeb75 100644
--- a/test/scene/materials/material.test.mjs
+++ b/test/scene/materials/material.test.mjs
@@ -1,4 +1,4 @@
-import { CULLFACE_BACK, FUNC_LESSEQUAL } from '../../../src/graphics/constants.js';
+import { CULLFACE_BACK, FUNC_LESSEQUAL } from '../../../src/platform/graphics/constants.js';
import { BLEND_NONE } from '../../../src/scene/constants.js';
import { Material } from '../../../src/scene/materials/material.js';
diff --git a/types-fixup.mjs b/types-fixup.mjs
index d437088ded0..bf4c1475a05 100644
--- a/types-fixup.mjs
+++ b/types-fixup.mjs
@@ -17,7 +17,7 @@ paths.forEach(path => {
// Fix up description parameter for VertexFormat constructor because tsc
// doesn't recognize it as an array
-let path = './types/graphics/vertex-format.d.ts';
+let path = './types/platform/graphics/vertex-format.d.ts';
let dts = fs.readFileSync(path, 'utf8');
dts = dts.replace('}, vertexCount?: number);', '}[], vertexCount?: number);');
fs.writeFileSync(path, dts);