ris-framework 0.2.0-dev.11 → 0.2.0-dev.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -29
- package/README.md +99 -150
- package/dist/Framework.d.ts +26 -8
- package/dist/Framework.d.ts.map +1 -1
- package/dist/api/IFramework.d.ts +43 -0
- package/dist/api/IFramework.d.ts.map +1 -1
- package/dist/api/_export.d.ts +1 -1
- package/dist/api/_export.d.ts.map +1 -1
- package/dist/api/content/ContentManager.d.ts +5 -57
- package/dist/api/content/ContentManager.d.ts.map +1 -1
- package/dist/api/content/IContentManager.d.ts +24 -21
- package/dist/api/content/IContentManager.d.ts.map +1 -1
- package/dist/api/lights/LightsBuffer.d.ts +13 -6
- package/dist/api/lights/LightsBuffer.d.ts.map +1 -1
- package/dist/api/loaders/ObjGeometryMapper.d.ts +2 -2
- package/dist/api/loaders/ObjLoader.d.ts +61 -0
- package/dist/api/loaders/ObjLoader.d.ts.map +1 -0
- package/dist/api/loaders/_export.d.ts +1 -0
- package/dist/api/loaders/_export.d.ts.map +1 -1
- package/dist/api/loaders/obj/{ObjLoader.d.ts → ObjParser.d.ts} +20 -5
- package/dist/api/loaders/obj/ObjParser.d.ts.map +1 -0
- package/dist/api/loaders/obj/ObjTypes.d.ts +17 -1
- package/dist/api/loaders/obj/ObjTypes.d.ts.map +1 -1
- package/dist/api/loaders/obj/index.d.ts +1 -1
- package/dist/api/material/ForwardBlinnPhongMaterial.d.ts +22 -11
- package/dist/api/material/ForwardBlinnPhongMaterial.d.ts.map +1 -1
- package/dist/api/material/ICameraMaterial.d.ts +18 -0
- package/dist/api/material/ICameraMaterial.d.ts.map +1 -0
- package/dist/api/material/ILightsMaterial.d.ts +26 -0
- package/dist/api/material/ILightsMaterial.d.ts.map +1 -0
- package/dist/api/material/IMaterial.d.ts +2 -8
- package/dist/api/material/IMaterial.d.ts.map +1 -1
- package/dist/api/material/InspectTextureMipsMaterial.d.ts +2 -2
- package/dist/api/material/InspectTextureMipsMaterial.d.ts.map +1 -1
- package/dist/api/material/SpriteMaterial.d.ts +2 -2
- package/dist/api/material/SpriteMaterial.d.ts.map +1 -1
- package/dist/api/material/UnlitMaterial.d.ts +4 -3
- package/dist/api/material/UnlitMaterial.d.ts.map +1 -1
- package/dist/api/material/_export.d.ts +2 -0
- package/dist/api/material/_export.d.ts.map +1 -1
- package/dist/api/meshes/IMesh.d.ts +29 -34
- package/dist/api/meshes/IMesh.d.ts.map +1 -1
- package/dist/api/meshes/IMeshFactory.d.ts +13 -8
- package/dist/api/meshes/IMeshFactory.d.ts.map +1 -1
- package/dist/api/meshes/IRenderableMesh.d.ts +47 -0
- package/dist/api/meshes/IRenderableMesh.d.ts.map +1 -0
- package/dist/api/meshes/Mesh.d.ts +11 -57
- package/dist/api/meshes/Mesh.d.ts.map +1 -1
- package/dist/api/meshes/MeshFactory.d.ts +6 -3
- package/dist/api/meshes/MeshFactory.d.ts.map +1 -1
- package/dist/api/meshes/QuadMesh.d.ts +3 -5
- package/dist/api/meshes/QuadMesh.d.ts.map +1 -1
- package/dist/api/meshes/RenderableMesh.d.ts +95 -0
- package/dist/api/meshes/RenderableMesh.d.ts.map +1 -0
- package/dist/api/meshes/_export.d.ts +2 -1
- package/dist/api/meshes/_export.d.ts.map +1 -1
- package/dist/api/rendering/IGraphicsDeviceFeatures.d.ts +8 -2
- package/dist/api/rendering/IGraphicsDeviceFeatures.d.ts.map +1 -1
- package/dist/api/rendering/IRenderer.d.ts +28 -1
- package/dist/api/rendering/IRenderer.d.ts.map +1 -1
- package/dist/api/rendering/enums.d.ts +7 -0
- package/dist/api/rendering/enums.d.ts.map +1 -1
- package/dist/api/rendering/renderer-interface.d.ts +1 -31
- package/dist/api/rendering/renderer-interface.d.ts.map +1 -1
- package/dist/api/rendering/renderpass/RenderPassDescriptor.d.ts +2 -6
- package/dist/api/rendering/renderpass/RenderPassDescriptor.d.ts.map +1 -1
- package/dist/api/rendering/swapchain/ISwapChain.d.ts +1 -3
- package/dist/api/rendering/swapchain/ISwapChain.d.ts.map +1 -1
- package/dist/api/rendering/texture/TextureFormat.d.ts +88 -14
- package/dist/api/rendering/texture/TextureFormat.d.ts.map +1 -1
- package/dist/api/rendering/texture/TextureUtilities.d.ts +23 -0
- package/dist/api/rendering/texture/TextureUtilities.d.ts.map +1 -1
- package/dist/api/scene/Scene.d.ts +30 -21
- package/dist/api/scene/Scene.d.ts.map +1 -1
- package/dist/api/scene/SceneMesh.d.ts +27 -0
- package/dist/api/scene/SceneMesh.d.ts.map +1 -0
- package/dist/api/utilities/AlignUtilities.d.ts.map +1 -1
- package/dist/api/window/WindowManager.d.ts.map +1 -1
- package/dist/core/rendering/ARenderer.d.ts +5 -5
- package/dist/core/rendering/ARenderer.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4006 -1355
- package/dist/webgl/WebGLGraphicsDeviceFeatures.d.ts +4 -0
- package/dist/webgl/WebGLGraphicsDeviceFeatures.d.ts.map +1 -1
- package/dist/webgl/WebGlRenderer.d.ts +1 -3
- package/dist/webgl/WebGlRenderer.d.ts.map +1 -1
- package/dist/webgl/lights/WebGlLightsBuffer.d.ts +8 -4
- package/dist/webgl/lights/WebGlLightsBuffer.d.ts.map +1 -1
- package/dist/webgl/render-pipelines/WebGlMainRenderTargetRenderPipeline.d.ts +2 -0
- package/dist/webgl/render-pipelines/WebGlMainRenderTargetRenderPipeline.d.ts.map +1 -1
- package/dist/webgl/swap-chain/WebGlSwapChain.d.ts +3 -2
- package/dist/webgl/swap-chain/WebGlSwapChain.d.ts.map +1 -1
- package/dist/webgl/texture/WebGlTextureFactory.d.ts +7 -0
- package/dist/webgl/texture/WebGlTextureFactory.d.ts.map +1 -1
- package/dist/webgl/utilities/WebGlConstants.d.ts +91 -0
- package/dist/webgl/utilities/WebGlConstants.d.ts.map +1 -0
- package/dist/webgl/utilities/WebGlConverter.d.ts +0 -7
- package/dist/webgl/utilities/WebGlConverter.d.ts.map +1 -1
- package/dist/webgl/utilities/WebGlErrorUtilities.d.ts +10 -0
- package/dist/webgl/utilities/WebGlErrorUtilities.d.ts.map +1 -0
- package/dist/webgl/utilities/WebGlTextureUtilities.d.ts.map +1 -1
- package/dist/webgl/utilities/WebGlUtilities.d.ts +3 -0
- package/dist/webgl/utilities/WebGlUtilities.d.ts.map +1 -1
- package/dist/webgpu/WebGpuGpuInfo.d.ts +28 -0
- package/dist/webgpu/WebGpuGpuInfo.d.ts.map +1 -0
- package/dist/webgpu/WebGpuGraphicsDevice.d.ts +80 -0
- package/dist/webgpu/WebGpuGraphicsDevice.d.ts.map +1 -0
- package/dist/webgpu/WebGpuGraphicsDeviceFeatures.d.ts +26 -0
- package/dist/webgpu/WebGpuGraphicsDeviceFeatures.d.ts.map +1 -0
- package/dist/webgpu/WebGpuRenderer.d.ts +26 -0
- package/dist/webgpu/WebGpuRenderer.d.ts.map +1 -0
- package/dist/webgpu/WebGpuTypes.d.ts +355 -0
- package/dist/webgpu/WebGpuTypes.d.ts.map +1 -0
- package/dist/webgpu/blending/WebGpuBlendState.d.ts +30 -0
- package/dist/webgpu/blending/WebGpuBlendState.d.ts.map +1 -0
- package/dist/webgpu/buffers/WebGpuBuffersFactory.d.ts +20 -0
- package/dist/webgpu/buffers/WebGpuBuffersFactory.d.ts.map +1 -0
- package/dist/webgpu/buffers/WebGpuIndexBuffer.d.ts +46 -0
- package/dist/webgpu/buffers/WebGpuIndexBuffer.d.ts.map +1 -0
- package/dist/webgpu/buffers/WebGpuUniformBuffer.d.ts +43 -0
- package/dist/webgpu/buffers/WebGpuUniformBuffer.d.ts.map +1 -0
- package/dist/webgpu/buffers/WebGpuVertexBuffer.d.ts +49 -0
- package/dist/webgpu/buffers/WebGpuVertexBuffer.d.ts.map +1 -0
- package/dist/webgpu/primitive/WebGpuPrimitiveState.d.ts +32 -0
- package/dist/webgpu/primitive/WebGpuPrimitiveState.d.ts.map +1 -0
- package/dist/webgpu/render-pass/WebGpuRenderPass.d.ts +28 -0
- package/dist/webgpu/render-pass/WebGpuRenderPass.d.ts.map +1 -0
- package/dist/webgpu/render-pipelines/AWebGpuRenderPipeline.d.ts +50 -0
- package/dist/webgpu/render-pipelines/AWebGpuRenderPipeline.d.ts.map +1 -0
- package/dist/webgpu/render-pipelines/WebGpuMainRenderTargetRenderPipeline.d.ts +34 -0
- package/dist/webgpu/render-pipelines/WebGpuMainRenderTargetRenderPipeline.d.ts.map +1 -0
- package/dist/webgpu/render-pipelines/WebGpuRenderPipelineFactory.d.ts +26 -0
- package/dist/webgpu/render-pipelines/WebGpuRenderPipelineFactory.d.ts.map +1 -0
- package/dist/webgpu/render-pipelines/material/AWebGpuMeshRenderPipeline.d.ts +72 -0
- package/dist/webgpu/render-pipelines/material/AWebGpuMeshRenderPipeline.d.ts.map +1 -0
- package/dist/webgpu/render-pipelines/material/WebGpuUnlitRenderPipeline.d.ts +40 -0
- package/dist/webgpu/render-pipelines/material/WebGpuUnlitRenderPipeline.d.ts.map +1 -0
- package/dist/webgpu/sampler/WebGpuSampler.d.ts +39 -0
- package/dist/webgpu/sampler/WebGpuSampler.d.ts.map +1 -0
- package/dist/webgpu/shader/WebGpuShaderModule.d.ts +29 -0
- package/dist/webgpu/shader/WebGpuShaderModule.d.ts.map +1 -0
- package/dist/webgpu/shader/WebGpuShaderModuleLoader.d.ts +21 -0
- package/dist/webgpu/shader/WebGpuShaderModuleLoader.d.ts.map +1 -0
- package/dist/webgpu/shader/WgslShaderContent.d.ts +9 -0
- package/dist/webgpu/shader/WgslShaderContent.d.ts.map +1 -0
- package/dist/webgpu/swap-chain/WebGpuSwapChain.d.ts +41 -0
- package/dist/webgpu/swap-chain/WebGpuSwapChain.d.ts.map +1 -0
- package/dist/webgpu/texture/WebGpuTexture2D.d.ts +47 -0
- package/dist/webgpu/texture/WebGpuTexture2D.d.ts.map +1 -0
- package/dist/webgpu/texture/WebGpuTextureFactory.d.ts +21 -0
- package/dist/webgpu/texture/WebGpuTextureFactory.d.ts.map +1 -0
- package/dist/webgpu/texture/WebGpuTextureView.d.ts +25 -0
- package/dist/webgpu/texture/WebGpuTextureView.d.ts.map +1 -0
- package/dist/webgpu/utilities/WebGpuConverter.d.ts +45 -0
- package/dist/webgpu/utilities/WebGpuConverter.d.ts.map +1 -0
- package/package.json +2 -2
- package/shaders/glsl/main_render_target_flip_y_fs.glsl +35 -1
- package/shaders/wgsl/forward_blinn_phong_material.wgsl +150 -0
- package/shaders/wgsl/inspect_texture_mips.wgsl +51 -0
- package/shaders/wgsl/main_frame_buffer.wgsl +35 -0
- package/shaders/wgsl/main_render_target_flip_y.wgsl +35 -0
- package/shaders/wgsl/sprite.wgsl +40 -0
- package/shaders/wgsl/unlit_material.wgsl +49 -0
- package/src/Framework.ts +121 -37
- package/src/api/IFramework.ts +55 -0
- package/src/api/_export.ts +1 -1
- package/src/api/content/ContentManager.ts +46 -180
- package/src/api/content/IContentManager.ts +25 -21
- package/src/api/lights/LightsBuffer.ts +13 -6
- package/src/api/loaders/ObjGeometryMapper.ts +2 -2
- package/src/api/loaders/ObjLoader.ts +126 -0
- package/src/api/loaders/_export.ts +1 -0
- package/src/api/loaders/obj/{ObjLoader.ts → ObjParser.ts} +35 -4
- package/src/api/loaders/obj/ObjTypes.ts +19 -1
- package/src/api/loaders/obj/index.ts +1 -1
- package/src/api/material/ForwardBlinnPhongMaterial.ts +48 -22
- package/src/api/material/ICameraMaterial.ts +22 -0
- package/src/api/material/ILightsMaterial.ts +32 -0
- package/src/api/material/IMaterial.ts +2 -9
- package/src/api/material/InspectTextureMipsMaterial.ts +2 -2
- package/src/api/material/SpriteMaterial.ts +2 -2
- package/src/api/material/UnlitMaterial.ts +4 -3
- package/src/api/material/_export.ts +2 -0
- package/src/api/meshes/IMesh.ts +32 -37
- package/src/api/meshes/IMeshFactory.ts +14 -8
- package/src/api/meshes/IRenderableMesh.ts +58 -0
- package/src/api/meshes/Mesh.ts +17 -132
- package/src/api/meshes/MeshFactory.ts +14 -5
- package/src/api/meshes/QuadMesh.ts +4 -6
- package/src/api/meshes/RenderableMesh.ts +207 -0
- package/src/api/meshes/_export.ts +6 -5
- package/src/api/rendering/IGraphicsDeviceFeatures.ts +28 -21
- package/src/api/rendering/IRenderer.ts +34 -1
- package/src/api/rendering/enums.ts +10 -0
- package/src/api/rendering/renderer-interface.ts +1 -36
- package/src/api/rendering/renderpass/RenderPassDescriptor.ts +10 -14
- package/src/api/rendering/swapchain/ISwapChain.ts +1 -3
- package/src/api/rendering/texture/TextureFormat.ts +128 -14
- package/src/api/rendering/texture/TextureUtilities.ts +225 -10
- package/src/api/scene/Scene.ts +102 -69
- package/src/api/scene/SceneMesh.ts +61 -0
- package/src/api/sprites/SpriteBatchMesh.ts +1 -1
- package/src/api/utilities/AlignUtilities.ts +2 -1
- package/src/api/window/WindowManager.ts +1 -1
- package/src/core/rendering/ARenderer.ts +24 -15
- package/src/index.ts +0 -1
- package/src/main.ts +2 -3
- package/src/webgl/WebGLGraphicsDeviceFeatures.ts +12 -2
- package/src/webgl/WebGlGpuInfo.ts +1 -1
- package/src/webgl/WebGlRenderer.ts +2 -5
- package/src/webgl/lights/WebGlLightsBuffer.ts +14 -4
- package/src/webgl/render-pipelines/WebGlMainRenderTargetRenderPipeline.ts +18 -1
- package/src/webgl/swap-chain/WebGlSwapChain.ts +7 -6
- package/src/webgl/texture/WebGlTextureFactory.ts +49 -7
- package/src/webgl/utilities/WebGlConstants.ts +136 -0
- package/src/webgl/utilities/WebGlConverter.ts +91 -22
- package/src/webgl/utilities/WebGlErrorUtilities.ts +15 -0
- package/src/webgl/utilities/WebGlTextureUtilities.ts +5 -2
- package/src/webgl/utilities/WebGlUtilities.ts +4 -0
- package/src/webgpu/WebGpuGpuInfo.ts +61 -0
- package/src/webgpu/WebGpuGraphicsDevice.ts +199 -0
- package/src/webgpu/WebGpuGraphicsDeviceFeatures.ts +41 -0
- package/src/webgpu/WebGpuRenderer.ts +49 -0
- package/src/webgpu/WebGpuTypes.ts +288 -0
- package/src/webgpu/blending/WebGpuBlendState.ts +53 -0
- package/src/webgpu/buffers/WebGpuBuffersFactory.ts +46 -0
- package/src/webgpu/buffers/WebGpuIndexBuffer.ts +118 -0
- package/src/webgpu/buffers/WebGpuUniformBuffer.ts +102 -0
- package/src/webgpu/buffers/WebGpuVertexBuffer.ts +119 -0
- package/src/webgpu/primitive/WebGpuPrimitiveState.ts +52 -0
- package/src/webgpu/render-pass/WebGpuRenderPass.ts +131 -0
- package/src/webgpu/render-pipelines/AWebGpuRenderPipeline.ts +123 -0
- package/src/webgpu/render-pipelines/WebGpuMainRenderTargetRenderPipeline.ts +119 -0
- package/src/webgpu/render-pipelines/WebGpuRenderPipelineFactory.ts +66 -0
- package/src/webgpu/render-pipelines/material/AWebGpuMeshRenderPipeline.ts +249 -0
- package/src/webgpu/render-pipelines/material/WebGpuUnlitRenderPipeline.ts +101 -0
- package/src/webgpu/sampler/WebGpuSampler.ts +84 -0
- package/src/webgpu/shader/WebGpuShaderModule.ts +65 -0
- package/src/webgpu/shader/WebGpuShaderModuleLoader.ts +38 -0
- package/src/webgpu/shader/WgslShaderContent.ts +20 -0
- package/src/webgpu/swap-chain/WebGpuSwapChain.ts +93 -0
- package/src/webgpu/texture/WebGpuTexture2D.ts +197 -0
- package/src/webgpu/texture/WebGpuTextureFactory.ts +118 -0
- package/src/webgpu/texture/WebGpuTextureView.ts +43 -0
- package/src/webgpu/utilities/WebGpuConverter.ts +299 -0
- package/src/wgsl-raw.d.ts +4 -0
- package/dist/api/FrameworkConfiguration.d.ts +0 -23
- package/dist/api/FrameworkConfiguration.d.ts.map +0 -1
- package/dist/api/IFrameworkConfiguration.d.ts +0 -25
- package/dist/api/IFrameworkConfiguration.d.ts.map +0 -1
- package/dist/api/loaders/obj/ObjLoader.d.ts.map +0 -1
- package/dist/api/meshes/SubMesh.d.ts +0 -47
- package/dist/api/meshes/SubMesh.d.ts.map +0 -1
- package/src/api/FrameworkConfiguration.ts +0 -29
- package/src/api/IFrameworkConfiguration.ts +0 -30
- package/src/api/meshes/SubMesh.ts +0 -71
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type {IFramework, IShaderModule, IShaderModuleLoader} from "../../api/index.ts";
|
|
2
|
+
import {shaderModuleCacheKey} from "../../webgl/shader/WebGlShaderModuleLoader.ts";
|
|
3
|
+
import {WebGpuShaderModule} from "./WebGpuShaderModule.ts";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Loads and caches WGSL shader modules by id.
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export class WebGpuShaderModuleLoader implements IShaderModuleLoader {
|
|
10
|
+
|
|
11
|
+
private readonly _shaderModules = new Map<string, WebGpuShaderModule>();
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The constructor.
|
|
15
|
+
* @param _framework The framework.
|
|
16
|
+
*/
|
|
17
|
+
public constructor(private readonly _framework: IFramework) {
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** @inheritDoc */
|
|
21
|
+
public load(shaderModuleId: string, keyValueDictionary?: { [id: string]: number }): IShaderModule {
|
|
22
|
+
const key = shaderModuleCacheKey(shaderModuleId, keyValueDictionary);
|
|
23
|
+
let module = this._shaderModules.get(key);
|
|
24
|
+
if (!module) {
|
|
25
|
+
module = new WebGpuShaderModule(this._framework, shaderModuleId, keyValueDictionary);
|
|
26
|
+
this._shaderModules.set(key, module);
|
|
27
|
+
}
|
|
28
|
+
return module;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Disposes every cached module. */
|
|
32
|
+
public dispose(): void {
|
|
33
|
+
for (const module of this._shaderModules.values()) {
|
|
34
|
+
module.dispose();
|
|
35
|
+
}
|
|
36
|
+
this._shaderModules.clear();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import mainFrameBuffer from "../../../shaders/wgsl/main_frame_buffer.wgsl?raw";
|
|
2
|
+
import mainRenderTargetFlipY from "../../../shaders/wgsl/main_render_target_flip_y.wgsl?raw";
|
|
3
|
+
import unlitMaterial from "../../../shaders/wgsl/unlit_material.wgsl?raw";
|
|
4
|
+
import forwardBlinnPhongMaterial from "../../../shaders/wgsl/forward_blinn_phong_material.wgsl?raw";
|
|
5
|
+
import sprite from "../../../shaders/wgsl/sprite.wgsl?raw";
|
|
6
|
+
import inspectTextureMips from "../../../shaders/wgsl/inspect_texture_mips.wgsl?raw";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The framework's built-in WGSL shaders, keyed by the same ids the WebGL backend uses where one exists.
|
|
10
|
+
* Every shader has `main_vs` and `main_fs` entry points.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export const WgslShaderContent: { [id: string]: string } = {
|
|
14
|
+
"main_frame_buffer": mainFrameBuffer,
|
|
15
|
+
"main_render_target_flip_y": mainRenderTargetFlipY,
|
|
16
|
+
"unlit_material": unlitMaterial,
|
|
17
|
+
"forward_blinn_phong_material": forwardBlinnPhongMaterial,
|
|
18
|
+
"sprite": sprite,
|
|
19
|
+
"inspect_texture_mips": inspectTextureMips,
|
|
20
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import {vec2} from "gl-matrix";
|
|
2
|
+
import {type ISwapChain, SwapChainDescriptor, TextureFormat} from "../../api/index.ts";
|
|
3
|
+
import type {WebGpuGraphicsDevice} from "../WebGpuGraphicsDevice.ts";
|
|
4
|
+
import {GpuTextureUsage, type GpuCanvasContext, type GpuTextureView} from "../WebGpuTypes.ts";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The WebGPU swap chain, backed by the canvas' `webgpu` context.
|
|
8
|
+
*
|
|
9
|
+
* The canvas is configured as `rgba8unorm` instead of `navigator.gpu.getPreferredCanvasFormat()` (often `bgra8unorm`),
|
|
10
|
+
* because the framework's {@link TextureFormat} has no BGRA format and the main render target uses the swap chain format.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export class WebGpuSwapChain implements ISwapChain {
|
|
14
|
+
|
|
15
|
+
private readonly _canvas: HTMLCanvasElement;
|
|
16
|
+
private readonly _graphicsDevice: WebGpuGraphicsDevice;
|
|
17
|
+
private readonly _context: GpuCanvasContext;
|
|
18
|
+
private readonly _backBufferSize: vec2;
|
|
19
|
+
private _currentView: GpuTextureView | null = null;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The constructor.
|
|
23
|
+
* @param canvas The canvas.
|
|
24
|
+
* @param graphicsDevice The graphics device.
|
|
25
|
+
* @param _descriptor The swap chain descriptor. WebGPU canvases always present with FIFO.
|
|
26
|
+
*/
|
|
27
|
+
public constructor(canvas: HTMLCanvasElement, graphicsDevice: WebGpuGraphicsDevice, _descriptor?: SwapChainDescriptor) {
|
|
28
|
+
this._canvas = canvas;
|
|
29
|
+
this._graphicsDevice = graphicsDevice;
|
|
30
|
+
const context = canvas.getContext("webgpu" as "webgl2") as unknown as GpuCanvasContext | null;
|
|
31
|
+
if (!context) {
|
|
32
|
+
throw new Error("WebGPU canvas context is not available.");
|
|
33
|
+
}
|
|
34
|
+
this._context = context;
|
|
35
|
+
this._backBufferSize = vec2.fromValues(canvas.width, canvas.height);
|
|
36
|
+
this._configure();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
private _configure(): void {
|
|
40
|
+
this._context.configure({
|
|
41
|
+
device: this._graphicsDevice.device,
|
|
42
|
+
format: "rgba8unorm",
|
|
43
|
+
usage: GpuTextureUsage.RENDER_ATTACHMENT,
|
|
44
|
+
alphaMode: this._graphicsDevice.alpha ? "premultiplied" : "opaque",
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** @inheritDoc */
|
|
49
|
+
public get textureFormat(): TextureFormat {
|
|
50
|
+
return TextureFormat.RGBA_8_UNORM;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** @inheritDoc */
|
|
54
|
+
public get backBufferSize(): vec2 {
|
|
55
|
+
return this._backBufferSize;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The view of the current canvas texture. Acquired once per frame and released on {@link present}.
|
|
60
|
+
*/
|
|
61
|
+
public get currentTextureView(): GpuTextureView {
|
|
62
|
+
if (!this._currentView) {
|
|
63
|
+
this._currentView = this._context.getCurrentTexture().createView();
|
|
64
|
+
}
|
|
65
|
+
return this._currentView;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** @inheritDoc */
|
|
69
|
+
public resize(width: number, height: number): void {
|
|
70
|
+
if (width <= 0 || height <= 0) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
this._currentView = null;
|
|
74
|
+
this._canvas.width = width;
|
|
75
|
+
this._canvas.height = height;
|
|
76
|
+
this._backBufferSize[0] = width;
|
|
77
|
+
this._backBufferSize[1] = height;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** @inheritDoc */
|
|
81
|
+
public present(): void {
|
|
82
|
+
// The browser presents the canvas texture after the task; the next frame needs a fresh texture.
|
|
83
|
+
this._currentView = null;
|
|
84
|
+
this._backBufferSize[0] = this._canvas.width;
|
|
85
|
+
this._backBufferSize[1] = this._canvas.height;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** @inheritDoc */
|
|
89
|
+
public dispose(): void {
|
|
90
|
+
this._currentView = null;
|
|
91
|
+
this._context.unconfigure();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type IFramework,
|
|
3
|
+
State,
|
|
4
|
+
TextureDescriptor,
|
|
5
|
+
TextureUsage,
|
|
6
|
+
TextureUtilities,
|
|
7
|
+
type ITextureView,
|
|
8
|
+
TextureViewDescriptor,
|
|
9
|
+
TextureViewDimension,
|
|
10
|
+
} from "../../api/index.ts";
|
|
11
|
+
import {ATexture2D} from "../../core/rendering/texture/texture.ts";
|
|
12
|
+
import type {WebGpuGraphicsDevice} from "../WebGpuGraphicsDevice.ts";
|
|
13
|
+
import {GpuTextureUsage, type GpuTexture, type GpuTextureView} from "../WebGpuTypes.ts";
|
|
14
|
+
import {WebGpuConverter} from "../utilities/WebGpuConverter.ts";
|
|
15
|
+
import {WebGpuTextureView} from "./WebGpuTextureView.ts";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The WebGPU 2D texture.
|
|
19
|
+
*
|
|
20
|
+
* Supports uncompressed formats with `Uint8Array` mip levels or an `HTMLImageElement`.
|
|
21
|
+
* Mipmap generation and compressed (KTX2) formats are not implemented for WebGPU yet.
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export class WebGpuTexture2D extends ATexture2D {
|
|
25
|
+
|
|
26
|
+
private readonly _graphicsDevice: WebGpuGraphicsDevice;
|
|
27
|
+
private readonly _image?: HTMLImageElement;
|
|
28
|
+
private _gpuTexture: GpuTexture | null = null;
|
|
29
|
+
private _gpuDefaultView: GpuTextureView | null = null;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The constructor.
|
|
33
|
+
* @param framework The framework.
|
|
34
|
+
* @param descriptor The texture descriptor.
|
|
35
|
+
* @param image An optional image to upload instead of `descriptor.data`.
|
|
36
|
+
*/
|
|
37
|
+
public constructor(framework: IFramework, descriptor: TextureDescriptor, image?: HTMLImageElement) {
|
|
38
|
+
super(descriptor);
|
|
39
|
+
this._graphicsDevice = framework.renderer.graphicsDevice as WebGpuGraphicsDevice;
|
|
40
|
+
this._image = image;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** The WebGPU texture. */
|
|
44
|
+
public get gpuTexture(): GpuTexture {
|
|
45
|
+
if (!this._gpuTexture) {
|
|
46
|
+
throw new Error("WebGpuTexture2D: the texture is not initialized or is disposed.");
|
|
47
|
+
}
|
|
48
|
+
return this._gpuTexture;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** The default WebGPU view of the whole texture. */
|
|
52
|
+
public get gpuDefaultView(): GpuTextureView {
|
|
53
|
+
if (!this._gpuDefaultView) {
|
|
54
|
+
throw new Error("WebGpuTexture2D: the texture is not initialized or is disposed.");
|
|
55
|
+
}
|
|
56
|
+
return this._gpuDefaultView;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** @inheritDoc */
|
|
60
|
+
public initialize(): void {
|
|
61
|
+
if (this._state == State.INITIALIZED) {
|
|
62
|
+
throw new Error("Texture is already initialized.");
|
|
63
|
+
} else if (this._state == State.DISPOSED) {
|
|
64
|
+
throw new Error("Texture is already disposed.");
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (TextureUtilities.isCompressedTextureFormat(this.textureFormat)) {
|
|
68
|
+
throw new Error("Compressed textures are not implemented for WebGPU.");
|
|
69
|
+
}
|
|
70
|
+
if (this._generateMipMaps) {
|
|
71
|
+
console.warn("WebGpuTexture2D: mipmap generation is not implemented for WebGPU; only the base level is used.");
|
|
72
|
+
this._generateMipMaps = false;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const hasData = !!this._data && this._data.length > 0;
|
|
76
|
+
let usage = WebGpuConverter.convertTextureUsage(this.textureUsage);
|
|
77
|
+
// Uploading needs COPY_DST; copyExternalImageToTexture also needs RENDER_ATTACHMENT.
|
|
78
|
+
if (hasData || this._image) {
|
|
79
|
+
usage |= GpuTextureUsage.COPY_DST;
|
|
80
|
+
}
|
|
81
|
+
if (this._image) {
|
|
82
|
+
usage |= GpuTextureUsage.RENDER_ATTACHMENT;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const device = this._graphicsDevice.device;
|
|
86
|
+
this._gpuTexture = device.createTexture({
|
|
87
|
+
label: this.label ?? `WebGpuTexture2D ${this.id}`,
|
|
88
|
+
size: {width: this.width, height: this.height, depthOrArrayLayers: 1},
|
|
89
|
+
mipLevelCount: this._mipLevels,
|
|
90
|
+
format: WebGpuConverter.convertTextureFormat(this.textureFormat),
|
|
91
|
+
usage,
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
if (this._image) {
|
|
95
|
+
device.queue.copyExternalImageToTexture(
|
|
96
|
+
{source: this._image},
|
|
97
|
+
{texture: this._gpuTexture},
|
|
98
|
+
{width: this.width, height: this.height});
|
|
99
|
+
} else if (hasData) {
|
|
100
|
+
let width = this.width;
|
|
101
|
+
let height = this.height;
|
|
102
|
+
for (let level = 0; level < this._data!.length; level++) {
|
|
103
|
+
const levelData = this._data![level];
|
|
104
|
+
const bytesPerPixel = TextureUtilities.getVRamSize(this.textureFormat, 1, 1);
|
|
105
|
+
device.queue.writeTexture(
|
|
106
|
+
{texture: this._gpuTexture, mipLevel: level},
|
|
107
|
+
levelData,
|
|
108
|
+
{bytesPerRow: width * bytesPerPixel, rowsPerImage: height},
|
|
109
|
+
{width, height});
|
|
110
|
+
width = Math.max(1, Math.floor(width / 2));
|
|
111
|
+
height = Math.max(1, Math.floor(height / 2));
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
this._gpuDefaultView = this._gpuTexture.createView({label: `${this.label ?? "WebGpuTexture2D"} default view`});
|
|
116
|
+
// ATexture2D declares the default view readonly and sets it to null; fill it in here.
|
|
117
|
+
(this as { defaultTextureView: ITextureView }).defaultTextureView =
|
|
118
|
+
new WebGpuTextureView(this._gpuDefaultView, this.textureFormat);
|
|
119
|
+
this._handle = this._gpuTexture;
|
|
120
|
+
|
|
121
|
+
this._state = State.INITIALIZED;
|
|
122
|
+
|
|
123
|
+
let width = this.width;
|
|
124
|
+
let height = this.height;
|
|
125
|
+
this._size = 0;
|
|
126
|
+
for (let i = 0; i < this.mipLevels; i++) {
|
|
127
|
+
this._size += TextureUtilities.getVRamSize(this.textureFormat, width, height);
|
|
128
|
+
width = Math.max(1, Math.floor(width / 2));
|
|
129
|
+
height = Math.max(1, Math.floor(height / 2));
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** @inheritDoc */
|
|
134
|
+
public createView(descriptor?: TextureViewDescriptor): ITextureView {
|
|
135
|
+
descriptor = descriptor ?? new TextureViewDescriptor();
|
|
136
|
+
if (descriptor.dimension !== TextureViewDimension.DIMENSION_2D) {
|
|
137
|
+
throw new Error("Only 2D texture views are implemented for WebGPU.");
|
|
138
|
+
}
|
|
139
|
+
const view = this.gpuTexture.createView({
|
|
140
|
+
label: descriptor.label,
|
|
141
|
+
format: WebGpuConverter.convertTextureFormat(descriptor.textureFormat),
|
|
142
|
+
dimension: "2d",
|
|
143
|
+
});
|
|
144
|
+
return new WebGpuTextureView(view, descriptor.textureFormat, descriptor.dimension);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/** @inheritDoc */
|
|
148
|
+
public dispose(): void {
|
|
149
|
+
if (this._state == State.DISPOSING || this._state == State.DISPOSED) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
this._gpuTexture?.destroy();
|
|
153
|
+
this._gpuTexture = null;
|
|
154
|
+
this._gpuDefaultView = null;
|
|
155
|
+
this.defaultTextureView?.dispose();
|
|
156
|
+
this._state = State.DISPOSED;
|
|
157
|
+
|
|
158
|
+
for (const listener of this._disposedListeners.slice()) {
|
|
159
|
+
listener(this);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/** One default texture per framework. */
|
|
164
|
+
private static readonly _defaultFilled = new WeakMap<IFramework, WebGpuTexture2D>();
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Returns the framework's 1x1 white texture, creating it on first use.
|
|
168
|
+
* Used when a pipeline has no texture set.
|
|
169
|
+
* @param framework The framework.
|
|
170
|
+
*/
|
|
171
|
+
public static getOrCreateDefault(framework: IFramework): WebGpuTexture2D {
|
|
172
|
+
let texture = WebGpuTexture2D._defaultFilled.get(framework);
|
|
173
|
+
if (!texture || texture.state === State.DISPOSED) {
|
|
174
|
+
const desc = new TextureDescriptor();
|
|
175
|
+
desc.width = 1;
|
|
176
|
+
desc.height = 1;
|
|
177
|
+
desc.data = [new Uint8Array([255, 255, 255, 255])];
|
|
178
|
+
desc.textureFormat = framework.renderer.preferredTextureFormat;
|
|
179
|
+
desc.textureUsage = TextureUsage.TEXTURE_BINDING | TextureUsage.COPY_DST;
|
|
180
|
+
desc.label = "RisDefaultFilledTexture";
|
|
181
|
+
texture = new WebGpuTexture2D(framework, desc);
|
|
182
|
+
texture.initialize();
|
|
183
|
+
WebGpuTexture2D._defaultFilled.set(framework, texture);
|
|
184
|
+
}
|
|
185
|
+
return texture;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Disposes and forgets the framework's default texture. Called from `Framework.dispose()`.
|
|
190
|
+
* @param framework The framework.
|
|
191
|
+
*/
|
|
192
|
+
public static disposeDefault(framework: IFramework): void {
|
|
193
|
+
const texture = WebGpuTexture2D._defaultFilled.get(framework);
|
|
194
|
+
WebGpuTexture2D._defaultFilled.delete(framework);
|
|
195
|
+
texture?.dispose();
|
|
196
|
+
}
|
|
197
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Color,
|
|
3
|
+
type IFramework,
|
|
4
|
+
type ITexture2D,
|
|
5
|
+
type ITextureFactory,
|
|
6
|
+
TextureDescriptor,
|
|
7
|
+
TextureFormat,
|
|
8
|
+
TextureUsage,
|
|
9
|
+
} from "../../api/index.ts";
|
|
10
|
+
import type {IKtx2Texture} from "ris-ktx2";
|
|
11
|
+
import {WebGpuTexture2D} from "./WebGpuTexture2D.ts";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The WebGPU texture factory.
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export class WebGpuTextureFactory implements ITextureFactory {
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The constructor.
|
|
21
|
+
* @param _framework The framework.
|
|
22
|
+
*/
|
|
23
|
+
public constructor(private readonly _framework: IFramework) {
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** @inheritDoc */
|
|
27
|
+
public createFromKtx2(_ktxTexture: IKtx2Texture, _descriptor?: TextureDescriptor): ITexture2D {
|
|
28
|
+
throw new Error("createFromKtx2 is not implemented for WebGPU.");
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** @inheritDoc */
|
|
32
|
+
public create(
|
|
33
|
+
width: number, height: number,
|
|
34
|
+
data?: number[] | HTMLImageElement | ArrayBufferView,
|
|
35
|
+
channels: number = 4,
|
|
36
|
+
label: string | null | undefined = null,
|
|
37
|
+
textureUsage = TextureUsage.COPY_DST | TextureUsage.TEXTURE_BINDING,
|
|
38
|
+
textureFormat = TextureFormat.RGBA_8_UNORM,
|
|
39
|
+
useMipMaps = false): ITexture2D {
|
|
40
|
+
|
|
41
|
+
if (!data) {
|
|
42
|
+
throw new Error("Data must not be null.");
|
|
43
|
+
}
|
|
44
|
+
if (width == 0 || height == 0) {
|
|
45
|
+
throw new Error("width and height must be greater than 0.");
|
|
46
|
+
}
|
|
47
|
+
if (channels == 0) {
|
|
48
|
+
throw new Error("channels must be greater than 0.");
|
|
49
|
+
}
|
|
50
|
+
if (textureFormat == TextureFormat.UNDEFINED) {
|
|
51
|
+
textureFormat = this._framework.renderer.preferredTextureFormat;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const desc = new TextureDescriptor();
|
|
55
|
+
desc.width = width;
|
|
56
|
+
desc.height = height;
|
|
57
|
+
desc.textureFormat = textureFormat;
|
|
58
|
+
desc.textureUsage = textureUsage;
|
|
59
|
+
desc.generateMipmaps = useMipMaps;
|
|
60
|
+
desc.label = label ?? null;
|
|
61
|
+
|
|
62
|
+
let image: HTMLImageElement | undefined;
|
|
63
|
+
if (typeof HTMLImageElement !== "undefined" && data instanceof HTMLImageElement) {
|
|
64
|
+
image = data;
|
|
65
|
+
} else if (Array.isArray(data)) {
|
|
66
|
+
desc.data = [new Uint8Array(data)];
|
|
67
|
+
} else {
|
|
68
|
+
const view = data as ArrayBufferView;
|
|
69
|
+
desc.data = [new Uint8Array(view.buffer, view.byteOffset, view.byteLength)];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const texture = new WebGpuTexture2D(this._framework, desc, image);
|
|
73
|
+
texture.initialize();
|
|
74
|
+
return texture;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** @inheritDoc */
|
|
78
|
+
public createEmpty(
|
|
79
|
+
width: number, height: number,
|
|
80
|
+
color: Color | null = null,
|
|
81
|
+
textureUsage = TextureUsage.COPY_DST | TextureUsage.TEXTURE_BINDING,
|
|
82
|
+
textureFormat = TextureFormat.UNDEFINED,
|
|
83
|
+
label: string | null = null,
|
|
84
|
+
useMipmap = false): ITexture2D {
|
|
85
|
+
|
|
86
|
+
if (width == 0 || height == 0) {
|
|
87
|
+
throw new Error("Width and height must be greater than 0.");
|
|
88
|
+
}
|
|
89
|
+
if (textureFormat == TextureFormat.UNDEFINED) {
|
|
90
|
+
textureFormat = this._framework.renderer.preferredTextureFormat;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const desc = new TextureDescriptor();
|
|
94
|
+
desc.width = width;
|
|
95
|
+
desc.height = height;
|
|
96
|
+
desc.textureUsage = textureUsage;
|
|
97
|
+
desc.textureFormat = textureFormat;
|
|
98
|
+
desc.label = label;
|
|
99
|
+
desc.generateMipmaps = useMipmap;
|
|
100
|
+
|
|
101
|
+
// WebGPU zero-initializes textures, so transparent black needs no upload; neither do depth textures.
|
|
102
|
+
if (!color || (color.r === 0 && color.g === 0 && color.b === 0 && color.a === 0)) {
|
|
103
|
+
const texture = new WebGpuTexture2D(this._framework, desc);
|
|
104
|
+
texture.initialize();
|
|
105
|
+
return texture;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const byteSize = width * height * 4;
|
|
109
|
+
const bytes = new Uint8Array(byteSize);
|
|
110
|
+
for (let i = 0; i < byteSize; i += 4) {
|
|
111
|
+
bytes[i] = color.r * 255;
|
|
112
|
+
bytes[i + 1] = color.g * 255;
|
|
113
|
+
bytes[i + 2] = color.b * 255;
|
|
114
|
+
bytes[i + 3] = color.a * 255;
|
|
115
|
+
}
|
|
116
|
+
return this.create(width, height, bytes, 4, label, textureUsage, textureFormat, useMipmap);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {type ITextureView, TextureFormat, TextureViewDimension} from "../../api/index.ts";
|
|
2
|
+
import type {GpuTextureView} from "../WebGpuTypes.ts";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The WebGPU texture view.
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export class WebGpuTextureView implements ITextureView {
|
|
9
|
+
|
|
10
|
+
private _gpuTextureView: GpuTextureView | null;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The constructor.
|
|
14
|
+
* @param gpuTextureView The WebGPU view.
|
|
15
|
+
* @param textureFormat The view format.
|
|
16
|
+
* @param dimension The view dimension.
|
|
17
|
+
*/
|
|
18
|
+
public constructor(gpuTextureView: GpuTextureView, textureFormat: TextureFormat, dimension = TextureViewDimension.DIMENSION_2D) {
|
|
19
|
+
this._gpuTextureView = gpuTextureView;
|
|
20
|
+
this.textureFormat = textureFormat;
|
|
21
|
+
this.dimension = dimension;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** @inheritDoc */
|
|
25
|
+
public readonly textureFormat: TextureFormat;
|
|
26
|
+
|
|
27
|
+
/** @inheritDoc */
|
|
28
|
+
public readonly dimension: TextureViewDimension;
|
|
29
|
+
|
|
30
|
+
/** The WebGPU view. */
|
|
31
|
+
public get gpuTextureView(): GpuTextureView {
|
|
32
|
+
if (!this._gpuTextureView) {
|
|
33
|
+
throw new Error("WebGpuTextureView: the view is disposed.");
|
|
34
|
+
}
|
|
35
|
+
return this._gpuTextureView;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** @inheritDoc */
|
|
39
|
+
public dispose(): void {
|
|
40
|
+
// Views have no destroy() in WebGPU; dropping the reference is enough.
|
|
41
|
+
this._gpuTextureView = null;
|
|
42
|
+
}
|
|
43
|
+
}
|