ris-framework 0.2.0-dev.11 → 0.2.0-dev.12

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.
Files changed (257) hide show
  1. package/CHANGELOG.md +22 -29
  2. package/README.md +13 -1
  3. package/dist/Framework.d.ts +26 -8
  4. package/dist/Framework.d.ts.map +1 -1
  5. package/dist/api/IFramework.d.ts +43 -0
  6. package/dist/api/IFramework.d.ts.map +1 -1
  7. package/dist/api/_export.d.ts +1 -1
  8. package/dist/api/_export.d.ts.map +1 -1
  9. package/dist/api/content/ContentManager.d.ts +5 -57
  10. package/dist/api/content/ContentManager.d.ts.map +1 -1
  11. package/dist/api/content/IContentManager.d.ts +24 -21
  12. package/dist/api/content/IContentManager.d.ts.map +1 -1
  13. package/dist/api/lights/LightsBuffer.d.ts +13 -6
  14. package/dist/api/lights/LightsBuffer.d.ts.map +1 -1
  15. package/dist/api/loaders/ObjGeometryMapper.d.ts +2 -2
  16. package/dist/api/loaders/ObjLoader.d.ts +61 -0
  17. package/dist/api/loaders/ObjLoader.d.ts.map +1 -0
  18. package/dist/api/loaders/_export.d.ts +1 -0
  19. package/dist/api/loaders/_export.d.ts.map +1 -1
  20. package/dist/api/loaders/obj/{ObjLoader.d.ts → ObjParser.d.ts} +20 -5
  21. package/dist/api/loaders/obj/ObjParser.d.ts.map +1 -0
  22. package/dist/api/loaders/obj/ObjTypes.d.ts +17 -1
  23. package/dist/api/loaders/obj/ObjTypes.d.ts.map +1 -1
  24. package/dist/api/loaders/obj/index.d.ts +1 -1
  25. package/dist/api/material/ForwardBlinnPhongMaterial.d.ts +22 -11
  26. package/dist/api/material/ForwardBlinnPhongMaterial.d.ts.map +1 -1
  27. package/dist/api/material/ICameraMaterial.d.ts +18 -0
  28. package/dist/api/material/ICameraMaterial.d.ts.map +1 -0
  29. package/dist/api/material/ILightsMaterial.d.ts +26 -0
  30. package/dist/api/material/ILightsMaterial.d.ts.map +1 -0
  31. package/dist/api/material/IMaterial.d.ts +2 -8
  32. package/dist/api/material/IMaterial.d.ts.map +1 -1
  33. package/dist/api/material/InspectTextureMipsMaterial.d.ts +2 -2
  34. package/dist/api/material/InspectTextureMipsMaterial.d.ts.map +1 -1
  35. package/dist/api/material/SpriteMaterial.d.ts +2 -2
  36. package/dist/api/material/SpriteMaterial.d.ts.map +1 -1
  37. package/dist/api/material/UnlitMaterial.d.ts +4 -3
  38. package/dist/api/material/UnlitMaterial.d.ts.map +1 -1
  39. package/dist/api/material/_export.d.ts +2 -0
  40. package/dist/api/material/_export.d.ts.map +1 -1
  41. package/dist/api/meshes/IMesh.d.ts +29 -34
  42. package/dist/api/meshes/IMesh.d.ts.map +1 -1
  43. package/dist/api/meshes/IMeshFactory.d.ts +13 -8
  44. package/dist/api/meshes/IMeshFactory.d.ts.map +1 -1
  45. package/dist/api/meshes/IRenderableMesh.d.ts +47 -0
  46. package/dist/api/meshes/IRenderableMesh.d.ts.map +1 -0
  47. package/dist/api/meshes/Mesh.d.ts +11 -57
  48. package/dist/api/meshes/Mesh.d.ts.map +1 -1
  49. package/dist/api/meshes/MeshFactory.d.ts +6 -3
  50. package/dist/api/meshes/MeshFactory.d.ts.map +1 -1
  51. package/dist/api/meshes/QuadMesh.d.ts +3 -5
  52. package/dist/api/meshes/QuadMesh.d.ts.map +1 -1
  53. package/dist/api/meshes/RenderableMesh.d.ts +95 -0
  54. package/dist/api/meshes/RenderableMesh.d.ts.map +1 -0
  55. package/dist/api/meshes/_export.d.ts +2 -1
  56. package/dist/api/meshes/_export.d.ts.map +1 -1
  57. package/dist/api/rendering/IGraphicsDeviceFeatures.d.ts +8 -2
  58. package/dist/api/rendering/IGraphicsDeviceFeatures.d.ts.map +1 -1
  59. package/dist/api/rendering/IRenderer.d.ts +28 -1
  60. package/dist/api/rendering/IRenderer.d.ts.map +1 -1
  61. package/dist/api/rendering/enums.d.ts +7 -0
  62. package/dist/api/rendering/enums.d.ts.map +1 -1
  63. package/dist/api/rendering/renderer-interface.d.ts +1 -31
  64. package/dist/api/rendering/renderer-interface.d.ts.map +1 -1
  65. package/dist/api/rendering/renderpass/RenderPassDescriptor.d.ts +2 -6
  66. package/dist/api/rendering/renderpass/RenderPassDescriptor.d.ts.map +1 -1
  67. package/dist/api/rendering/swapchain/ISwapChain.d.ts +1 -3
  68. package/dist/api/rendering/swapchain/ISwapChain.d.ts.map +1 -1
  69. package/dist/api/rendering/texture/TextureFormat.d.ts +88 -14
  70. package/dist/api/rendering/texture/TextureFormat.d.ts.map +1 -1
  71. package/dist/api/rendering/texture/TextureUtilities.d.ts +23 -0
  72. package/dist/api/rendering/texture/TextureUtilities.d.ts.map +1 -1
  73. package/dist/api/scene/Scene.d.ts +30 -21
  74. package/dist/api/scene/Scene.d.ts.map +1 -1
  75. package/dist/api/scene/SceneMesh.d.ts +27 -0
  76. package/dist/api/scene/SceneMesh.d.ts.map +1 -0
  77. package/dist/api/utilities/AlignUtilities.d.ts.map +1 -1
  78. package/dist/api/window/WindowManager.d.ts.map +1 -1
  79. package/dist/core/rendering/ARenderer.d.ts +5 -5
  80. package/dist/core/rendering/ARenderer.d.ts.map +1 -1
  81. package/dist/index.d.ts +0 -1
  82. package/dist/index.d.ts.map +1 -1
  83. package/dist/index.js +4006 -1355
  84. package/dist/webgl/WebGLGraphicsDeviceFeatures.d.ts +4 -0
  85. package/dist/webgl/WebGLGraphicsDeviceFeatures.d.ts.map +1 -1
  86. package/dist/webgl/WebGlRenderer.d.ts +1 -3
  87. package/dist/webgl/WebGlRenderer.d.ts.map +1 -1
  88. package/dist/webgl/lights/WebGlLightsBuffer.d.ts +8 -4
  89. package/dist/webgl/lights/WebGlLightsBuffer.d.ts.map +1 -1
  90. package/dist/webgl/render-pipelines/WebGlMainRenderTargetRenderPipeline.d.ts +2 -0
  91. package/dist/webgl/render-pipelines/WebGlMainRenderTargetRenderPipeline.d.ts.map +1 -1
  92. package/dist/webgl/swap-chain/WebGlSwapChain.d.ts +3 -2
  93. package/dist/webgl/swap-chain/WebGlSwapChain.d.ts.map +1 -1
  94. package/dist/webgl/texture/WebGlTextureFactory.d.ts +7 -0
  95. package/dist/webgl/texture/WebGlTextureFactory.d.ts.map +1 -1
  96. package/dist/webgl/utilities/WebGlConstants.d.ts +91 -0
  97. package/dist/webgl/utilities/WebGlConstants.d.ts.map +1 -0
  98. package/dist/webgl/utilities/WebGlConverter.d.ts +0 -7
  99. package/dist/webgl/utilities/WebGlConverter.d.ts.map +1 -1
  100. package/dist/webgl/utilities/WebGlErrorUtilities.d.ts +10 -0
  101. package/dist/webgl/utilities/WebGlErrorUtilities.d.ts.map +1 -0
  102. package/dist/webgl/utilities/WebGlTextureUtilities.d.ts.map +1 -1
  103. package/dist/webgl/utilities/WebGlUtilities.d.ts +3 -0
  104. package/dist/webgl/utilities/WebGlUtilities.d.ts.map +1 -1
  105. package/dist/webgpu/WebGpuGpuInfo.d.ts +28 -0
  106. package/dist/webgpu/WebGpuGpuInfo.d.ts.map +1 -0
  107. package/dist/webgpu/WebGpuGraphicsDevice.d.ts +80 -0
  108. package/dist/webgpu/WebGpuGraphicsDevice.d.ts.map +1 -0
  109. package/dist/webgpu/WebGpuGraphicsDeviceFeatures.d.ts +26 -0
  110. package/dist/webgpu/WebGpuGraphicsDeviceFeatures.d.ts.map +1 -0
  111. package/dist/webgpu/WebGpuRenderer.d.ts +26 -0
  112. package/dist/webgpu/WebGpuRenderer.d.ts.map +1 -0
  113. package/dist/webgpu/WebGpuTypes.d.ts +355 -0
  114. package/dist/webgpu/WebGpuTypes.d.ts.map +1 -0
  115. package/dist/webgpu/blending/WebGpuBlendState.d.ts +30 -0
  116. package/dist/webgpu/blending/WebGpuBlendState.d.ts.map +1 -0
  117. package/dist/webgpu/buffers/WebGpuBuffersFactory.d.ts +20 -0
  118. package/dist/webgpu/buffers/WebGpuBuffersFactory.d.ts.map +1 -0
  119. package/dist/webgpu/buffers/WebGpuIndexBuffer.d.ts +46 -0
  120. package/dist/webgpu/buffers/WebGpuIndexBuffer.d.ts.map +1 -0
  121. package/dist/webgpu/buffers/WebGpuUniformBuffer.d.ts +43 -0
  122. package/dist/webgpu/buffers/WebGpuUniformBuffer.d.ts.map +1 -0
  123. package/dist/webgpu/buffers/WebGpuVertexBuffer.d.ts +49 -0
  124. package/dist/webgpu/buffers/WebGpuVertexBuffer.d.ts.map +1 -0
  125. package/dist/webgpu/primitive/WebGpuPrimitiveState.d.ts +32 -0
  126. package/dist/webgpu/primitive/WebGpuPrimitiveState.d.ts.map +1 -0
  127. package/dist/webgpu/render-pass/WebGpuRenderPass.d.ts +28 -0
  128. package/dist/webgpu/render-pass/WebGpuRenderPass.d.ts.map +1 -0
  129. package/dist/webgpu/render-pipelines/AWebGpuRenderPipeline.d.ts +50 -0
  130. package/dist/webgpu/render-pipelines/AWebGpuRenderPipeline.d.ts.map +1 -0
  131. package/dist/webgpu/render-pipelines/WebGpuMainRenderTargetRenderPipeline.d.ts +34 -0
  132. package/dist/webgpu/render-pipelines/WebGpuMainRenderTargetRenderPipeline.d.ts.map +1 -0
  133. package/dist/webgpu/render-pipelines/WebGpuRenderPipelineFactory.d.ts +26 -0
  134. package/dist/webgpu/render-pipelines/WebGpuRenderPipelineFactory.d.ts.map +1 -0
  135. package/dist/webgpu/render-pipelines/material/AWebGpuMeshRenderPipeline.d.ts +72 -0
  136. package/dist/webgpu/render-pipelines/material/AWebGpuMeshRenderPipeline.d.ts.map +1 -0
  137. package/dist/webgpu/render-pipelines/material/WebGpuUnlitRenderPipeline.d.ts +40 -0
  138. package/dist/webgpu/render-pipelines/material/WebGpuUnlitRenderPipeline.d.ts.map +1 -0
  139. package/dist/webgpu/sampler/WebGpuSampler.d.ts +39 -0
  140. package/dist/webgpu/sampler/WebGpuSampler.d.ts.map +1 -0
  141. package/dist/webgpu/shader/WebGpuShaderModule.d.ts +29 -0
  142. package/dist/webgpu/shader/WebGpuShaderModule.d.ts.map +1 -0
  143. package/dist/webgpu/shader/WebGpuShaderModuleLoader.d.ts +21 -0
  144. package/dist/webgpu/shader/WebGpuShaderModuleLoader.d.ts.map +1 -0
  145. package/dist/webgpu/shader/WgslShaderContent.d.ts +9 -0
  146. package/dist/webgpu/shader/WgslShaderContent.d.ts.map +1 -0
  147. package/dist/webgpu/swap-chain/WebGpuSwapChain.d.ts +41 -0
  148. package/dist/webgpu/swap-chain/WebGpuSwapChain.d.ts.map +1 -0
  149. package/dist/webgpu/texture/WebGpuTexture2D.d.ts +47 -0
  150. package/dist/webgpu/texture/WebGpuTexture2D.d.ts.map +1 -0
  151. package/dist/webgpu/texture/WebGpuTextureFactory.d.ts +21 -0
  152. package/dist/webgpu/texture/WebGpuTextureFactory.d.ts.map +1 -0
  153. package/dist/webgpu/texture/WebGpuTextureView.d.ts +25 -0
  154. package/dist/webgpu/texture/WebGpuTextureView.d.ts.map +1 -0
  155. package/dist/webgpu/utilities/WebGpuConverter.d.ts +45 -0
  156. package/dist/webgpu/utilities/WebGpuConverter.d.ts.map +1 -0
  157. package/package.json +2 -2
  158. package/shaders/glsl/main_render_target_flip_y_fs.glsl +35 -1
  159. package/shaders/wgsl/forward_blinn_phong_material.wgsl +150 -0
  160. package/shaders/wgsl/inspect_texture_mips.wgsl +51 -0
  161. package/shaders/wgsl/main_frame_buffer.wgsl +35 -0
  162. package/shaders/wgsl/main_render_target_flip_y.wgsl +35 -0
  163. package/shaders/wgsl/sprite.wgsl +40 -0
  164. package/shaders/wgsl/unlit_material.wgsl +49 -0
  165. package/src/Framework.ts +121 -37
  166. package/src/api/IFramework.ts +55 -0
  167. package/src/api/_export.ts +1 -1
  168. package/src/api/content/ContentManager.ts +46 -180
  169. package/src/api/content/IContentManager.ts +25 -21
  170. package/src/api/lights/LightsBuffer.ts +13 -6
  171. package/src/api/loaders/ObjGeometryMapper.ts +2 -2
  172. package/src/api/loaders/ObjLoader.ts +126 -0
  173. package/src/api/loaders/_export.ts +1 -0
  174. package/src/api/loaders/obj/{ObjLoader.ts → ObjParser.ts} +35 -4
  175. package/src/api/loaders/obj/ObjTypes.ts +19 -1
  176. package/src/api/loaders/obj/index.ts +1 -1
  177. package/src/api/material/ForwardBlinnPhongMaterial.ts +48 -22
  178. package/src/api/material/ICameraMaterial.ts +22 -0
  179. package/src/api/material/ILightsMaterial.ts +32 -0
  180. package/src/api/material/IMaterial.ts +2 -9
  181. package/src/api/material/InspectTextureMipsMaterial.ts +2 -2
  182. package/src/api/material/SpriteMaterial.ts +2 -2
  183. package/src/api/material/UnlitMaterial.ts +4 -3
  184. package/src/api/material/_export.ts +2 -0
  185. package/src/api/meshes/IMesh.ts +32 -37
  186. package/src/api/meshes/IMeshFactory.ts +14 -8
  187. package/src/api/meshes/IRenderableMesh.ts +58 -0
  188. package/src/api/meshes/Mesh.ts +17 -132
  189. package/src/api/meshes/MeshFactory.ts +14 -5
  190. package/src/api/meshes/QuadMesh.ts +4 -6
  191. package/src/api/meshes/RenderableMesh.ts +207 -0
  192. package/src/api/meshes/_export.ts +6 -5
  193. package/src/api/rendering/IGraphicsDeviceFeatures.ts +28 -21
  194. package/src/api/rendering/IRenderer.ts +34 -1
  195. package/src/api/rendering/enums.ts +10 -0
  196. package/src/api/rendering/renderer-interface.ts +1 -36
  197. package/src/api/rendering/renderpass/RenderPassDescriptor.ts +10 -14
  198. package/src/api/rendering/swapchain/ISwapChain.ts +1 -3
  199. package/src/api/rendering/texture/TextureFormat.ts +128 -14
  200. package/src/api/rendering/texture/TextureUtilities.ts +225 -10
  201. package/src/api/scene/Scene.ts +102 -69
  202. package/src/api/scene/SceneMesh.ts +61 -0
  203. package/src/api/sprites/SpriteBatchMesh.ts +1 -1
  204. package/src/api/utilities/AlignUtilities.ts +2 -1
  205. package/src/api/window/WindowManager.ts +1 -1
  206. package/src/core/rendering/ARenderer.ts +24 -15
  207. package/src/index.ts +0 -1
  208. package/src/main.ts +2 -3
  209. package/src/webgl/WebGLGraphicsDeviceFeatures.ts +12 -2
  210. package/src/webgl/WebGlGpuInfo.ts +1 -1
  211. package/src/webgl/WebGlRenderer.ts +2 -5
  212. package/src/webgl/lights/WebGlLightsBuffer.ts +14 -4
  213. package/src/webgl/render-pipelines/WebGlMainRenderTargetRenderPipeline.ts +18 -1
  214. package/src/webgl/swap-chain/WebGlSwapChain.ts +7 -6
  215. package/src/webgl/texture/WebGlTextureFactory.ts +49 -7
  216. package/src/webgl/utilities/WebGlConstants.ts +136 -0
  217. package/src/webgl/utilities/WebGlConverter.ts +91 -22
  218. package/src/webgl/utilities/WebGlErrorUtilities.ts +15 -0
  219. package/src/webgl/utilities/WebGlTextureUtilities.ts +5 -2
  220. package/src/webgl/utilities/WebGlUtilities.ts +4 -0
  221. package/src/webgpu/WebGpuGpuInfo.ts +61 -0
  222. package/src/webgpu/WebGpuGraphicsDevice.ts +199 -0
  223. package/src/webgpu/WebGpuGraphicsDeviceFeatures.ts +41 -0
  224. package/src/webgpu/WebGpuRenderer.ts +49 -0
  225. package/src/webgpu/WebGpuTypes.ts +288 -0
  226. package/src/webgpu/blending/WebGpuBlendState.ts +53 -0
  227. package/src/webgpu/buffers/WebGpuBuffersFactory.ts +46 -0
  228. package/src/webgpu/buffers/WebGpuIndexBuffer.ts +118 -0
  229. package/src/webgpu/buffers/WebGpuUniformBuffer.ts +102 -0
  230. package/src/webgpu/buffers/WebGpuVertexBuffer.ts +119 -0
  231. package/src/webgpu/primitive/WebGpuPrimitiveState.ts +52 -0
  232. package/src/webgpu/render-pass/WebGpuRenderPass.ts +131 -0
  233. package/src/webgpu/render-pipelines/AWebGpuRenderPipeline.ts +123 -0
  234. package/src/webgpu/render-pipelines/WebGpuMainRenderTargetRenderPipeline.ts +119 -0
  235. package/src/webgpu/render-pipelines/WebGpuRenderPipelineFactory.ts +66 -0
  236. package/src/webgpu/render-pipelines/material/AWebGpuMeshRenderPipeline.ts +249 -0
  237. package/src/webgpu/render-pipelines/material/WebGpuUnlitRenderPipeline.ts +101 -0
  238. package/src/webgpu/sampler/WebGpuSampler.ts +84 -0
  239. package/src/webgpu/shader/WebGpuShaderModule.ts +65 -0
  240. package/src/webgpu/shader/WebGpuShaderModuleLoader.ts +38 -0
  241. package/src/webgpu/shader/WgslShaderContent.ts +20 -0
  242. package/src/webgpu/swap-chain/WebGpuSwapChain.ts +93 -0
  243. package/src/webgpu/texture/WebGpuTexture2D.ts +197 -0
  244. package/src/webgpu/texture/WebGpuTextureFactory.ts +118 -0
  245. package/src/webgpu/texture/WebGpuTextureView.ts +43 -0
  246. package/src/webgpu/utilities/WebGpuConverter.ts +299 -0
  247. package/src/wgsl-raw.d.ts +4 -0
  248. package/dist/api/FrameworkConfiguration.d.ts +0 -23
  249. package/dist/api/FrameworkConfiguration.d.ts.map +0 -1
  250. package/dist/api/IFrameworkConfiguration.d.ts +0 -25
  251. package/dist/api/IFrameworkConfiguration.d.ts.map +0 -1
  252. package/dist/api/loaders/obj/ObjLoader.d.ts.map +0 -1
  253. package/dist/api/meshes/SubMesh.d.ts +0 -47
  254. package/dist/api/meshes/SubMesh.d.ts.map +0 -1
  255. package/src/api/FrameworkConfiguration.ts +0 -29
  256. package/src/api/IFrameworkConfiguration.ts +0 -30
  257. package/src/api/meshes/SubMesh.ts +0 -71
