@forgeax/engine-render 0.1.3 → 0.1.6

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 (918) hide show
  1. package/README.md +130 -641
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/__tests__/device-scope-lifecycle.unit.test.d.ts +2 -0
  4. package/dist/__tests__/device-scope-lifecycle.unit.test.d.ts.map +1 -0
  5. package/dist/__tests__/device-scope-stale-matrix.unit.test.d.ts +2 -0
  6. package/dist/__tests__/device-scope-stale-matrix.unit.test.d.ts.map +1 -0
  7. package/dist/__tests__/fullscreen-feature-plan.unit.test.d.ts +2 -0
  8. package/dist/__tests__/fullscreen-feature-plan.unit.test.d.ts.map +1 -0
  9. package/dist/__tests__/gpu-driven-indirect-raster-evidence.d.ts.map +1 -1
  10. package/dist/__tests__/gpu-driven-view-gpu-evidence.d.ts +6 -0
  11. package/dist/__tests__/gpu-driven-view-gpu-evidence.d.ts.map +1 -1
  12. package/dist/{gpu-driven/view-reference.d.ts → __tests__/gpu-driven-view-reference.d.ts} +4 -4
  13. package/dist/__tests__/gpu-driven-view-reference.d.ts.map +1 -0
  14. package/dist/__tests__/gpu-scene-render-graph-gpu.d.ts.map +1 -1
  15. package/dist/__tests__/ibl/face-uniforms.unit.test.d.ts +2 -0
  16. package/dist/__tests__/ibl/face-uniforms.unit.test.d.ts.map +1 -0
  17. package/dist/__tests__/morph-feature-plan.unit.test.d.ts +2 -0
  18. package/dist/__tests__/morph-feature-plan.unit.test.d.ts.map +1 -0
  19. package/dist/__tests__/render-feature-plan.test-d.d.ts +2 -0
  20. package/dist/__tests__/render-feature-plan.test-d.d.ts.map +1 -0
  21. package/dist/__tests__/render-feature-plan.unit.test.d.ts +2 -0
  22. package/dist/__tests__/render-feature-plan.unit.test.d.ts.map +1 -0
  23. package/dist/__tests__/ssao-config.unit.test.d.ts +2 -0
  24. package/dist/__tests__/ssao-config.unit.test.d.ts.map +1 -0
  25. package/dist/__tests__/standard-clustered-pipeline.unit.test.d.ts +2 -0
  26. package/dist/__tests__/standard-clustered-pipeline.unit.test.d.ts.map +1 -0
  27. package/dist/__tests__/standard-descriptors.test-d.d.ts +2 -0
  28. package/dist/__tests__/standard-descriptors.test-d.d.ts.map +1 -0
  29. package/dist/__tests__/standard-pipeline.dawn.test.d.ts +2 -0
  30. package/dist/__tests__/standard-pipeline.dawn.test.d.ts.map +1 -0
  31. package/dist/__tests__/standard-pipeline.integration.test.d.ts +2 -0
  32. package/dist/__tests__/standard-pipeline.integration.test.d.ts.map +1 -0
  33. package/dist/__tests__/standard-profile-oracle.unit.test.d.ts +2 -0
  34. package/dist/__tests__/standard-profile-oracle.unit.test.d.ts.map +1 -0
  35. package/dist/__tests__/visibility-resource-short-circuit.unit.test.d.ts +2 -0
  36. package/dist/__tests__/visibility-resource-short-circuit.unit.test.d.ts.map +1 -0
  37. package/dist/{renderer/backend-selection.d.ts → assembly/backend-contract.d.ts} +15 -4
  38. package/dist/assembly/backend-contract.d.ts.map +1 -0
  39. package/dist/assembly/factory.d.ts +207 -0
  40. package/dist/assembly/factory.d.ts.map +1 -0
  41. package/dist/assembly/host-contract.d.ts +84 -0
  42. package/dist/assembly/host-contract.d.ts.map +1 -0
  43. package/dist/{renderer → assembly}/material/assembly.d.ts +1 -2
  44. package/dist/{renderer → assembly}/material/assembly.d.ts.map +1 -1
  45. package/dist/assembly/material/pipeline-projection.d.ts +30 -0
  46. package/dist/assembly/material/pipeline-projection.d.ts.map +1 -0
  47. package/dist/authoring.d.ts +10 -11
  48. package/dist/authoring.d.ts.map +1 -1
  49. package/dist/authoring.mjs +25 -3
  50. package/dist/authoring.mjs.map +1 -1
  51. package/dist/chunk-CQXZC5XI.mjs +182 -0
  52. package/dist/chunk-CQXZC5XI.mjs.map +1 -0
  53. package/dist/chunk-QC4VW3XJ.mjs +79 -0
  54. package/dist/chunk-QC4VW3XJ.mjs.map +1 -0
  55. package/dist/chunk-SCRSAK5B.mjs +480 -0
  56. package/dist/chunk-SCRSAK5B.mjs.map +1 -0
  57. package/dist/components/__tests__/schema-contract.unit.test.d.ts +2 -0
  58. package/dist/components/__tests__/schema-contract.unit.test.d.ts.map +1 -0
  59. package/dist/components/glyph-text.d.ts +1 -1
  60. package/dist/components/glyph-text.d.ts.map +1 -1
  61. package/dist/components/index.d.ts +2 -2
  62. package/dist/components/index.d.ts.map +1 -1
  63. package/dist/components/instances.d.ts +1 -1
  64. package/dist/components/instances.d.ts.map +1 -1
  65. package/dist/components/light-helpers.d.ts +1 -1
  66. package/dist/components/light-helpers.d.ts.map +1 -1
  67. package/dist/components/mesh-filter.d.ts +7 -7
  68. package/dist/components/mesh-filter.d.ts.map +1 -1
  69. package/dist/components/scene-instance.d.ts +11 -11
  70. package/dist/components/skybox-background.d.ts +56 -0
  71. package/dist/components/skybox-background.d.ts.map +1 -0
  72. package/dist/components/skylight.d.ts +55 -0
  73. package/dist/components/skylight.d.ts.map +1 -0
  74. package/dist/components/sprite-animation.d.ts +2 -3
  75. package/dist/components/sprite-animation.d.ts.map +1 -1
  76. package/dist/components/sprite-instances.d.ts +1 -1
  77. package/dist/components/sprite-playback-mode.d.ts +6 -1
  78. package/dist/components/sprite-playback-mode.d.ts.map +1 -1
  79. package/dist/components/sprite-region-override.d.ts +2 -3
  80. package/dist/components/sprite-region-override.d.ts.map +1 -1
  81. package/dist/components/tile-layer.d.ts +5 -0
  82. package/dist/components/tile-layer.d.ts.map +1 -1
  83. package/dist/construct-renderer.d.ts +18 -1
  84. package/dist/construct-renderer.d.ts.map +1 -1
  85. package/dist/construct-renderer.mjs +27008 -4
  86. package/dist/construct-renderer.mjs.map +1 -1
  87. package/dist/debug-draw-glue.d.ts +2 -53
  88. package/dist/debug-draw-glue.d.ts.map +1 -1
  89. package/dist/device/device-scope.d.ts +83 -0
  90. package/dist/device/device-scope.d.ts.map +1 -0
  91. package/dist/{gpu-resource-store.d.ts → device/gpu-residency.d.ts} +91 -48
  92. package/dist/device/gpu-residency.d.ts.map +1 -0
  93. package/dist/device/resource-types.d.ts +8 -0
  94. package/dist/device/resource-types.d.ts.map +1 -0
  95. package/dist/engine-metrics.d.ts +2 -2
  96. package/dist/engine-metrics.d.ts.map +1 -1
  97. package/dist/errors/recover.d.ts +28 -1
  98. package/dist/errors/recover.d.ts.map +1 -1
  99. package/dist/errors/render.d.ts +249 -258
  100. package/dist/errors/render.d.ts.map +1 -1
  101. package/dist/features/fullscreen.d.ts +19 -0
  102. package/dist/features/fullscreen.d.ts.map +1 -0
  103. package/dist/features/host.d.ts +32 -26
  104. package/dist/features/host.d.ts.map +1 -1
  105. package/dist/features/morph/morph-feature.d.ts +39 -5
  106. package/dist/features/morph/morph-feature.d.ts.map +1 -1
  107. package/dist/features/plan.d.ts +182 -0
  108. package/dist/features/plan.d.ts.map +1 -0
  109. package/dist/features/prepared-gpu-work.d.ts +21 -17
  110. package/dist/features/prepared-gpu-work.d.ts.map +1 -1
  111. package/dist/features/prepared-graphics-store.d.ts +2 -1
  112. package/dist/features/prepared-graphics-store.d.ts.map +1 -1
  113. package/dist/features/prepared-graphics.d.ts +11 -21
  114. package/dist/features/prepared-graphics.d.ts.map +1 -1
  115. package/dist/features/render-graph-compute.d.ts +2 -2
  116. package/dist/features/render-graph-compute.d.ts.map +1 -1
  117. package/dist/features/render-graph-contribution.d.ts +4 -7
  118. package/dist/features/render-graph-contribution.d.ts.map +1 -1
  119. package/dist/features/render-graph-raster.d.ts +2 -2
  120. package/dist/features/render-graph-raster.d.ts.map +1 -1
  121. package/dist/features/render-graph-resources.d.ts +6 -6
  122. package/dist/features/render-graph-resources.d.ts.map +1 -1
  123. package/dist/features/targets.d.ts +5 -5
  124. package/dist/features/targets.d.ts.map +1 -1
  125. package/dist/features/types.d.ts +11 -190
  126. package/dist/features/types.d.ts.map +1 -1
  127. package/dist/features/vocabulary.d.ts +14 -0
  128. package/dist/features/vocabulary.d.ts.map +1 -0
  129. package/dist/fullscreen-post-process-pass.d.ts +4 -25
  130. package/dist/fullscreen-post-process-pass.d.ts.map +1 -1
  131. package/dist/glyph-text-layout-system.d.ts +3 -2
  132. package/dist/glyph-text-layout-system.d.ts.map +1 -1
  133. package/dist/gpu-driven/batch-topology.d.ts +6 -75
  134. package/dist/gpu-driven/batch-topology.d.ts.map +1 -1
  135. package/dist/gpu-driven/production-raster.d.ts +13 -112
  136. package/dist/gpu-driven/production-raster.d.ts.map +1 -1
  137. package/dist/gpu-driven/view-gpu.d.ts +10 -66
  138. package/dist/gpu-driven/view-gpu.d.ts.map +1 -1
  139. package/dist/gpu-resource.d.ts +3 -3
  140. package/dist/gpu-scene-schema.d.ts +1 -94
  141. package/dist/gpu-scene-schema.d.ts.map +1 -1
  142. package/dist/gpu-scene.d.ts +7 -33
  143. package/dist/gpu-scene.d.ts.map +1 -1
  144. package/dist/hdrp-buffers.d.ts +3 -53
  145. package/dist/hdrp-buffers.d.ts.map +1 -1
  146. package/dist/ibl/IblPipelineCache.d.ts +74 -180
  147. package/dist/ibl/IblPipelineCache.d.ts.map +1 -1
  148. package/dist/ibl/skylight-bind-group.d.ts +1 -1
  149. package/dist/index.d.ts +13 -43
  150. package/dist/index.d.ts.map +1 -1
  151. package/dist/index.mjs +165 -3
  152. package/dist/index.mjs.map +1 -1
  153. package/dist/inspection-types.d.ts +69 -0
  154. package/dist/inspection-types.d.ts.map +1 -0
  155. package/dist/instance-buffer-cache.d.ts +1 -4
  156. package/dist/instance-buffer-cache.d.ts.map +1 -1
  157. package/dist/internal.d.ts +1 -73
  158. package/dist/internal.d.ts.map +1 -1
  159. package/dist/internal.mjs +1 -43
  160. package/dist/internal.mjs.map +1 -1
  161. package/dist/lifecycle.d.ts +36 -2
  162. package/dist/lifecycle.d.ts.map +1 -1
  163. package/dist/materials.d.ts +0 -3
  164. package/dist/materials.d.ts.map +1 -1
  165. package/dist/mesh-material-bindings.d.ts +0 -1
  166. package/dist/mesh-material-bindings.d.ts.map +1 -1
  167. package/dist/pbr-pipeline.d.ts +75 -29
  168. package/dist/pbr-pipeline.d.ts.map +1 -1
  169. package/dist/pipeline/standard-forward-lane.d.ts +5 -0
  170. package/dist/pipeline/standard-forward-lane.d.ts.map +1 -0
  171. package/dist/pipeline/standard-pipeline.d.ts +31 -0
  172. package/dist/pipeline/standard-pipeline.d.ts.map +1 -0
  173. package/dist/pipeline/standard-profile.d.ts +40 -0
  174. package/dist/pipeline/standard-profile.d.ts.map +1 -0
  175. package/dist/pipeline-builder.d.ts +3 -3
  176. package/dist/pipeline-builder.d.ts.map +1 -1
  177. package/dist/pipeline-spec-types.d.ts +24 -0
  178. package/dist/pipeline-spec-types.d.ts.map +1 -0
  179. package/dist/pipeline-spec.d.ts +16 -155
  180. package/dist/pipeline-spec.d.ts.map +1 -1
  181. package/dist/plugin.d.ts +1 -14
  182. package/dist/plugin.d.ts.map +1 -1
  183. package/dist/post-process-errors.d.ts +18 -18
  184. package/dist/post-process-errors.d.ts.map +1 -1
  185. package/dist/prepare/prepared-graphics-resolver.d.ts +2 -5
  186. package/dist/prepare/prepared-graphics-resolver.d.ts.map +1 -1
  187. package/dist/record/__tests__/typed-frame-graph-plan.unit.test.d.ts +2 -0
  188. package/dist/record/__tests__/typed-frame-graph-plan.unit.test.d.ts.map +1 -0
  189. package/dist/record/frame-lighting.d.ts +7 -73
  190. package/dist/record/frame-lighting.d.ts.map +1 -1
  191. package/dist/record/frame-snapshot.d.ts +44 -44
  192. package/dist/record/frame-snapshot.d.ts.map +1 -1
  193. package/dist/record/frame-targets.d.ts +5 -38
  194. package/dist/record/frame-targets.d.ts.map +1 -1
  195. package/dist/record/frame.d.ts +64 -52
  196. package/dist/record/frame.d.ts.map +1 -1
  197. package/dist/record/helpers.d.ts +3 -2
  198. package/dist/record/helpers.d.ts.map +1 -1
  199. package/dist/record/main-pass-geometry.d.ts +5 -4
  200. package/dist/record/main-pass-geometry.d.ts.map +1 -1
  201. package/dist/record/main-pass-material.d.ts +90 -59
  202. package/dist/record/main-pass-material.d.ts.map +1 -1
  203. package/dist/record/main-pass-sprite-draws.d.ts +28 -3
  204. package/dist/record/main-pass-sprite-draws.d.ts.map +1 -1
  205. package/dist/record/main-pass.d.ts +1 -1
  206. package/dist/record/main-pass.d.ts.map +1 -1
  207. package/dist/record/mesh-ssbo.d.ts +276 -3
  208. package/dist/record/mesh-ssbo.d.ts.map +1 -1
  209. package/dist/record/render-context.d.ts +235 -0
  210. package/dist/record/render-context.d.ts.map +1 -0
  211. package/dist/record/shadow-pass.d.ts +15 -88
  212. package/dist/record/shadow-pass.d.ts.map +1 -1
  213. package/dist/record/skybox-post-pass.d.ts +1 -1
  214. package/dist/record/skybox-post-pass.d.ts.map +1 -1
  215. package/dist/record/typed-frame-graph.d.ts +29 -7
  216. package/dist/record/typed-frame-graph.d.ts.map +1 -1
  217. package/dist/record/view-ubo.d.ts +3 -3
  218. package/dist/record/view-ubo.d.ts.map +1 -1
  219. package/dist/render-contract.d.ts +416 -0
  220. package/dist/render-contract.d.ts.map +1 -0
  221. package/dist/render-data.d.ts.map +1 -1
  222. package/dist/render-graph-primitives.d.ts +14 -362
  223. package/dist/render-graph-primitives.d.ts.map +1 -1
  224. package/dist/render-pipeline.d.ts +25 -64
  225. package/dist/render-pipeline.d.ts.map +1 -1
  226. package/dist/render-system-extract.d.ts +107 -338
  227. package/dist/render-system-extract.d.ts.map +1 -1
  228. package/dist/render-system.d.ts +21 -713
  229. package/dist/render-system.d.ts.map +1 -1
  230. package/dist/scene/render-scene-types.d.ts +58 -0
  231. package/dist/scene/render-scene-types.d.ts.map +1 -0
  232. package/dist/scene/render-scene.d.ts +105 -0
  233. package/dist/scene/render-scene.d.ts.map +1 -0
  234. package/dist/scene-instances/post-spawn-resolve-joints.d.ts +2 -5
  235. package/dist/scene-instances/post-spawn-resolve-joints.d.ts.map +1 -1
  236. package/dist/ssao-buffers.d.ts +22 -3
  237. package/dist/ssao-buffers.d.ts.map +1 -1
  238. package/dist/systems/skin-palette-allocator.d.ts +2 -4
  239. package/dist/systems/skin-palette-allocator.d.ts.map +1 -1
  240. package/dist/systems/skin-palette-types.d.ts +14 -0
  241. package/dist/systems/skin-palette-types.d.ts.map +1 -0
  242. package/dist/systems/transparent-sort-config.d.ts +23 -2
  243. package/dist/systems/transparent-sort-config.d.ts.map +1 -1
  244. package/dist/tilemap-chunk-extract-system.d.ts +4 -3
  245. package/dist/tilemap-chunk-extract-system.d.ts.map +1 -1
  246. package/dist/typed-render-graph-primitives.d.ts +2 -4
  247. package/dist/typed-render-graph-primitives.d.ts.map +1 -1
  248. package/dist/typed-shadow-passes.d.ts +3 -3
  249. package/dist/typed-shadow-passes.d.ts.map +1 -1
  250. package/package.json +23 -23
  251. package/src/__tests__/backend-selection-rhi-capture.test-d.ts +1 -1
  252. package/src/__tests__/callback-inference.test-d.ts +6 -3
  253. package/src/__tests__/cluster-grid-default-surface.unit.test.ts +7 -4
  254. package/src/__tests__/construct-renderer-identity.unit.test.ts +15 -2
  255. package/src/__tests__/device-scope-lifecycle.unit.test.ts +151 -0
  256. package/src/__tests__/device-scope-stale-matrix.unit.test.ts +42 -0
  257. package/src/__tests__/direct-extract-consumer-contract.test-d.ts +8 -19
  258. package/src/__tests__/direct-light-snapshot.unit.test.ts +3 -13
  259. package/src/__tests__/factory-contract.integration.test.ts +158 -209
  260. package/src/__tests__/fallback-row-stride-surface.unit.test.ts +1 -4
  261. package/src/__tests__/frame-observation.contract.test.ts +17 -8
  262. package/src/__tests__/fullscreen-feature-plan.unit.test.ts +32 -0
  263. package/src/__tests__/glyph-text-layout-recovery.unit.test.ts +6 -11
  264. package/src/__tests__/gpu-driven-indirect-raster-evidence.ts +9 -16
  265. package/src/__tests__/gpu-driven-production.integration.test.ts +32 -205
  266. package/src/__tests__/gpu-driven-scaling.unit.test.ts +4 -7
  267. package/src/__tests__/gpu-driven-view-gpu-evidence.ts +87 -8
  268. package/src/__tests__/gpu-driven-view-graph.integration.test.ts +170 -8
  269. package/src/{gpu-driven/view-reference.ts → __tests__/gpu-driven-view-reference.ts} +4 -3
  270. package/src/__tests__/gpu-driven-view.browser.test.ts +12 -1
  271. package/src/__tests__/gpu-driven-view.dawn.test.ts +12 -1
  272. package/src/__tests__/gpu-driven-view.unit.test.ts +11 -267
  273. package/src/__tests__/gpu-resource-store-stride.unit.test.ts +3 -3
  274. package/src/__tests__/gpu-scene-render-graph-gpu.ts +2 -3
  275. package/src/__tests__/gpu-scene.dawn.test.ts +2 -6
  276. package/src/__tests__/gpu-scene.unit.test.ts +10 -24
  277. package/src/__tests__/ibl/face-uniforms.unit.test.ts +46 -0
  278. package/src/__tests__/infinite-grid-no-vertex-probe.unit.test.ts +34 -66
  279. package/src/__tests__/ktx2-basis-gpu-consumer.dawn.test.ts +14 -5
  280. package/src/__tests__/light-buffer-layout.unit.test.ts +4 -49
  281. package/src/__tests__/material-cooked-projection.unit.test.ts +2 -51
  282. package/src/__tests__/material-snapshot-mutation.integration.test.ts +10 -15
  283. package/src/__tests__/material-static-dynamic-route.unit.test.ts +4 -23
  284. package/src/__tests__/material-stride-surface.unit.test.ts +2 -2
  285. package/src/__tests__/mesh-buffer-usage-surface.unit.test.ts +7 -8
  286. package/src/__tests__/morph-culling-reentry.dawn.test.ts +29 -38
  287. package/src/__tests__/morph-feature-gpu-work.integration.test.ts +45 -43
  288. package/src/__tests__/morph-feature-plan.unit.test.ts +53 -0
  289. package/src/__tests__/morph-visual-evidence.integration.test.ts +47 -33
  290. package/src/__tests__/nineslice-handle-surface.unit.test.ts +11 -6
  291. package/src/__tests__/post-process-error-policy-owner.unit.test.ts +6 -13
  292. package/src/__tests__/prepared-graphics-capability.unit.test.ts +6 -81
  293. package/src/__tests__/prepared-graphics-generation.unit.test.ts +3 -17
  294. package/src/__tests__/prepared-graphics-lifecycle.unit.test.ts +6 -74
  295. package/src/__tests__/prepared-graphics-resolver.unit.test.ts +1 -3
  296. package/src/__tests__/prepared-graphics-snapshot.unit.test.ts +2 -2
  297. package/src/__tests__/profiler-default-off.test.ts +1 -1
  298. package/src/__tests__/profiler-phase-catalog.test.ts +2 -2
  299. package/src/__tests__/profiler-phase-integration.test.ts +5 -13
  300. package/src/__tests__/profiler-phase-token.test.ts +3 -8
  301. package/src/__tests__/public-surface.test-d.ts +65 -3
  302. package/src/__tests__/recover-error-policy-owner.unit.test.ts +1 -21
  303. package/src/__tests__/render-error-code-owner.test-d.ts +18 -23
  304. package/src/__tests__/render-error-detail-ssot.test-d.ts +0 -95
  305. package/src/__tests__/render-error-exhaustive.test-d.ts +8 -1
  306. package/src/__tests__/render-feature-assembly.test-d.ts +8 -16
  307. package/src/__tests__/render-feature-context.test-d.ts +16 -40
  308. package/src/__tests__/render-feature-contract.test-d.ts +9 -18
  309. package/src/__tests__/render-feature-diagnostics.unit.test.ts +6 -8
  310. package/src/__tests__/render-feature-docs.unit.test.ts +8 -7
  311. package/src/__tests__/render-feature-gpu-work.integration.test.ts +14 -75
  312. package/src/__tests__/render-feature-plan.test-d.ts +161 -0
  313. package/src/__tests__/render-feature-plan.unit.test.ts +170 -0
  314. package/src/__tests__/render-feature-prepared-diagnostics.unit.test.ts +8 -19
  315. package/src/__tests__/render-feature-prepared-errors.test-d.ts +3 -6
  316. package/src/__tests__/render-feature-prepared-graphics-docs.unit.test.ts +10 -71
  317. package/src/__tests__/render-feature-prepared-graphics-isolation.unit.test.ts +11 -61
  318. package/src/__tests__/render-feature-prepared-graphics-negative.test-d.ts +20 -43
  319. package/src/__tests__/render-feature-prepared-graphics.test-d.ts +56 -78
  320. package/src/__tests__/render-feature-public-surface.test-d.ts +6 -24
  321. package/src/__tests__/render-feature-retry.unit.test.ts +7 -48
  322. package/src/__tests__/render-feature-scheduling.unit.test.ts +15 -27
  323. package/src/__tests__/render-feature-stage-failed-policy-owner.unit.test.ts +0 -9
  324. package/src/__tests__/render-feature-stage-fault-recovery.unit.test.ts +19 -109
  325. package/src/__tests__/render-feature-visibility-context.test-d.ts +1 -6
  326. package/src/__tests__/render-feature-visibility-context.unit.test.ts +1 -2
  327. package/src/__tests__/render-feature-zero-work.unit.test.ts +14 -20
  328. package/src/__tests__/render-scene-projection.unit.test.ts +73 -111
  329. package/src/__tests__/renderer-factory-material-contract.unit.test.ts +46 -50
  330. package/src/__tests__/renderer-lifecycle.integration.test.ts +49 -1
  331. package/src/__tests__/shader-stage-surface.unit.test.ts +14 -9
  332. package/src/__tests__/ssao-config.unit.test.ts +36 -0
  333. package/src/__tests__/ssao-kernel-surface.unit.test.ts +4 -5
  334. package/src/__tests__/standard-clustered-pipeline.unit.test.ts +28 -0
  335. package/src/__tests__/standard-descriptors.test-d.ts +22 -0
  336. package/src/__tests__/standard-pipeline.dawn.test.ts +61 -0
  337. package/src/__tests__/standard-pipeline.integration.test.ts +124 -0
  338. package/src/__tests__/standard-profile-oracle.unit.test.ts +62 -0
  339. package/src/__tests__/surface-configuration.unit.test.ts +1 -2
  340. package/src/__tests__/texture-usage-surface.unit.test.ts +3 -6
  341. package/src/__tests__/typed-pipeline-topology.unit.test.ts +40 -206
  342. package/src/__tests__/urp-pipeline-targets.unit.test.ts +1 -11
  343. package/src/__tests__/urp-pipeline.unit.test.ts +2 -2
  344. package/src/__tests__/vertex-color-pipeline.unit.test.ts +10 -2
  345. package/src/__tests__/vertex-layout-consumer.unit.test.ts +1 -1
  346. package/src/__tests__/visibility-diagnostics.integration.test.ts +7 -11
  347. package/src/__tests__/visibility-extract.integration.test.ts +20 -11
  348. package/src/__tests__/visibility-extract.perf.test.ts +66 -32
  349. package/src/__tests__/visibility-feature-dedup.integration.test.ts +2 -4
  350. package/src/__tests__/visibility-hidden-report.unit.test.ts +1 -2
  351. package/src/__tests__/visibility-instances.integration.test.ts +7 -11
  352. package/src/__tests__/visibility-multi-world.integration.test.ts +38 -6
  353. package/src/__tests__/visibility-producer-matrix.integration.test.ts +18 -41
  354. package/src/__tests__/visibility-public-surface.test-d.ts +10 -9
  355. package/src/__tests__/visibility-resolver.unit.test.ts +2 -1
  356. package/src/__tests__/visibility-resource-short-circuit.unit.test.ts +80 -0
  357. package/src/__tests__/visibility-snapshot-contract.unit.test.ts +2 -1
  358. package/src/__tests__/vocabulary.unit.test.ts +1 -1
  359. package/src/assembly/backend-contract.ts +57 -0
  360. package/src/{renderer/renderer-factory.ts → assembly/factory.ts} +1709 -2693
  361. package/src/assembly/host-contract.ts +101 -0
  362. package/src/{renderer → assembly}/material/assembly.ts +1 -3
  363. package/src/assembly/material/pipeline-projection.ts +63 -0
  364. package/src/authoring.ts +14 -22
  365. package/src/components/__tests__/schema-contract.unit.test.ts +10 -0
  366. package/src/components/glyph-text.ts +3 -2
  367. package/src/components/index.ts +7 -9
  368. package/src/components/instances.ts +4 -5
  369. package/src/components/light-helpers.ts +1 -1
  370. package/src/components/mesh-filter.ts +11 -10
  371. package/src/components/post-process-params.ts +3 -3
  372. package/src/components/scene-instance.ts +12 -12
  373. package/src/components/skybox-background.ts +103 -0
  374. package/src/components/{environment.ts → skylight.ts} +2 -111
  375. package/src/components/sprite-animation.ts +3 -4
  376. package/src/components/sprite-instances.ts +2 -2
  377. package/src/components/sprite-playback-mode.ts +7 -1
  378. package/src/components/sprite-region-override.ts +2 -3
  379. package/src/components/tile-layer.ts +8 -2
  380. package/src/construct-renderer.ts +67 -4
  381. package/src/debug-draw-glue.ts +8 -129
  382. package/src/device/device-scope.ts +306 -0
  383. package/src/{gpu-resource-store.ts → device/gpu-residency.ts} +540 -639
  384. package/src/device/resource-types.ts +20 -0
  385. package/src/engine-metrics.ts +12 -19
  386. package/src/errors/recover.ts +45 -3
  387. package/src/errors/render.ts +357 -460
  388. package/src/features/fullscreen.ts +46 -0
  389. package/src/features/host.ts +575 -309
  390. package/src/features/morph/morph-feature.ts +195 -105
  391. package/src/features/plan.ts +447 -0
  392. package/src/features/prepared-gpu-work.ts +72 -15
  393. package/src/features/prepared-graphics-store.ts +20 -6
  394. package/src/features/prepared-graphics.ts +12 -71
  395. package/src/features/render-graph-compute.ts +14 -5
  396. package/src/features/render-graph-contribution.ts +43 -63
  397. package/src/features/render-graph-raster.ts +11 -6
  398. package/src/features/render-graph-resources.ts +25 -23
  399. package/src/features/targets.ts +8 -21
  400. package/src/features/types.ts +39 -227
  401. package/src/features/vocabulary.ts +24 -0
  402. package/src/fullscreen-post-process-pass.ts +14 -57
  403. package/src/glyph-text-layout-system.ts +70 -96
  404. package/src/gpu-driven/batch-topology.ts +24 -202
  405. package/src/gpu-driven/production-raster.ts +93 -1108
  406. package/src/gpu-driven/view-gpu.ts +46 -192
  407. package/src/gpu-resource.ts +4 -4
  408. package/src/gpu-scene-schema.ts +11 -99
  409. package/src/gpu-scene.ts +231 -364
  410. package/src/hdrp-buffers.ts +12 -221
  411. package/src/ibl/IblPipelineCache.ts +471 -711
  412. package/src/ibl/skylight-bind-group.ts +4 -4
  413. package/src/index.ts +58 -217
  414. package/src/inspection-types.ts +76 -0
  415. package/src/instance-buffer-cache.ts +1 -29
  416. package/src/internal.ts +6 -85
  417. package/src/lifecycle.ts +64 -19
  418. package/src/materials.ts +7 -29
  419. package/src/mesh-material-bindings.ts +0 -1
  420. package/src/pbr-pipeline.ts +434 -53
  421. package/src/{urp-pipeline.ts → pipeline/standard-forward-lane.ts} +38 -149
  422. package/src/{hdrp-pipeline.ts → pipeline/standard-pipeline.ts} +221 -191
  423. package/src/pipeline/standard-profile.ts +65 -0
  424. package/src/pipeline-builder.ts +60 -64
  425. package/src/pipeline-spec-types.ts +28 -0
  426. package/src/pipeline-spec.ts +72 -609
  427. package/src/plugin.ts +3 -75
  428. package/src/post-process-errors.ts +31 -33
  429. package/src/prepare/prepared-graphics-resolver.ts +5 -4
  430. package/src/record/__tests__/material-slot-plan.unit.test.ts +1 -33
  431. package/src/record/__tests__/typed-frame-graph-plan.unit.test.ts +41 -0
  432. package/src/record/__tests__/video-texture-view.unit.test.ts +1 -1
  433. package/src/record/frame-lighting.ts +74 -195
  434. package/src/record/frame-snapshot.ts +45 -60
  435. package/src/record/frame-targets.ts +8 -243
  436. package/src/record/frame.ts +509 -796
  437. package/src/record/helpers.ts +6 -11
  438. package/src/record/main-pass-geometry.ts +106 -147
  439. package/src/record/main-pass-material.ts +517 -190
  440. package/src/record/main-pass-sprite-draws.ts +198 -117
  441. package/src/record/main-pass.ts +162 -143
  442. package/src/record/mesh-ssbo.ts +517 -38
  443. package/src/record/render-context.ts +364 -0
  444. package/src/record/shadow-pass.ts +138 -1838
  445. package/src/record/skybox-post-pass.ts +12 -14
  446. package/src/record/typed-frame-graph.ts +215 -254
  447. package/src/record/view-ubo.ts +6 -37
  448. package/src/render-contract.ts +571 -0
  449. package/src/render-data.ts +3 -3
  450. package/src/render-graph-primitives.ts +76 -851
  451. package/src/render-pipeline.ts +104 -188
  452. package/src/render-system-extract.ts +1048 -1729
  453. package/src/render-system.ts +330 -1957
  454. package/src/scene/render-scene-types.ts +64 -0
  455. package/src/scene/render-scene.ts +1032 -0
  456. package/src/scene-instances/post-spawn-resolve-joints.ts +4 -7
  457. package/src/ssao-buffers.ts +167 -8
  458. package/src/systems/skin-palette-allocator.ts +21 -64
  459. package/src/systems/skin-palette-types.ts +14 -0
  460. package/src/systems/transparent-sort-config.ts +25 -3
  461. package/src/tilemap-chunk-extract-system.ts +53 -70
  462. package/src/typed-render-graph-primitives.ts +35 -24
  463. package/src/typed-shadow-passes.ts +26 -56
  464. package/dist/__tests__/analytic-sky-contract.test.d.ts +0 -2
  465. package/dist/__tests__/analytic-sky-contract.test.d.ts.map +0 -1
  466. package/dist/__tests__/analytic-sky-falsify.test.d.ts +0 -2
  467. package/dist/__tests__/analytic-sky-falsify.test.d.ts.map +0 -1
  468. package/dist/__tests__/assets-runtime-handoff.integration.test.d.ts +0 -2
  469. package/dist/__tests__/assets-runtime-handoff.integration.test.d.ts.map +0 -1
  470. package/dist/__tests__/backend-selection.integration.test.d.ts +0 -2
  471. package/dist/__tests__/backend-selection.integration.test.d.ts.map +0 -1
  472. package/dist/__tests__/camera-temporal.test-d.d.ts +0 -2
  473. package/dist/__tests__/camera-temporal.test-d.d.ts.map +0 -1
  474. package/dist/__tests__/camera-temporal.test.d.ts +0 -2
  475. package/dist/__tests__/camera-temporal.test.d.ts.map +0 -1
  476. package/dist/__tests__/directional-shadow-probe-atlas-layout.unit.test.d.ts +0 -2
  477. package/dist/__tests__/directional-shadow-probe-atlas-layout.unit.test.d.ts.map +0 -1
  478. package/dist/__tests__/environment-inspection.test.d.ts +0 -2
  479. package/dist/__tests__/environment-inspection.test.d.ts.map +0 -1
  480. package/dist/__tests__/fog-ai-user.fixture.d.ts +0 -2
  481. package/dist/__tests__/fog-ai-user.fixture.d.ts.map +0 -1
  482. package/dist/__tests__/fog-custom-render-feature.fixture.d.ts +0 -16
  483. package/dist/__tests__/fog-custom-render-feature.fixture.d.ts.map +0 -1
  484. package/dist/__tests__/fog-custom-render-feature.integration.test.d.ts +0 -2
  485. package/dist/__tests__/fog-custom-render-feature.integration.test.d.ts.map +0 -1
  486. package/dist/__tests__/fog-inspection.integration.test.d.ts +0 -2
  487. package/dist/__tests__/fog-inspection.integration.test.d.ts.map +0 -1
  488. package/dist/__tests__/fog-owner-state.integration.test.d.ts +0 -2
  489. package/dist/__tests__/fog-owner-state.integration.test.d.ts.map +0 -1
  490. package/dist/__tests__/fog-pipeline-topology.integration.test.d.ts +0 -2
  491. package/dist/__tests__/fog-pipeline-topology.integration.test.d.ts.map +0 -1
  492. package/dist/__tests__/fog-public-surface.integration.test.d.ts +0 -2
  493. package/dist/__tests__/fog-public-surface.integration.test.d.ts.map +0 -1
  494. package/dist/__tests__/fog-ray-contract.integration.test.d.ts +0 -2
  495. package/dist/__tests__/fog-ray-contract.integration.test.d.ts.map +0 -1
  496. package/dist/__tests__/fog-source-absence.integration.test.d.ts +0 -2
  497. package/dist/__tests__/fog-source-absence.integration.test.d.ts.map +0 -1
  498. package/dist/__tests__/fog-temporal.integration.test.d.ts +0 -2
  499. package/dist/__tests__/fog-temporal.integration.test.d.ts.map +0 -1
  500. package/dist/__tests__/frame-chain.unit.test.d.ts +0 -2
  501. package/dist/__tests__/frame-chain.unit.test.d.ts.map +0 -1
  502. package/dist/__tests__/gpu-scene-field-type-owner.test-d.d.ts +0 -2
  503. package/dist/__tests__/gpu-scene-field-type-owner.test-d.d.ts.map +0 -1
  504. package/dist/__tests__/hdrp-pipeline.unit.test.d.ts +0 -2
  505. package/dist/__tests__/hdrp-pipeline.unit.test.d.ts.map +0 -1
  506. package/dist/__tests__/ibl/ibl-fallback.unit.test.d.ts +0 -2
  507. package/dist/__tests__/ibl/ibl-fallback.unit.test.d.ts.map +0 -1
  508. package/dist/__tests__/material-derived-error-stop-draw.integration.test.d.ts +0 -2
  509. package/dist/__tests__/material-derived-error-stop-draw.integration.test.d.ts.map +0 -1
  510. package/dist/__tests__/material-derived-payload.integration.test.d.ts +0 -2
  511. package/dist/__tests__/material-derived-payload.integration.test.d.ts.map +0 -1
  512. package/dist/__tests__/materials.unit.test.d.ts +0 -2
  513. package/dist/__tests__/materials.unit.test.d.ts.map +0 -1
  514. package/dist/__tests__/param-schema-projection-census.unit.test.d.ts +0 -2
  515. package/dist/__tests__/param-schema-projection-census.unit.test.d.ts.map +0 -1
  516. package/dist/__tests__/persistent-render-scene.unit.test.d.ts +0 -2
  517. package/dist/__tests__/persistent-render-scene.unit.test.d.ts.map +0 -1
  518. package/dist/__tests__/pipeline-error-policy-owner.unit.test.d.ts +0 -2
  519. package/dist/__tests__/pipeline-error-policy-owner.unit.test.d.ts.map +0 -1
  520. package/dist/__tests__/pipeline-pass-trace.test.d.ts +0 -2
  521. package/dist/__tests__/pipeline-pass-trace.test.d.ts.map +0 -1
  522. package/dist/__tests__/pipeline-stage-owner.test-d.d.ts +0 -2
  523. package/dist/__tests__/pipeline-stage-owner.test-d.d.ts.map +0 -1
  524. package/dist/__tests__/plugin.test.d.ts +0 -2
  525. package/dist/__tests__/plugin.test.d.ts.map +0 -1
  526. package/dist/__tests__/prepared-graphics-backend-matrix.unit.test.d.ts +0 -2
  527. package/dist/__tests__/prepared-graphics-backend-matrix.unit.test.d.ts.map +0 -1
  528. package/dist/__tests__/prepared-graphics-resolver-recording.unit.test.d.ts +0 -2
  529. package/dist/__tests__/prepared-graphics-resolver-recording.unit.test.d.ts.map +0 -1
  530. package/dist/__tests__/public-pipeline-id.test-d.d.ts +0 -2
  531. package/dist/__tests__/public-pipeline-id.test-d.d.ts.map +0 -1
  532. package/dist/__tests__/render-dispatch-membership.unit.test.d.ts +0 -2
  533. package/dist/__tests__/render-dispatch-membership.unit.test.d.ts.map +0 -1
  534. package/dist/__tests__/render-feature-construction.unit.test.d.ts +0 -2
  535. package/dist/__tests__/render-feature-construction.unit.test.d.ts.map +0 -1
  536. package/dist/__tests__/render-feature-error-code-owner.test-d.d.ts +0 -2
  537. package/dist/__tests__/render-feature-error-code-owner.test-d.d.ts.map +0 -1
  538. package/dist/__tests__/render-feature-gpu-buffer-usage-owner.test-d.d.ts +0 -2
  539. package/dist/__tests__/render-feature-gpu-buffer-usage-owner.test-d.d.ts.map +0 -1
  540. package/dist/__tests__/render-feature-graph.integration.test.d.ts +0 -2
  541. package/dist/__tests__/render-feature-graph.integration.test.d.ts.map +0 -1
  542. package/dist/__tests__/render-feature-graphics-staging.unit.test.d.ts +0 -2
  543. package/dist/__tests__/render-feature-graphics-staging.unit.test.d.ts.map +0 -1
  544. package/dist/__tests__/render-feature-order.unit.test.d.ts +0 -2
  545. package/dist/__tests__/render-feature-order.unit.test.d.ts.map +0 -1
  546. package/dist/__tests__/render-feature-prepared-graphics-recording.unit.test.d.ts +0 -2
  547. package/dist/__tests__/render-feature-prepared-graphics-recording.unit.test.d.ts.map +0 -1
  548. package/dist/__tests__/render-feature-staging.unit.test.d.ts +0 -2
  549. package/dist/__tests__/render-feature-staging.unit.test.d.ts.map +0 -1
  550. package/dist/__tests__/renderer-render-scene-public.test-d.d.ts +0 -2
  551. package/dist/__tests__/renderer-render-scene-public.test-d.d.ts.map +0 -1
  552. package/dist/__tests__/scene-temporal-coverage.unit.test.d.ts +0 -2
  553. package/dist/__tests__/scene-temporal-coverage.unit.test.d.ts.map +0 -1
  554. package/dist/__tests__/sun-snapshot-consumers.test.d.ts +0 -2
  555. package/dist/__tests__/sun-snapshot-consumers.test.d.ts.map +0 -1
  556. package/dist/__tests__/surface-backend-kind-owner.test-d.d.ts +0 -2
  557. package/dist/__tests__/surface-backend-kind-owner.test-d.d.ts.map +0 -1
  558. package/dist/__tests__/taa-history-store.unit.test.d.ts +0 -2
  559. package/dist/__tests__/taa-history-store.unit.test.d.ts.map +0 -1
  560. package/dist/__tests__/temporal-frame-transaction.integration.test.d.ts +0 -2
  561. package/dist/__tests__/temporal-frame-transaction.integration.test.d.ts.map +0 -1
  562. package/dist/__tests__/temporal-inspection.unit.test.d.ts +0 -2
  563. package/dist/__tests__/temporal-inspection.unit.test.d.ts.map +0 -1
  564. package/dist/assets/__tests__/asset-decoders.unit.test.d.ts +0 -2
  565. package/dist/assets/__tests__/asset-decoders.unit.test.d.ts.map +0 -1
  566. package/dist/assets/__tests__/mipmap-generator.unit.test.d.ts +0 -2
  567. package/dist/assets/__tests__/mipmap-generator.unit.test.d.ts.map +0 -1
  568. package/dist/assets/__tests__/render-asset-port.unit.test.d.ts +0 -2
  569. package/dist/assets/__tests__/render-asset-port.unit.test.d.ts.map +0 -1
  570. package/dist/assets/__tests__/resolve-render-asset.unit.test.d.ts +0 -2
  571. package/dist/assets/__tests__/resolve-render-asset.unit.test.d.ts.map +0 -1
  572. package/dist/chunk-33UF5SAO.mjs +0 -7397
  573. package/dist/chunk-33UF5SAO.mjs.map +0 -1
  574. package/dist/chunk-A5QCJSNL.mjs +0 -29913
  575. package/dist/chunk-A5QCJSNL.mjs.map +0 -1
  576. package/dist/chunk-JMSB7AR4.mjs +0 -3
  577. package/dist/chunk-JMSB7AR4.mjs.map +0 -1
  578. package/dist/chunk-LXNGO6AO.mjs +0 -569
  579. package/dist/chunk-LXNGO6AO.mjs.map +0 -1
  580. package/dist/chunk-QRXPSX4X.mjs +0 -659
  581. package/dist/chunk-QRXPSX4X.mjs.map +0 -1
  582. package/dist/chunk-YAKEQPWO.mjs +0 -1439
  583. package/dist/chunk-YAKEQPWO.mjs.map +0 -1
  584. package/dist/components/__tests__/atmosphere-red.test.d.ts +0 -2
  585. package/dist/components/__tests__/atmosphere-red.test.d.ts.map +0 -1
  586. package/dist/components/__tests__/atmosphere.test.d.ts +0 -2
  587. package/dist/components/__tests__/atmosphere.test.d.ts.map +0 -1
  588. package/dist/components/__tests__/fog.test-d.d.ts +0 -2
  589. package/dist/components/__tests__/fog.test-d.d.ts.map +0 -1
  590. package/dist/components/__tests__/fog.test.d.ts +0 -2
  591. package/dist/components/__tests__/fog.test.d.ts.map +0 -1
  592. package/dist/components/atmosphere.d.ts +0 -18
  593. package/dist/components/atmosphere.d.ts.map +0 -1
  594. package/dist/components/environment.d.ts +0 -116
  595. package/dist/components/environment.d.ts.map +0 -1
  596. package/dist/deferred-lighting.d.ts +0 -13
  597. package/dist/deferred-lighting.d.ts.map +0 -1
  598. package/dist/dynamic-texture-store.d.ts +0 -42
  599. package/dist/dynamic-texture-store.d.ts.map +0 -1
  600. package/dist/environment/__tests__/failure-injection.test.d.ts +0 -2
  601. package/dist/environment/__tests__/failure-injection.test.d.ts.map +0 -1
  602. package/dist/environment/__tests__/generation-red.test.d.ts +0 -2
  603. package/dist/environment/__tests__/generation-red.test.d.ts.map +0 -1
  604. package/dist/environment/__tests__/generation.test.d.ts +0 -2
  605. package/dist/environment/__tests__/generation.test.d.ts.map +0 -1
  606. package/dist/environment/__tests__/graph-transaction.test.d.ts +0 -2
  607. package/dist/environment/__tests__/graph-transaction.test.d.ts.map +0 -1
  608. package/dist/environment/__tests__/inspection-red.test.d.ts +0 -2
  609. package/dist/environment/__tests__/inspection-red.test.d.ts.map +0 -1
  610. package/dist/environment/__tests__/lifecycle-evidence.test.d.ts +0 -2
  611. package/dist/environment/__tests__/lifecycle-evidence.test.d.ts.map +0 -1
  612. package/dist/environment/__tests__/pipeline-topology.test.d.ts +0 -2
  613. package/dist/environment/__tests__/pipeline-topology.test.d.ts.map +0 -1
  614. package/dist/environment/__tests__/readiness.test.d.ts +0 -2
  615. package/dist/environment/__tests__/readiness.test.d.ts.map +0 -1
  616. package/dist/environment/__tests__/recovery.test.d.ts +0 -2
  617. package/dist/environment/__tests__/recovery.test.d.ts.map +0 -1
  618. package/dist/environment/__tests__/resize-dispose.test.d.ts +0 -2
  619. package/dist/environment/__tests__/resize-dispose.test.d.ts.map +0 -1
  620. package/dist/environment/__tests__/signature-red.test.d.ts +0 -2
  621. package/dist/environment/__tests__/signature-red.test.d.ts.map +0 -1
  622. package/dist/environment/__tests__/signature.test.d.ts +0 -2
  623. package/dist/environment/__tests__/signature.test.d.ts.map +0 -1
  624. package/dist/environment/descriptors.d.ts +0 -2
  625. package/dist/environment/descriptors.d.ts.map +0 -1
  626. package/dist/environment/extracted-environment.d.ts +0 -53
  627. package/dist/environment/extracted-environment.d.ts.map +0 -1
  628. package/dist/environment/generation.d.ts +0 -62
  629. package/dist/environment/generation.d.ts.map +0 -1
  630. package/dist/environment/gpu-bundle.d.ts +0 -23
  631. package/dist/environment/gpu-bundle.d.ts.map +0 -1
  632. package/dist/environment/graph.d.ts +0 -108
  633. package/dist/environment/graph.d.ts.map +0 -1
  634. package/dist/environment/inspection.d.ts +0 -48
  635. package/dist/environment/inspection.d.ts.map +0 -1
  636. package/dist/environment/lifecycle.d.ts +0 -22
  637. package/dist/environment/lifecycle.d.ts.map +0 -1
  638. package/dist/environment/readiness.d.ts +0 -29
  639. package/dist/environment/readiness.d.ts.map +0 -1
  640. package/dist/environment/signature.d.ts +0 -70
  641. package/dist/environment/signature.d.ts.map +0 -1
  642. package/dist/extract/__tests__/directional-csm-domain.unit.test.d.ts +0 -2
  643. package/dist/extract/__tests__/directional-csm-domain.unit.test.d.ts.map +0 -1
  644. package/dist/extract/__tests__/environment-source.test.d.ts +0 -2
  645. package/dist/extract/__tests__/environment-source.test.d.ts.map +0 -1
  646. package/dist/extract/__tests__/schema-readers.unit.test.d.ts +0 -2
  647. package/dist/extract/__tests__/schema-readers.unit.test.d.ts.map +0 -1
  648. package/dist/extract/directional-csm.d.ts +0 -129
  649. package/dist/extract/directional-csm.d.ts.map +0 -1
  650. package/dist/extract/index.d.ts +0 -5
  651. package/dist/extract/index.d.ts.map +0 -1
  652. package/dist/extract/material-interface.d.ts +0 -56
  653. package/dist/extract/material-interface.d.ts.map +0 -1
  654. package/dist/extract/schema-readers.d.ts +0 -20
  655. package/dist/extract/schema-readers.d.ts.map +0 -1
  656. package/dist/features/graph-contribution.d.ts +0 -64
  657. package/dist/features/graph-contribution.d.ts.map +0 -1
  658. package/dist/features/index.d.ts +0 -21
  659. package/dist/features/index.d.ts.map +0 -1
  660. package/dist/features/morph/index.d.ts +0 -3
  661. package/dist/features/morph/index.d.ts.map +0 -1
  662. package/dist/features/morph/morph-bounds.d.ts +0 -42
  663. package/dist/features/morph/morph-bounds.d.ts.map +0 -1
  664. package/dist/features/scene-temporal.d.ts +0 -45
  665. package/dist/features/scene-temporal.d.ts.map +0 -1
  666. package/dist/features/taa-resolve.d.ts +0 -21
  667. package/dist/features/taa-resolve.d.ts.map +0 -1
  668. package/dist/frame-chain.d.ts +0 -14
  669. package/dist/frame-chain.d.ts.map +0 -1
  670. package/dist/gpu-driven/view-reference.d.ts.map +0 -1
  671. package/dist/gpu-resource-store.d.ts.map +0 -1
  672. package/dist/hdrp-cluster-membership.d.ts +0 -2
  673. package/dist/hdrp-cluster-membership.d.ts.map +0 -1
  674. package/dist/hdrp-pipeline.d.ts +0 -36
  675. package/dist/hdrp-pipeline.d.ts.map +0 -1
  676. package/dist/ibl/cubemap-projection.d.ts +0 -23
  677. package/dist/ibl/cubemap-projection.d.ts.map +0 -1
  678. package/dist/ibl/face-uniforms.d.ts +0 -65
  679. package/dist/ibl/face-uniforms.d.ts.map +0 -1
  680. package/dist/mesh-update-errors.d.ts +0 -71
  681. package/dist/mesh-update-errors.d.ts.map +0 -1
  682. package/dist/mipmap-generator.d.ts +0 -39
  683. package/dist/mipmap-generator.d.ts.map +0 -1
  684. package/dist/param-schema-projection-census.d.ts +0 -18
  685. package/dist/param-schema-projection-census.d.ts.map +0 -1
  686. package/dist/persistent-render-scene.d.ts +0 -158
  687. package/dist/persistent-render-scene.d.ts.map +0 -1
  688. package/dist/pipeline/index.d.ts +0 -11
  689. package/dist/pipeline/index.d.ts.map +0 -1
  690. package/dist/pipeline-errors.d.ts +0 -110
  691. package/dist/pipeline-errors.d.ts.map +0 -1
  692. package/dist/prepare/__tests__/schema-readers.unit.test.d.ts +0 -2
  693. package/dist/prepare/__tests__/schema-readers.unit.test.d.ts.map +0 -1
  694. package/dist/prepare/index.d.ts +0 -4
  695. package/dist/prepare/index.d.ts.map +0 -1
  696. package/dist/prepare/schema-readers.d.ts +0 -11
  697. package/dist/prepare/schema-readers.d.ts.map +0 -1
  698. package/dist/record/__tests__/environment-record.test.d.ts +0 -2
  699. package/dist/record/__tests__/environment-record.test.d.ts.map +0 -1
  700. package/dist/record/__tests__/frame-targets.unit.test.d.ts +0 -2
  701. package/dist/record/__tests__/frame-targets.unit.test.d.ts.map +0 -1
  702. package/dist/record/__tests__/membership-timing.unit.test.d.ts +0 -2
  703. package/dist/record/__tests__/membership-timing.unit.test.d.ts.map +0 -1
  704. package/dist/record/__tests__/render-submission.integration.test.d.ts +0 -2
  705. package/dist/record/__tests__/render-submission.integration.test.d.ts.map +0 -1
  706. package/dist/record/__tests__/render-submission.perf.test.d.ts +0 -2
  707. package/dist/record/__tests__/render-submission.perf.test.d.ts.map +0 -1
  708. package/dist/record/__tests__/shadow-submit-mode.unit.test.d.ts +0 -2
  709. package/dist/record/__tests__/shadow-submit-mode.unit.test.d.ts.map +0 -1
  710. package/dist/record/__tests__/view-ubo-layout.unit.test.d.ts +0 -2
  711. package/dist/record/__tests__/view-ubo-layout.unit.test.d.ts.map +0 -1
  712. package/dist/record/frame-observation.d.ts +0 -38
  713. package/dist/record/frame-observation.d.ts.map +0 -1
  714. package/dist/record/index.d.ts +0 -15
  715. package/dist/record/index.d.ts.map +0 -1
  716. package/dist/record/main-pass-skin.d.ts +0 -46
  717. package/dist/record/main-pass-skin.d.ts.map +0 -1
  718. package/dist/record/main-pass-sprite.d.ts +0 -69
  719. package/dist/record/main-pass-sprite.d.ts.map +0 -1
  720. package/dist/record/material-payload.d.ts +0 -43
  721. package/dist/record/material-payload.d.ts.map +0 -1
  722. package/dist/record/material-slot-plan.d.ts +0 -26
  723. package/dist/record/material-slot-plan.d.ts.map +0 -1
  724. package/dist/record/membership-timing.d.ts +0 -232
  725. package/dist/record/membership-timing.d.ts.map +0 -1
  726. package/dist/record/shadow-caster-uniform.d.ts +0 -8
  727. package/dist/record/shadow-caster-uniform.d.ts.map +0 -1
  728. package/dist/record/shadow-submit-mode.d.ts +0 -66
  729. package/dist/record/shadow-submit-mode.d.ts.map +0 -1
  730. package/dist/render-dispatch-membership.d.ts +0 -47
  731. package/dist/render-dispatch-membership.d.ts.map +0 -1
  732. package/dist/render-pipeline-context.d.ts +0 -289
  733. package/dist/render-pipeline-context.d.ts.map +0 -1
  734. package/dist/render-pipeline-target.d.ts +0 -16
  735. package/dist/render-pipeline-target.d.ts.map +0 -1
  736. package/dist/render-scene-projection.d.ts +0 -174
  737. package/dist/render-scene-projection.d.ts.map +0 -1
  738. package/dist/render-system-fold.d.ts +0 -266
  739. package/dist/render-system-fold.d.ts.map +0 -1
  740. package/dist/renderer/asset-service.d.ts +0 -10
  741. package/dist/renderer/asset-service.d.ts.map +0 -1
  742. package/dist/renderer/backend-selection.d.ts.map +0 -1
  743. package/dist/renderer/environment-classify.d.ts +0 -6
  744. package/dist/renderer/environment-classify.d.ts.map +0 -1
  745. package/dist/renderer/environment-error.d.ts +0 -13
  746. package/dist/renderer/environment-error.d.ts.map +0 -1
  747. package/dist/renderer/material/pipeline-projection.d.ts +0 -91
  748. package/dist/renderer/material/pipeline-projection.d.ts.map +0 -1
  749. package/dist/renderer/renderer-factory.d.ts +0 -283
  750. package/dist/renderer/renderer-factory.d.ts.map +0 -1
  751. package/dist/renderer.d.ts +0 -771
  752. package/dist/renderer.d.ts.map +0 -1
  753. package/dist/scene-utils/collect-subtree.d.ts +0 -11
  754. package/dist/scene-utils/collect-subtree.d.ts.map +0 -1
  755. package/dist/ssao-data.d.ts +0 -34
  756. package/dist/ssao-data.d.ts.map +0 -1
  757. package/dist/surface-format.d.ts +0 -10
  758. package/dist/surface-format.d.ts.map +0 -1
  759. package/dist/taa-history-store.d.ts +0 -88
  760. package/dist/taa-history-store.d.ts.map +0 -1
  761. package/dist/temporal-coverage.d.ts +0 -35
  762. package/dist/temporal-coverage.d.ts.map +0 -1
  763. package/dist/temporal-frame-transaction.d.ts +0 -92
  764. package/dist/temporal-frame-transaction.d.ts.map +0 -1
  765. package/dist/temporal-inspection.d.ts +0 -57
  766. package/dist/temporal-inspection.d.ts.map +0 -1
  767. package/dist/temporal-view.d.ts +0 -43
  768. package/dist/temporal-view.d.ts.map +0 -1
  769. package/dist/tilemap/resolve-tileset-runtime.d.ts +0 -23
  770. package/dist/tilemap/resolve-tileset-runtime.d.ts.map +0 -1
  771. package/dist/urp-pipeline.d.ts +0 -4
  772. package/dist/urp-pipeline.d.ts.map +0 -1
  773. package/src/__tests__/analytic-sky-contract.test.ts +0 -27
  774. package/src/__tests__/analytic-sky-falsify-carriers.mjs +0 -43
  775. package/src/__tests__/analytic-sky-falsify.test.ts +0 -94
  776. package/src/__tests__/assets-runtime-handoff.integration.test.ts +0 -36
  777. package/src/__tests__/backend-selection.integration.test.ts +0 -11
  778. package/src/__tests__/camera-temporal.test-d.ts +0 -8
  779. package/src/__tests__/camera-temporal.test.ts +0 -188
  780. package/src/__tests__/directional-shadow-probe-atlas-layout.unit.test.ts +0 -18
  781. package/src/__tests__/environment-inspection.test.ts +0 -45
  782. package/src/__tests__/fog-ai-user.fixture.ts +0 -350
  783. package/src/__tests__/fog-custom-render-feature.fixture.ts +0 -33
  784. package/src/__tests__/fog-custom-render-feature.integration.test.ts +0 -76
  785. package/src/__tests__/fog-inspection.integration.test.ts +0 -127
  786. package/src/__tests__/fog-owner-state.integration.test.ts +0 -112
  787. package/src/__tests__/fog-pipeline-topology.integration.test.ts +0 -93
  788. package/src/__tests__/fog-public-surface.integration.test.ts +0 -60
  789. package/src/__tests__/fog-ray-contract.integration.test.ts +0 -73
  790. package/src/__tests__/fog-source-absence.integration.test.ts +0 -51
  791. package/src/__tests__/fog-temporal.integration.test.ts +0 -115
  792. package/src/__tests__/frame-chain.unit.test.ts +0 -26
  793. package/src/__tests__/gpu-scene-field-type-owner.test-d.ts +0 -27
  794. package/src/__tests__/hdrp-pipeline.unit.test.ts +0 -100
  795. package/src/__tests__/ibl/ibl-fallback.unit.test.ts +0 -23
  796. package/src/__tests__/material-derived-error-stop-draw.integration.test.ts +0 -69
  797. package/src/__tests__/material-derived-payload.integration.test.ts +0 -164
  798. package/src/__tests__/materials.unit.test.ts +0 -25
  799. package/src/__tests__/param-schema-projection-census.unit.test.ts +0 -40
  800. package/src/__tests__/persistent-render-scene.unit.test.ts +0 -1311
  801. package/src/__tests__/pipeline-error-policy-owner.unit.test.ts +0 -167
  802. package/src/__tests__/pipeline-pass-trace.test.ts +0 -92
  803. package/src/__tests__/pipeline-stage-owner.test-d.ts +0 -13
  804. package/src/__tests__/plugin.test.ts +0 -25
  805. package/src/__tests__/prepared-graphics-backend-matrix.unit.test.ts +0 -129
  806. package/src/__tests__/prepared-graphics-resolver-recording.unit.test.ts +0 -180
  807. package/src/__tests__/public-pipeline-id.test-d.ts +0 -6
  808. package/src/__tests__/render-dispatch-membership.unit.test.ts +0 -117
  809. package/src/__tests__/render-feature-construction.unit.test.ts +0 -124
  810. package/src/__tests__/render-feature-error-code-owner.test-d.ts +0 -27
  811. package/src/__tests__/render-feature-gpu-buffer-usage-owner.test-d.ts +0 -46
  812. package/src/__tests__/render-feature-graph.integration.test.ts +0 -205
  813. package/src/__tests__/render-feature-graphics-staging.unit.test.ts +0 -200
  814. package/src/__tests__/render-feature-order.unit.test.ts +0 -66
  815. package/src/__tests__/render-feature-prepared-graphics-recording.unit.test.ts +0 -107
  816. package/src/__tests__/render-feature-staging.unit.test.ts +0 -94
  817. package/src/__tests__/renderer-render-scene-public.test-d.ts +0 -27
  818. package/src/__tests__/scene-temporal-coverage.unit.test.ts +0 -259
  819. package/src/__tests__/sun-snapshot-consumers.test.ts +0 -35
  820. package/src/__tests__/surface-backend-kind-owner.test-d.ts +0 -42
  821. package/src/__tests__/taa-history-store.unit.test.ts +0 -196
  822. package/src/__tests__/temporal-frame-transaction.integration.test.ts +0 -537
  823. package/src/__tests__/temporal-inspection.unit.test.ts +0 -138
  824. package/src/assets/__tests__/asset-decoders.unit.test.ts +0 -92
  825. package/src/assets/__tests__/mipmap-generator.unit.test.ts +0 -52
  826. package/src/assets/__tests__/render-asset-port.unit.test.ts +0 -54
  827. package/src/assets/__tests__/resolve-render-asset.unit.test.ts +0 -47
  828. package/src/components/__tests__/atmosphere-red.test.ts +0 -51
  829. package/src/components/__tests__/atmosphere.test.ts +0 -79
  830. package/src/components/__tests__/fog.test-d.ts +0 -49
  831. package/src/components/__tests__/fog.test.ts +0 -60
  832. package/src/components/atmosphere.ts +0 -64
  833. package/src/deferred-lighting.ts +0 -92
  834. package/src/dynamic-texture-store.ts +0 -111
  835. package/src/environment/README.md +0 -76
  836. package/src/environment/__tests__/failure-injection.test.ts +0 -50
  837. package/src/environment/__tests__/generation-red.test.ts +0 -64
  838. package/src/environment/__tests__/generation.test.ts +0 -37
  839. package/src/environment/__tests__/graph-transaction.test.ts +0 -85
  840. package/src/environment/__tests__/inspection-red.test.ts +0 -53
  841. package/src/environment/__tests__/lifecycle-evidence.test.ts +0 -40
  842. package/src/environment/__tests__/pipeline-topology.test.ts +0 -33
  843. package/src/environment/__tests__/readiness.test.ts +0 -42
  844. package/src/environment/__tests__/recovery.test.ts +0 -62
  845. package/src/environment/__tests__/resize-dispose.test.ts +0 -30
  846. package/src/environment/__tests__/signature-red.test.ts +0 -45
  847. package/src/environment/__tests__/signature.test.ts +0 -60
  848. package/src/environment/descriptors.ts +0 -7
  849. package/src/environment/extracted-environment.ts +0 -239
  850. package/src/environment/generation.ts +0 -158
  851. package/src/environment/gpu-bundle.ts +0 -144
  852. package/src/environment/graph.ts +0 -588
  853. package/src/environment/inspection.ts +0 -107
  854. package/src/environment/lifecycle.ts +0 -124
  855. package/src/environment/readiness.ts +0 -76
  856. package/src/environment/signature.ts +0 -185
  857. package/src/extract/__tests__/directional-csm-domain.unit.test.ts +0 -391
  858. package/src/extract/__tests__/environment-source.test.ts +0 -105
  859. package/src/extract/__tests__/schema-readers.unit.test.ts +0 -16
  860. package/src/extract/directional-csm.ts +0 -959
  861. package/src/extract/index.ts +0 -10
  862. package/src/extract/material-interface.ts +0 -604
  863. package/src/extract/schema-readers.ts +0 -27
  864. package/src/features/graph-contribution.ts +0 -577
  865. package/src/features/index.ts +0 -100
  866. package/src/features/morph/index.ts +0 -24
  867. package/src/features/morph/morph-bounds.ts +0 -123
  868. package/src/features/scene-temporal.ts +0 -274
  869. package/src/features/taa-resolve.ts +0 -244
  870. package/src/frame-chain.ts +0 -21
  871. package/src/hdrp-cluster-membership.ts +0 -70
  872. package/src/ibl/cubemap-projection.ts +0 -60
  873. package/src/ibl/face-uniforms.ts +0 -150
  874. package/src/mesh-update-errors.ts +0 -113
  875. package/src/mipmap-generator.ts +0 -244
  876. package/src/param-schema-projection-census.ts +0 -73
  877. package/src/persistent-render-scene.ts +0 -1752
  878. package/src/pipeline/index.ts +0 -40
  879. package/src/pipeline-errors.ts +0 -172
  880. package/src/prepare/__tests__/schema-readers.unit.test.ts +0 -16
  881. package/src/prepare/index.ts +0 -8
  882. package/src/prepare/schema-readers.ts +0 -20
  883. package/src/record/__tests__/environment-record.test.ts +0 -35
  884. package/src/record/__tests__/frame-targets.unit.test.ts +0 -54
  885. package/src/record/__tests__/membership-timing.unit.test.ts +0 -524
  886. package/src/record/__tests__/render-submission.integration.test.ts +0 -76
  887. package/src/record/__tests__/render-submission.perf.test.ts +0 -141
  888. package/src/record/__tests__/shadow-submit-mode.unit.test.ts +0 -88
  889. package/src/record/__tests__/view-ubo-layout.unit.test.ts +0 -101
  890. package/src/record/frame-observation.ts +0 -122
  891. package/src/record/index.ts +0 -15
  892. package/src/record/main-pass-skin.ts +0 -51
  893. package/src/record/main-pass-sprite.ts +0 -166
  894. package/src/record/material-payload.ts +0 -292
  895. package/src/record/material-slot-plan.ts +0 -68
  896. package/src/record/membership-timing.ts +0 -1012
  897. package/src/record/shadow-caster-uniform.ts +0 -37
  898. package/src/record/shadow-submit-mode.ts +0 -277
  899. package/src/render-dispatch-membership.ts +0 -155
  900. package/src/render-pipeline-context.ts +0 -332
  901. package/src/render-pipeline-target.ts +0 -96
  902. package/src/render-scene-projection.ts +0 -1738
  903. package/src/render-system-fold.ts +0 -531
  904. package/src/renderer/asset-service.ts +0 -32
  905. package/src/renderer/backend-selection.ts +0 -121
  906. package/src/renderer/environment-classify.ts +0 -30
  907. package/src/renderer/environment-error.ts +0 -19
  908. package/src/renderer/material/pipeline-projection.ts +0 -140
  909. package/src/renderer.ts +0 -940
  910. package/src/scene-utils/collect-subtree.ts +0 -40
  911. package/src/ssao-data.ts +0 -106
  912. package/src/surface-format.ts +0 -37
  913. package/src/taa-history-store.ts +0 -429
  914. package/src/temporal-coverage.ts +0 -106
  915. package/src/temporal-frame-transaction.ts +0 -301
  916. package/src/temporal-inspection.ts +0 -194
  917. package/src/temporal-view.ts +0 -174
  918. package/src/tilemap/resolve-tileset-runtime.ts +0 -72
