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,50 @@
|
|
|
1
|
+
import { GeometryFormat, type IBlendState, type IFramework, type IIndexBuffer, type IPrimitiveState, type IRenderPipeline, type IVertexBuffer, TextureFormat } from "../../api/index.js";
|
|
2
|
+
import type { VertexBufferLayout } from "../../core/rendering/vertex-buffer-layout.js";
|
|
3
|
+
import type { WebGpuGraphicsDevice } from "../WebGpuGraphicsDevice.js";
|
|
4
|
+
import type { WebGpuBlendState } from "../blending/WebGpuBlendState.js";
|
|
5
|
+
import type { WebGpuPrimitiveState } from "../primitive/WebGpuPrimitiveState.js";
|
|
6
|
+
import type { WebGpuSampler } from "../sampler/WebGpuSampler.js";
|
|
7
|
+
import type { GpuBindGroupLayout, GpuPipelineLayout, GpuRenderPipeline, GpuShaderModule } from "../WebGpuTypes.js";
|
|
8
|
+
/**
|
|
9
|
+
* The base WebGPU render pipeline. Holds the device, the states and the vertex layouts,
|
|
10
|
+
* and builds the `GPURenderPipeline` from them.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare abstract class AWebGpuRenderPipeline implements IRenderPipeline {
|
|
14
|
+
protected readonly _framework: IFramework;
|
|
15
|
+
protected readonly _graphicsDevice: WebGpuGraphicsDevice;
|
|
16
|
+
protected readonly _defaultTextureSampler: WebGpuSampler;
|
|
17
|
+
protected _blendState: WebGpuBlendState;
|
|
18
|
+
protected _gpuPipeline: GpuRenderPipeline | null;
|
|
19
|
+
protected _pipelineLayout: GpuPipelineLayout | null;
|
|
20
|
+
/**
|
|
21
|
+
* The constructor.
|
|
22
|
+
* @param framework The framework.
|
|
23
|
+
* @param primitiveState The optional primitive state; defaults to the device's.
|
|
24
|
+
*/
|
|
25
|
+
protected constructor(framework: IFramework, primitiveState?: IPrimitiveState);
|
|
26
|
+
/** @inheritDoc */
|
|
27
|
+
abstract readonly geometryFormat: GeometryFormat;
|
|
28
|
+
/** @inheritDoc */
|
|
29
|
+
get blendState(): IBlendState;
|
|
30
|
+
/** @inheritDoc */
|
|
31
|
+
readonly primitiveState: WebGpuPrimitiveState;
|
|
32
|
+
/** @inheritDoc */
|
|
33
|
+
vertexBufferLayouts: VertexBufferLayout[];
|
|
34
|
+
/** @inheritDoc */
|
|
35
|
+
abstract initialize(): void;
|
|
36
|
+
/** @inheritDoc */
|
|
37
|
+
abstract render(vertexBuffer: IVertexBuffer, indexBuffer: IIndexBuffer, indicesCount?: number, indicesOffset?: number): void;
|
|
38
|
+
/**
|
|
39
|
+
* Creates the pipeline layout and the render pipeline.
|
|
40
|
+
* @param label The label.
|
|
41
|
+
* @param module The WGSL module with `main_vs` and `main_fs`.
|
|
42
|
+
* @param bindGroupLayouts The bind group layouts, in group order.
|
|
43
|
+
* @param colorFormat The color target format.
|
|
44
|
+
* @param depthStencilFormat The depth format, or undefined when the pass has no depth attachment.
|
|
45
|
+
*/
|
|
46
|
+
protected _createGpuPipeline(label: string, module: GpuShaderModule, bindGroupLayouts: GpuBindGroupLayout[], colorFormat: TextureFormat, depthStencilFormat?: TextureFormat): void;
|
|
47
|
+
/** @inheritDoc */
|
|
48
|
+
dispose(): void;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=AWebGpuRenderPipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AWebGpuRenderPipeline.d.ts","sourceRoot":"","sources":["../../../src/webgpu/render-pipelines/AWebGpuRenderPipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,cAAc,EACd,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,aAAa,EAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,8CAA8C,CAAC;AACrF,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,sCAAsC,CAAC;AAC/E,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EACR,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EAClB,MAAM,mBAAmB,CAAC;AAG3B;;;;GAIG;AACH,8BAAsB,qBAAsB,YAAW,eAAe;IAElE,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAC1C,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,oBAAoB,CAAC;IACzD,SAAS,CAAC,QAAQ,CAAC,sBAAsB,EAAE,aAAa,CAAC;IACzD,SAAS,CAAC,WAAW,EAAE,gBAAgB,CAAC;IACxC,SAAS,CAAC,YAAY,EAAE,iBAAiB,GAAG,IAAI,CAAQ;IACxD,SAAS,CAAC,eAAe,EAAE,iBAAiB,GAAG,IAAI,CAAQ;IAE3D;;;;OAIG;IACH,SAAS,aAAa,SAAS,EAAE,UAAU,EAAE,cAAc,CAAC,EAAE,eAAe;IAQ7E,kBAAkB;IAClB,kBAAyB,cAAc,EAAE,cAAc,CAAC;IAExD,kBAAkB;IAClB,IAAW,UAAU,IAAI,WAAW,CAEnC;IAED,kBAAkB;IAClB,SAAgB,cAAc,EAAE,oBAAoB,CAAC;IAErD,kBAAkB;IACX,mBAAmB,EAAE,kBAAkB,EAAE,CAAS;IAEzD,kBAAkB;aACF,UAAU,IAAI,IAAI;IAElC,kBAAkB;aACF,MAAM,CAAC,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI;IAEnI;;;;;;;OAOG;IACH,SAAS,CAAC,kBAAkB,CACxB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,eAAe,EACvB,gBAAgB,EAAE,kBAAkB,EAAE,EACtC,WAAW,EAAE,aAAa,EAC1B,kBAAkB,CAAC,EAAE,aAAa,GAAG,IAAI;IAiC7C,kBAAkB;IACX,OAAO,IAAI,IAAI;CAKzB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { GeometryFormat, type IFramework, type IMainRenderTargetRenderPipeline, type ITexture2D } from "../../api/index.js";
|
|
2
|
+
import { AWebGpuRenderPipeline } from "./AWebGpuRenderPipeline.js";
|
|
3
|
+
/**
|
|
4
|
+
* Draws the main render target to the swap chain with `main_frame_buffer.wgsl`.
|
|
5
|
+
* No Y flip: in WebGPU texture (0,0) is the top-left, which matches the quad's UVs (same as the C# backend).
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare class WebGpuMainRenderTargetRenderPipeline extends AWebGpuRenderPipeline implements IMainRenderTargetRenderPipeline {
|
|
9
|
+
private _vertexBuffer;
|
|
10
|
+
private _indexBuffer;
|
|
11
|
+
private _mainRenderTarget;
|
|
12
|
+
private _bindGroupLayout;
|
|
13
|
+
private _bindGroup;
|
|
14
|
+
/**
|
|
15
|
+
* The constructor.
|
|
16
|
+
* @param framework The framework.
|
|
17
|
+
* @param mainRenderTarget The main render target.
|
|
18
|
+
*/
|
|
19
|
+
constructor(framework: IFramework, mainRenderTarget: ITexture2D);
|
|
20
|
+
/** @inheritDoc */
|
|
21
|
+
readonly geometryFormat = GeometryFormat.POS3_TEXTURECOORDS2;
|
|
22
|
+
/** @inheritDoc */
|
|
23
|
+
get mainRenderTarget(): ITexture2D;
|
|
24
|
+
/** Sets the main render target and rebuilds the bind group. */
|
|
25
|
+
set mainRenderTarget(value: ITexture2D);
|
|
26
|
+
/** @inheritDoc */
|
|
27
|
+
initialize(): void;
|
|
28
|
+
private _getBindGroup;
|
|
29
|
+
/** @inheritDoc */
|
|
30
|
+
render(): void;
|
|
31
|
+
/** @inheritDoc */
|
|
32
|
+
dispose(): void;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=WebGpuMainRenderTargetRenderPipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebGpuMainRenderTargetRenderPipeline.d.ts","sourceRoot":"","sources":["../../../src/webgpu/render-pipelines/WebGpuMainRenderTargetRenderPipeline.ts"],"names":[],"mappings":"AACA,OAAO,EAEH,cAAc,EACd,KAAK,UAAU,EACf,KAAK,+BAA+B,EACpC,KAAK,UAAU,EAClB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAC,qBAAqB,EAAC,MAAM,4BAA4B,CAAC;AAOjE;;;;GAIG;AACH,qBAAa,oCAAqC,SAAQ,qBAAsB,YAAW,+BAA+B;IAEtH,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,YAAY,CAA4B;IAChD,OAAO,CAAC,iBAAiB,CAAkB;IAC3C,OAAO,CAAC,gBAAgB,CAA6B;IACrD,OAAO,CAAC,UAAU,CAA6B;IAE/C;;;;OAIG;gBACgB,SAAS,EAAE,UAAU,EAAE,gBAAgB,EAAE,UAAU;IAKtE,kBAAkB;IAClB,SAAgB,cAAc,sCAAsC;IAEpE,kBAAkB;IAClB,IAAW,gBAAgB,IAAI,UAAU,CAExC;IAED,+DAA+D;IAC/D,IAAW,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAG5C;IAED,kBAAkB;IACX,UAAU,IAAI,IAAI;IA6BzB,OAAO,CAAC,aAAa;IAcrB,kBAAkB;IACX,MAAM,IAAI,IAAI;IAYrB,kBAAkB;IACF,OAAO,IAAI,IAAI;CAOlC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ForwardBlinnPhongRenderPipelineDescriptor, IForwardBlinnPhongRenderPipeline, IFramework, IInspectTextureMipsRenderPipeline, IMainRenderTargetRenderPipeline, IPrimitiveState, IRenderPipelineFactory, ISpriteRenderPipeline, ITexture2D, IUniformBuffer, IUnlitRenderPipeline } from "../../api/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* The WebGPU render pipeline factory. Slice 1 implements the main render target and unlit pipelines.
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare class WebGpuRenderPipelineFactory implements IRenderPipelineFactory {
|
|
7
|
+
private readonly _framework;
|
|
8
|
+
/**
|
|
9
|
+
* The constructor.
|
|
10
|
+
* @param _framework The framework.
|
|
11
|
+
*/
|
|
12
|
+
constructor(_framework: IFramework);
|
|
13
|
+
/** @inheritDoc */
|
|
14
|
+
createMainFrameBufferPipeline(mainFrameBuffer: ITexture2D): IMainRenderTargetRenderPipeline;
|
|
15
|
+
/** Same as {@link createMainFrameBufferPipeline}, mirroring the WebGL factory. */
|
|
16
|
+
createMainRenderTargetRenderPipeline(renderTarget: ITexture2D): IMainRenderTargetRenderPipeline;
|
|
17
|
+
/** @inheritDoc */
|
|
18
|
+
createUnlitRenderPipeline(projectionViewBuffer: IUniformBuffer, modelBuffer: IUniformBuffer, materialBuffer: IUniformBuffer, primitiveState?: IPrimitiveState): IUnlitRenderPipeline;
|
|
19
|
+
/** @inheritDoc */
|
|
20
|
+
createSpriteRenderPipeline(_projectionViewBuffer: IUniformBuffer): ISpriteRenderPipeline;
|
|
21
|
+
/** @inheritDoc */
|
|
22
|
+
createInspectTextureMipsRenderPipeline(_projectionViewBuffer: IUniformBuffer, _modelBuffer: IUniformBuffer, _textureConstantsBuffer: IUniformBuffer): IInspectTextureMipsRenderPipeline;
|
|
23
|
+
/** @inheritDoc */
|
|
24
|
+
createForwardBlinnPhongRenderPipeline(_descriptor: ForwardBlinnPhongRenderPipelineDescriptor): IForwardBlinnPhongRenderPipeline;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=WebGpuRenderPipelineFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebGpuRenderPipelineFactory.d.ts","sourceRoot":"","sources":["../../../src/webgpu/render-pipelines/WebGpuRenderPipelineFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,yCAAyC,EACzC,gCAAgC,EAChC,UAAU,EACV,iCAAiC,EACjC,+BAA+B,EAC/B,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,UAAU,EACV,cAAc,EACd,oBAAoB,EACvB,MAAM,oBAAoB,CAAC;AAI5B;;;GAGG;AACH,qBAAa,2BAA4B,YAAW,sBAAsB;IAMnD,OAAO,CAAC,QAAQ,CAAC,UAAU;IAJ9C;;;OAGG;gBACiC,UAAU,EAAE,UAAU;IAG1D,kBAAkB;IACX,6BAA6B,CAAC,eAAe,EAAE,UAAU,GAAG,+BAA+B;IAMlG,kFAAkF;IAC3E,oCAAoC,CAAC,YAAY,EAAE,UAAU,GAAG,+BAA+B;IAItG,kBAAkB;IACX,yBAAyB,CAAC,oBAAoB,EAAE,cAAc,EACpC,WAAW,EAAE,cAAc,EAC3B,cAAc,EAAE,cAAc,EAC9B,cAAc,CAAC,EAAE,eAAe,GAAG,oBAAoB;IAMxF,kBAAkB;IACX,0BAA0B,CAAC,qBAAqB,EAAE,cAAc,GAAG,qBAAqB;IAI/F,kBAAkB;IACX,sCAAsC,CAAC,qBAAqB,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,uBAAuB,EAAE,cAAc,GAAG,iCAAiC;IAI9L,kBAAkB;IACX,qCAAqC,CAAC,WAAW,EAAE,yCAAyC,GAAG,gCAAgC;CAGzI"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { type IFramework, type IIndexBuffer, type IPrimitiveState, type ISampler, type ITexture2D, type IUniformBuffer, type IVertexBuffer } from "../../../api/index.js";
|
|
2
|
+
import { AWebGpuRenderPipeline } from "../AWebGpuRenderPipeline.js";
|
|
3
|
+
import { WebGpuTexture2D } from "../../texture/WebGpuTexture2D.js";
|
|
4
|
+
import type { WebGpuSampler } from "../../sampler/WebGpuSampler.js";
|
|
5
|
+
/**
|
|
6
|
+
* One uniform buffer binding of a uniform bind group.
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export interface IWebGpuUniformBinding {
|
|
10
|
+
/** The WGSL `@binding`. */
|
|
11
|
+
binding: number;
|
|
12
|
+
/** The shader stages that read it. */
|
|
13
|
+
visibility: number;
|
|
14
|
+
/** Returns the current buffer. */
|
|
15
|
+
buffer: () => IUniformBuffer;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A uniform-buffer-only bind group. The bind group is rebuilt when any of its buffers change (dirty check).
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export interface IWebGpuUniformGroup {
|
|
22
|
+
/** The WGSL `@group`. */
|
|
23
|
+
group: number;
|
|
24
|
+
/** The bindings. */
|
|
25
|
+
bindings: IWebGpuUniformBinding[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The base of WebGPU mesh pipelines, like the C# `AWebGPUMeshRenderPipeline`:
|
|
29
|
+
* uniform groups with dirty checks, plus one texture + sampler group cached per texture and sampler id.
|
|
30
|
+
* A 1x1 white texture is used when no texture is set.
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
export declare abstract class AWebGpuMeshRenderPipeline extends AWebGpuRenderPipeline {
|
|
34
|
+
private _uniformGroups;
|
|
35
|
+
private _textureGroupIndex;
|
|
36
|
+
private _textureGroupLayout;
|
|
37
|
+
private readonly _textureBindGroups;
|
|
38
|
+
private readonly _watchedTextures;
|
|
39
|
+
private readonly _onTextureDisposed;
|
|
40
|
+
protected _texture: WebGpuTexture2D | null;
|
|
41
|
+
protected _sampler?: WebGpuSampler;
|
|
42
|
+
/**
|
|
43
|
+
* The constructor.
|
|
44
|
+
* @param framework The framework.
|
|
45
|
+
* @param primitiveState The optional primitive state.
|
|
46
|
+
*/
|
|
47
|
+
protected constructor(framework: IFramework, primitiveState?: IPrimitiveState);
|
|
48
|
+
/** The shader id to load. */
|
|
49
|
+
protected abstract readonly _shaderId: string;
|
|
50
|
+
/** The uniform groups. */
|
|
51
|
+
protected abstract _describeUniformGroups(): IWebGpuUniformGroup[];
|
|
52
|
+
/** The group index used for texture + sampler. */
|
|
53
|
+
protected get _textureGroup(): number;
|
|
54
|
+
/** @inheritDoc */
|
|
55
|
+
get diffuseTexture(): ITexture2D;
|
|
56
|
+
/** @inheritDoc */
|
|
57
|
+
set diffuseTexture(value: ITexture2D);
|
|
58
|
+
/** @inheritDoc */
|
|
59
|
+
get diffuseTextureSampler(): ISampler | undefined;
|
|
60
|
+
/** @inheritDoc */
|
|
61
|
+
set diffuseTextureSampler(value: ISampler | undefined);
|
|
62
|
+
/** @inheritDoc */
|
|
63
|
+
initialize(): void;
|
|
64
|
+
private _getUniformBindGroup;
|
|
65
|
+
private _getTextureBindGroup;
|
|
66
|
+
private _forgetTexture;
|
|
67
|
+
/** @inheritDoc */
|
|
68
|
+
render(vertexBuffer: IVertexBuffer, indexBuffer: IIndexBuffer, indicesCount?: number, indicesOffset?: number): void;
|
|
69
|
+
/** @inheritDoc */
|
|
70
|
+
dispose(): void;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=AWebGpuMeshRenderPipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AWebGpuMeshRenderPipeline.d.ts","sourceRoot":"","sources":["../../../../src/webgpu/render-pipelines/material/AWebGpuMeshRenderPipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,aAAa,EAErB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAC,qBAAqB,EAAC,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAC,eAAe,EAAC,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAC;AAYlE;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IAClC,2BAA2B;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,MAAM,EAAE,MAAM,cAAc,CAAC;CAChC;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAChC,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,oBAAoB;IACpB,QAAQ,EAAE,qBAAqB,EAAE,CAAC;CACrC;AASD;;;;;GAKG;AACH,8BAAsB,yBAA0B,SAAQ,qBAAqB;IAEzE,OAAO,CAAC,cAAc,CAA2B;IACjD,OAAO,CAAC,kBAAkB,CAAK;IAC/B,OAAO,CAAC,mBAAmB,CAA6B;IACxD,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAmC;IACtE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAyB;IAC1D,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAyD;IAE5F,SAAS,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI,CAAQ;IAClD,SAAS,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC;IAEnC;;;;OAIG;IACH,SAAS,aAAa,SAAS,EAAE,UAAU,EAAE,cAAc,CAAC,EAAE,eAAe;IAI7E,6BAA6B;IAC7B,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE9C,0BAA0B;IAC1B,SAAS,CAAC,QAAQ,CAAC,sBAAsB,IAAI,mBAAmB,EAAE;IAElE,kDAAkD;IAClD,SAAS,KAAK,aAAa,IAAI,MAAM,CAEpC;IAED,kBAAkB;IAClB,IAAW,cAAc,IAAI,UAAU,CAEtC;IAED,kBAAkB;IAClB,IAAW,cAAc,CAAC,KAAK,EAAE,UAAU,EAE1C;IAED,kBAAkB;IAClB,IAAW,qBAAqB,IAAI,QAAQ,GAAG,SAAS,CAEvD;IAED,kBAAkB;IAClB,IAAW,qBAAqB,CAAC,KAAK,EAAE,QAAQ,GAAG,SAAS,EAE3D;IAED,kBAAkB;IACX,UAAU,IAAI,IAAI;IA4CzB,OAAO,CAAC,oBAAoB;IAmB5B,OAAO,CAAC,oBAAoB;IAyB5B,OAAO,CAAC,cAAc;IAUtB,kBAAkB;IACX,MAAM,CAAC,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,GAAE,MAAW,EAAE,aAAa,GAAE,MAAU,GAAG,IAAI;IAuBjI,kBAAkB;IACF,OAAO,IAAI,IAAI;CAWlC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { GeometryFormat, type IFramework, type IPrimitiveState, type IUniformBuffer, type IUnlitRenderPipeline } from "../../../api/index.js";
|
|
2
|
+
import { AWebGpuMeshRenderPipeline, type IWebGpuUniformGroup } from "./AWebGpuMeshRenderPipeline.js";
|
|
3
|
+
/**
|
|
4
|
+
* The WebGPU unlit pipeline (`unlit_material.wgsl`).
|
|
5
|
+
* Group 0: projection-view (0), model (1). Group 1: texture (0), sampler (1). Group 2: material (2).
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare class WebGpuUnlitRenderPipeline extends AWebGpuMeshRenderPipeline implements IUnlitRenderPipeline {
|
|
9
|
+
private _projectionViewBuffer;
|
|
10
|
+
private _modelBuffer;
|
|
11
|
+
private _materialBuffer;
|
|
12
|
+
/**
|
|
13
|
+
* The constructor.
|
|
14
|
+
* @param framework The framework.
|
|
15
|
+
* @param projectionViewBuffer The projection-view buffer.
|
|
16
|
+
* @param modelBuffer The model buffer.
|
|
17
|
+
* @param materialBuffer The material buffer.
|
|
18
|
+
* @param primitiveState The optional primitive state.
|
|
19
|
+
*/
|
|
20
|
+
constructor(framework: IFramework, projectionViewBuffer: IUniformBuffer, modelBuffer: IUniformBuffer, materialBuffer: IUniformBuffer, primitiveState?: IPrimitiveState);
|
|
21
|
+
/** @inheritDoc */
|
|
22
|
+
readonly geometryFormat = GeometryFormat.POS3_COLOR4_TEXTURECOORDS2;
|
|
23
|
+
/** @inheritDoc */
|
|
24
|
+
protected readonly _shaderId = "unlit_material";
|
|
25
|
+
/** @inheritDoc */
|
|
26
|
+
protected _describeUniformGroups(): IWebGpuUniformGroup[];
|
|
27
|
+
/** @inheritDoc */
|
|
28
|
+
get projectionViewBuffer(): IUniformBuffer;
|
|
29
|
+
/** @inheritDoc */
|
|
30
|
+
set projectionViewBuffer(value: IUniformBuffer);
|
|
31
|
+
/** @inheritDoc */
|
|
32
|
+
get modelBuffer(): IUniformBuffer;
|
|
33
|
+
/** @inheritDoc */
|
|
34
|
+
set modelBuffer(value: IUniformBuffer);
|
|
35
|
+
/** @inheritDoc */
|
|
36
|
+
get materialBuffer(): IUniformBuffer;
|
|
37
|
+
/** @inheritDoc */
|
|
38
|
+
set materialBuffer(value: IUniformBuffer);
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=WebGpuUnlitRenderPipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebGpuUnlitRenderPipeline.d.ts","sourceRoot":"","sources":["../../../../src/webgpu/render-pipelines/material/WebGpuUnlitRenderPipeline.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,cAAc,EACd,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EAC5B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAC,yBAAyB,EAAE,KAAK,mBAAmB,EAAC,MAAM,gCAAgC,CAAC;AAGnG;;;;GAIG;AACH,qBAAa,yBAA0B,SAAQ,yBAA0B,YAAW,oBAAoB;IAEpG,OAAO,CAAC,qBAAqB,CAAiB;IAC9C,OAAO,CAAC,YAAY,CAAiB;IACrC,OAAO,CAAC,eAAe,CAAiB;IAExC;;;;;;;OAOG;gBACgB,SAAS,EAAE,UAAU,EACrB,oBAAoB,EAAE,cAAc,EACpC,WAAW,EAAE,cAAc,EAC3B,cAAc,EAAE,cAAc,EAC9B,cAAc,CAAC,EAAE,eAAe;IAWnD,kBAAkB;IAClB,SAAgB,cAAc,6CAA6C;IAE3E,kBAAkB;IAClB,SAAS,CAAC,QAAQ,CAAC,SAAS,oBAAoB;IAEhD,kBAAkB;IAClB,SAAS,CAAC,sBAAsB,IAAI,mBAAmB,EAAE;IAgBzD,kBAAkB;IAClB,IAAW,oBAAoB,IAAI,cAAc,CAEhD;IAED,kBAAkB;IAClB,IAAW,oBAAoB,CAAC,KAAK,EAAE,cAAc,EAEpD;IAED,kBAAkB;IAClB,IAAW,WAAW,IAAI,cAAc,CAEvC;IAED,kBAAkB;IAClB,IAAW,WAAW,CAAC,KAAK,EAAE,cAAc,EAK3C;IAED,kBAAkB;IAClB,IAAW,cAAc,IAAI,cAAc,CAE1C;IAED,kBAAkB;IAClB,IAAW,cAAc,CAAC,KAAK,EAAE,cAAc,EAE9C;CACJ"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { SamplerDescriptor } from "../../core/rendering/sampler/sampler-descriptor.js";
|
|
2
|
+
import { type ISampler, MipMapSamplerFilter } from "../../api/index.js";
|
|
3
|
+
import type { WebGpuGraphicsDevice } from "../WebGpuGraphicsDevice.js";
|
|
4
|
+
import type { GpuSampler } from "../WebGpuTypes.js";
|
|
5
|
+
/**
|
|
6
|
+
* The WebGPU sampler.
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare class WebGpuSampler implements ISampler {
|
|
10
|
+
private static _nextId;
|
|
11
|
+
private _gpuSampler;
|
|
12
|
+
/**
|
|
13
|
+
* The constructor.
|
|
14
|
+
* @param graphicsDevice The graphics device.
|
|
15
|
+
* @param descriptor The sampler descriptor.
|
|
16
|
+
*/
|
|
17
|
+
constructor(graphicsDevice: WebGpuGraphicsDevice, descriptor?: SamplerDescriptor);
|
|
18
|
+
/** @inheritDoc */
|
|
19
|
+
readonly id: number;
|
|
20
|
+
/** @inheritDoc */
|
|
21
|
+
readonly minFilter: import("../../index.js").SamplerFilter;
|
|
22
|
+
/** @inheritDoc */
|
|
23
|
+
readonly magFilter: import("../../index.js").SamplerFilter;
|
|
24
|
+
/** @inheritDoc */
|
|
25
|
+
readonly mipmapFilter: MipMapSamplerFilter;
|
|
26
|
+
/** @inheritDoc */
|
|
27
|
+
readonly addressModeU: import("../../index.js").SamplerAddressMode;
|
|
28
|
+
/** @inheritDoc */
|
|
29
|
+
readonly addressModeV: import("../../index.js").SamplerAddressMode;
|
|
30
|
+
/** @inheritDoc */
|
|
31
|
+
readonly addressModeW: import("../../index.js").SamplerAddressMode;
|
|
32
|
+
/** The WebGPU sampler. */
|
|
33
|
+
get gpuSampler(): GpuSampler;
|
|
34
|
+
/** @inheritDoc */
|
|
35
|
+
get handle(): any;
|
|
36
|
+
/** @inheritDoc */
|
|
37
|
+
dispose(): void;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=WebGpuSampler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebGpuSampler.d.ts","sourceRoot":"","sources":["../../../src/webgpu/sampler/WebGpuSampler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,oDAAoD,CAAC;AACrF,OAAO,EAAC,KAAK,QAAQ,EAAE,mBAAmB,EAAC,MAAM,oBAAoB,CAAC;AACtE,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAGlD;;;GAGG;AACH,qBAAa,aAAc,YAAW,QAAQ;IAE1C,OAAO,CAAC,MAAM,CAAC,OAAO,CAAK;IAE3B,OAAO,CAAC,WAAW,CAAoB;IAEvC;;;;OAIG;gBACgB,cAAc,EAAE,oBAAoB,EAAE,UAAU,CAAC,EAAE,iBAAiB;IAuBvF,kBAAkB;IAClB,SAAgB,EAAE,EAAE,MAAM,CAAC;IAE3B,kBAAkB;IAClB,SAAgB,SAAS,yCAAC;IAE1B,kBAAkB;IAClB,SAAgB,SAAS,yCAAC;IAE1B,kBAAkB;IAClB,SAAgB,YAAY,sBAAC;IAE7B,kBAAkB;IAClB,SAAgB,YAAY,8CAAC;IAE7B,kBAAkB;IAClB,SAAgB,YAAY,8CAAC;IAE7B,kBAAkB;IAClB,SAAgB,YAAY,8CAAC;IAE7B,0BAA0B;IAC1B,IAAW,UAAU,IAAI,UAAU,CAKlC;IAED,kBAAkB;IAClB,IAAW,MAAM,IAAI,GAAG,CAEvB;IAED,kBAAkB;IACX,OAAO,IAAI,IAAI;CAIzB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type IFramework, type IShaderModule, ShaderStage } from "../../api/index.js";
|
|
2
|
+
import type { GpuShaderModule } from "../WebGpuTypes.js";
|
|
3
|
+
/**
|
|
4
|
+
* A WGSL shader module. One module holds both stages (`main_vs` and `main_fs`).
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare class WebGpuShaderModule implements IShaderModule {
|
|
8
|
+
private _gpuShaderModule;
|
|
9
|
+
/**
|
|
10
|
+
* The constructor.
|
|
11
|
+
* @param framework The framework.
|
|
12
|
+
* @param id The built-in shader id, for example `unlit_material`.
|
|
13
|
+
* @param keyValueDictionary Optional `##KEY##` replacements, like the WebGL loader.
|
|
14
|
+
*/
|
|
15
|
+
constructor(framework: IFramework, id: string, keyValueDictionary?: {
|
|
16
|
+
[id: string]: number;
|
|
17
|
+
});
|
|
18
|
+
/** The shader id. */
|
|
19
|
+
readonly label: string;
|
|
20
|
+
/** @inheritDoc */
|
|
21
|
+
readonly stages: ShaderStage[];
|
|
22
|
+
/** The WebGPU shader module. */
|
|
23
|
+
get gpuShaderModule(): GpuShaderModule;
|
|
24
|
+
/** @inheritDoc */
|
|
25
|
+
get nativeHandle(): any;
|
|
26
|
+
/** @inheritDoc */
|
|
27
|
+
dispose(): void;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=WebGpuShaderModule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebGpuShaderModule.d.ts","sourceRoot":"","sources":["../../../src/webgpu/shader/WebGpuShaderModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,WAAW,EAAC,MAAM,oBAAoB,CAAC;AAEpF,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAGvD;;;GAGG;AACH,qBAAa,kBAAmB,YAAW,aAAa;IAEpD,OAAO,CAAC,gBAAgB,CAAyB;IAEjD;;;;;OAKG;gBACgB,SAAS,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE;IAsBnG,qBAAqB;IACrB,SAAgB,KAAK,EAAE,MAAM,CAAC;IAE9B,kBAAkB;IAClB,SAAgB,MAAM,EAAE,WAAW,EAAE,CAA8C;IAEnF,gCAAgC;IAChC,IAAW,eAAe,IAAI,eAAe,CAK5C;IAED,kBAAkB;IAClB,IAAW,YAAY,IAAI,GAAG,CAE7B;IAED,kBAAkB;IACX,OAAO,IAAI,IAAI;CAGzB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { IFramework, IShaderModule, IShaderModuleLoader } from "../../api/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Loads and caches WGSL shader modules by id.
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare class WebGpuShaderModuleLoader implements IShaderModuleLoader {
|
|
7
|
+
private readonly _framework;
|
|
8
|
+
private readonly _shaderModules;
|
|
9
|
+
/**
|
|
10
|
+
* The constructor.
|
|
11
|
+
* @param _framework The framework.
|
|
12
|
+
*/
|
|
13
|
+
constructor(_framework: IFramework);
|
|
14
|
+
/** @inheritDoc */
|
|
15
|
+
load(shaderModuleId: string, keyValueDictionary?: {
|
|
16
|
+
[id: string]: number;
|
|
17
|
+
}): IShaderModule;
|
|
18
|
+
/** Disposes every cached module. */
|
|
19
|
+
dispose(): void;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=WebGpuShaderModuleLoader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebGpuShaderModuleLoader.d.ts","sourceRoot":"","sources":["../../../src/webgpu/shader/WebGpuShaderModuleLoader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAE,aAAa,EAAE,mBAAmB,EAAC,MAAM,oBAAoB,CAAC;AAIvF;;;GAGG;AACH,qBAAa,wBAAyB,YAAW,mBAAmB;IAQ7C,OAAO,CAAC,QAAQ,CAAC,UAAU;IAN9C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAyC;IAExE;;;OAGG;gBACiC,UAAU,EAAE,UAAU;IAG1D,kBAAkB;IACX,IAAI,CAAC,cAAc,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,aAAa;IAUjG,oCAAoC;IAC7B,OAAO,IAAI,IAAI;CAMzB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The framework's built-in WGSL shaders, keyed by the same ids the WebGL backend uses where one exists.
|
|
3
|
+
* Every shader has `main_vs` and `main_fs` entry points.
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare const WgslShaderContent: {
|
|
7
|
+
[id: string]: string;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=WgslShaderContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WgslShaderContent.d.ts","sourceRoot":"","sources":["../../../src/webgpu/shader/WgslShaderContent.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE;IAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;CAOrD,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { vec2 } from "gl-matrix";
|
|
2
|
+
import { type ISwapChain, SwapChainDescriptor, TextureFormat } from "../../api/index.js";
|
|
3
|
+
import type { WebGpuGraphicsDevice } from "../WebGpuGraphicsDevice.js";
|
|
4
|
+
import { type GpuTextureView } from "../WebGpuTypes.js";
|
|
5
|
+
/**
|
|
6
|
+
* The WebGPU swap chain, backed by the canvas' `webgpu` context.
|
|
7
|
+
*
|
|
8
|
+
* The canvas is configured as `rgba8unorm` instead of `navigator.gpu.getPreferredCanvasFormat()` (often `bgra8unorm`),
|
|
9
|
+
* because the framework's {@link TextureFormat} has no BGRA format and the main render target uses the swap chain format.
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare class WebGpuSwapChain implements ISwapChain {
|
|
13
|
+
private readonly _canvas;
|
|
14
|
+
private readonly _graphicsDevice;
|
|
15
|
+
private readonly _context;
|
|
16
|
+
private readonly _backBufferSize;
|
|
17
|
+
private _currentView;
|
|
18
|
+
/**
|
|
19
|
+
* The constructor.
|
|
20
|
+
* @param canvas The canvas.
|
|
21
|
+
* @param graphicsDevice The graphics device.
|
|
22
|
+
* @param _descriptor The swap chain descriptor. WebGPU canvases always present with FIFO.
|
|
23
|
+
*/
|
|
24
|
+
constructor(canvas: HTMLCanvasElement, graphicsDevice: WebGpuGraphicsDevice, _descriptor?: SwapChainDescriptor);
|
|
25
|
+
private _configure;
|
|
26
|
+
/** @inheritDoc */
|
|
27
|
+
get textureFormat(): TextureFormat;
|
|
28
|
+
/** @inheritDoc */
|
|
29
|
+
get backBufferSize(): vec2;
|
|
30
|
+
/**
|
|
31
|
+
* The view of the current canvas texture. Acquired once per frame and released on {@link present}.
|
|
32
|
+
*/
|
|
33
|
+
get currentTextureView(): GpuTextureView;
|
|
34
|
+
/** @inheritDoc */
|
|
35
|
+
resize(width: number, height: number): void;
|
|
36
|
+
/** @inheritDoc */
|
|
37
|
+
present(): void;
|
|
38
|
+
/** @inheritDoc */
|
|
39
|
+
dispose(): void;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=WebGpuSwapChain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebGpuSwapChain.d.ts","sourceRoot":"","sources":["../../../src/webgpu/swap-chain/WebGpuSwapChain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAC,KAAK,UAAU,EAAE,mBAAmB,EAAE,aAAa,EAAC,MAAM,oBAAoB,CAAC;AACvF,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAyC,KAAK,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAE9F;;;;;;GAMG;AACH,qBAAa,eAAgB,YAAW,UAAU;IAE9C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;IAC5C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAuB;IACvD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmB;IAC5C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAO;IACvC,OAAO,CAAC,YAAY,CAA+B;IAEnD;;;;;OAKG;gBACgB,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,oBAAoB,EAAE,WAAW,CAAC,EAAE,mBAAmB;IAYrH,OAAO,CAAC,UAAU;IASlB,kBAAkB;IAClB,IAAW,aAAa,IAAI,aAAa,CAExC;IAED,kBAAkB;IAClB,IAAW,cAAc,IAAI,IAAI,CAEhC;IAED;;OAEG;IACH,IAAW,kBAAkB,IAAI,cAAc,CAK9C;IAED,kBAAkB;IACX,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAWlD,kBAAkB;IACX,OAAO,IAAI,IAAI;IAOtB,kBAAkB;IACX,OAAO,IAAI,IAAI;CAIzB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type IFramework, TextureDescriptor, type ITextureView, TextureViewDescriptor } from "../../api/index.js";
|
|
2
|
+
import { ATexture2D } from "../../core/rendering/texture/texture.js";
|
|
3
|
+
import { type GpuTexture, type GpuTextureView } from "../WebGpuTypes.js";
|
|
4
|
+
/**
|
|
5
|
+
* The WebGPU 2D texture.
|
|
6
|
+
*
|
|
7
|
+
* Supports uncompressed formats with `Uint8Array` mip levels or an `HTMLImageElement`.
|
|
8
|
+
* Mipmap generation and compressed (KTX2) formats are not implemented for WebGPU yet.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare class WebGpuTexture2D extends ATexture2D {
|
|
12
|
+
private readonly _graphicsDevice;
|
|
13
|
+
private readonly _image?;
|
|
14
|
+
private _gpuTexture;
|
|
15
|
+
private _gpuDefaultView;
|
|
16
|
+
/**
|
|
17
|
+
* The constructor.
|
|
18
|
+
* @param framework The framework.
|
|
19
|
+
* @param descriptor The texture descriptor.
|
|
20
|
+
* @param image An optional image to upload instead of `descriptor.data`.
|
|
21
|
+
*/
|
|
22
|
+
constructor(framework: IFramework, descriptor: TextureDescriptor, image?: HTMLImageElement);
|
|
23
|
+
/** The WebGPU texture. */
|
|
24
|
+
get gpuTexture(): GpuTexture;
|
|
25
|
+
/** The default WebGPU view of the whole texture. */
|
|
26
|
+
get gpuDefaultView(): GpuTextureView;
|
|
27
|
+
/** @inheritDoc */
|
|
28
|
+
initialize(): void;
|
|
29
|
+
/** @inheritDoc */
|
|
30
|
+
createView(descriptor?: TextureViewDescriptor): ITextureView;
|
|
31
|
+
/** @inheritDoc */
|
|
32
|
+
dispose(): void;
|
|
33
|
+
/** One default texture per framework. */
|
|
34
|
+
private static readonly _defaultFilled;
|
|
35
|
+
/**
|
|
36
|
+
* Returns the framework's 1x1 white texture, creating it on first use.
|
|
37
|
+
* Used when a pipeline has no texture set.
|
|
38
|
+
* @param framework The framework.
|
|
39
|
+
*/
|
|
40
|
+
static getOrCreateDefault(framework: IFramework): WebGpuTexture2D;
|
|
41
|
+
/**
|
|
42
|
+
* Disposes and forgets the framework's default texture. Called from `Framework.dispose()`.
|
|
43
|
+
* @param framework The framework.
|
|
44
|
+
*/
|
|
45
|
+
static disposeDefault(framework: IFramework): void;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=WebGpuTexture2D.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebGpuTexture2D.d.ts","sourceRoot":"","sources":["../../../src/webgpu/texture/WebGpuTexture2D.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,UAAU,EAEf,iBAAiB,EAGjB,KAAK,YAAY,EACjB,qBAAqB,EAExB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAC,UAAU,EAAC,MAAM,yCAAyC,CAAC;AAEnE,OAAO,EAAkB,KAAK,UAAU,EAAE,KAAK,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAIxF;;;;;;GAMG;AACH,qBAAa,eAAgB,SAAQ,UAAU;IAE3C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAuB;IACvD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAmB;IAC3C,OAAO,CAAC,WAAW,CAA2B;IAC9C,OAAO,CAAC,eAAe,CAA+B;IAEtD;;;;;OAKG;gBACgB,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,iBAAiB,EAAE,KAAK,CAAC,EAAE,gBAAgB;IAMjG,0BAA0B;IAC1B,IAAW,UAAU,IAAI,UAAU,CAKlC;IAED,oDAAoD;IACpD,IAAW,cAAc,IAAI,cAAc,CAK1C;IAED,kBAAkB;IACX,UAAU,IAAI,IAAI;IAyEzB,kBAAkB;IACX,UAAU,CAAC,UAAU,CAAC,EAAE,qBAAqB,GAAG,YAAY;IAanE,kBAAkB;IACX,OAAO,IAAI,IAAI;IAetB,yCAAyC;IACzC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAA8C;IAEpF;;;;OAIG;WACW,kBAAkB,CAAC,SAAS,EAAE,UAAU,GAAG,eAAe;IAiBxE;;;OAGG;WACW,cAAc,CAAC,SAAS,EAAE,UAAU,GAAG,IAAI;CAK5D"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Color, type IFramework, type ITexture2D, type ITextureFactory, TextureDescriptor, TextureFormat } from "../../api/index.js";
|
|
2
|
+
import type { IKtx2Texture } from "ris-ktx2";
|
|
3
|
+
/**
|
|
4
|
+
* The WebGPU texture factory.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare class WebGpuTextureFactory implements ITextureFactory {
|
|
8
|
+
private readonly _framework;
|
|
9
|
+
/**
|
|
10
|
+
* The constructor.
|
|
11
|
+
* @param _framework The framework.
|
|
12
|
+
*/
|
|
13
|
+
constructor(_framework: IFramework);
|
|
14
|
+
/** @inheritDoc */
|
|
15
|
+
createFromKtx2(_ktxTexture: IKtx2Texture, _descriptor?: TextureDescriptor): ITexture2D;
|
|
16
|
+
/** @inheritDoc */
|
|
17
|
+
create(width: number, height: number, data?: number[] | HTMLImageElement | ArrayBufferView, channels?: number, label?: string | null | undefined, textureUsage?: number, textureFormat?: TextureFormat, useMipMaps?: boolean): ITexture2D;
|
|
18
|
+
/** @inheritDoc */
|
|
19
|
+
createEmpty(width: number, height: number, color?: Color | null, textureUsage?: number, textureFormat?: TextureFormat, label?: string | null, useMipmap?: boolean): ITexture2D;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=WebGpuTextureFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebGpuTextureFactory.d.ts","sourceRoot":"","sources":["../../../src/webgpu/texture/WebGpuTextureFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,EACL,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,iBAAiB,EACjB,aAAa,EAEhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,UAAU,CAAC;AAG3C;;;GAGG;AACH,qBAAa,oBAAqB,YAAW,eAAe;IAMrC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAJ9C;;;OAGG;gBACiC,UAAU,EAAE,UAAU;IAG1D,kBAAkB;IACX,cAAc,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,CAAC,EAAE,iBAAiB,GAAG,UAAU;IAI7F,kBAAkB;IACX,MAAM,CACT,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAC7B,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,gBAAgB,GAAG,eAAe,EACpD,QAAQ,GAAE,MAAU,EACpB,KAAK,GAAE,MAAM,GAAG,IAAI,GAAG,SAAgB,EACvC,YAAY,SAAuD,EACnE,aAAa,gBAA6B,EAC1C,UAAU,UAAQ,GAAG,UAAU;IAsCnC,kBAAkB;IACX,WAAW,CACd,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAC7B,KAAK,GAAE,KAAK,GAAG,IAAW,EAC1B,YAAY,SAAuD,EACnE,aAAa,gBAA0B,EACvC,KAAK,GAAE,MAAM,GAAG,IAAW,EAC3B,SAAS,UAAQ,GAAG,UAAU;CAkCrC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ITextureView, TextureFormat, TextureViewDimension } from "../../api/index.js";
|
|
2
|
+
import type { GpuTextureView } from "../WebGpuTypes.js";
|
|
3
|
+
/**
|
|
4
|
+
* The WebGPU texture view.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare class WebGpuTextureView implements ITextureView {
|
|
8
|
+
private _gpuTextureView;
|
|
9
|
+
/**
|
|
10
|
+
* The constructor.
|
|
11
|
+
* @param gpuTextureView The WebGPU view.
|
|
12
|
+
* @param textureFormat The view format.
|
|
13
|
+
* @param dimension The view dimension.
|
|
14
|
+
*/
|
|
15
|
+
constructor(gpuTextureView: GpuTextureView, textureFormat: TextureFormat, dimension?: TextureViewDimension);
|
|
16
|
+
/** @inheritDoc */
|
|
17
|
+
readonly textureFormat: TextureFormat;
|
|
18
|
+
/** @inheritDoc */
|
|
19
|
+
readonly dimension: TextureViewDimension;
|
|
20
|
+
/** The WebGPU view. */
|
|
21
|
+
get gpuTextureView(): GpuTextureView;
|
|
22
|
+
/** @inheritDoc */
|
|
23
|
+
dispose(): void;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=WebGpuTextureView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebGpuTextureView.d.ts","sourceRoot":"","sources":["../../../src/webgpu/texture/WebGpuTextureView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AAC1F,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAEtD;;;GAGG;AACH,qBAAa,iBAAkB,YAAW,YAAY;IAElD,OAAO,CAAC,eAAe,CAAwB;IAE/C;;;;;OAKG;gBACgB,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,uBAAoC;IAM9H,kBAAkB;IAClB,SAAgB,aAAa,EAAE,aAAa,CAAC;IAE7C,kBAAkB;IAClB,SAAgB,SAAS,EAAE,oBAAoB,CAAC;IAEhD,uBAAuB;IACvB,IAAW,cAAc,IAAI,cAAc,CAK1C;IAED,kBAAkB;IACX,OAAO,IAAI,IAAI;CAIzB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { BufferUsage, CullMode, FrontFace, LoadAction, MipMapSamplerFilter, PrimitiveTopology, SamplerAddressMode, SamplerFilter, StoreAction, TextureFormat, TextureUsage, type IVertexBufferLayout } from "../../api/index.js";
|
|
2
|
+
import { VertexFormat } from "../../api/geometry/VertexFormat.js";
|
|
3
|
+
import { BlendFactor, BlendOperation } from "../../core/rendering/blending/enums.js";
|
|
4
|
+
import { type GpuAddressMode, type GpuBlendFactor, type GpuBlendOperation, type GpuCullMode, type GpuFilterMode, type GpuFrontFace, type GpuLoadOp, type GpuPrimitiveTopology, type GpuStoreOp, type GpuTextureFormat, type GpuVertexBufferLayout, type GpuVertexFormat } from "../WebGpuTypes.js";
|
|
5
|
+
/**
|
|
6
|
+
* Converts framework enums to WebGPU values.
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare class WebGpuConverter {
|
|
10
|
+
/** Converts buffer usage flags. */
|
|
11
|
+
static convertBufferUsage(usage: BufferUsage): number;
|
|
12
|
+
/** Converts texture usage flags. `TextureUsage.NONE` maps to 0. */
|
|
13
|
+
static convertTextureUsage(usage: TextureUsage): number;
|
|
14
|
+
/** Converts a texture format. Throws for formats the WebGPU backend does not support yet. */
|
|
15
|
+
static convertTextureFormat(format: TextureFormat): GpuTextureFormat;
|
|
16
|
+
/** Whether the format has a stencil aspect. */
|
|
17
|
+
static hasStencil(format: TextureFormat): boolean;
|
|
18
|
+
/** Whether the format is a depth (or depth-stencil) format. */
|
|
19
|
+
static isDepthFormat(format: TextureFormat): boolean;
|
|
20
|
+
/** Converts a load action. WebGPU has no "don't care", so `UNDEFINED` clears. */
|
|
21
|
+
static convertLoadAction(action: LoadAction): GpuLoadOp;
|
|
22
|
+
/** Converts a store action. */
|
|
23
|
+
static convertStoreAction(action: StoreAction): GpuStoreOp;
|
|
24
|
+
/** Converts a sampler address mode. WebGPU has no border clamp, so it falls back to clamp to edge. */
|
|
25
|
+
static convertAddressMode(mode: SamplerAddressMode): GpuAddressMode;
|
|
26
|
+
/** Converts a sampler filter. */
|
|
27
|
+
static convertFilter(filter: SamplerFilter): GpuFilterMode;
|
|
28
|
+
/** Converts a mip map filter. `NONE` maps to nearest; the sampler then clamps to mip 0. */
|
|
29
|
+
static convertMipMapFilter(filter: MipMapSamplerFilter): GpuFilterMode;
|
|
30
|
+
/** Converts a blend factor. */
|
|
31
|
+
static convertBlendFactor(factor: BlendFactor): GpuBlendFactor;
|
|
32
|
+
/** Converts a blend operation. */
|
|
33
|
+
static convertBlendOperation(operation: BlendOperation): GpuBlendOperation;
|
|
34
|
+
/** Converts a primitive topology. */
|
|
35
|
+
static convertTopology(topology: PrimitiveTopology): GpuPrimitiveTopology;
|
|
36
|
+
/** Converts a cull mode. */
|
|
37
|
+
static convertCullMode(mode: CullMode): GpuCullMode;
|
|
38
|
+
/** Converts a front face. */
|
|
39
|
+
static convertFrontFace(face: FrontFace): GpuFrontFace;
|
|
40
|
+
/** Converts a vertex format. */
|
|
41
|
+
static convertVertexFormat(format: VertexFormat): GpuVertexFormat;
|
|
42
|
+
/** Converts a vertex buffer layout. */
|
|
43
|
+
static convertVertexBufferLayout(layout: IVertexBufferLayout): GpuVertexBufferLayout;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=WebGpuConverter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebGpuConverter.d.ts","sourceRoot":"","sources":["../../../src/webgpu/utilities/WebGpuConverter.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,WAAW,EACX,QAAQ,EACR,SAAS,EACT,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,aAAa,EACb,YAAY,EAEZ,KAAK,mBAAmB,EAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAC,YAAY,EAAC,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAC,WAAW,EAAE,cAAc,EAAC,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAGH,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,oBAAoB,EACzB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACvB,MAAM,mBAAmB,CAAC;AAE3B;;;GAGG;AACH,qBAAa,eAAe;IAExB,mCAAmC;WACrB,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM;IAW5D,mEAAmE;WACrD,mBAAmB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM;IAU9D,6FAA6F;WAC/E,oBAAoB,CAAC,MAAM,EAAE,aAAa,GAAG,gBAAgB;IAmG3E,+CAA+C;WACjC,UAAU,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO;IAIxD,+DAA+D;WACjD,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO;IAI3D,iFAAiF;WACnE,iBAAiB,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS;IAI9D,+BAA+B;WACjB,kBAAkB,CAAC,MAAM,EAAE,WAAW,GAAG,UAAU;IAIjE,sGAAsG;WACxF,kBAAkB,CAAC,IAAI,EAAE,kBAAkB,GAAG,cAAc;IAW1E,iCAAiC;WACnB,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,aAAa;IAIjE,2FAA2F;WAC7E,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,GAAG,aAAa;IAI7E,+BAA+B;WACjB,kBAAkB,CAAC,MAAM,EAAE,WAAW,GAAG,cAAc;IAarE,kCAAkC;WACpB,qBAAqB,CAAC,SAAS,EAAE,cAAc,GAAG,iBAAiB;IAiBjF,qCAAqC;WACvB,eAAe,CAAC,QAAQ,EAAE,iBAAiB,GAAG,oBAAoB;IAehF,4BAA4B;WACd,eAAe,CAAC,IAAI,EAAE,QAAQ,GAAG,WAAW;IAW1D,6BAA6B;WACf,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,YAAY;IAI7D,gCAAgC;WAClB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,eAAe;IAexE,uCAAuC;WACzB,yBAAyB,CAAC,MAAM,EAAE,mBAAmB,GAAG,qBAAqB;CAW9F"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ris-framework",
|
|
3
|
-
"version": "0.2.0-dev.
|
|
3
|
+
"version": "0.2.0-dev.13",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"gl-matrix": "^3.4.4",
|
|
37
|
-
"ris-ktx2": "^0.
|
|
37
|
+
"ris-ktx2": "^0.2.0-dev.13"
|
|
38
38
|
},
|
|
39
39
|
"files": [
|
|
40
40
|
"dist",
|