@@ -0,0 +1,355 @@
1
+ /**
2
+ * Minimal hand-written WebGPU type declarations used by the WebGPU backend.
3
+ *
4
+ * TypeScript 5.9's `lib.dom` does not ship the WebGPU API, and the project avoids adding `@webgpu/types`.
5
+ * The types are module-scoped (prefixed with `Gpu`) instead of global, so they never clash with `@webgpu/types`
6
+ * in a consumer's project. Only what the backend uses is declared.
7
+ * @internal
8
+ */
9
+ /** `GPUBufferUsage` flags. */
10
+ export declare const GpuBufferUsage: {
11
+ readonly MAP_READ: 1;
12
+ readonly MAP_WRITE: 2;
13
+ readonly COPY_SRC: 4;
14
+ readonly COPY_DST: 8;
15
+ readonly INDEX: 16;
16
+ readonly VERTEX: 32;
17
+ readonly UNIFORM: 64;
18
+ readonly STORAGE: 128;
19
+ readonly INDIRECT: 256;
20
+ readonly QUERY_RESOLVE: 512;
21
+ };
22
+ /** `GPUTextureUsage` flags. */
23
+ export declare const GpuTextureUsage: {
24
+ readonly COPY_SRC: 1;
25
+ readonly COPY_DST: 2;
26
+ readonly TEXTURE_BINDING: 4;
27
+ readonly STORAGE_BINDING: 8;
28
+ readonly RENDER_ATTACHMENT: 16;
29
+ };
30
+ /** `GPUShaderStage` flags. */
31
+ export declare const GpuShaderStage: {
32
+ readonly VERTEX: 1;
33
+ readonly FRAGMENT: 2;
34
+ readonly COMPUTE: 4;
35
+ };
36
+ export type GpuTextureFormat = string;
37
+ export type GpuPowerPreference = "low-power" | "high-performance";
38
+ export type GpuLoadOp = "load" | "clear";
39
+ export type GpuStoreOp = "store" | "discard";
40
+ export type GpuIndexFormat = "uint16" | "uint32";
41
+ export type GpuPrimitiveTopology = "point-list" | "line-list" | "line-strip" | "triangle-list" | "triangle-strip";
42
+ export type GpuCullMode = "none" | "front" | "back";
43
+ export type GpuFrontFace = "ccw" | "cw";
44
+ export type GpuBlendFactor = "zero" | "one" | "src-alpha" | "one-minus-src-alpha" | string;
45
+ export type GpuBlendOperation = "add" | "subtract" | "reverse-subtract" | "min" | "max";
46
+ export type GpuAddressMode = "clamp-to-edge" | "repeat" | "mirror-repeat";
47
+ export type GpuFilterMode = "nearest" | "linear";
48
+ export type GpuCompareFunction = "never" | "less" | "equal" | "less-equal" | "greater" | "not-equal" | "greater-equal" | "always";
49
+ export type GpuVertexFormat = "float32" | "float32x2" | "float32x3" | "float32x4" | string;
50
+ export type GpuVertexStepMode = "vertex" | "instance";
51
+ export interface GpuObjectBase {
52
+ label: string;
53
+ }
54
+ export interface GpuAdapterInfo {
55
+ readonly vendor: string;
56
+ readonly architecture: string;
57
+ readonly device: string;
58
+ readonly description: string;
59
+ }
60
+ export interface GpuSupportedFeatures {
61
+ has(feature: string): boolean;
62
+ }
63
+ export interface Gpu {
64
+ requestAdapter(options?: {
65
+ powerPreference?: GpuPowerPreference;
66
+ }): Promise<GpuAdapter | null>;
67
+ getPreferredCanvasFormat(): GpuTextureFormat;
68
+ }
69
+ export interface GpuAdapter {
70
+ readonly features: GpuSupportedFeatures;
71
+ readonly info?: GpuAdapterInfo;
72
+ requestDevice(descriptor?: {
73
+ label?: string;
74
+ requiredFeatures?: string[];
75
+ }): Promise<GpuDevice>;
76
+ }
77
+ export interface GpuError {
78
+ readonly message: string;
79
+ }
80
+ export interface GpuDevice extends GpuObjectBase {
81
+ readonly features: GpuSupportedFeatures;
82
+ readonly queue: GpuQueue;
83
+ readonly lost: Promise<{
84
+ reason: string;
85
+ message: string;
86
+ }>;
87
+ createBuffer(descriptor: {
88
+ label?: string;
89
+ size: number;
90
+ usage: number;
91
+ mappedAtCreation?: boolean;
92
+ }): GpuBuffer;
93
+ createTexture(descriptor: {
94
+ label?: string;
95
+ size: [number, number, number?] | {
96
+ width: number;
97
+ height?: number;
98
+ depthOrArrayLayers?: number;
99
+ };
100
+ mipLevelCount?: number;
101
+ sampleCount?: number;
102
+ dimension?: "1d" | "2d" | "3d";
103
+ format: GpuTextureFormat;
104
+ usage: number;
105
+ }): GpuTexture;
106
+ createSampler(descriptor?: {
107
+ label?: string;
108
+ addressModeU?: GpuAddressMode;
109
+ addressModeV?: GpuAddressMode;
110
+ addressModeW?: GpuAddressMode;
111
+ magFilter?: GpuFilterMode;
112
+ minFilter?: GpuFilterMode;
113
+ mipmapFilter?: GpuFilterMode;
114
+ lodMinClamp?: number;
115
+ lodMaxClamp?: number;
116
+ compare?: GpuCompareFunction;
117
+ maxAnisotropy?: number;
118
+ }): GpuSampler;
119
+ createBindGroupLayout(descriptor: {
120
+ label?: string;
121
+ entries: GpuBindGroupLayoutEntry[];
122
+ }): GpuBindGroupLayout;
123
+ createPipelineLayout(descriptor: {
124
+ label?: string;
125
+ bindGroupLayouts: GpuBindGroupLayout[];
126
+ }): GpuPipelineLayout;
127
+ createBindGroup(descriptor: {
128
+ label?: string;
129
+ layout: GpuBindGroupLayout;
130
+ entries: GpuBindGroupEntry[];
131
+ }): GpuBindGroup;
132
+ createShaderModule(descriptor: {
133
+ label?: string;
134
+ code: string;
135
+ }): GpuShaderModule;
136
+ createRenderPipeline(descriptor: GpuRenderPipelineDescriptor): GpuRenderPipeline;
137
+ createCommandEncoder(descriptor?: {
138
+ label?: string;
139
+ }): GpuCommandEncoder;
140
+ pushErrorScope(filter: "validation" | "out-of-memory" | "internal"): void;
141
+ popErrorScope(): Promise<GpuError | null>;
142
+ addEventListener(type: "uncapturederror", listener: (event: {
143
+ error: GpuError;
144
+ }) => void): void;
145
+ destroy(): void;
146
+ }
147
+ export interface GpuQueue {
148
+ submit(commandBuffers: GpuCommandBuffer[]): void;
149
+ writeBuffer(buffer: GpuBuffer, bufferOffset: number, data: ArrayBufferLike | ArrayBufferView, dataOffset?: number, size?: number): void;
150
+ writeTexture(destination: {
151
+ texture: GpuTexture;
152
+ mipLevel?: number;
153
+ origin?: [number, number, number?];
154
+ }, data: ArrayBufferView | ArrayBufferLike, dataLayout: {
155
+ offset?: number;
156
+ bytesPerRow?: number;
157
+ rowsPerImage?: number;
158
+ }, size: [number, number, number?] | {
159
+ width: number;
160
+ height?: number;
161
+ depthOrArrayLayers?: number;
162
+ }): void;
163
+ copyExternalImageToTexture(source: {
164
+ source: any;
165
+ flipY?: boolean;
166
+ }, destination: {
167
+ texture: GpuTexture;
168
+ mipLevel?: number;
169
+ premultipliedAlpha?: boolean;
170
+ }, copySize: [number, number, number?] | {
171
+ width: number;
172
+ height?: number;
173
+ depthOrArrayLayers?: number;
174
+ }): void;
175
+ }
176
+ export interface GpuBuffer extends GpuObjectBase {
177
+ readonly size: number;
178
+ destroy(): void;
179
+ }
180
+ export interface GpuTexture extends GpuObjectBase {
181
+ readonly width: number;
182
+ readonly height: number;
183
+ readonly format: GpuTextureFormat;
184
+ createView(descriptor?: {
185
+ label?: string;
186
+ format?: GpuTextureFormat;
187
+ dimension?: string;
188
+ }): GpuTextureView;
189
+ destroy(): void;
190
+ }
191
+ export interface GpuTextureView extends GpuObjectBase {
192
+ readonly __brand?: "GPUTextureView";
193
+ }
194
+ export interface GpuSampler extends GpuObjectBase {
195
+ readonly __brand?: "GPUSampler";
196
+ }
197
+ export interface GpuBindGroupLayout extends GpuObjectBase {
198
+ readonly __brand?: "GPUBindGroupLayout";
199
+ }
200
+ export interface GpuPipelineLayout extends GpuObjectBase {
201
+ readonly __brand?: "GPUPipelineLayout";
202
+ }
203
+ export interface GpuBindGroup extends GpuObjectBase {
204
+ readonly __brand?: "GPUBindGroup";
205
+ }
206
+ export interface GpuShaderModule extends GpuObjectBase {
207
+ getCompilationInfo?(): Promise<{
208
+ messages: readonly {
209
+ type: string;
210
+ message: string;
211
+ lineNum: number;
212
+ linePos: number;
213
+ }[];
214
+ }>;
215
+ }
216
+ export interface GpuRenderPipeline extends GpuObjectBase {
217
+ readonly __brand?: "GPURenderPipeline";
218
+ }
219
+ export interface GpuCommandBuffer extends GpuObjectBase {
220
+ readonly __brand?: "GPUCommandBuffer";
221
+ }
222
+ export interface GpuBindGroupLayoutEntry {
223
+ binding: number;
224
+ visibility: number;
225
+ buffer?: {
226
+ type?: "uniform" | "storage" | "read-only-storage";
227
+ hasDynamicOffset?: boolean;
228
+ minBindingSize?: number;
229
+ };
230
+ sampler?: {
231
+ type?: "filtering" | "non-filtering" | "comparison";
232
+ };
233
+ texture?: {
234
+ sampleType?: "float" | "unfilterable-float" | "depth" | "sint" | "uint";
235
+ viewDimension?: string;
236
+ multisampled?: boolean;
237
+ };
238
+ }
239
+ export interface GpuBindGroupEntry {
240
+ binding: number;
241
+ resource: GpuSampler | GpuTextureView | {
242
+ buffer: GpuBuffer;
243
+ offset?: number;
244
+ size?: number;
245
+ };
246
+ }
247
+ export interface GpuVertexBufferLayout {
248
+ arrayStride: number;
249
+ stepMode?: GpuVertexStepMode;
250
+ attributes: {
251
+ format: GpuVertexFormat;
252
+ offset: number;
253
+ shaderLocation: number;
254
+ }[];
255
+ }
256
+ export interface GpuBlendComponent {
257
+ operation?: GpuBlendOperation;
258
+ srcFactor?: GpuBlendFactor;
259
+ dstFactor?: GpuBlendFactor;
260
+ }
261
+ export interface GpuColorTargetState {
262
+ format: GpuTextureFormat;
263
+ blend?: {
264
+ color: GpuBlendComponent;
265
+ alpha: GpuBlendComponent;
266
+ };
267
+ writeMask?: number;
268
+ }
269
+ export interface GpuDepthStencilState {
270
+ format: GpuTextureFormat;
271
+ depthWriteEnabled?: boolean;
272
+ depthCompare?: GpuCompareFunction;
273
+ }
274
+ export interface GpuRenderPipelineDescriptor {
275
+ label?: string;
276
+ layout: GpuPipelineLayout | "auto";
277
+ vertex: {
278
+ module: GpuShaderModule;
279
+ entryPoint?: string;
280
+ buffers?: GpuVertexBufferLayout[];
281
+ };
282
+ fragment?: {
283
+ module: GpuShaderModule;
284
+ entryPoint?: string;
285
+ targets: GpuColorTargetState[];
286
+ };
287
+ primitive?: {
288
+ topology?: GpuPrimitiveTopology;
289
+ cullMode?: GpuCullMode;
290
+ frontFace?: GpuFrontFace;
291
+ stripIndexFormat?: GpuIndexFormat;
292
+ };
293
+ depthStencil?: GpuDepthStencilState;
294
+ multisample?: {
295
+ count?: number;
296
+ };
297
+ }
298
+ export interface GpuRenderPassColorAttachment {
299
+ view: GpuTextureView;
300
+ resolveTarget?: GpuTextureView;
301
+ clearValue?: {
302
+ r: number;
303
+ g: number;
304
+ b: number;
305
+ a: number;
306
+ };
307
+ loadOp: GpuLoadOp;
308
+ storeOp: GpuStoreOp;
309
+ }
310
+ export interface GpuRenderPassDepthStencilAttachment {
311
+ view: GpuTextureView;
312
+ depthClearValue?: number;
313
+ depthLoadOp?: GpuLoadOp;
314
+ depthStoreOp?: GpuStoreOp;
315
+ stencilClearValue?: number;
316
+ stencilLoadOp?: GpuLoadOp;
317
+ stencilStoreOp?: GpuStoreOp;
318
+ }
319
+ export interface GpuRenderPassDescriptor {
320
+ label?: string;
321
+ colorAttachments: GpuRenderPassColorAttachment[];
322
+ depthStencilAttachment?: GpuRenderPassDepthStencilAttachment;
323
+ }
324
+ export interface GpuCommandEncoder extends GpuObjectBase {
325
+ beginRenderPass(descriptor: GpuRenderPassDescriptor): GpuRenderPassEncoder;
326
+ finish(descriptor?: {
327
+ label?: string;
328
+ }): GpuCommandBuffer;
329
+ }
330
+ export interface GpuRenderPassEncoder extends GpuObjectBase {
331
+ setPipeline(pipeline: GpuRenderPipeline): void;
332
+ setVertexBuffer(slot: number, buffer: GpuBuffer, offset?: number, size?: number): void;
333
+ setIndexBuffer(buffer: GpuBuffer, format: GpuIndexFormat, offset?: number, size?: number): void;
334
+ setBindGroup(index: number, bindGroup: GpuBindGroup): void;
335
+ drawIndexed(indexCount: number, instanceCount?: number, firstIndex?: number, baseVertex?: number, firstInstance?: number): void;
336
+ draw(vertexCount: number, instanceCount?: number, firstVertex?: number, firstInstance?: number): void;
337
+ pushDebugGroup(label: string): void;
338
+ popDebugGroup(): void;
339
+ end(): void;
340
+ }
341
+ export interface GpuCanvasContext {
342
+ configure(configuration: {
343
+ device: GpuDevice;
344
+ format: GpuTextureFormat;
345
+ usage?: number;
346
+ alphaMode?: "opaque" | "premultiplied";
347
+ }): void;
348
+ unconfigure(): void;
349
+ getCurrentTexture(): GpuTexture;
350
+ }
351
+ /**
352
+ * Returns `navigator.gpu`, or undefined when the browser has no WebGPU.
353
+ */
354
+ export declare function getNavigatorGpu(): Gpu | undefined;
355
+ //# sourceMappingURL=WebGpuTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebGpuTypes.d.ts","sourceRoot":"","sources":["../../src/webgpu/WebGpuTypes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,8BAA8B;AAC9B,eAAO,MAAM,cAAc;;;;;;;;;;;CAWjB,CAAC;AAEX,+BAA+B;AAC/B,eAAO,MAAM,eAAe;;;;;;CAMlB,CAAC;AAEX,8BAA8B;AAC9B,eAAO,MAAM,cAAc;;;;CAIjB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC;AACtC,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,kBAAkB,CAA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,EAAE,SAAS,CAAC;QAAC,MAAM,EAAE,gBAAgB,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,QAAQ,GAAG,eAAe,CAAA;KAAE,GAAG,IAAI,CAAC;IACxI,WAAW,IAAI,IAAI,CAAC;IACpB,iBAAiB,IAAI,UAAU,CAAC;CACnC;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,GAAG,GAAG,SAAS,CAKjD"}
@@ -0,0 +1,30 @@
1
+ import type { BlendStateDescriptor } from "../../core/rendering/blending/blend-state-descriptor.js";
2
+ import type { IBlendState } from "../../api/index.js";
3
+ import type { GpuBlendComponent } from "../WebGpuTypes.js";
4
+ /**
5
+ * The WebGPU blend state. WebGPU bakes blending into the render pipeline, so this only holds the converted values.
6
+ * @internal
7
+ */
8
+ export declare class WebGpuBlendState implements IBlendState {
9
+ /**
10
+ * The constructor.
11
+ * @param descriptor The blend state descriptor.
12
+ */
13
+ constructor(descriptor: BlendStateDescriptor);
14
+ /** Whether blending is enabled. */
15
+ readonly blendingEnabled: boolean;
16
+ /** The color blend component. */
17
+ readonly color: GpuBlendComponent;
18
+ /** The alpha blend component. */
19
+ readonly alpha: GpuBlendComponent;
20
+ /** The `GPUBlendState` for a color target, or undefined when blending is disabled. */
21
+ get gpuBlendState(): {
22
+ color: GpuBlendComponent;
23
+ alpha: GpuBlendComponent;
24
+ } | undefined;
25
+ /** @inheritDoc */
26
+ get nativePtr(): any;
27
+ /** @inheritDoc */
28
+ dispose(): void;
29
+ }
30
+ //# sourceMappingURL=WebGpuBlendState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebGpuBlendState.d.ts","sourceRoot":"","sources":["../../../src/webgpu/blending/WebGpuBlendState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,yDAAyD,CAAC;AAClG,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AAGzD;;;GAGG;AACH,qBAAa,gBAAiB,YAAW,WAAW;IAEhD;;;OAGG;gBACgB,UAAU,EAAE,oBAAoB;IAcnD,mCAAmC;IACnC,SAAgB,eAAe,EAAE,OAAO,CAAC;IAEzC,iCAAiC;IACjC,SAAgB,KAAK,EAAE,iBAAiB,CAAC;IAEzC,iCAAiC;IACjC,SAAgB,KAAK,EAAE,iBAAiB,CAAC;IAEzC,sFAAsF;IACtF,IAAW,aAAa,IAAI;QAAE,KAAK,EAAE,iBAAiB,CAAC;QAAC,KAAK,EAAE,iBAAiB,CAAA;KAAE,GAAG,SAAS,CAE7F;IAED,kBAAkB;IAClB,IAAW,SAAS,IAAI,GAAG,CAE1B;IAED,kBAAkB;IACX,OAAO,IAAI,IAAI;CAGzB"}
@@ -0,0 +1,20 @@
1
+ import { BufferUsage, type IBufferFactory, type IFramework, type IIndexBuffer, type IUniformBuffer, type IVertexBuffer } from "../../api/index.js";
2
+ /**
3
+ * The WebGPU buffers factory.
4
+ * @internal
5
+ */
6
+ export declare class WebGpuBuffersFactory implements IBufferFactory {
7
+ private readonly _framework;
8
+ /**
9
+ * The constructor.
10
+ * @param _framework The framework.
11
+ */
12
+ constructor(_framework: IFramework);
13
+ /** @inheritDoc */
14
+ createVertexBuffer(data: ArrayLike<number>, vertexStride: number, usage?: BufferUsage, label?: string): IVertexBuffer;
15
+ /** @inheritDoc */
16
+ createUniformBuffer(data: ArrayLike<number>, usage?: BufferUsage, label?: string): IUniformBuffer;
17
+ /** @inheritDoc */
18
+ createIndexBuffer(data: ArrayLike<number>, label?: string): IIndexBuffer;
19
+ }
20
+ //# sourceMappingURL=WebGpuBuffersFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebGpuBuffersFactory.d.ts","sourceRoot":"","sources":["../../../src/webgpu/buffers/WebGpuBuffersFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,WAAW,EACX,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,aAAa,EACrB,MAAM,oBAAoB,CAAC;AAK5B;;;GAGG;AACH,qBAAa,oBAAqB,YAAW,cAAc;IAMpC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAJ9C;;;OAGG;gBACiC,UAAU,EAAE,UAAU;IAG1D,kBAAkB;IACX,kBAAkB,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,GAAE,WAAuD,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,aAAa;IAMvK,kBAAkB;IACX,mBAAmB,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,KAAK,GAAE,WAAwD,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,cAAc;IAMpJ,kBAAkB;IACX,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,YAAY;CAKlF"}
@@ -0,0 +1,46 @@
1
+ import { BufferUsage, type IFramework, type IIndexBuffer, IndexBufferType } from "../../api/index.js";
2
+ import { type GpuBuffer, type GpuIndexFormat } from "../WebGpuTypes.js";
3
+ /**
4
+ * The WebGPU index buffer. Uses uint16 when every index fits, otherwise uint32.
5
+ * The allocation and the write are padded to 4 bytes, because WebGPU requires it (odd uint16 counts).
6
+ * @internal
7
+ */
8
+ export declare class WebGpuIndexBuffer implements IIndexBuffer {
9
+ private readonly _graphicsDevice;
10
+ private readonly _label?;
11
+ private _type;
12
+ private _elementByteSize;
13
+ private _indicesCount;
14
+ private _byteSize;
15
+ private _gpuBuffer;
16
+ /**
17
+ * The constructor.
18
+ * @param framework The framework.
19
+ * @param label The label.
20
+ */
21
+ constructor(framework: IFramework, label?: string);
22
+ /** @inheritDoc */
23
+ readonly usage: BufferUsage;
24
+ /** The WebGPU buffer. */
25
+ get gpuBuffer(): GpuBuffer;
26
+ /** The WebGPU index format. */
27
+ get gpuIndexFormat(): GpuIndexFormat;
28
+ /** The buffer size padded to 4 bytes, as used for `setIndexBuffer`. */
29
+ get paddedByteSize(): number;
30
+ /** @inheritDoc */
31
+ get type(): IndexBufferType;
32
+ /** @inheritDoc */
33
+ get elementByteSize(): number;
34
+ /** @inheritDoc */
35
+ get label(): string;
36
+ /** @inheritDoc */
37
+ get indicesCount(): number;
38
+ /** @inheritDoc */
39
+ get byteSize(): number;
40
+ private static _canUseUint16;
41
+ /** @inheritDoc */
42
+ initialize(data: ArrayLike<number>): void;
43
+ /** @inheritDoc */
44
+ dispose(): void;
45
+ }
46
+ //# sourceMappingURL=WebGpuIndexBuffer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebGpuIndexBuffer.d.ts","sourceRoot":"","sources":["../../../src/webgpu/buffers/WebGpuIndexBuffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,eAAe,EAAC,MAAM,oBAAoB,CAAC;AAEpG,OAAO,EAAiB,KAAK,SAAS,EAAE,KAAK,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAEtF;;;;GAIG;AACH,qBAAa,iBAAkB,YAAW,YAAY;IAElD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAuB;IACvD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAS;IACjC,OAAO,CAAC,KAAK,CAA2B;IACxC,OAAO,CAAC,gBAAgB,CAAK;IAC7B,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,UAAU,CAA0B;IAE5C;;;;OAIG;gBACgB,SAAS,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,MAAM;IAKxD,kBAAkB;IAClB,SAAgB,KAAK,EAAE,WAAW,CAAqB;IAEvD,yBAAyB;IACzB,IAAW,SAAS,IAAI,SAAS,CAKhC;IAED,+BAA+B;IAC/B,IAAW,cAAc,IAAI,cAAc,CAE1C;IAED,uEAAuE;IACvE,IAAW,cAAc,IAAI,MAAM,CAElC;IAED,kBAAkB;IAClB,IAAW,IAAI,IAAI,eAAe,CAEjC;IAED,kBAAkB;IAClB,IAAW,eAAe,IAAI,MAAM,CAEnC;IAED,kBAAkB;IAClB,IAAW,KAAK,IAAI,MAAM,CAEzB;IAED,kBAAkB;IAClB,IAAW,YAAY,IAAI,MAAM,CAEhC;IAED,kBAAkB;IAClB,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,OAAO,CAAC,MAAM,CAAC,aAAa;IAU5B,kBAAkB;IACX,UAAU,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,IAAI;IA0BhD,kBAAkB;IACX,OAAO,IAAI,IAAI;CAIzB"}
@@ -0,0 +1,43 @@
1
+ import { type BufferUsage, type IFramework, type IUniformBuffer } from "../../api/index.js";
2
+ import { type GpuBuffer } from "../WebGpuTypes.js";
3
+ /**
4
+ * The WebGPU uniform buffer. The size is aligned to 16 bytes and the buffer always has UNIFORM | COPY_DST.
5
+ * @internal
6
+ */
7
+ export declare class WebGpuUniformBuffer implements IUniformBuffer {
8
+ private static _nextId;
9
+ private readonly _graphicsDevice;
10
+ private readonly _data;
11
+ private readonly _byteSize;
12
+ private _gpuBuffer;
13
+ /**
14
+ * The constructor.
15
+ * @param framework The framework.
16
+ * @param dataOrFloatCount The initial float data, or the number of floats.
17
+ * @param bufferUsage The buffer usage.
18
+ * @param label The label.
19
+ */
20
+ constructor(framework: IFramework, dataOrFloatCount: ArrayLike<number> | number, bufferUsage: BufferUsage, label?: string);
21
+ /** A unique id, used to cache bind groups. */
22
+ readonly id: number;
23
+ /** @inheritDoc */
24
+ readonly label?: string;
25
+ /** @inheritDoc */
26
+ readonly usage: BufferUsage;
27
+ /** @inheritDoc */
28
+ get byteSize(): number;
29
+ /** The WebGPU buffer. */
30
+ get gpuBuffer(): GpuBuffer;
31
+ /** @inheritDoc */
32
+ initialize(): void;
33
+ /**
34
+ * Updates the buffer. Only the data's length is written.
35
+ * @param data The float data.
36
+ * @param offset The first float to write.
37
+ * @param length The number of floats to write; defaults to the data's length after the offset.
38
+ */
39
+ update(data: ArrayLike<number>, offset?: number, length?: number): void;
40
+ /** @inheritDoc */
41
+ dispose(): void;
42
+ }
43
+ //# sourceMappingURL=WebGpuUniformBuffer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebGpuUniformBuffer.d.ts","sourceRoot":"","sources":["../../../src/webgpu/buffers/WebGpuUniformBuffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAE1F,OAAO,EAAiB,KAAK,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAGjE;;;GAGG;AACH,qBAAa,mBAAoB,YAAW,cAAc;IAEtD,OAAO,CAAC,MAAM,CAAC,OAAO,CAAK;IAE3B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAuB;IACvD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAe;IACrC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,UAAU,CAA0B;IAE5C;;;;;;OAMG;gBACgB,SAAS,EAAE,UAAU,EAAE,gBAAgB,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,MAAM;IAehI,8CAA8C;IAC9C,SAAgB,EAAE,EAAE,MAAM,CAAC;IAE3B,kBAAkB;IAClB,SAAgB,KAAK,CAAC,EAAE,MAAM,CAAC;IAE/B,kBAAkB;IAClB,SAAgB,KAAK,EAAE,WAAW,CAAC;IAEnC,kBAAkB;IAClB,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,yBAAyB;IACzB,IAAW,SAAS,IAAI,SAAS,CAKhC;IAED,kBAAkB;IACX,UAAU,IAAI,IAAI;IAUzB;;;;;OAKG;IACI,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,GAAE,MAAU,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAiBjF,kBAAkB;IACX,OAAO,IAAI,IAAI;CAIzB"}
@@ -0,0 +1,49 @@
1
+ import { BufferUsage, type IFramework, type IVertexBuffer } from "../../api/index.js";
2
+ import { type GpuBuffer } from "../WebGpuTypes.js";
3
+ /**
4
+ * The WebGPU vertex buffer. Always created with COPY_DST so it can be updated.
5
+ * @internal
6
+ */
7
+ export declare class WebGpuVertexBuffer implements IVertexBuffer {
8
+ private readonly _byteStride;
9
+ private readonly _bufferUsage;
10
+ private readonly _label?;
11
+ private readonly _graphicsDevice;
12
+ private readonly _data;
13
+ private readonly _vertexCount;
14
+ private readonly _byteSize;
15
+ private _gpuBuffer;
16
+ /**
17
+ * The constructor.
18
+ * @param framework The framework.
19
+ * @param dataOrVertexCount The float vertex data, or the number of vertices to allocate.
20
+ * @param _byteStride The vertex stride in bytes.
21
+ * @param _bufferUsage The buffer usage.
22
+ * @param _label The label.
23
+ */
24
+ constructor(framework: IFramework, dataOrVertexCount: ArrayLike<number> | number, _byteStride: number, _bufferUsage: BufferUsage, _label?: string | undefined);
25
+ /** The WebGPU buffer. */
26
+ get gpuBuffer(): GpuBuffer;
27
+ /** @inheritDoc */
28
+ get label(): string | undefined;
29
+ /** @inheritDoc */
30
+ get vertexCount(): number;
31
+ /** @inheritDoc */
32
+ get byteSize(): number;
33
+ /** @inheritDoc */
34
+ get byteStride(): number;
35
+ /** @inheritDoc */
36
+ get usage(): BufferUsage;
37
+ /** @inheritDoc */
38
+ initialize(): void;
39
+ /**
40
+ * Updates the buffer.
41
+ * @param data The float data.
42
+ * @param offset The first float to write (in floats, like WebGL).
43
+ * @param length The number of floats to write; 0 writes the whole data.
44
+ */
45
+ update(data: number[], offset?: number, length?: number): void;
46
+ /** @inheritDoc */
47
+ dispose(): void;
48
+ }
49
+ //# sourceMappingURL=WebGpuVertexBuffer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebGpuVertexBuffer.d.ts","sourceRoot":"","sources":["../../../src/webgpu/buffers/WebGpuVertexBuffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAC,MAAM,oBAAoB,CAAC;AAEpF,OAAO,EAAiB,KAAK,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAGjE;;;GAGG;AACH,qBAAa,kBAAmB,YAAW,aAAa;IAkBjC,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;IAlB3C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAuB;IACvD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAe;IACrC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,UAAU,CAA0B;IAE5C;;;;;;;OAOG;gBACgB,SAAS,EAAE,UAAU,EACrB,iBAAiB,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,MAAM,EAC5B,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,WAAW,EACzB,MAAM,CAAC,EAAE,MAAM,YAAA;IAanD,yBAAyB;IACzB,IAAW,SAAS,IAAI,SAAS,CAKhC;IAED,kBAAkB;IAClB,IAAW,KAAK,IAAI,MAAM,GAAG,SAAS,CAErC;IAED,kBAAkB;IAClB,IAAW,WAAW,IAAI,MAAM,CAE/B;IAED,kBAAkB;IAClB,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,kBAAkB;IAClB,IAAW,UAAU,IAAI,MAAM,CAE9B;IAED,kBAAkB;IAClB,IAAW,KAAK,IAAI,WAAW,CAE9B;IAED,kBAAkB;IACX,UAAU,IAAI,IAAI;IAazB;;;;;OAKG;IACI,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,GAAE,MAAU,EAAE,MAAM,GAAE,MAAU,GAAG,IAAI;IAkB3E,kBAAkB;IACX,OAAO,IAAI,IAAI;CAIzB"}
@@ -0,0 +1,32 @@
1
+ import { type CullMode, type FrontFace, type IPrimitiveState, type PrimitiveStateDescriptor, type PrimitiveTopology } from "../../api/index.js";
2
+ import type { GpuCullMode, GpuFrontFace, GpuPrimitiveTopology } from "../WebGpuTypes.js";
3
+ /**
4
+ * The WebGPU primitive state. WebGPU bakes it into the render pipeline, so this only holds the converted values.
5
+ * @internal
6
+ */
7
+ export declare class WebGpuPrimitiveState implements IPrimitiveState {
8
+ /**
9
+ * The constructor.
10
+ * @param descriptor The primitive state descriptor.
11
+ */
12
+ constructor(descriptor: PrimitiveStateDescriptor);
13
+ /** @inheritDoc */
14
+ readonly topology: PrimitiveTopology;
15
+ /** @inheritDoc */
16
+ readonly cullFace: CullMode;
17
+ /** @inheritDoc */
18
+ readonly frontFace: FrontFace;
19
+ /** The WebGPU topology. */
20
+ readonly gpuTopology: GpuPrimitiveTopology;
21
+ /** The WebGPU cull mode. */
22
+ readonly gpuCullMode: GpuCullMode;
23
+ /** The WebGPU front face. */
24
+ readonly gpuFrontFace: GpuFrontFace;
25
+ /** The `GPUPrimitiveState` for a render pipeline. */
26
+ get gpuPrimitiveState(): {
27
+ topology: GpuPrimitiveTopology;
28
+ cullMode: GpuCullMode;
29
+ frontFace: GpuFrontFace;
30
+ };
31
+ }
32
+ //# sourceMappingURL=WebGpuPrimitiveState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebGpuPrimitiveState.d.ts","sourceRoot":"","sources":["../../../src/webgpu/primitive/WebGpuPrimitiveState.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAC,WAAW,EAAE,YAAY,EAAE,oBAAoB,EAAC,MAAM,mBAAmB,CAAC;AAGvF;;;GAGG;AACH,qBAAa,oBAAqB,YAAW,eAAe;IAExD;;;OAGG;gBACgB,UAAU,EAAE,wBAAwB;IASvD,kBAAkB;IAClB,SAAgB,QAAQ,EAAE,iBAAiB,CAAC;IAE5C,kBAAkB;IAClB,SAAgB,QAAQ,EAAE,QAAQ,CAAC;IAEnC,kBAAkB;IAClB,SAAgB,SAAS,EAAE,SAAS,CAAC;IAErC,2BAA2B;IAC3B,SAAgB,WAAW,EAAE,oBAAoB,CAAC;IAElD,4BAA4B;IAC5B,SAAgB,WAAW,EAAE,WAAW,CAAC;IAEzC,6BAA6B;IAC7B,SAAgB,YAAY,EAAE,YAAY,CAAC;IAE3C,qDAAqD;IACrD,IAAW,iBAAiB,IAAI;QAAE,QAAQ,EAAE,oBAAoB,CAAC;QAAC,QAAQ,EAAE,WAAW,CAAC;QAAC,SAAS,EAAE,YAAY,CAAA;KAAE,CAEjH;CACJ"}
@@ -0,0 +1,28 @@
1
+ import { type IRenderPass, type RenderPassDescriptor } from "../../api/index.js";
2
+ import type { WebGpuGraphicsDevice } from "../WebGpuGraphicsDevice.js";
3
+ /**
4
+ * The WebGPU render pass. `beginPass` creates a command encoder and begins a render pass,
5
+ * `endPass` ends it and submits the command buffer, like the C# `WebGPURenderPass`.
6
+ * @internal
7
+ */
8
+ export declare class WebGpuRenderPass implements IRenderPass {
9
+ private readonly _graphicsDevice;
10
+ private readonly _descriptor;
11
+ private _commandEncoder;
12
+ /**
13
+ * The constructor.
14
+ * @param graphicsDevice The graphics device.
15
+ * @param descriptor The render pass descriptor.
16
+ */
17
+ constructor(graphicsDevice: WebGpuGraphicsDevice, descriptor: RenderPassDescriptor);
18
+ private _buildDescriptor;
19
+ /** Whether the pass has a depth attachment. */
20
+ get hasDepthStencil(): boolean;
21
+ /** @inheritDoc */
22
+ beginPass(): void;
23
+ /** @inheritDoc */
24
+ endPass(): void;
25
+ /** @inheritDoc */
26
+ dispose(): void;
27
+ }
28
+ //# sourceMappingURL=WebGpuRenderPass.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebGpuRenderPass.d.ts","sourceRoot":"","sources":["../../../src/webgpu/render-pass/WebGpuRenderPass.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,WAAW,EAEhB,KAAK,oBAAoB,EAE5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,4BAA4B,CAAC;AAYrE;;;;GAIG;AACH,qBAAa,gBAAiB,YAAW,WAAW;IAEhD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAuB;IACvD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAuB;IACnD,OAAO,CAAC,eAAe,CAAkC;IAEzD;;;;OAIG;gBACgB,cAAc,EAAE,oBAAoB,EAAE,UAAU,EAAE,oBAAoB;IAQzF,OAAO,CAAC,gBAAgB;IAqDxB,+CAA+C;IAC/C,IAAW,eAAe,IAAI,OAAO,CAGpC;IAED,kBAAkB;IACX,SAAS,IAAI,IAAI;IASxB,kBAAkB;IACX,OAAO,IAAI,IAAI;IAUtB,kBAAkB;IACX,OAAO,IAAI,IAAI;CAOzB"}