@@ -9,7 +9,7 @@
9
9
  //
10
10
  // Design axiom: PipelineSpec is business-agnostic — no 'pbr' / 'sprite' / 'skybox'
11
11
  // / 'fullscreen-*' strings appear on the type surface (plan-strategy D-7).
12
- // BGL shape taxonomy lives in ShaderRegistry internal reflection, not in spec.
12
+ // BGL shape taxonomy lives in the ShaderCatalog implementation, not in spec.
13
13
  //
14
14
  // Charter alignment:
15
15
  // F1: single file entrypoint (getOrBuildPipeline) — AI user indexes once
@@ -23,32 +23,22 @@ import {
23
23
  type VertexLayoutProjection,
24
24
  } from '@forgeax/engine-geometry';
25
25
  import {
26
- DEFAULT_STANDARD_PBR_PARAM_SCHEMA,
27
- DEFAULT_UNLIT_PARAM_SCHEMA,
28
- type RegisteredMaterialShaderEntry,
29
- type ShaderRegistry,
30
- } from '@forgeax/engine-shader';
31
- import {
32
- type BindGroupLayoutEntry,
33
- type DerivedMaterialInterface,
34
- derive,
26
+ err,
35
27
  KNOWN_PASS_KINDS,
36
28
  type MaterialRenderState,
37
- type ParamSchemaEntry,
29
+ ok,
38
30
  type PrimitiveTopology,
31
+ type Result,
39
32
  type VertexAttributeMap,
40
33
  } from '@forgeax/engine-types';
41
- import { GPU_SHADER_STAGE_FRAGMENT, GPU_SHADER_STAGE_VERTEX } from './gpu-stage';
42
- import { createHdrpBindGroupLayoutDescriptor } from './hdrp-buffers';
43
- import {
44
- appendInjection,
45
- buildPbrMaterialUserRegionEntries,
46
- buildPbrViewBglEntries,
47
- type PbrCaps,
48
- } from './pbr-pipeline';
34
+ import { VertexColorVariantConflictError } from './errors/render';
49
35
 
50
- const DEFAULT_STANDARD_PBR_PROJECTION = derive(DEFAULT_STANDARD_PBR_PARAM_SCHEMA);
51
- const DEFAULT_UNLIT_PROJECTION = derive(DEFAULT_UNLIT_PARAM_SCHEMA);
36
+ export {
37
+ type BglKind,
38
+ type BindGroupLayoutDescriptorOutput,
39
+ buildBindGroupLayoutDescriptor,
40
+ createHdrpBindGroupLayoutDescriptor,
41
+ } from './pbr-pipeline';
52
42
 
53
43
  // Re-export KNOWN_PASS_KINDS from @forgeax/engine-types for single-file discoverability (charter F1).
54
44
  export { KNOWN_PASS_KINDS };
@@ -68,7 +58,7 @@ export function colorFormatsForPassKind(
68
58
  passKind: string,
69
59
  defaultColorFormat: GPUTextureFormat,
70
60
  ): readonly GPUTextureFormat[] {
71
- if (passKind === 'shadow-caster') return [];
61
+ if (passKindPolicyTable[passKind]?.shape === 'depth-only') return [];
72
62
  if (passKind === 'deferred') return DEFERRED_COLOR_FORMATS;
73
63
  return [defaultColorFormat];
74
64
  }
@@ -88,55 +78,14 @@ export function colorFormatsForPassKind(
88
78
  * - `renderState`: optional per-material render-state overrides (blend/cull/depth/stencil)
89
79
  *
90
80
  * Business-agnostic: no `'pbr'` / `'sprite'` / `'skybox'` strings pollute this
91
- * type. BGL shape taxonomy is derived from `ShaderRegistry` internal reflection
81
+ * type. BGL shape taxonomy is derived from `ShaderCatalog` internal reflection
92
82
  * and never appears on the spec surface (plan-strategy D-7).
93
83
  *
94
84
  * @see plan-strategy §1 (4-axis) · D-7 (business-agnostic) · requirements §3.1
95
85
  */
96
- export interface PipelineSpec {
97
- /** Shader identity + routing axis. */
98
- readonly shader: {
99
- /** Registered shader identifier (e.g. `'forgeax::default-standard-pbr'`). */
100
- readonly id: string;
101
- /** Pass kind for attachment shape selection. Must be in {@link KNOWN_PASS_KINDS} or registered. */
102
- readonly passKind: string;
103
- /** Shader variant set string (e.g. `'SKIN_AVAILABLE=1'`). `undefined` for no variant. */
104
- readonly variantSet: string | undefined;
105
- /** Fragment entry point; omitted means the shader's standard `fs_main`. */
106
- readonly fragmentEntry?: string | undefined;
107
- };
108
- /** Attachment format + sample-count axis. */
109
- readonly attachments: {
110
- /** Colour attachment formats in draw order. Empty for depth-only passes (shadow-caster). */
111
- readonly colorFormats: readonly GPUTextureFormat[];
112
- /** Depth-stencil format, or `undefined` when no depth target is bound. */
113
- readonly depthFormat: GPUTextureFormat | undefined;
114
- /** Sample count: 1 (no MSAA) or 4 (4x MSAA). */
115
- readonly sampleCount: 1 | 4;
116
- };
117
- /** Geometry layout axis. */
118
- readonly geometry: {
119
- /** Primitive topology baked into the PSO. */
120
- readonly topology: PrimitiveTopology;
121
- /** Strip index format (uint16 / uint32), only meaningful for strip topologies. */
122
- readonly stripIndexFormat?: 'uint16' | 'uint32' | undefined;
123
- /** Per-vertex attribute layout (position / normal / uv / tangent / skinIndex / skinWeight). */
124
- readonly vertexLayout: VertexAttributeMap;
125
- /** Canonical geometry-owned projection; derived when omitted for legacy callers. */
126
- readonly vertexLayoutProjection?: VertexLayoutProjection | undefined;
127
- /**
128
- * Number of UV sets declared by the shader (derived from @location reflection).
129
- * Forwarded to deriveVertexBufferLayout for clamp-to-last alias (D-1 / D-4).
130
- * Undefined = fallback to mesh-provided UV count (no clamping).
131
- * feat-20260629-multi-uv-set-support m3-w5: plumbed placeholder.
132
- * TODO(M4/m4-w3): fill from naga reflection JSON when available.
133
- */
134
- readonly shaderUvSetCount?: number | undefined;
135
- };
136
- /** Per-material render-state overrides (optional — engine defaults applied when absent). */
137
- readonly renderState: MaterialRenderState | undefined;
138
- }
86
+ export type { PipelineSpec } from './pipeline-spec-types';
139
87
 
88
+ import type { PipelineSpec } from './pipeline-spec-types';
140
89
  // ══════════════════════════════════════════════════════════════════════════════
141
90
  // PipelineSpecError — closed union (5 + 2 transit codes)
142
91
  // ══════════════════════════════════════════════════════════════════════════════
@@ -153,7 +102,7 @@ export interface PipelineSpec {
153
102
  *
154
103
  * 2 transit codes:
155
104
  * - `'pipeline-build-failed'`: wraps RhiError from device.createRenderPipeline
156
- * - `'shader-not-registered'`: ShaderRegistry.lookup returned undefined
105
+ * - `'shader-not-registered'`: ShaderCatalog lookup returned undefined
157
106
  *
158
107
  * @see requirements §3.4 · AC-10 · charter P3
159
108
  */
@@ -205,55 +154,6 @@ export class PipelineSpecError extends Error {
205
154
  }
206
155
  }
207
156
 
208
- // ══════════════════════════════════════════════════════════════════════════════
209
- // BindGroupLayoutShape — reflection-derived BGL descriptor
210
- // ══════════════════════════════════════════════════════════════════════════════
211
-
212
- /**
213
- * Bind group layout shape derived from ShaderRegistry reflection.
214
- *
215
- * `entries` mirrors `GPUBindGroupLayoutDescriptor.entries` — the binding
216
- * slot layout the shader expects for a given variantSet.
217
- */
218
- export interface BindGroupLayoutShape {
219
- readonly entries: readonly BindGroupLayoutEntry[];
220
- }
221
-
222
- // ══════════════════════════════════════════════════════════════════════════════
223
- // deriveBglShapeFromShader — reflection helper (D-1)
224
- // ══════════════════════════════════════════════════════════════════════════════
225
-
226
- /**
227
- * Derive BGL shape from a registered shader entry's paramSchema.
228
- *
229
- * Pure function: same `entry` always yields the same shape (no variant-set
230
- * dispatch — that role moved into `BglKind` after D-13's closed-union
231
- * dispatch landed; see plan-decisions.md). The `_variantSet` parameter is
232
- * preserved for backward signature compat but ignored — variant routing is
233
- * now explicit at the BglKind level (see `buildBindGroupLayoutDescriptor`
234
- * arms `pbr-skin-mesh-array` vs `hdrp-7-slot` vs `pbr-mesh-array`).
235
- *
236
- * This helper lives in `pipeline-spec.ts` (not ShaderRegistry) per D-1:
237
- * it wraps the existing `derive(paramSchema).bglEntries` from
238
- * `@forgeax/engine-types` so cacheKeyOf can hash BGL shape deterministically
239
- * without expanding the ShaderRegistry public interface.
240
- *
241
- * @param entry - material shader entry from ShaderRegistry.findMaterialArtifact
242
- * @param _variantSet - unused (post D-13); kept for backward signature compat
243
- * @returns the BGL shape for the given entry
244
- * @see plan-decisions.md D-13
245
- */
246
- export function deriveBglShapeFromShader(
247
- entry: RegisteredMaterialShaderEntry,
248
- _variantSet?: string | undefined,
249
- ): BindGroupLayoutShape {
250
- // derive() from @forgeax/engine-types is the actual SSOT; we invoke it
251
- // here so that cacheKeyOf can hash BGL shape deterministically.
252
- return {
253
- entries: entry.paramSchemaProjection.derivedInterface.bglEntries,
254
- };
255
- }
256
-
257
157
  // ══════════════════════════════════════════════════════════════════════════════
258
158
  // renderStateHashSuffix — deterministic hash of MaterialRenderState
259
159
  // ══════════════════════════════════════════════════════════════════════════════
@@ -299,7 +199,7 @@ export function renderStateHash(renderState: MaterialRenderState | undefined): s
299
199
  /**
300
200
  * Compute a deterministic cache key from a PipelineSpec.
301
201
  *
302
- * The key covers all 4 axes + BGL shape hash (derived from ShaderRegistry
202
+ * The key covers all 4 axes + BGL shape hash (derived from ShaderCatalog
303
203
  * reflection via {@link deriveBglShapeFromShader}). Two specs that produce
304
204
  * the same cache key MUST produce byte-identical PSO descriptors.
305
205
  *
@@ -317,8 +217,8 @@ export function cacheKeyOf(spec: PipelineSpec): string {
317
217
  ? `:${geometry.stripIndexFormat}`
318
218
  : '';
319
219
 
320
- // Hash vertexLayout deterministically the digest is identity-cached for
321
- // immutable mesh-asset maps reused across submeshes and frames.
220
+ // The geometry owner publishes one immutable projection. Legacy callers may
221
+ // still provide only the map; derive the same projection at this boundary.
322
222
  const vlDigest =
323
223
  geometry.vertexLayoutProjection?.digest ??
324
224
  deriveVertexLayoutProjection(geometry.vertexLayout).digest;
@@ -335,13 +235,11 @@ export function cacheKeyOf(spec: PipelineSpec): string {
335
235
  // variantSet literal contains it; guarded by
336
236
  // `pipeline-cache-keying.unit.test.ts` sentinel-conflict assertions.
337
237
  const variantSegment = shader.variantSet === undefined ? '~' : shader.variantSet;
338
- const fragmentEntrySegment = shader.fragmentEntry ?? 'fs_main';
339
238
  return (
340
239
  [
341
240
  shader.id,
342
241
  shader.passKind,
343
242
  variantSegment,
344
- fragmentEntrySegment,
345
243
  attachments.colorFormats.join(','),
346
244
  attachments.depthFormat ?? '',
347
245
  String(attachments.sampleCount),
@@ -353,6 +251,42 @@ export function cacheKeyOf(spec: PipelineSpec): string {
353
251
  );
354
252
  }
355
253
 
254
+ /**
255
+ * Reconcile the authored vertex-color shader axis with the geometry-owned
256
+ * projection. COLOR_0 is a geometry fact and cannot be selected independently
257
+ * by a material variant.
258
+ */
259
+ export function variantSetFromVertexLayoutProjection(
260
+ projection: VertexLayoutProjection,
261
+ authoredVariantSet: string | undefined,
262
+ ): Result<string, VertexColorVariantConflictError> {
263
+ const projected = projection.attributes.some((attribute) => attribute.key === 'color');
264
+ const axis = `VERTEX_COLOR_AVAILABLE=${projected ? 'true' : 'false'}`;
265
+ if (authoredVariantSet === undefined) return ok(axis);
266
+ if (projected && authoredVariantSet === '') return ok(authoredVariantSet);
267
+
268
+ const authoredParts = authoredVariantSet.split('+');
269
+ const authoredColorPart = authoredParts.find((part) =>
270
+ part.startsWith('VERTEX_COLOR_AVAILABLE='),
271
+ );
272
+ if (authoredColorPart === undefined) {
273
+ const parts = authoredParts.filter((part) => part.length > 0);
274
+ parts.push(axis);
275
+ return ok(parts.join('+'));
276
+ }
277
+
278
+ const authoredValue = authoredColorPart.slice('VERTEX_COLOR_AVAILABLE='.length);
279
+ const authored = authoredValue === 'true';
280
+ if ((authoredValue !== 'true' && authoredValue !== 'false') || authored !== projected) {
281
+ return err(new VertexColorVariantConflictError(authoredValue, projected));
282
+ }
283
+ const parts = authoredParts.filter(
284
+ (part) => part.length > 0 && !part.startsWith('VERTEX_COLOR_AVAILABLE='),
285
+ );
286
+ parts.push(axis);
287
+ return ok(parts.join('+'));
288
+ }
289
+
356
290
  /**
357
291
  * Build a `GPURenderPipelineDescriptor` from a PipelineSpec + shader modules.
358
292
  *
@@ -390,13 +324,8 @@ export function buildPipelineDescriptor(
390
324
 
391
325
  const { attachments, geometry, renderState } = spec;
392
326
 
393
- const isShadowCaster = spec.shader.passKind === 'shadow-caster';
394
- const isStrip = geometry.topology === 'line-strip' || geometry.topology === 'triangle-strip';
395
-
396
- // A supplied projection is already the geometry owner's immutable GPU
397
- // descriptor. Do not re-derive it from the caller's attribute map: that
398
- // would permit a stale map to disagree with the uploaded interleaved bytes.
399
- // Legacy callers without a projection retain the UV aliasing derivation.
327
+ // A supplied projection is the geometry owner's immutable GPU descriptor.
328
+ // Do not re-derive it from a possibly stale attribute map.
400
329
  const vertexBuffers =
401
330
  geometry.vertexLayoutProjection === undefined
402
331
  ? deriveVertexBufferLayout(geometry.vertexLayout, {
@@ -428,7 +357,7 @@ export function buildPipelineDescriptor(
428
357
  };
429
358
 
430
359
  // Fragment stage: absent for shadow-caster (depth-only), present for forward.
431
- if (!isShadowCaster && attachments.colorFormats.length > 0) {
360
+ if (attachments.colorFormats.length > 0) {
432
361
  descriptor.fragment = {
433
362
  module: modules.fragment,
434
363
  entryPoint: modules.fragmentEntryPoint ?? 'fs_main',
@@ -453,7 +382,7 @@ export function buildPipelineDescriptor(
453
382
  cullMode: renderState?.cullMode ?? 'back',
454
383
  frontFace: renderState?.frontFace ?? 'ccw',
455
384
  };
456
- if (isStrip && geometry.stripIndexFormat !== undefined) {
385
+ if (geometry.topology.endsWith('strip') && geometry.stripIndexFormat !== undefined) {
457
386
  primitive.stripIndexFormat = geometry.stripIndexFormat;
458
387
  }
459
388
  descriptor.primitive = primitive;
@@ -478,7 +407,7 @@ export function buildPipelineDescriptor(
478
407
  descriptor.depthStencil = ds;
479
408
  }
480
409
 
481
- // Multisample: absent for sampleCount=1 (undefined). For any value > 1,
410
+ // Multisample: absent for sampleCount=1 (undefined). For each value > 1,
482
411
  // emit { count: sampleCount } so forward-compat sample counts (2, 8, …)
483
412
  // flow through to the descriptor without requiring a type change.
484
413
  if (attachments.sampleCount > 1) {
@@ -491,407 +420,6 @@ export function buildPipelineDescriptor(
491
420
  return descriptor;
492
421
  }
493
422
 
494
- // ══════════════════════════════════════════════════════════════════════════════
495
- // BglKind dispatch (M3 / D-13) — closed union of BGL shapes the runtime ships
496
- // ══════════════════════════════════════════════════════════════════════════════
497
-
498
- /**
499
- * Closed union of bind-group-layout shapes the runtime constructs.
500
- *
501
- * Each kind names one physically distinct BGL the runtime has historically
502
- * built by hand. {@link buildBindGroupLayoutDescriptor} dispatches on this
503
- * union so every `device.createBindGroupLayout(...)` call site shares one
504
- * SSOT for entries / labels (plan-strategy §3.2; D-13 round-2 decision).
505
- *
506
- * Three groups by derivation source:
507
- * 1. Shader-derived (paramSchema reflection + injection chain):
508
- * - `'pbr-material-merged'` — derived user region + Skylight 7 + lightmap 4
509
- * - `'unlit-material'` — 7 entries: base PBR material only (no inject)
510
- * - `'hdrp-7-slot'` — 7 entries (binding 0 + 3..8): HDRP cluster + SSAO group(2) BGL
511
- * 2. Caps-driven literal shapes (no shader):
512
- * - `'pbr-view'` — 10 entries: view UBO + lights + 6 shadow bindings
513
- * (directional 3/4, point 5/6, cascade 7, spot atlas 8, spot
514
- * lightViewProj matrices 9 — feat-20260625)
515
- * - `'pbr-mesh-array'` — 1 entry: per-entity mesh SSBO (dynamic-offset)
516
- * - `'pbr-instances'` — 1 entry: per-instance SSBO (no dynamic-offset)
517
- * - `'pbr-skin-mesh-array'` — 3 entries: meshes + current/previous skin palettes
518
- * 3. Attachment-driven (fullscreen post-process):
519
- * - `'fullscreen-post'` — 2 entries: input texture + sampler. The texture
520
- * `sampleType` is derived from `spec.attachments` (plan §R3 fix):
521
- * `'depth32float'` → `'depth'`; `'r32float'` → `'unfilterable-float'`;
522
- * else → `'float'`.
523
- * - `'fullscreen-post-with-params'` — 3 entries: the same texture@0 +
524
- * sampler@1 as `'fullscreen-post'`, plus a `buffer@2` uniform for the
525
- * per-frame params UBO (feat-20260621 D-2: `entry.params !== undefined`
526
- * passes route here; the layout stays group(1), q3=B). `'fullscreen-post'`
527
- * stays byte-identical so param-less consumers degrade with no change.
528
- * - `'fullscreen-post-with-scene-depth-msaa'` — the depth-read layout with
529
- * `texture.multisampled=true`, selected for a 4-sample scene depth target.
530
- */
531
- export type BglKind =
532
- | 'pbr-view'
533
- | 'pbr-material-merged'
534
- | 'pbr-mesh-array'
535
- | 'pbr-instances'
536
- | 'pbr-skin-mesh-array'
537
- | 'unlit-material'
538
- | 'hdrp-7-slot'
539
- | 'fullscreen-post'
540
- | 'fullscreen-post-with-params'
541
- | 'fullscreen-post-with-scene-depth'
542
- | 'fullscreen-post-with-scene-depth-msaa'
543
- | 'fullscreen-post-with-gbuffer-depth';
544
-
545
- /**
546
- * Output shape of {@link buildBindGroupLayoutDescriptor}: matches the RHI
547
- * `BindGroupLayoutDescriptor` (label + entries with `ExplicitUndefined`) so
548
- * the result can be passed directly to `device.createBindGroupLayout(...)`.
549
- *
550
- * `entries` is a mutable `Array` to match `GPUBindGroupLayoutDescriptor`
551
- * (WebGPU types declare it mutable). Callers MUST treat the array as
552
- * read-only — the dispatcher freezes neither the array nor its entries
553
- * for hot-path performance.
554
- */
555
- export interface BindGroupLayoutDescriptorOutput {
556
- readonly label: string | undefined;
557
- readonly entries: GPUBindGroupLayoutEntry[];
558
- }
559
-
560
- /**
561
- * Build a `GPUBindGroupLayoutDescriptor` from a PipelineSpec, dispatching on
562
- * `options.kind` to one of 9 closed BGL shapes (D-13 round-2).
563
- *
564
- * Shader-derived kinds (`'pbr-material-merged'` / `'unlit-material'` /
565
- * `'hdrp-7-slot'`) require `options.registry` to look up the shader entry
566
- * and reflect its `paramSchema` via {@link deriveBglShapeFromShader}; they
567
- * compose the per-entry injection chain (Skylight + lightmap for material;
568
- * HDRP variantSet for cluster-forward).
569
- *
570
- * Caps-driven kinds (`'pbr-view'` / `'pbr-mesh-array'` / `'pbr-instances'` /
571
- * `'pbr-skin-mesh-array'`) require `options.caps` for the storage-buffer
572
- * vs uniform-buffer fallback (RhiCaps.storageBuffer; PBR feat-20260526 M3 /
573
- * w9). They are wholly determined by the caps shape.
574
- *
575
- * Attachment-driven kind (`'fullscreen-post'`) reads
576
- * `spec.attachments.depthFormat` and `spec.attachments.colorFormats[0]` to
577
- * pick the texture binding's `sampleType` (R3 fix: `'depth32float'` → `'depth'`,
578
- * `'r32float'` → `'unfilterable-float'`, else → `'float'`).
579
- *
580
- * @param spec - the pipeline spec (axis source for reflection / caps fallback)
581
- * @param options.kind - which BGL shape to build (closed {@link BglKind} union)
582
- * @param options.registry - ShaderRegistry for shader-derived kinds
583
- * @param options.caps - caps shape for caps-driven kinds (storageBuffer)
584
- * @returns a WebGPU bind-group-layout descriptor (entries + label)
585
- * @see plan-strategy §3.2 · plan-decisions D-13 · requirements AC-02
586
- */
587
- /**
588
- * Resolve the material paramSchema for a per-shader user-region BGL derivation.
589
- *
590
- * Priority (D-1): explicit `options.materialParamSchema` > registry lookup of
591
- * `spec.shader.id` > `undefined` (the user-region builder then falls back to
592
- * the built-in standard-PBR 4-texture schema, whose user region is 9 entries).
593
- */
594
- function resolveMaterialProjection(
595
- spec: PipelineSpec,
596
- options: { registry?: ShaderRegistry; materialParamSchema?: readonly ParamSchemaEntry[] },
597
- ): DerivedMaterialInterface | undefined {
598
- if (options.registry !== undefined) {
599
- const lookup = options.registry.findMaterialArtifact(spec.shader.id);
600
- if (lookup.ok) return lookup.value.paramSchemaProjection.derivedInterface;
601
- }
602
- // Compatibility seam for callers that have not reached ShaderRegistry
603
- // admission yet. Runtime registry callers always take the branch above.
604
- if (options.materialParamSchema !== undefined) return derive(options.materialParamSchema);
605
- return undefined;
606
- }
607
-
608
- export function buildBindGroupLayoutDescriptor(
609
- spec: PipelineSpec,
610
- options: {
611
- kind: BglKind;
612
- registry?: ShaderRegistry;
613
- caps?: PbrCaps;
614
- /**
615
- * Material paramSchema for the per-shader user-region derivation
616
- * (`'pbr-material-merged'` / `'unlit-material'`). When supplied it is the
617
- * authoritative source for the user-region BGL shape (D-1); when omitted,
618
- * `buildPbrMaterialUserRegionEntries` falls back to the built-in
619
- * standard-PBR 4-texture schema (user region is 9 entries), so
620
- * the caps-driven `buildPbrPipelineLayouts` seam keeps working unchanged.
621
- * A registry + resolvable shader id takes precedence over this field.
622
- */
623
- materialParamSchema?: readonly ParamSchemaEntry[];
624
- },
625
- ): BindGroupLayoutDescriptorOutput {
626
- switch (options.kind) {
627
- case 'pbr-view': {
628
- const caps = options.caps ?? { storageBuffer: true };
629
- return {
630
- label: 'pbr-view-bgl',
631
- entries: buildPbrViewBglEntries(caps),
632
- };
633
- }
634
- case 'pbr-mesh-array': {
635
- const caps = options.caps ?? { storageBuffer: true };
636
- const meshBufType: GPUBufferBindingType = caps.storageBuffer
637
- ? 'read-only-storage'
638
- : 'uniform';
639
- // sprite-lit's fragment stage does not read the mesh SSBO -- worldPos
640
- // is carried through the VsOut interpolant. Visibility is kept widened
641
- // to VERTEX|FRAGMENT because the BGL JSON is compared byte-identically
642
- // across the sprite / sprite-lit / PBR pipelines that share this
643
- // descriptor; narrowing here would change every sibling pipeline's
644
- // BGL fingerprint. WebGPU rejects createRenderPipeline when a fragment
645
- // stage accesses a binding whose BGL visibility excludes FRAGMENT --
646
- // widening is permissive (validation-only, no perf cost).
647
- return {
648
- label: 'pbr-mesh-array-bgl',
649
- entries: [
650
- {
651
- binding: 0,
652
- visibility: GPU_SHADER_STAGE_VERTEX | GPU_SHADER_STAGE_FRAGMENT,
653
- buffer: { type: meshBufType, hasDynamicOffset: true },
654
- },
655
- ],
656
- };
657
- }
658
- case 'pbr-instances': {
659
- const caps = options.caps ?? { storageBuffer: true };
660
- const meshBufType: GPUBufferBindingType = caps.storageBuffer
661
- ? 'read-only-storage'
662
- : 'uniform';
663
- return {
664
- label: 'pbr-instances-bgl',
665
- entries: [
666
- {
667
- binding: 0,
668
- visibility: GPU_SHADER_STAGE_VERTEX,
669
- buffer: { type: meshBufType, hasDynamicOffset: false },
670
- },
671
- ],
672
- };
673
- }
674
- case 'pbr-skin-mesh-array': {
675
- const caps = options.caps ?? { storageBuffer: true };
676
- const meshBufType: GPUBufferBindingType = caps.storageBuffer
677
- ? 'read-only-storage'
678
- : 'uniform';
679
- return {
680
- label: 'pbr-skin-mesh-array-bgl',
681
- entries: [
682
- {
683
- binding: 0,
684
- visibility: GPU_SHADER_STAGE_VERTEX | GPU_SHADER_STAGE_FRAGMENT,
685
- buffer: { type: meshBufType, hasDynamicOffset: true },
686
- },
687
- {
688
- binding: 1,
689
- visibility: GPU_SHADER_STAGE_VERTEX,
690
- buffer: { type: meshBufType, hasDynamicOffset: true },
691
- },
692
- {
693
- binding: 2,
694
- visibility: GPU_SHADER_STAGE_VERTEX,
695
- buffer: { type: meshBufType, hasDynamicOffset: true },
696
- },
697
- ],
698
- };
699
- }
700
- case 'pbr-material-merged': {
701
- // Material BGL: per-shader user-region (derive(paramSchema).bglEntries)
702
- // + IBL injection (7). Emissive and occlusion are material texture
703
- // parameters in the derived user-region; they are not a second
704
- // engine-owned lightmap ledger.
705
- //
706
- // Schema source priority (D-1): explicit materialParamSchema option >
707
- // registry lookup of spec.shader.id > built-in standard-PBR fallback.
708
- const resolvedProjection =
709
- resolveMaterialProjection(spec, options) ?? DEFAULT_STANDARD_PBR_PROJECTION;
710
- const userRegion = buildPbrMaterialUserRegionEntries(resolvedProjection);
711
- const afterIbl = [...userRegion, ...appendInjection(userRegion, 'ibl')];
712
- return {
713
- label: 'pbr-material-skylight-bgl',
714
- entries: afterIbl,
715
- };
716
- }
717
- case 'unlit-material': {
718
- // Unlit material BGL: per-shader user-region only. No IBL/lightmap
719
- // injection (D-5 round-4: unlit demos do not pay for IBL state).
720
- const resolvedProjection =
721
- resolveMaterialProjection(spec, options) ?? DEFAULT_UNLIT_PROJECTION;
722
- return {
723
- label: 'unlit-material-bgl',
724
- entries: buildPbrMaterialUserRegionEntries(resolvedProjection),
725
- };
726
- }
727
- case 'hdrp-7-slot': {
728
- // HDRP unified BGL for group(2): 9 entries (binding 0 + 3..8). The
729
- // shape depends on caps.storageBuffer for the cluster-buffer fallback.
730
- const caps = options.caps ?? { storageBuffer: true };
731
- const desc = createHdrpBindGroupLayoutDescriptor(caps.storageBuffer);
732
- if (options.registry !== undefined) {
733
- const lookup = options.registry.findMaterialArtifact(spec.shader.id);
734
- if (lookup.ok) {
735
- deriveBglShapeFromShader(lookup.value, spec.shader.variantSet);
736
- }
737
- }
738
- return {
739
- label: desc.label ?? 'hdrp-unified-bgl-group2',
740
- entries: desc.entries ?? [],
741
- };
742
- }
743
- case 'fullscreen-post': {
744
- // Fullscreen post-process BGL: 2 entries (input texture + sampler).
745
- // R3 fix: derive sampleType from spec.attachments. Depth attachments
746
- // (depth32float) need `sampleType: 'depth'`; r32float needs
747
- // `'unfilterable-float'`; everything else (rgba8unorm-srgb, rgba16float,
748
- // bgra8unorm, …) is filterable `'float'`.
749
- return {
750
- label: 'fullscreen-post-bgl',
751
- entries: buildFullscreenPostInputEntries(spec),
752
- };
753
- }
754
- case 'fullscreen-post-with-params': {
755
- // feat-20260621 D-2: the same input texture@0 + sampler@1 as
756
- // 'fullscreen-post', plus binding 2 = per-frame params UBO (uniform).
757
- // The first two entries reuse buildFullscreenPostInputEntries so the
758
- // sampleType derivation stays a single SSOT; 'fullscreen-post' is
759
- // untouched (param-less zero-regression, R-A7).
760
- return {
761
- label: 'fullscreen-post-with-params-bgl',
762
- entries: [
763
- ...buildFullscreenPostInputEntries(spec),
764
- {
765
- binding: 2,
766
- visibility: GPU_SHADER_STAGE_FRAGMENT,
767
- buffer: { type: 'uniform' },
768
- },
769
- ],
770
- };
771
- }
772
- case 'fullscreen-post-with-scene-depth': {
773
- // plan-strategy D-3: 5-entry BGL for post-process passes that read the
774
- // camera scene depth. color@0 + sampler@1 reuse buildFullscreenPostInputEntries
775
- // (float+filtering for color). depthTex@3 uses `sampleType: 'depth'` and
776
- // `dimension: '2d'`; depthSampler@4 uses `type: 'non-filtering'` (nearest
777
- // + clamp-to-edge, D-2 — NOT comparison). params@2 is always present
778
- // (uniform) to avoid a 2x2 kind explosion per D-3.
779
- return {
780
- label: 'fullscreen-post-with-scene-depth-bgl',
781
- entries: [
782
- ...buildFullscreenPostInputEntries(spec),
783
- {
784
- binding: 2,
785
- visibility: GPU_SHADER_STAGE_FRAGMENT,
786
- buffer: { type: 'uniform' },
787
- },
788
- {
789
- binding: 3,
790
- visibility: GPU_SHADER_STAGE_FRAGMENT,
791
- texture: { sampleType: 'depth', viewDimension: '2d' },
792
- },
793
- {
794
- binding: 4,
795
- visibility: GPU_SHADER_STAGE_FRAGMENT,
796
- sampler: { type: 'non-filtering' },
797
- },
798
- ],
799
- };
800
- }
801
- case 'fullscreen-post-with-scene-depth-msaa': {
802
- return {
803
- label: 'fullscreen-post-with-scene-depth-msaa-bgl',
804
- entries: [
805
- ...buildFullscreenPostInputEntries(spec),
806
- {
807
- binding: 2,
808
- visibility: GPU_SHADER_STAGE_FRAGMENT,
809
- buffer: { type: 'uniform' },
810
- },
811
- {
812
- binding: 3,
813
- visibility: GPU_SHADER_STAGE_FRAGMENT,
814
- texture: { sampleType: 'depth', viewDimension: '2d', multisampled: true },
815
- },
816
- {
817
- binding: 4,
818
- visibility: GPU_SHADER_STAGE_FRAGMENT,
819
- sampler: { type: 'non-filtering' },
820
- },
821
- ],
822
- };
823
- }
824
- case 'fullscreen-post-with-gbuffer-depth': {
825
- return {
826
- label: 'fullscreen-post-with-gbuffer-depth-bgl',
827
- entries: [
828
- ...buildFullscreenPostInputEntries(spec),
829
- {
830
- binding: 2,
831
- visibility: GPU_SHADER_STAGE_FRAGMENT,
832
- buffer: { type: 'uniform' },
833
- },
834
- {
835
- binding: 3,
836
- visibility: GPU_SHADER_STAGE_FRAGMENT,
837
- texture: { sampleType: 'depth', viewDimension: '2d' },
838
- },
839
- {
840
- binding: 4,
841
- visibility: GPU_SHADER_STAGE_FRAGMENT,
842
- sampler: { type: 'non-filtering' },
843
- },
844
- {
845
- binding: 5,
846
- visibility: GPU_SHADER_STAGE_FRAGMENT,
847
- texture: { sampleType: 'float', viewDimension: '2d' },
848
- },
849
- {
850
- binding: 6,
851
- visibility: GPU_SHADER_STAGE_FRAGMENT,
852
- texture: { sampleType: 'float', viewDimension: '2d' },
853
- },
854
- ],
855
- };
856
- }
857
- }
858
- }
859
-
860
- /**
861
- * The shared texture@0 + sampler@1 entries for fullscreen post-process BGLs.
862
- * sampleType is derived from `spec.attachments` (R3 fix): depth attachments →
863
- * `'depth'` + `'comparison'` sampler; `'r32float'` → `'unfilterable-float'`;
864
- * else → `'float'` + `'filtering'`. Both `'fullscreen-post'` and
865
- * `'fullscreen-post-with-params'` reuse this so the derivation is one SSOT.
866
- */
867
- function buildFullscreenPostInputEntries(spec: PipelineSpec): GPUBindGroupLayoutEntry[] {
868
- const inputFormat: GPUTextureFormat | undefined =
869
- spec.attachments.depthFormat ?? spec.attachments.colorFormats[0];
870
- const sampleType: GPUTextureSampleType =
871
- inputFormat === 'depth32float' ||
872
- inputFormat === 'depth24plus' ||
873
- inputFormat === 'depth24plus-stencil8' ||
874
- inputFormat === 'depth16unorm'
875
- ? 'depth'
876
- : inputFormat === 'r32float'
877
- ? 'unfilterable-float'
878
- : 'float';
879
- return [
880
- {
881
- binding: 0,
882
- visibility: GPU_SHADER_STAGE_FRAGMENT,
883
- texture: { sampleType, viewDimension: '2d' },
884
- },
885
- {
886
- binding: 1,
887
- visibility: GPU_SHADER_STAGE_FRAGMENT,
888
- sampler: {
889
- type: sampleType === 'depth' ? 'comparison' : 'filtering',
890
- },
891
- },
892
- ];
893
- }
894
-
895
423
  // ══════════════════════════════════════════════════════════════════════════════
896
424
  // passKindPolicyTable — closed map: passKind → attachment shape + default ops
897
425
  // ══════════════════════════════════════════════════════════════════════════════
@@ -985,15 +513,6 @@ export const passKindPolicyTable: Readonly<Record<string, PassKindAttachmentPoli
985
513
  },
986
514
  defaultDepthOps: { loadOp: 'clear', storeOp: 'store', clearValue: 1 },
987
515
  },
988
- temporal: {
989
- shape: 'color-and-depth',
990
- defaultColorOps: {
991
- loadOp: 'clear',
992
- storeOp: 'store',
993
- clearValue: { r: 0, g: 0, b: -1, a: 1 },
994
- },
995
- defaultDepthOps: { loadOp: 'clear', storeOp: 'store', clearValue: 1 },
996
- },
997
516
  'shadow-caster': {
998
517
  shape: 'depth-only',
999
518
  defaultColorOps: undefined,
@@ -1083,7 +602,7 @@ export const passKindPolicyTable: Readonly<Record<string, PassKindAttachmentPoli
1083
602
  *
1084
603
  * Stencil-op gate is auto-derived from `specAttachments.depthFormat`:
1085
604
  * - `'depth24plus-stencil8'` → emits `stencilLoadOp:'clear', stencilStoreOp:'discard'`
1086
- * - any other depth format → omits stencil ops entirely
605
+ * - every other depth format → omits stencil ops entirely
1087
606
  *
1088
607
  * This collapses the R3/R5 stencil-op duplicates that previously lived inline
1089
608
  * at every forward-pass beginRenderPass site.
@@ -1192,64 +711,6 @@ export function buildBeginRenderPassDescriptor(
1192
711
  return out;
1193
712
  }
1194
713
 
1195
- /**
1196
- * Dev-mode equality check: two PipelineSpec instances are structurally equal
1197
- * when every axis field is `===` (shallow compare).
1198
- *
1199
- * Not intended for runtime hot paths — use `cacheKeyOf(a) === cacheKeyOf(b)`
1200
- * for cache-hit checks. This function exists for dev-time assertions
1201
- * (`assert(specsEqual(specA, specB))`) and unit-test round-trip verification.
1202
- *
1203
- * @see plan-strategy §3.2 · requirements AC-02
1204
- */
1205
- export function specsEqual(a: PipelineSpec, b: PipelineSpec): boolean {
1206
- if (
1207
- a.shader.id !== b.shader.id ||
1208
- a.shader.passKind !== b.shader.passKind ||
1209
- a.shader.variantSet !== b.shader.variantSet ||
1210
- a.attachments.colorFormats.length !== b.attachments.colorFormats.length ||
1211
- !a.attachments.colorFormats.every((f, i) => f === b.attachments.colorFormats[i]) ||
1212
- a.attachments.depthFormat !== b.attachments.depthFormat ||
1213
- a.attachments.sampleCount !== b.attachments.sampleCount ||
1214
- a.geometry.topology !== b.geometry.topology ||
1215
- a.geometry.stripIndexFormat !== b.geometry.stripIndexFormat
1216
- ) {
1217
- return false;
1218
- }
1219
-
1220
- // VertexLayout: same reference or structurally equal keys + byte lengths
1221
- if (a.geometry.vertexLayout !== b.geometry.vertexLayout) {
1222
- const aKeys = Object.keys(a.geometry.vertexLayout).sort();
1223
- const bKeys = Object.keys(b.geometry.vertexLayout).sort();
1224
- if (aKeys.length !== bKeys.length || !aKeys.every((k, i) => k === bKeys[i])) return false;
1225
- for (const k of aKeys) {
1226
- const aBuf = a.geometry.vertexLayout[k as keyof VertexAttributeMap];
1227
- const bBuf = b.geometry.vertexLayout[k as keyof VertexAttributeMap];
1228
- if (aBuf === bBuf) continue;
1229
- if (aBuf === undefined || bBuf === undefined) return false;
1230
- if ((aBuf as ArrayBuffer).byteLength !== (bBuf as ArrayBuffer).byteLength) return false;
1231
- }
1232
- }
1233
-
1234
- // RenderState: same reference or JSON-equal
1235
- if (a.renderState !== b.renderState) {
1236
- if (a.renderState === undefined || b.renderState === undefined) return false;
1237
- const aSorted = Object.keys(a.renderState).sort();
1238
- const bSorted = Object.keys(b.renderState).sort();
1239
- if (aSorted.length !== bSorted.length || !aSorted.every((k, i) => k === bSorted[i]))
1240
- return false;
1241
- for (const k of aSorted) {
1242
- if (
1243
- a.renderState[k as keyof MaterialRenderState] !==
1244
- b.renderState[k as keyof MaterialRenderState]
1245
- )
1246
- return false;
1247
- }
1248
- }
1249
-
1250
- return true;
1251
- }
1252
-
1253
714
  /**
1254
715
  * Validate a PipelineSpec before attempting to build.
1255
716
  *
@@ -1287,19 +748,21 @@ export function validateSpec(
1287
748
  ok: false,
1288
749
  code: 'unknown-pass-kind',
1289
750
  detail: { expected: KNOWN_PASS_KINDS, actual: spec.shader.passKind },
1290
- hint: `passKind '${spec.shader.passKind}' is not in KNOWN_PASS_KINDS; register custom pass kinds via ShaderRegistry`,
751
+ hint: `passKind '${spec.shader.passKind}' is not in KNOWN_PASS_KINDS; register custom pass kinds via ShaderCatalog`,
1291
752
  };
1292
753
  }
1293
754
 
1294
755
  // Check 3: depth-testing renderState without a depthFormat
1295
- if (spec.attachments.depthFormat === undefined && spec.renderState?.depthCompare !== undefined) {
756
+ const depthOnly = passKindPolicyTable[spec.shader.passKind]?.shape === 'depth-only';
757
+ const depthRequired = !!spec.renderState?.depthCompare || depthOnly;
758
+ if (!spec.attachments.depthFormat && depthRequired) {
1296
759
  return {
1297
760
  ok: false,
1298
761
  code: 'attachment-format-incompatible',
1299
762
  detail: {
1300
- reason: 'depth-compare-without-depth-format',
1301
- expected: 'depthFormat must be set when renderState.depthCompare is defined',
1302
- actual: `depthFormat=${String(spec.attachments.depthFormat)}, depthCompare=${spec.renderState.depthCompare}`,
763
+ reason: 'depth-requirement-without-depth-format',
764
+ expected: 'depthFormat must be set when depth testing or a depth-only pass is requested',
765
+ actual: `depthFormat=${String(spec.attachments.depthFormat)}, depthCompare=${spec.renderState?.depthCompare}`,
1303
766
  },
1304
767
  hint: 'set attachments.depthFormat (e.g. depth24plus-stencil8 or depth32float) when renderState specifies depthCompare',
1305
768
  };
@@ -1417,8 +880,8 @@ const PROCEDURAL_ATTR_LAYOUT: VertexAttributeMap = {
1417
880
  tangent: new Float32Array(0),
1418
881
  };
1419
882
 
1420
- const HDR_FORMAT: GPUTextureFormat = 'rgba16float' as unknown as GPUTextureFormat;
1421
- const DEPTH_DS: GPUTextureFormat = 'depth24plus-stencil8' as unknown as GPUTextureFormat;
883
+ const HDR_FORMAT: GPUTextureFormat = 'rgba16float';
884
+ const DEPTH_DS: GPUTextureFormat = 'depth24plus-stencil8';
1422
885
 
1423
886
  /**
1424
887
  * Default LDR view format used when callers ask for the SPEC_CONST table
@@ -1428,7 +891,7 @@ const DEPTH_DS: GPUTextureFormat = 'depth24plus-stencil8' as unknown as GPUTextu
1428
891
  * format selected by `selectSwapChainFormat` (Channel 2 BGRA / Channel 3
1429
892
  * RGBA / dawn-node RGBA — see bug-20260615 fix-up note in `createRenderer`).
1430
893
  */
1431
- const DEFAULT_LDR_FORMAT: GPUTextureFormat = 'bgra8unorm-srgb' as unknown as GPUTextureFormat;
894
+ const DEFAULT_LDR_FORMAT: GPUTextureFormat = 'bgra8unorm-srgb';
1432
895
 
1433
896
  const TRI_GEOMETRY = {
1434
897
  topology: 'triangle-list' as PrimitiveTopology,
@@ -1485,7 +948,7 @@ const URP_PBR_VARIANT_SET = 'CLUSTER_FORWARD_AVAILABLE=false+STORAGE_BUFFER_AVAI
1485
948
  * - sprite goes through `getMaterialShaderPipeline('forgeax::sprite', ...)`
1486
949
  * lazily at first transparent-LDR-split draw — no boot-time pre-warm.
1487
950
  * - HDRP variant (`variantSet=''` or compound `=true` form) is registered
1488
- * lazily on `installPipeline(hdrpAsset)`, not at boot — adding HDRP
951
+ * lazily when the clustered Standard profile activates, not at boot — adding clustered
1489
952
  * prewarm here would build PSOs against the URP layout (the boot-time
1490
953
  * `pbrModule` is the URP variant when `isHdrpActive=false`)
1491
954
  *