@forgeax/engine-render 0.0.0-dev.8d955ade1c79

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 (891) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +647 -0
  3. package/dist/.tsbuildinfo +1 -0
  4. package/dist/__tests__/authoring-path.unit.test.d.ts +2 -0
  5. package/dist/__tests__/authoring-path.unit.test.d.ts.map +1 -0
  6. package/dist/__tests__/backend-selection-rhi-capture.test-d.d.ts +2 -0
  7. package/dist/__tests__/backend-selection-rhi-capture.test-d.d.ts.map +1 -0
  8. package/dist/__tests__/callback-inference.test-d.d.ts +2 -0
  9. package/dist/__tests__/callback-inference.test-d.d.ts.map +1 -0
  10. package/dist/__tests__/cluster-binner.test.d.ts +2 -0
  11. package/dist/__tests__/cluster-binner.test.d.ts.map +1 -0
  12. package/dist/__tests__/cluster-grid-default-surface.unit.test.d.ts +2 -0
  13. package/dist/__tests__/cluster-grid-default-surface.unit.test.d.ts.map +1 -0
  14. package/dist/__tests__/construct-renderer-identity.unit.test.d.ts +2 -0
  15. package/dist/__tests__/construct-renderer-identity.unit.test.d.ts.map +1 -0
  16. package/dist/__tests__/device-scope-lifecycle.unit.test.d.ts +2 -0
  17. package/dist/__tests__/device-scope-lifecycle.unit.test.d.ts.map +1 -0
  18. package/dist/__tests__/device-scope-stale-matrix.unit.test.d.ts +2 -0
  19. package/dist/__tests__/device-scope-stale-matrix.unit.test.d.ts.map +1 -0
  20. package/dist/__tests__/direct-extract-consumer-contract.test-d.d.ts +2 -0
  21. package/dist/__tests__/direct-extract-consumer-contract.test-d.d.ts.map +1 -0
  22. package/dist/__tests__/direct-light-snapshot.unit.test.d.ts +2 -0
  23. package/dist/__tests__/direct-light-snapshot.unit.test.d.ts.map +1 -0
  24. package/dist/__tests__/factory-contract.integration.test.d.ts +2 -0
  25. package/dist/__tests__/factory-contract.integration.test.d.ts.map +1 -0
  26. package/dist/__tests__/fallback-row-stride-surface.unit.test.d.ts +2 -0
  27. package/dist/__tests__/fallback-row-stride-surface.unit.test.d.ts.map +1 -0
  28. package/dist/__tests__/frame-observation.contract.test.d.ts +2 -0
  29. package/dist/__tests__/frame-observation.contract.test.d.ts.map +1 -0
  30. package/dist/__tests__/fullscreen-feature-plan.unit.test.d.ts +2 -0
  31. package/dist/__tests__/fullscreen-feature-plan.unit.test.d.ts.map +1 -0
  32. package/dist/__tests__/glyph-text-layout-recovery.unit.test.d.ts +2 -0
  33. package/dist/__tests__/glyph-text-layout-recovery.unit.test.d.ts.map +1 -0
  34. package/dist/__tests__/gpu-driven-indirect-raster-evidence.d.ts +6 -0
  35. package/dist/__tests__/gpu-driven-indirect-raster-evidence.d.ts.map +1 -0
  36. package/dist/__tests__/gpu-driven-indirect-raster.browser.test.d.ts +2 -0
  37. package/dist/__tests__/gpu-driven-indirect-raster.browser.test.d.ts.map +1 -0
  38. package/dist/__tests__/gpu-driven-indirect-raster.dawn.test.d.ts +2 -0
  39. package/dist/__tests__/gpu-driven-indirect-raster.dawn.test.d.ts.map +1 -0
  40. package/dist/__tests__/gpu-driven-production.integration.test.d.ts +2 -0
  41. package/dist/__tests__/gpu-driven-production.integration.test.d.ts.map +1 -0
  42. package/dist/__tests__/gpu-driven-scaling.unit.test.d.ts +2 -0
  43. package/dist/__tests__/gpu-driven-scaling.unit.test.d.ts.map +1 -0
  44. package/dist/__tests__/gpu-driven-view-gpu-evidence.d.ts +18 -0
  45. package/dist/__tests__/gpu-driven-view-gpu-evidence.d.ts.map +1 -0
  46. package/dist/__tests__/gpu-driven-view-graph.integration.test.d.ts +2 -0
  47. package/dist/__tests__/gpu-driven-view-graph.integration.test.d.ts.map +1 -0
  48. package/dist/__tests__/gpu-driven-view-reference.d.ts +15 -0
  49. package/dist/__tests__/gpu-driven-view-reference.d.ts.map +1 -0
  50. package/dist/__tests__/gpu-driven-view.browser.test.d.ts +2 -0
  51. package/dist/__tests__/gpu-driven-view.browser.test.d.ts.map +1 -0
  52. package/dist/__tests__/gpu-driven-view.dawn.test.d.ts +2 -0
  53. package/dist/__tests__/gpu-driven-view.dawn.test.d.ts.map +1 -0
  54. package/dist/__tests__/gpu-driven-view.unit.test.d.ts +2 -0
  55. package/dist/__tests__/gpu-driven-view.unit.test.d.ts.map +1 -0
  56. package/dist/__tests__/gpu-resource-store-stride.unit.test.d.ts +2 -0
  57. package/dist/__tests__/gpu-resource-store-stride.unit.test.d.ts.map +1 -0
  58. package/dist/__tests__/gpu-scene-render-graph-gpu.d.ts +7 -0
  59. package/dist/__tests__/gpu-scene-render-graph-gpu.d.ts.map +1 -0
  60. package/dist/__tests__/gpu-scene-render-graph.browser.test.d.ts +2 -0
  61. package/dist/__tests__/gpu-scene-render-graph.browser.test.d.ts.map +1 -0
  62. package/dist/__tests__/gpu-scene-render-graph.dawn.test.d.ts +2 -0
  63. package/dist/__tests__/gpu-scene-render-graph.dawn.test.d.ts.map +1 -0
  64. package/dist/__tests__/gpu-scene-schema.unit.test.d.ts +2 -0
  65. package/dist/__tests__/gpu-scene-schema.unit.test.d.ts.map +1 -0
  66. package/dist/__tests__/gpu-scene.dawn.test.d.ts +2 -0
  67. package/dist/__tests__/gpu-scene.dawn.test.d.ts.map +1 -0
  68. package/dist/__tests__/gpu-scene.unit.test.d.ts +2 -0
  69. package/dist/__tests__/gpu-scene.unit.test.d.ts.map +1 -0
  70. package/dist/__tests__/ibl/face-uniforms.unit.test.d.ts +2 -0
  71. package/dist/__tests__/ibl/face-uniforms.unit.test.d.ts.map +1 -0
  72. package/dist/__tests__/infinite-grid-no-vertex-probe.unit.test.d.ts +2 -0
  73. package/dist/__tests__/infinite-grid-no-vertex-probe.unit.test.d.ts.map +1 -0
  74. package/dist/__tests__/injection-kind-owner.test-d.d.ts +2 -0
  75. package/dist/__tests__/injection-kind-owner.test-d.d.ts.map +1 -0
  76. package/dist/__tests__/ktx2-basis-gpu-consumer.dawn.test.d.ts +2 -0
  77. package/dist/__tests__/ktx2-basis-gpu-consumer.dawn.test.d.ts.map +1 -0
  78. package/dist/__tests__/light-buffer-layout.unit.test.d.ts +2 -0
  79. package/dist/__tests__/light-buffer-layout.unit.test.d.ts.map +1 -0
  80. package/dist/__tests__/material-contract-inventory.unit.test.d.ts +2 -0
  81. package/dist/__tests__/material-contract-inventory.unit.test.d.ts.map +1 -0
  82. package/dist/__tests__/material-cooked-projection.unit.test.d.ts +2 -0
  83. package/dist/__tests__/material-cooked-projection.unit.test.d.ts.map +1 -0
  84. package/dist/__tests__/material-snapshot-mutation.integration.test.d.ts +2 -0
  85. package/dist/__tests__/material-snapshot-mutation.integration.test.d.ts.map +1 -0
  86. package/dist/__tests__/material-static-dynamic-route.unit.test.d.ts +2 -0
  87. package/dist/__tests__/material-static-dynamic-route.unit.test.d.ts.map +1 -0
  88. package/dist/__tests__/material-stride-surface.unit.test.d.ts +2 -0
  89. package/dist/__tests__/material-stride-surface.unit.test.d.ts.map +1 -0
  90. package/dist/__tests__/mesh-buffer-usage-surface.unit.test.d.ts +2 -0
  91. package/dist/__tests__/mesh-buffer-usage-surface.unit.test.d.ts.map +1 -0
  92. package/dist/__tests__/mesh-material-bindings.unit.test.d.ts +2 -0
  93. package/dist/__tests__/mesh-material-bindings.unit.test.d.ts.map +1 -0
  94. package/dist/__tests__/mesh-stride-surface.unit.test.d.ts +2 -0
  95. package/dist/__tests__/mesh-stride-surface.unit.test.d.ts.map +1 -0
  96. package/dist/__tests__/morph-culling-reentry.dawn.test.d.ts +2 -0
  97. package/dist/__tests__/morph-culling-reentry.dawn.test.d.ts.map +1 -0
  98. package/dist/__tests__/morph-feature-gpu-work.integration.test.d.ts +2 -0
  99. package/dist/__tests__/morph-feature-gpu-work.integration.test.d.ts.map +1 -0
  100. package/dist/__tests__/morph-feature-plan.unit.test.d.ts +2 -0
  101. package/dist/__tests__/morph-feature-plan.unit.test.d.ts.map +1 -0
  102. package/dist/__tests__/morph-visual-evidence.integration.test.d.ts +2 -0
  103. package/dist/__tests__/morph-visual-evidence.integration.test.d.ts.map +1 -0
  104. package/dist/__tests__/nineslice-handle-surface.unit.test.d.ts +2 -0
  105. package/dist/__tests__/nineslice-handle-surface.unit.test.d.ts.map +1 -0
  106. package/dist/__tests__/post-process-error-policy-owner.unit.test.d.ts +2 -0
  107. package/dist/__tests__/post-process-error-policy-owner.unit.test.d.ts.map +1 -0
  108. package/dist/__tests__/prepared-buffer-kind-owner.test-d.d.ts +2 -0
  109. package/dist/__tests__/prepared-buffer-kind-owner.test-d.d.ts.map +1 -0
  110. package/dist/__tests__/prepared-graphics-capability.unit.test.d.ts +2 -0
  111. package/dist/__tests__/prepared-graphics-capability.unit.test.d.ts.map +1 -0
  112. package/dist/__tests__/prepared-graphics-generation.unit.test.d.ts +2 -0
  113. package/dist/__tests__/prepared-graphics-generation.unit.test.d.ts.map +1 -0
  114. package/dist/__tests__/prepared-graphics-lifecycle.unit.test.d.ts +2 -0
  115. package/dist/__tests__/prepared-graphics-lifecycle.unit.test.d.ts.map +1 -0
  116. package/dist/__tests__/prepared-graphics-pipeline-warmup.unit.test.d.ts +2 -0
  117. package/dist/__tests__/prepared-graphics-pipeline-warmup.unit.test.d.ts.map +1 -0
  118. package/dist/__tests__/prepared-graphics-resolver.unit.test.d.ts +2 -0
  119. package/dist/__tests__/prepared-graphics-resolver.unit.test.d.ts.map +1 -0
  120. package/dist/__tests__/prepared-graphics-snapshot.unit.test.d.ts +2 -0
  121. package/dist/__tests__/prepared-graphics-snapshot.unit.test.d.ts.map +1 -0
  122. package/dist/__tests__/prepared-graphics-store.unit.test.d.ts +2 -0
  123. package/dist/__tests__/prepared-graphics-store.unit.test.d.ts.map +1 -0
  124. package/dist/__tests__/prepared-graphics-validation.unit.test.d.ts +2 -0
  125. package/dist/__tests__/prepared-graphics-validation.unit.test.d.ts.map +1 -0
  126. package/dist/__tests__/profiler-default-off.test.d.ts +2 -0
  127. package/dist/__tests__/profiler-default-off.test.d.ts.map +1 -0
  128. package/dist/__tests__/profiler-phase-catalog.test.d.ts +2 -0
  129. package/dist/__tests__/profiler-phase-catalog.test.d.ts.map +1 -0
  130. package/dist/__tests__/profiler-phase-integration.test.d.ts +2 -0
  131. package/dist/__tests__/profiler-phase-integration.test.d.ts.map +1 -0
  132. package/dist/__tests__/profiler-phase-token.test.d.ts +2 -0
  133. package/dist/__tests__/profiler-phase-token.test.d.ts.map +1 -0
  134. package/dist/__tests__/public-surface.test-d.d.ts +2 -0
  135. package/dist/__tests__/public-surface.test-d.d.ts.map +1 -0
  136. package/dist/__tests__/recover-error-policy-owner.unit.test.d.ts +2 -0
  137. package/dist/__tests__/recover-error-policy-owner.unit.test.d.ts.map +1 -0
  138. package/dist/__tests__/render-error-code-owner.test-d.d.ts +2 -0
  139. package/dist/__tests__/render-error-code-owner.test-d.d.ts.map +1 -0
  140. package/dist/__tests__/render-error-detail-ssot.test-d.d.ts +2 -0
  141. package/dist/__tests__/render-error-detail-ssot.test-d.d.ts.map +1 -0
  142. package/dist/__tests__/render-error-exhaustive.test-d.d.ts +2 -0
  143. package/dist/__tests__/render-error-exhaustive.test-d.d.ts.map +1 -0
  144. package/dist/__tests__/render-feature-assembly.test-d.d.ts +2 -0
  145. package/dist/__tests__/render-feature-assembly.test-d.d.ts.map +1 -0
  146. package/dist/__tests__/render-feature-context.test-d.d.ts +2 -0
  147. package/dist/__tests__/render-feature-context.test-d.d.ts.map +1 -0
  148. package/dist/__tests__/render-feature-contract.test-d.d.ts +2 -0
  149. package/dist/__tests__/render-feature-contract.test-d.d.ts.map +1 -0
  150. package/dist/__tests__/render-feature-diagnostics.unit.test.d.ts +2 -0
  151. package/dist/__tests__/render-feature-diagnostics.unit.test.d.ts.map +1 -0
  152. package/dist/__tests__/render-feature-docs.unit.test.d.ts +2 -0
  153. package/dist/__tests__/render-feature-docs.unit.test.d.ts.map +1 -0
  154. package/dist/__tests__/render-feature-errors.unit.test.d.ts +2 -0
  155. package/dist/__tests__/render-feature-errors.unit.test.d.ts.map +1 -0
  156. package/dist/__tests__/render-feature-gpu-work.integration.test.d.ts +2 -0
  157. package/dist/__tests__/render-feature-gpu-work.integration.test.d.ts.map +1 -0
  158. package/dist/__tests__/render-feature-plan.test-d.d.ts +2 -0
  159. package/dist/__tests__/render-feature-plan.test-d.d.ts.map +1 -0
  160. package/dist/__tests__/render-feature-plan.unit.test.d.ts +2 -0
  161. package/dist/__tests__/render-feature-plan.unit.test.d.ts.map +1 -0
  162. package/dist/__tests__/render-feature-prepared-diagnostics.unit.test.d.ts +2 -0
  163. package/dist/__tests__/render-feature-prepared-diagnostics.unit.test.d.ts.map +1 -0
  164. package/dist/__tests__/render-feature-prepared-errors.test-d.d.ts +2 -0
  165. package/dist/__tests__/render-feature-prepared-errors.test-d.d.ts.map +1 -0
  166. package/dist/__tests__/render-feature-prepared-graphics-docs.unit.test.d.ts +2 -0
  167. package/dist/__tests__/render-feature-prepared-graphics-docs.unit.test.d.ts.map +1 -0
  168. package/dist/__tests__/render-feature-prepared-graphics-isolation.unit.test.d.ts +2 -0
  169. package/dist/__tests__/render-feature-prepared-graphics-isolation.unit.test.d.ts.map +1 -0
  170. package/dist/__tests__/render-feature-prepared-graphics-negative.test-d.d.ts +2 -0
  171. package/dist/__tests__/render-feature-prepared-graphics-negative.test-d.d.ts.map +1 -0
  172. package/dist/__tests__/render-feature-prepared-graphics.test-d.d.ts +2 -0
  173. package/dist/__tests__/render-feature-prepared-graphics.test-d.d.ts.map +1 -0
  174. package/dist/__tests__/render-feature-prepared-graphics.unit.test.d.ts +2 -0
  175. package/dist/__tests__/render-feature-prepared-graphics.unit.test.d.ts.map +1 -0
  176. package/dist/__tests__/render-feature-public-surface.test-d.d.ts +2 -0
  177. package/dist/__tests__/render-feature-public-surface.test-d.d.ts.map +1 -0
  178. package/dist/__tests__/render-feature-retry.unit.test.d.ts +2 -0
  179. package/dist/__tests__/render-feature-retry.unit.test.d.ts.map +1 -0
  180. package/dist/__tests__/render-feature-scheduling.unit.test.d.ts +2 -0
  181. package/dist/__tests__/render-feature-scheduling.unit.test.d.ts.map +1 -0
  182. package/dist/__tests__/render-feature-stage-failed-policy-owner.unit.test.d.ts +2 -0
  183. package/dist/__tests__/render-feature-stage-failed-policy-owner.unit.test.d.ts.map +1 -0
  184. package/dist/__tests__/render-feature-stage-fault-recovery.unit.test.d.ts +2 -0
  185. package/dist/__tests__/render-feature-stage-fault-recovery.unit.test.d.ts.map +1 -0
  186. package/dist/__tests__/render-feature-visibility-context.test-d.d.ts +2 -0
  187. package/dist/__tests__/render-feature-visibility-context.test-d.d.ts.map +1 -0
  188. package/dist/__tests__/render-feature-visibility-context.unit.test.d.ts +2 -0
  189. package/dist/__tests__/render-feature-visibility-context.unit.test.d.ts.map +1 -0
  190. package/dist/__tests__/render-feature-zero-work.unit.test.d.ts +2 -0
  191. package/dist/__tests__/render-feature-zero-work.unit.test.d.ts.map +1 -0
  192. package/dist/__tests__/render-graph-compute-raster-gpu.d.ts +7 -0
  193. package/dist/__tests__/render-graph-compute-raster-gpu.d.ts.map +1 -0
  194. package/dist/__tests__/render-graph-compute-raster.browser.test.d.ts +2 -0
  195. package/dist/__tests__/render-graph-compute-raster.browser.test.d.ts.map +1 -0
  196. package/dist/__tests__/render-graph-compute-raster.dawn.test.d.ts +2 -0
  197. package/dist/__tests__/render-graph-compute-raster.dawn.test.d.ts.map +1 -0
  198. package/dist/__tests__/render-graph-hzb-gpu.d.ts +7 -0
  199. package/dist/__tests__/render-graph-hzb-gpu.d.ts.map +1 -0
  200. package/dist/__tests__/render-graph-hzb.browser.test.d.ts +2 -0
  201. package/dist/__tests__/render-graph-hzb.browser.test.d.ts.map +1 -0
  202. package/dist/__tests__/render-graph-hzb.dawn.test.d.ts +2 -0
  203. package/dist/__tests__/render-graph-hzb.dawn.test.d.ts.map +1 -0
  204. package/dist/__tests__/render-graph-primitives.unit.test.d.ts +2 -0
  205. package/dist/__tests__/render-graph-primitives.unit.test.d.ts.map +1 -0
  206. package/dist/__tests__/render-graph-storage-indirect-gpu.d.ts +12 -0
  207. package/dist/__tests__/render-graph-storage-indirect-gpu.d.ts.map +1 -0
  208. package/dist/__tests__/render-graph-storage-indirect.browser.test.d.ts +2 -0
  209. package/dist/__tests__/render-graph-storage-indirect.browser.test.d.ts.map +1 -0
  210. package/dist/__tests__/render-graph-storage-indirect.dawn.test.d.ts +2 -0
  211. package/dist/__tests__/render-graph-storage-indirect.dawn.test.d.ts.map +1 -0
  212. package/dist/__tests__/render-scene-projection.unit.test.d.ts +2 -0
  213. package/dist/__tests__/render-scene-projection.unit.test.d.ts.map +1 -0
  214. package/dist/__tests__/renderer-factory-material-contract.unit.test.d.ts +2 -0
  215. package/dist/__tests__/renderer-factory-material-contract.unit.test.d.ts.map +1 -0
  216. package/dist/__tests__/renderer-lifecycle.integration.test.d.ts +2 -0
  217. package/dist/__tests__/renderer-lifecycle.integration.test.d.ts.map +1 -0
  218. package/dist/__tests__/rhi-backend-package-boundary.unit.test.d.ts +2 -0
  219. package/dist/__tests__/rhi-backend-package-boundary.unit.test.d.ts.map +1 -0
  220. package/dist/__tests__/scriptable-pack-consumer.test-d.d.ts +2 -0
  221. package/dist/__tests__/scriptable-pack-consumer.test-d.d.ts.map +1 -0
  222. package/dist/__tests__/shader-stage-surface.unit.test.d.ts +2 -0
  223. package/dist/__tests__/shader-stage-surface.unit.test.d.ts.map +1 -0
  224. package/dist/__tests__/ssao-config.unit.test.d.ts +2 -0
  225. package/dist/__tests__/ssao-config.unit.test.d.ts.map +1 -0
  226. package/dist/__tests__/ssao-kernel-surface.unit.test.d.ts +2 -0
  227. package/dist/__tests__/ssao-kernel-surface.unit.test.d.ts.map +1 -0
  228. package/dist/__tests__/standard-clustered-pipeline.unit.test.d.ts +2 -0
  229. package/dist/__tests__/standard-clustered-pipeline.unit.test.d.ts.map +1 -0
  230. package/dist/__tests__/standard-descriptors.test-d.d.ts +2 -0
  231. package/dist/__tests__/standard-descriptors.test-d.d.ts.map +1 -0
  232. package/dist/__tests__/standard-pipeline.dawn.test.d.ts +2 -0
  233. package/dist/__tests__/standard-pipeline.dawn.test.d.ts.map +1 -0
  234. package/dist/__tests__/standard-pipeline.integration.test.d.ts +2 -0
  235. package/dist/__tests__/standard-pipeline.integration.test.d.ts.map +1 -0
  236. package/dist/__tests__/standard-profile-oracle.unit.test.d.ts +2 -0
  237. package/dist/__tests__/standard-profile-oracle.unit.test.d.ts.map +1 -0
  238. package/dist/__tests__/surface-configuration.unit.test.d.ts +2 -0
  239. package/dist/__tests__/surface-configuration.unit.test.d.ts.map +1 -0
  240. package/dist/__tests__/texture-usage-surface.unit.test.d.ts +2 -0
  241. package/dist/__tests__/texture-usage-surface.unit.test.d.ts.map +1 -0
  242. package/dist/__tests__/typed-pipeline-topology.unit.test.d.ts +2 -0
  243. package/dist/__tests__/typed-pipeline-topology.unit.test.d.ts.map +1 -0
  244. package/dist/__tests__/urp-pipeline-targets.unit.test.d.ts +2 -0
  245. package/dist/__tests__/urp-pipeline-targets.unit.test.d.ts.map +1 -0
  246. package/dist/__tests__/urp-pipeline.unit.test.d.ts +2 -0
  247. package/dist/__tests__/urp-pipeline.unit.test.d.ts.map +1 -0
  248. package/dist/__tests__/vertex-color-pipeline.unit.test.d.ts +2 -0
  249. package/dist/__tests__/vertex-color-pipeline.unit.test.d.ts.map +1 -0
  250. package/dist/__tests__/vertex-layout-consumer.unit.test.d.ts +2 -0
  251. package/dist/__tests__/vertex-layout-consumer.unit.test.d.ts.map +1 -0
  252. package/dist/__tests__/visibility-diagnostics.integration.test.d.ts +2 -0
  253. package/dist/__tests__/visibility-diagnostics.integration.test.d.ts.map +1 -0
  254. package/dist/__tests__/visibility-extract.integration.test.d.ts +2 -0
  255. package/dist/__tests__/visibility-extract.integration.test.d.ts.map +1 -0
  256. package/dist/__tests__/visibility-extract.perf.test.d.ts +2 -0
  257. package/dist/__tests__/visibility-extract.perf.test.d.ts.map +1 -0
  258. package/dist/__tests__/visibility-feature-dedup.integration.test.d.ts +2 -0
  259. package/dist/__tests__/visibility-feature-dedup.integration.test.d.ts.map +1 -0
  260. package/dist/__tests__/visibility-hidden-report.unit.test.d.ts +2 -0
  261. package/dist/__tests__/visibility-hidden-report.unit.test.d.ts.map +1 -0
  262. package/dist/__tests__/visibility-instances.integration.test.d.ts +2 -0
  263. package/dist/__tests__/visibility-instances.integration.test.d.ts.map +1 -0
  264. package/dist/__tests__/visibility-multi-world.integration.test.d.ts +2 -0
  265. package/dist/__tests__/visibility-multi-world.integration.test.d.ts.map +1 -0
  266. package/dist/__tests__/visibility-producer-matrix.integration.test.d.ts +2 -0
  267. package/dist/__tests__/visibility-producer-matrix.integration.test.d.ts.map +1 -0
  268. package/dist/__tests__/visibility-producer-matrix.unit.test.d.ts +2 -0
  269. package/dist/__tests__/visibility-producer-matrix.unit.test.d.ts.map +1 -0
  270. package/dist/__tests__/visibility-public-surface.test-d.d.ts +2 -0
  271. package/dist/__tests__/visibility-public-surface.test-d.d.ts.map +1 -0
  272. package/dist/__tests__/visibility-resolver.unit.test.d.ts +2 -0
  273. package/dist/__tests__/visibility-resolver.unit.test.d.ts.map +1 -0
  274. package/dist/__tests__/visibility-resource-short-circuit.unit.test.d.ts +2 -0
  275. package/dist/__tests__/visibility-resource-short-circuit.unit.test.d.ts.map +1 -0
  276. package/dist/__tests__/visibility-snapshot-contract.unit.test.d.ts +2 -0
  277. package/dist/__tests__/visibility-snapshot-contract.unit.test.d.ts.map +1 -0
  278. package/dist/__tests__/vocabulary.unit.test.d.ts +2 -0
  279. package/dist/__tests__/vocabulary.unit.test.d.ts.map +1 -0
  280. package/dist/assembly/backend-contract.d.ts +37 -0
  281. package/dist/assembly/backend-contract.d.ts.map +1 -0
  282. package/dist/assembly/factory.d.ts +207 -0
  283. package/dist/assembly/factory.d.ts.map +1 -0
  284. package/dist/assembly/host-contract.d.ts +84 -0
  285. package/dist/assembly/host-contract.d.ts.map +1 -0
  286. package/dist/assembly/material/assembly.d.ts +21 -0
  287. package/dist/assembly/material/assembly.d.ts.map +1 -0
  288. package/dist/assembly/material/pipeline-projection.d.ts +30 -0
  289. package/dist/assembly/material/pipeline-projection.d.ts.map +1 -0
  290. package/dist/assets/asset-decoders.d.ts +5 -0
  291. package/dist/assets/asset-decoders.d.ts.map +1 -0
  292. package/dist/assets/render-asset-port.d.ts +17 -0
  293. package/dist/assets/render-asset-port.d.ts.map +1 -0
  294. package/dist/assets/resolve-render-asset.d.ts +6 -0
  295. package/dist/assets/resolve-render-asset.d.ts.map +1 -0
  296. package/dist/authoring.d.ts +12 -0
  297. package/dist/authoring.d.ts.map +1 -0
  298. package/dist/authoring.mjs +27 -0
  299. package/dist/authoring.mjs.map +1 -0
  300. package/dist/chunk-CQXZC5XI.mjs +182 -0
  301. package/dist/chunk-CQXZC5XI.mjs.map +1 -0
  302. package/dist/chunk-HCOGPHKS.mjs +93 -0
  303. package/dist/chunk-HCOGPHKS.mjs.map +1 -0
  304. package/dist/chunk-YEJIUW7D.mjs +1152 -0
  305. package/dist/chunk-YEJIUW7D.mjs.map +1 -0
  306. package/dist/cluster-binner.d.ts +152 -0
  307. package/dist/cluster-binner.d.ts.map +1 -0
  308. package/dist/components/__tests__/points-lines-admission.unit.test.d.ts +2 -0
  309. package/dist/components/__tests__/points-lines-admission.unit.test.d.ts.map +1 -0
  310. package/dist/components/__tests__/points-lines-schema.unit.test.d.ts +2 -0
  311. package/dist/components/__tests__/points-lines-schema.unit.test.d.ts.map +1 -0
  312. package/dist/components/__tests__/schema-contract.unit.test.d.ts +2 -0
  313. package/dist/components/__tests__/schema-contract.unit.test.d.ts.map +1 -0
  314. package/dist/components/__tests__/schema-parity.unit.test.d.ts +2 -0
  315. package/dist/components/__tests__/schema-parity.unit.test.d.ts.map +1 -0
  316. package/dist/components/__tests__/visibility-schema.unit.test.d.ts +2 -0
  317. package/dist/components/__tests__/visibility-schema.unit.test.d.ts.map +1 -0
  318. package/dist/components/camera.d.ts +311 -0
  319. package/dist/components/camera.d.ts.map +1 -0
  320. package/dist/components/directional-light.d.ts +76 -0
  321. package/dist/components/directional-light.d.ts.map +1 -0
  322. package/dist/components/glyph-text.d.ts +26 -0
  323. package/dist/components/glyph-text.d.ts.map +1 -0
  324. package/dist/components/index.d.ts +24 -0
  325. package/dist/components/index.d.ts.map +1 -0
  326. package/dist/components/instances.d.ts +41 -0
  327. package/dist/components/instances.d.ts.map +1 -0
  328. package/dist/components/layer.d.ts +34 -0
  329. package/dist/components/layer.d.ts.map +1 -0
  330. package/dist/components/light-helpers.d.ts +53 -0
  331. package/dist/components/light-helpers.d.ts.map +1 -0
  332. package/dist/components/lines.d.ts +5 -0
  333. package/dist/components/lines.d.ts.map +1 -0
  334. package/dist/components/mesh-filter.d.ts +24 -0
  335. package/dist/components/mesh-filter.d.ts.map +1 -0
  336. package/dist/components/mesh-renderer.d.ts +33 -0
  337. package/dist/components/mesh-renderer.d.ts.map +1 -0
  338. package/dist/components/point-light-shadow.d.ts +27 -0
  339. package/dist/components/point-light-shadow.d.ts.map +1 -0
  340. package/dist/components/point-light.d.ts +35 -0
  341. package/dist/components/point-light.d.ts.map +1 -0
  342. package/dist/components/points.d.ts +15 -0
  343. package/dist/components/points.d.ts.map +1 -0
  344. package/dist/components/post-process-params.d.ts +5 -0
  345. package/dist/components/post-process-params.d.ts.map +1 -0
  346. package/dist/components/scene-instance.d.ts +140 -0
  347. package/dist/components/scene-instance.d.ts.map +1 -0
  348. package/dist/components/skybox-background.d.ts +56 -0
  349. package/dist/components/skybox-background.d.ts.map +1 -0
  350. package/dist/components/skylight.d.ts +55 -0
  351. package/dist/components/skylight.d.ts.map +1 -0
  352. package/dist/components/sort-key.d.ts +44 -0
  353. package/dist/components/sort-key.d.ts.map +1 -0
  354. package/dist/components/spot-light.d.ts +81 -0
  355. package/dist/components/spot-light.d.ts.map +1 -0
  356. package/dist/components/sprite-animation.d.ts +74 -0
  357. package/dist/components/sprite-animation.d.ts.map +1 -0
  358. package/dist/components/sprite-instances.d.ts +51 -0
  359. package/dist/components/sprite-instances.d.ts.map +1 -0
  360. package/dist/components/sprite-playback-mode.d.ts +42 -0
  361. package/dist/components/sprite-playback-mode.d.ts.map +1 -0
  362. package/dist/components/sprite-region-override.d.ts +46 -0
  363. package/dist/components/sprite-region-override.d.ts.map +1 -0
  364. package/dist/components/tile-layer.d.ts +106 -0
  365. package/dist/components/tile-layer.d.ts.map +1 -0
  366. package/dist/components/tilemap.d.ts +25 -0
  367. package/dist/components/tilemap.d.ts.map +1 -0
  368. package/dist/components/visibility.d.ts +22 -0
  369. package/dist/components/visibility.d.ts.map +1 -0
  370. package/dist/construct-renderer.d.ts +19 -0
  371. package/dist/construct-renderer.d.ts.map +1 -0
  372. package/dist/construct-renderer.mjs +27462 -0
  373. package/dist/construct-renderer.mjs.map +1 -0
  374. package/dist/debug-draw-glue.d.ts +5 -0
  375. package/dist/debug-draw-glue.d.ts.map +1 -0
  376. package/dist/device/device-scope.d.ts +83 -0
  377. package/dist/device/device-scope.d.ts.map +1 -0
  378. package/dist/device/gpu-residency.d.ts +337 -0
  379. package/dist/device/gpu-residency.d.ts.map +1 -0
  380. package/dist/device/resource-types.d.ts +8 -0
  381. package/dist/device/resource-types.d.ts.map +1 -0
  382. package/dist/engine-metrics.d.ts +23 -0
  383. package/dist/engine-metrics.d.ts.map +1 -0
  384. package/dist/errors/ecs-validation.d.ts +3 -0
  385. package/dist/errors/ecs-validation.d.ts.map +1 -0
  386. package/dist/errors/index.d.ts +4 -0
  387. package/dist/errors/index.d.ts.map +1 -0
  388. package/dist/errors/recover.d.ts +105 -0
  389. package/dist/errors/recover.d.ts.map +1 -0
  390. package/dist/errors/render.d.ts +705 -0
  391. package/dist/errors/render.d.ts.map +1 -0
  392. package/dist/extract/visibility.d.ts +26 -0
  393. package/dist/extract/visibility.d.ts.map +1 -0
  394. package/dist/features/fullscreen.d.ts +19 -0
  395. package/dist/features/fullscreen.d.ts.map +1 -0
  396. package/dist/features/host.d.ts +106 -0
  397. package/dist/features/host.d.ts.map +1 -0
  398. package/dist/features/morph/morph-feature.d.ts +79 -0
  399. package/dist/features/morph/morph-feature.d.ts.map +1 -0
  400. package/dist/features/plan.d.ts +182 -0
  401. package/dist/features/plan.d.ts.map +1 -0
  402. package/dist/features/prepared-gpu-work.d.ts +117 -0
  403. package/dist/features/prepared-gpu-work.d.ts.map +1 -0
  404. package/dist/features/prepared-graphics-store.d.ts +66 -0
  405. package/dist/features/prepared-graphics-store.d.ts.map +1 -0
  406. package/dist/features/prepared-graphics.d.ts +215 -0
  407. package/dist/features/prepared-graphics.d.ts.map +1 -0
  408. package/dist/features/render-graph-compute.d.ts +13 -0
  409. package/dist/features/render-graph-compute.d.ts.map +1 -0
  410. package/dist/features/render-graph-contribution.d.ts +12 -0
  411. package/dist/features/render-graph-contribution.d.ts.map +1 -0
  412. package/dist/features/render-graph-raster.d.ts +38 -0
  413. package/dist/features/render-graph-raster.d.ts.map +1 -0
  414. package/dist/features/render-graph-resources.d.ts +11 -0
  415. package/dist/features/render-graph-resources.d.ts.map +1 -0
  416. package/dist/features/targets.d.ts +32 -0
  417. package/dist/features/targets.d.ts.map +1 -0
  418. package/dist/features/types.d.ts +68 -0
  419. package/dist/features/types.d.ts.map +1 -0
  420. package/dist/features/vocabulary.d.ts +14 -0
  421. package/dist/features/vocabulary.d.ts.map +1 -0
  422. package/dist/fullscreen-post-process-pass.d.ts +157 -0
  423. package/dist/fullscreen-post-process-pass.d.ts.map +1 -0
  424. package/dist/glyph-text-layout-system.d.ts +19 -0
  425. package/dist/glyph-text-layout-system.d.ts.map +1 -0
  426. package/dist/gpu-driven/batch-topology.d.ts +55 -0
  427. package/dist/gpu-driven/batch-topology.d.ts.map +1 -0
  428. package/dist/gpu-driven/production-raster.d.ts +51 -0
  429. package/dist/gpu-driven/production-raster.d.ts.map +1 -0
  430. package/dist/gpu-driven/view-gpu.d.ts +85 -0
  431. package/dist/gpu-driven/view-gpu.d.ts.map +1 -0
  432. package/dist/gpu-resource.d.ts +73 -0
  433. package/dist/gpu-resource.d.ts.map +1 -0
  434. package/dist/gpu-scene-schema.d.ts +78 -0
  435. package/dist/gpu-scene-schema.d.ts.map +1 -0
  436. package/dist/gpu-scene.d.ts +55 -0
  437. package/dist/gpu-scene.d.ts.map +1 -0
  438. package/dist/gpu-stage.d.ts +4 -0
  439. package/dist/gpu-stage.d.ts.map +1 -0
  440. package/dist/gpu-texture-usage.d.ts +6 -0
  441. package/dist/gpu-texture-usage.d.ts.map +1 -0
  442. package/dist/gpu-usage.d.ts +9 -0
  443. package/dist/gpu-usage.d.ts.map +1 -0
  444. package/dist/hdrp-buffers.d.ts +163 -0
  445. package/dist/hdrp-buffers.d.ts.map +1 -0
  446. package/dist/ibl/IblPipelineCache.d.ts +168 -0
  447. package/dist/ibl/IblPipelineCache.d.ts.map +1 -0
  448. package/dist/ibl/skylight-bind-group.d.ts +130 -0
  449. package/dist/ibl/skylight-bind-group.d.ts.map +1 -0
  450. package/dist/index.d.ts +31 -0
  451. package/dist/index.d.ts.map +1 -0
  452. package/dist/index.mjs +169 -0
  453. package/dist/index.mjs.map +1 -0
  454. package/dist/inspection-types.d.ts +72 -0
  455. package/dist/inspection-types.d.ts.map +1 -0
  456. package/dist/instance-buffer-cache.d.ts +56 -0
  457. package/dist/instance-buffer-cache.d.ts.map +1 -0
  458. package/dist/internal.d.ts +2 -0
  459. package/dist/internal.d.ts.map +1 -0
  460. package/dist/internal.mjs +3 -0
  461. package/dist/internal.mjs.map +1 -0
  462. package/dist/lifecycle.d.ts +62 -0
  463. package/dist/lifecycle.d.ts.map +1 -0
  464. package/dist/light-buffer-layout.d.ts +164 -0
  465. package/dist/light-buffer-layout.d.ts.map +1 -0
  466. package/dist/materials.d.ts +47 -0
  467. package/dist/materials.d.ts.map +1 -0
  468. package/dist/mesh-material-bindings.d.ts +43 -0
  469. package/dist/mesh-material-bindings.d.ts.map +1 -0
  470. package/dist/pbr-pipeline.d.ts +301 -0
  471. package/dist/pbr-pipeline.d.ts.map +1 -0
  472. package/dist/pipeline/standard-forward-lane.d.ts +5 -0
  473. package/dist/pipeline/standard-forward-lane.d.ts.map +1 -0
  474. package/dist/pipeline/standard-pipeline.d.ts +31 -0
  475. package/dist/pipeline/standard-pipeline.d.ts.map +1 -0
  476. package/dist/pipeline/standard-profile.d.ts +40 -0
  477. package/dist/pipeline/standard-profile.d.ts.map +1 -0
  478. package/dist/pipeline-builder.d.ts +122 -0
  479. package/dist/pipeline-builder.d.ts.map +1 -0
  480. package/dist/pipeline-spec-types.d.ts +24 -0
  481. package/dist/pipeline-spec-types.d.ts.map +1 -0
  482. package/dist/pipeline-spec.d.ts +367 -0
  483. package/dist/pipeline-spec.d.ts.map +1 -0
  484. package/dist/plugin.d.ts +4 -0
  485. package/dist/plugin.d.ts.map +1 -0
  486. package/dist/points-lines/__tests__/bounds.unit.test.d.ts +2 -0
  487. package/dist/points-lines/__tests__/bounds.unit.test.d.ts.map +1 -0
  488. package/dist/points-lines/__tests__/cache-recovery.unit.test.d.ts +2 -0
  489. package/dist/points-lines/__tests__/cache-recovery.unit.test.d.ts.map +1 -0
  490. package/dist/points-lines/__tests__/inspection-lanes.integration.test.d.ts +2 -0
  491. package/dist/points-lines/__tests__/inspection-lanes.integration.test.d.ts.map +1 -0
  492. package/dist/points-lines/__tests__/inspection.unit.test.d.ts +2 -0
  493. package/dist/points-lines/__tests__/inspection.unit.test.d.ts.map +1 -0
  494. package/dist/points-lines/__tests__/lane-structural.integration.test.d.ts +2 -0
  495. package/dist/points-lines/__tests__/lane-structural.integration.test.d.ts.map +1 -0
  496. package/dist/points-lines/__tests__/points-lines.bench.d.ts +2 -0
  497. package/dist/points-lines/__tests__/points-lines.bench.d.ts.map +1 -0
  498. package/dist/points-lines/__tests__/raster-lane.integration.test.d.ts +2 -0
  499. package/dist/points-lines/__tests__/raster-lane.integration.test.d.ts.map +1 -0
  500. package/dist/points-lines/__tests__/snapshot.unit.test.d.ts +2 -0
  501. package/dist/points-lines/__tests__/snapshot.unit.test.d.ts.map +1 -0
  502. package/dist/points-lines/__tests__/view-ubo.unit.test.d.ts +2 -0
  503. package/dist/points-lines/__tests__/view-ubo.unit.test.d.ts.map +1 -0
  504. package/dist/points-lines/admission.d.ts +36 -0
  505. package/dist/points-lines/admission.d.ts.map +1 -0
  506. package/dist/points-lines/bounds.d.ts +8 -0
  507. package/dist/points-lines/bounds.d.ts.map +1 -0
  508. package/dist/points-lines/expansion-cache.d.ts +28 -0
  509. package/dist/points-lines/expansion-cache.d.ts.map +1 -0
  510. package/dist/points-lines/inspection.d.ts +53 -0
  511. package/dist/points-lines/inspection.d.ts.map +1 -0
  512. package/dist/points-lines/prepare.d.ts +67 -0
  513. package/dist/points-lines/prepare.d.ts.map +1 -0
  514. package/dist/points-lines/record.d.ts +60 -0
  515. package/dist/points-lines/record.d.ts.map +1 -0
  516. package/dist/points-lines/snapshot.d.ts +49 -0
  517. package/dist/points-lines/snapshot.d.ts.map +1 -0
  518. package/dist/post-process-errors.d.ts +182 -0
  519. package/dist/post-process-errors.d.ts.map +1 -0
  520. package/dist/prepare/prepared-graphics-resolver.d.ts +59 -0
  521. package/dist/prepare/prepared-graphics-resolver.d.ts.map +1 -0
  522. package/dist/record/__tests__/material-bg-cache.unit.test.d.ts +2 -0
  523. package/dist/record/__tests__/material-bg-cache.unit.test.d.ts.map +1 -0
  524. package/dist/record/__tests__/material-slot-plan.unit.test.d.ts +2 -0
  525. package/dist/record/__tests__/material-slot-plan.unit.test.d.ts.map +1 -0
  526. package/dist/record/__tests__/typed-frame-graph-plan.unit.test.d.ts +2 -0
  527. package/dist/record/__tests__/typed-frame-graph-plan.unit.test.d.ts.map +1 -0
  528. package/dist/record/__tests__/video-texture-view.unit.test.d.ts +2 -0
  529. package/dist/record/__tests__/video-texture-view.unit.test.d.ts.map +1 -0
  530. package/dist/record/frame-lighting.d.ts +121 -0
  531. package/dist/record/frame-lighting.d.ts.map +1 -0
  532. package/dist/record/frame-snapshot.d.ts +429 -0
  533. package/dist/record/frame-snapshot.d.ts.map +1 -0
  534. package/dist/record/frame-targets.d.ts +20 -0
  535. package/dist/record/frame-targets.d.ts.map +1 -0
  536. package/dist/record/frame.d.ts +71 -0
  537. package/dist/record/frame.d.ts.map +1 -0
  538. package/dist/record/helpers.d.ts +102 -0
  539. package/dist/record/helpers.d.ts.map +1 -0
  540. package/dist/record/main-pass-geometry.d.ts +28 -0
  541. package/dist/record/main-pass-geometry.d.ts.map +1 -0
  542. package/dist/record/main-pass-material.d.ts +204 -0
  543. package/dist/record/main-pass-material.d.ts.map +1 -0
  544. package/dist/record/main-pass-sprite-draws.d.ts +43 -0
  545. package/dist/record/main-pass-sprite-draws.d.ts.map +1 -0
  546. package/dist/record/main-pass.d.ts +20 -0
  547. package/dist/record/main-pass.d.ts.map +1 -0
  548. package/dist/record/mesh-ssbo.d.ts +446 -0
  549. package/dist/record/mesh-ssbo.d.ts.map +1 -0
  550. package/dist/record/render-context.d.ts +252 -0
  551. package/dist/record/render-context.d.ts.map +1 -0
  552. package/dist/record/shadow-pass.d.ts +52 -0
  553. package/dist/record/shadow-pass.d.ts.map +1 -0
  554. package/dist/record/skybox-post-pass.d.ts +33 -0
  555. package/dist/record/skybox-post-pass.d.ts.map +1 -0
  556. package/dist/record/typed-frame-graph.d.ts +35 -0
  557. package/dist/record/typed-frame-graph.d.ts.map +1 -0
  558. package/dist/record/view-ubo.d.ts +45 -0
  559. package/dist/record/view-ubo.d.ts.map +1 -0
  560. package/dist/render-contract.d.ts +424 -0
  561. package/dist/render-contract.d.ts.map +1 -0
  562. package/dist/render-data.d.ts +143 -0
  563. package/dist/render-data.d.ts.map +1 -0
  564. package/dist/render-graph-primitives.d.ts +76 -0
  565. package/dist/render-graph-primitives.d.ts.map +1 -0
  566. package/dist/render-pipeline.d.ts +110 -0
  567. package/dist/render-pipeline.d.ts.map +1 -0
  568. package/dist/render-system-extract.d.ts +868 -0
  569. package/dist/render-system-extract.d.ts.map +1 -0
  570. package/dist/render-system.d.ts +125 -0
  571. package/dist/render-system.d.ts.map +1 -0
  572. package/dist/scene/render-scene-types.d.ts +61 -0
  573. package/dist/scene/render-scene-types.d.ts.map +1 -0
  574. package/dist/scene/render-scene.d.ts +112 -0
  575. package/dist/scene/render-scene.d.ts.map +1 -0
  576. package/dist/scene-instances/post-spawn-resolve-joints.d.ts +30 -0
  577. package/dist/scene-instances/post-spawn-resolve-joints.d.ts.map +1 -0
  578. package/dist/shadow-atlas.d.ts +117 -0
  579. package/dist/shadow-atlas.d.ts.map +1 -0
  580. package/dist/ssao-buffers.d.ts +50 -0
  581. package/dist/ssao-buffers.d.ts.map +1 -0
  582. package/dist/ssao-config.d.ts +28 -0
  583. package/dist/ssao-config.d.ts.map +1 -0
  584. package/dist/systems/active-camera.d.ts +53 -0
  585. package/dist/systems/active-camera.d.ts.map +1 -0
  586. package/dist/systems/pass-selector.d.ts +24 -0
  587. package/dist/systems/pass-selector.d.ts.map +1 -0
  588. package/dist/systems/skin-palette-allocator.d.ts +49 -0
  589. package/dist/systems/skin-palette-allocator.d.ts.map +1 -0
  590. package/dist/systems/skin-palette-types.d.ts +14 -0
  591. package/dist/systems/skin-palette-types.d.ts.map +1 -0
  592. package/dist/systems/transparent-sort-config.d.ts +112 -0
  593. package/dist/systems/transparent-sort-config.d.ts.map +1 -0
  594. package/dist/tilemap-chunk-extract-system.d.ts +143 -0
  595. package/dist/tilemap-chunk-extract-system.d.ts.map +1 -0
  596. package/dist/typed-render-graph-primitives.d.ts +57 -0
  597. package/dist/typed-render-graph-primitives.d.ts.map +1 -0
  598. package/dist/typed-shadow-passes.d.ts +11 -0
  599. package/dist/typed-shadow-passes.d.ts.map +1 -0
  600. package/package.json +94 -0
  601. package/src/__tests__/authoring-path.unit.test.ts +23 -0
  602. package/src/__tests__/backend-selection-rhi-capture.test-d.ts +21 -0
  603. package/src/__tests__/callback-inference.test-d.ts +8 -0
  604. package/src/__tests__/cluster-binner.test.ts +272 -0
  605. package/src/__tests__/cluster-grid-default-surface.unit.test.ts +20 -0
  606. package/src/__tests__/construct-renderer-identity.unit.test.ts +23 -0
  607. package/src/__tests__/device-scope-lifecycle.unit.test.ts +151 -0
  608. package/src/__tests__/device-scope-stale-matrix.unit.test.ts +42 -0
  609. package/src/__tests__/direct-extract-consumer-contract.test-d.ts +23 -0
  610. package/src/__tests__/direct-light-snapshot.unit.test.ts +61 -0
  611. package/src/__tests__/factory-contract.integration.test.ts +280 -0
  612. package/src/__tests__/fallback-row-stride-surface.unit.test.ts +15 -0
  613. package/src/__tests__/frame-observation.contract.test.ts +112 -0
  614. package/src/__tests__/fullscreen-feature-plan.unit.test.ts +32 -0
  615. package/src/__tests__/glyph-text-layout-recovery.unit.test.ts +167 -0
  616. package/src/__tests__/gpu-driven-indirect-raster-evidence.ts +350 -0
  617. package/src/__tests__/gpu-driven-indirect-raster.browser.test.ts +12 -0
  618. package/src/__tests__/gpu-driven-indirect-raster.dawn.test.ts +16 -0
  619. package/src/__tests__/gpu-driven-production.integration.test.ts +436 -0
  620. package/src/__tests__/gpu-driven-scaling.unit.test.ts +87 -0
  621. package/src/__tests__/gpu-driven-view-gpu-evidence.ts +271 -0
  622. package/src/__tests__/gpu-driven-view-graph.integration.test.ts +290 -0
  623. package/src/__tests__/gpu-driven-view-reference.ts +111 -0
  624. package/src/__tests__/gpu-driven-view.browser.test.ts +30 -0
  625. package/src/__tests__/gpu-driven-view.dawn.test.ts +28 -0
  626. package/src/__tests__/gpu-driven-view.unit.test.ts +199 -0
  627. package/src/__tests__/gpu-resource-store-stride.unit.test.ts +59 -0
  628. package/src/__tests__/gpu-scene-render-graph-gpu.ts +308 -0
  629. package/src/__tests__/gpu-scene-render-graph.browser.test.ts +19 -0
  630. package/src/__tests__/gpu-scene-render-graph.dawn.test.ts +19 -0
  631. package/src/__tests__/gpu-scene-schema.unit.test.ts +16 -0
  632. package/src/__tests__/gpu-scene.dawn.test.ts +205 -0
  633. package/src/__tests__/gpu-scene.unit.test.ts +147 -0
  634. package/src/__tests__/ibl/face-uniforms.unit.test.ts +46 -0
  635. package/src/__tests__/infinite-grid-no-vertex-probe.unit.test.ts +92 -0
  636. package/src/__tests__/injection-kind-owner.test-d.ts +14 -0
  637. package/src/__tests__/ktx2-basis-gpu-consumer.dawn.test.ts +728 -0
  638. package/src/__tests__/light-buffer-layout.unit.test.ts +40 -0
  639. package/src/__tests__/material-contract-inventory.unit.test.ts +24 -0
  640. package/src/__tests__/material-cooked-projection.unit.test.ts +150 -0
  641. package/src/__tests__/material-snapshot-mutation.integration.test.ts +53 -0
  642. package/src/__tests__/material-static-dynamic-route.unit.test.ts +94 -0
  643. package/src/__tests__/material-stride-surface.unit.test.ts +32 -0
  644. package/src/__tests__/mesh-buffer-usage-surface.unit.test.ts +106 -0
  645. package/src/__tests__/mesh-material-bindings.unit.test.ts +89 -0
  646. package/src/__tests__/mesh-stride-surface.unit.test.ts +16 -0
  647. package/src/__tests__/morph-culling-reentry.dawn.test.ts +157 -0
  648. package/src/__tests__/morph-feature-gpu-work.integration.test.ts +80 -0
  649. package/src/__tests__/morph-feature-plan.unit.test.ts +53 -0
  650. package/src/__tests__/morph-visual-evidence.integration.test.ts +80 -0
  651. package/src/__tests__/nineslice-handle-surface.unit.test.ts +19 -0
  652. package/src/__tests__/post-process-error-policy-owner.unit.test.ts +201 -0
  653. package/src/__tests__/prepared-buffer-kind-owner.test-d.ts +29 -0
  654. package/src/__tests__/prepared-graphics-capability.unit.test.ts +65 -0
  655. package/src/__tests__/prepared-graphics-generation.unit.test.ts +161 -0
  656. package/src/__tests__/prepared-graphics-lifecycle.unit.test.ts +138 -0
  657. package/src/__tests__/prepared-graphics-pipeline-warmup.unit.test.ts +29 -0
  658. package/src/__tests__/prepared-graphics-resolver.unit.test.ts +285 -0
  659. package/src/__tests__/prepared-graphics-snapshot.unit.test.ts +105 -0
  660. package/src/__tests__/prepared-graphics-store.unit.test.ts +154 -0
  661. package/src/__tests__/prepared-graphics-validation.unit.test.ts +176 -0
  662. package/src/__tests__/profiler-default-off.test.ts +22 -0
  663. package/src/__tests__/profiler-phase-catalog.test.ts +66 -0
  664. package/src/__tests__/profiler-phase-integration.test.ts +62 -0
  665. package/src/__tests__/profiler-phase-token.test.ts +79 -0
  666. package/src/__tests__/public-surface.test-d.ts +94 -0
  667. package/src/__tests__/recover-error-policy-owner.unit.test.ts +107 -0
  668. package/src/__tests__/render-error-code-owner.test-d.ts +116 -0
  669. package/src/__tests__/render-error-detail-ssot.test-d.ts +139 -0
  670. package/src/__tests__/render-error-exhaustive.test-d.ts +110 -0
  671. package/src/__tests__/render-feature-assembly.test-d.ts +43 -0
  672. package/src/__tests__/render-feature-context.test-d.ts +57 -0
  673. package/src/__tests__/render-feature-contract.test-d.ts +49 -0
  674. package/src/__tests__/render-feature-diagnostics.unit.test.ts +149 -0
  675. package/src/__tests__/render-feature-docs.unit.test.ts +89 -0
  676. package/src/__tests__/render-feature-errors.unit.test.ts +47 -0
  677. package/src/__tests__/render-feature-gpu-work.integration.test.ts +316 -0
  678. package/src/__tests__/render-feature-plan.test-d.ts +161 -0
  679. package/src/__tests__/render-feature-plan.unit.test.ts +170 -0
  680. package/src/__tests__/render-feature-prepared-diagnostics.unit.test.ts +90 -0
  681. package/src/__tests__/render-feature-prepared-errors.test-d.ts +79 -0
  682. package/src/__tests__/render-feature-prepared-graphics-docs.unit.test.ts +80 -0
  683. package/src/__tests__/render-feature-prepared-graphics-isolation.unit.test.ts +72 -0
  684. package/src/__tests__/render-feature-prepared-graphics-negative.test-d.ts +36 -0
  685. package/src/__tests__/render-feature-prepared-graphics.test-d.ts +74 -0
  686. package/src/__tests__/render-feature-prepared-graphics.unit.test.ts +121 -0
  687. package/src/__tests__/render-feature-public-surface.test-d.ts +57 -0
  688. package/src/__tests__/render-feature-retry.unit.test.ts +87 -0
  689. package/src/__tests__/render-feature-scheduling.unit.test.ts +110 -0
  690. package/src/__tests__/render-feature-stage-failed-policy-owner.unit.test.ts +137 -0
  691. package/src/__tests__/render-feature-stage-fault-recovery.unit.test.ts +146 -0
  692. package/src/__tests__/render-feature-visibility-context.test-d.ts +33 -0
  693. package/src/__tests__/render-feature-visibility-context.unit.test.ts +37 -0
  694. package/src/__tests__/render-feature-zero-work.unit.test.ts +76 -0
  695. package/src/__tests__/render-graph-compute-raster-gpu.ts +342 -0
  696. package/src/__tests__/render-graph-compute-raster.browser.test.ts +16 -0
  697. package/src/__tests__/render-graph-compute-raster.dawn.test.ts +22 -0
  698. package/src/__tests__/render-graph-hzb-gpu.ts +239 -0
  699. package/src/__tests__/render-graph-hzb.browser.test.ts +16 -0
  700. package/src/__tests__/render-graph-hzb.dawn.test.ts +23 -0
  701. package/src/__tests__/render-graph-primitives.unit.test.ts +22 -0
  702. package/src/__tests__/render-graph-storage-indirect-gpu.ts +162 -0
  703. package/src/__tests__/render-graph-storage-indirect.browser.test.ts +21 -0
  704. package/src/__tests__/render-graph-storage-indirect.dawn.test.ts +28 -0
  705. package/src/__tests__/render-scene-projection.unit.test.ts +168 -0
  706. package/src/__tests__/renderer-factory-material-contract.unit.test.ts +121 -0
  707. package/src/__tests__/renderer-lifecycle.integration.test.ts +58 -0
  708. package/src/__tests__/rhi-backend-package-boundary.unit.test.ts +11 -0
  709. package/src/__tests__/scriptable-pack-consumer.test-d.ts +14 -0
  710. package/src/__tests__/shader-stage-surface.unit.test.ts +43 -0
  711. package/src/__tests__/ssao-config.unit.test.ts +36 -0
  712. package/src/__tests__/ssao-kernel-surface.unit.test.ts +14 -0
  713. package/src/__tests__/standard-clustered-pipeline.unit.test.ts +28 -0
  714. package/src/__tests__/standard-descriptors.test-d.ts +22 -0
  715. package/src/__tests__/standard-pipeline.dawn.test.ts +61 -0
  716. package/src/__tests__/standard-pipeline.integration.test.ts +124 -0
  717. package/src/__tests__/standard-profile-oracle.unit.test.ts +62 -0
  718. package/src/__tests__/surface-configuration.unit.test.ts +91 -0
  719. package/src/__tests__/texture-usage-surface.unit.test.ts +58 -0
  720. package/src/__tests__/typed-pipeline-topology.unit.test.ts +223 -0
  721. package/src/__tests__/urp-pipeline-targets.unit.test.ts +42 -0
  722. package/src/__tests__/urp-pipeline.unit.test.ts +14 -0
  723. package/src/__tests__/vertex-color-pipeline.unit.test.ts +132 -0
  724. package/src/__tests__/vertex-layout-consumer.unit.test.ts +25 -0
  725. package/src/__tests__/visibility-diagnostics.integration.test.ts +62 -0
  726. package/src/__tests__/visibility-extract.integration.test.ts +98 -0
  727. package/src/__tests__/visibility-extract.perf.test.ts +130 -0
  728. package/src/__tests__/visibility-feature-dedup.integration.test.ts +55 -0
  729. package/src/__tests__/visibility-hidden-report.unit.test.ts +36 -0
  730. package/src/__tests__/visibility-instances.integration.test.ts +46 -0
  731. package/src/__tests__/visibility-multi-world.integration.test.ts +86 -0
  732. package/src/__tests__/visibility-producer-matrix.integration.test.ts +168 -0
  733. package/src/__tests__/visibility-producer-matrix.unit.test.ts +96 -0
  734. package/src/__tests__/visibility-public-surface.test-d.ts +27 -0
  735. package/src/__tests__/visibility-resolver.unit.test.ts +85 -0
  736. package/src/__tests__/visibility-resource-short-circuit.unit.test.ts +80 -0
  737. package/src/__tests__/visibility-snapshot-contract.unit.test.ts +60 -0
  738. package/src/__tests__/vocabulary.unit.test.ts +21 -0
  739. package/src/assembly/backend-contract.ts +57 -0
  740. package/src/assembly/factory.ts +8130 -0
  741. package/src/assembly/host-contract.ts +101 -0
  742. package/src/assembly/material/assembly.ts +48 -0
  743. package/src/assembly/material/pipeline-projection.ts +63 -0
  744. package/src/assets/asset-decoders.ts +158 -0
  745. package/src/assets/render-asset-port.ts +44 -0
  746. package/src/assets/resolve-render-asset.ts +13 -0
  747. package/src/authoring.ts +17 -0
  748. package/src/cluster-binner.ts +700 -0
  749. package/src/components/__tests__/points-lines-admission.unit.test.ts +219 -0
  750. package/src/components/__tests__/points-lines-schema.unit.test.ts +56 -0
  751. package/src/components/__tests__/schema-contract.unit.test.ts +10 -0
  752. package/src/components/__tests__/schema-parity.unit.test.ts +25 -0
  753. package/src/components/__tests__/visibility-schema.unit.test.ts +35 -0
  754. package/src/components/camera.ts +512 -0
  755. package/src/components/directional-light.ts +120 -0
  756. package/src/components/glyph-text.ts +64 -0
  757. package/src/components/index.ts +54 -0
  758. package/src/components/instances.ts +206 -0
  759. package/src/components/layer.ts +69 -0
  760. package/src/components/light-helpers.ts +188 -0
  761. package/src/components/lines.ts +18 -0
  762. package/src/components/mesh-filter.ts +60 -0
  763. package/src/components/mesh-renderer.ts +61 -0
  764. package/src/components/point-light-shadow.ts +43 -0
  765. package/src/components/point-light.ts +65 -0
  766. package/src/components/points.ts +40 -0
  767. package/src/components/post-process-params.ts +35 -0
  768. package/src/components/scene-instance.ts +193 -0
  769. package/src/components/skybox-background.ts +103 -0
  770. package/src/components/skylight.ts +97 -0
  771. package/src/components/sort-key.ts +75 -0
  772. package/src/components/spot-light.ts +124 -0
  773. package/src/components/sprite-animation.ts +168 -0
  774. package/src/components/sprite-instances.ts +179 -0
  775. package/src/components/sprite-playback-mode.ts +79 -0
  776. package/src/components/sprite-region-override.ts +105 -0
  777. package/src/components/tile-layer.ts +167 -0
  778. package/src/components/tilemap.ts +48 -0
  779. package/src/components/visibility.ts +53 -0
  780. package/src/construct-renderer.ts +67 -0
  781. package/src/debug-draw-glue.ts +48 -0
  782. package/src/device/device-scope.ts +306 -0
  783. package/src/device/gpu-residency.ts +1822 -0
  784. package/src/device/resource-types.ts +20 -0
  785. package/src/engine-metrics.ts +82 -0
  786. package/src/errors/ecs-validation.ts +16 -0
  787. package/src/errors/index.ts +3 -0
  788. package/src/errors/recover.ts +161 -0
  789. package/src/errors/render.ts +1284 -0
  790. package/src/extract/visibility.ts +120 -0
  791. package/src/features/fullscreen.ts +46 -0
  792. package/src/features/host.ts +1363 -0
  793. package/src/features/morph/morph-feature.ts +377 -0
  794. package/src/features/plan.ts +447 -0
  795. package/src/features/prepared-gpu-work.ts +959 -0
  796. package/src/features/prepared-graphics-store.ts +449 -0
  797. package/src/features/prepared-graphics.ts +420 -0
  798. package/src/features/render-graph-compute.ts +69 -0
  799. package/src/features/render-graph-contribution.ts +75 -0
  800. package/src/features/render-graph-raster.ts +332 -0
  801. package/src/features/render-graph-resources.ts +38 -0
  802. package/src/features/targets.ts +70 -0
  803. package/src/features/types.ts +103 -0
  804. package/src/features/vocabulary.ts +24 -0
  805. package/src/fullscreen-post-process-pass.ts +363 -0
  806. package/src/glyph-text-layout-system.ts +421 -0
  807. package/src/gpu-driven/batch-topology.ts +245 -0
  808. package/src/gpu-driven/production-raster.ts +695 -0
  809. package/src/gpu-driven/view-gpu.ts +703 -0
  810. package/src/gpu-resource.ts +159 -0
  811. package/src/gpu-scene-schema.ts +136 -0
  812. package/src/gpu-scene.ts +722 -0
  813. package/src/gpu-stage.ts +9 -0
  814. package/src/gpu-texture-usage.ts +12 -0
  815. package/src/gpu-usage.ts +14 -0
  816. package/src/hdrp-buffers.ts +480 -0
  817. package/src/ibl/IblPipelineCache.ts +1006 -0
  818. package/src/ibl/skylight-bind-group.ts +513 -0
  819. package/src/index.ts +129 -0
  820. package/src/inspection-types.ts +80 -0
  821. package/src/instance-buffer-cache.ts +95 -0
  822. package/src/internal.ts +9 -0
  823. package/src/lifecycle.ts +168 -0
  824. package/src/light-buffer-layout.ts +346 -0
  825. package/src/materials.ts +214 -0
  826. package/src/mesh-material-bindings.ts +103 -0
  827. package/src/pbr-pipeline.ts +1137 -0
  828. package/src/pipeline/standard-forward-lane.ts +229 -0
  829. package/src/pipeline/standard-pipeline.ts +555 -0
  830. package/src/pipeline/standard-profile.ts +65 -0
  831. package/src/pipeline-builder.ts +382 -0
  832. package/src/pipeline-spec-types.ts +28 -0
  833. package/src/pipeline-spec.ts +1231 -0
  834. package/src/plugin.ts +69 -0
  835. package/src/points-lines/__tests__/bounds.unit.test.ts +21 -0
  836. package/src/points-lines/__tests__/cache-recovery.unit.test.ts +157 -0
  837. package/src/points-lines/__tests__/inspection-lanes.integration.test.ts +146 -0
  838. package/src/points-lines/__tests__/inspection.unit.test.ts +173 -0
  839. package/src/points-lines/__tests__/lane-structural.integration.test.ts +122 -0
  840. package/src/points-lines/__tests__/points-lines.bench.ts +400 -0
  841. package/src/points-lines/__tests__/raster-lane.integration.test.ts +44 -0
  842. package/src/points-lines/__tests__/snapshot.unit.test.ts +101 -0
  843. package/src/points-lines/__tests__/view-ubo.unit.test.ts +73 -0
  844. package/src/points-lines/admission.ts +238 -0
  845. package/src/points-lines/bounds.ts +23 -0
  846. package/src/points-lines/expansion-cache.ts +215 -0
  847. package/src/points-lines/inspection.ts +97 -0
  848. package/src/points-lines/prepare.ts +177 -0
  849. package/src/points-lines/record.ts +125 -0
  850. package/src/points-lines/snapshot.ts +130 -0
  851. package/src/post-process-errors.ts +302 -0
  852. package/src/prepare/prepared-graphics-resolver.ts +456 -0
  853. package/src/record/__tests__/material-bg-cache.unit.test.ts +41 -0
  854. package/src/record/__tests__/material-slot-plan.unit.test.ts +44 -0
  855. package/src/record/__tests__/typed-frame-graph-plan.unit.test.ts +41 -0
  856. package/src/record/__tests__/video-texture-view.unit.test.ts +90 -0
  857. package/src/record/frame-lighting.ts +1074 -0
  858. package/src/record/frame-snapshot.ts +500 -0
  859. package/src/record/frame-targets.ts +137 -0
  860. package/src/record/frame.ts +1598 -0
  861. package/src/record/helpers.ts +284 -0
  862. package/src/record/main-pass-geometry.ts +1065 -0
  863. package/src/record/main-pass-material.ts +1043 -0
  864. package/src/record/main-pass-sprite-draws.ts +1137 -0
  865. package/src/record/main-pass.ts +610 -0
  866. package/src/record/mesh-ssbo.ts +885 -0
  867. package/src/record/render-context.ts +384 -0
  868. package/src/record/shadow-pass.ts +698 -0
  869. package/src/record/skybox-post-pass.ts +593 -0
  870. package/src/record/typed-frame-graph.ts +461 -0
  871. package/src/record/view-ubo.ts +222 -0
  872. package/src/render-contract.ts +582 -0
  873. package/src/render-data.ts +385 -0
  874. package/src/render-graph-primitives.ts +811 -0
  875. package/src/render-pipeline.ts +259 -0
  876. package/src/render-system-extract.ts +4585 -0
  877. package/src/render-system.ts +1933 -0
  878. package/src/scene/render-scene-types.ts +67 -0
  879. package/src/scene/render-scene.ts +1087 -0
  880. package/src/scene-instances/post-spawn-resolve-joints.ts +165 -0
  881. package/src/shadow-atlas.ts +244 -0
  882. package/src/ssao-buffers.ts +334 -0
  883. package/src/ssao-config.ts +61 -0
  884. package/src/systems/active-camera.ts +116 -0
  885. package/src/systems/pass-selector.ts +49 -0
  886. package/src/systems/skin-palette-allocator.ts +251 -0
  887. package/src/systems/skin-palette-types.ts +14 -0
  888. package/src/systems/transparent-sort-config.ts +233 -0
  889. package/src/tilemap-chunk-extract-system.ts +1290 -0
  890. package/src/typed-render-graph-primitives.ts +541 -0
  891. package/src/typed-shadow-passes.ts +165 -0
@@ -0,0 +1,610 @@
1
+ import type { World } from '@forgeax/engine-ecs';
2
+ import { probeVideoHighPerfUpload } from '@forgeax/engine-graphics-extras';
3
+ import {
4
+ type BindGroup,
5
+ RhiError,
6
+ type RhiRenderPassEncoder,
7
+ type TextureView,
8
+ } from '@forgeax/engine-rhi';
9
+ import type { Handle, PassKind, PassSelector } from '@forgeax/engine-types';
10
+ import { createHdrpUnifiedBindGroup, getOrCreateHdrpBuffers } from '../hdrp-buffers';
11
+ import { getOrCreateIblCache } from '../ibl/IblPipelineCache';
12
+ import { buildBeginRenderPassDescriptor } from '../pipeline-spec';
13
+ import { POINTS_LINES_MATERIAL_SHADER_ID } from '../points-lines/record';
14
+ import type { RenderRecordPhase } from '../render-contract';
15
+ import type { MaterialSnapshot } from '../render-system-extract';
16
+ import { recordGeometryDraws } from './main-pass-geometry';
17
+ import {
18
+ applyMaterialTextureUvScales,
19
+ applyParamSnapshotToUbo,
20
+ buildPerSubmeshMaterialBg as buildPerSubmeshMaterialBgImpl,
21
+ detectNineSliceScaleTooSmall,
22
+ type PerSubmeshMaterialBgDeps,
23
+ residentTextureView,
24
+ writePbrMaterialUboPayload,
25
+ } from './main-pass-material';
26
+ import { recordSpritePass } from './main-pass-sprite-draws';
27
+ import type { _InternalRenderPipelineContext } from './render-context';
28
+ import { MATERIAL_PER_ENTITY_STRIDE, STANDARD_PBR_UBO_SIZE } from './render-context';
29
+ import {
30
+ buildMatchedMaterialHandlesByRenderable,
31
+ buildMatchedRenderableIndices,
32
+ } from './shadow-pass';
33
+
34
+ const ZERO_SKYLIGHT_PAYLOAD = new Float32Array([0, 0, 0, 0, 0, 0, 0, 1]);
35
+
36
+ export type MainPassOptions = {
37
+ readonly colorViews?: readonly (TextureView | null)[];
38
+ readonly colorFormats?: readonly GPUTextureFormat[];
39
+ readonly depthView?: TextureView | null;
40
+ readonly passKind?: PassKind;
41
+ readonly clearColor?: readonly [number, number, number, number];
42
+ };
43
+
44
+ /**
45
+ * feat-20260529-rendergraph-pass-abstraction M4 / w13b: main forward
46
+ * (geometry) pass recording, extracted verbatim from recordFrame. Uses the
47
+ * SHARED frame encoder (c.encoder); the geometry + optional LDR sprite-split
48
+ * sub-pass write into geometryColorView (HDR target or swap-chain view).
49
+ * Driven by the render-graph 'main' pass execute closure.
50
+ */
51
+ export function recordMainPass(
52
+ c: _InternalRenderPipelineContext,
53
+ selector?: PassSelector,
54
+ options?: MainPassOptions,
55
+ graphPass?: RhiRenderPassEncoder,
56
+ ): void {
57
+ const {
58
+ runtime,
59
+ world,
60
+ store,
61
+ pipelineState,
62
+ encoder,
63
+ clear,
64
+ geometryColorView,
65
+ geometryDepthView,
66
+ validatedOrdered,
67
+ viewBindGroup,
68
+ meshBindGroup,
69
+ frameState,
70
+ bindGroupCounts,
71
+ skylight,
72
+ skylightCount,
73
+ skyboxActive,
74
+ splitLdrSprite,
75
+ msaaActive,
76
+ geometryColorResolveView,
77
+ dispatch,
78
+ hdrpClusterBindGroup,
79
+ materialSlotIndices,
80
+ materialSlots,
81
+ materialSlotOwners,
82
+ materialSlotCount,
83
+ } = c;
84
+ // bug-20260615 M3 / m3-1: sampleCount is threaded through every
85
+ // getMaterialShaderPipeline call site so the cache key / builder
86
+ // disambiguate count=1 vs count=4 PSOs. Derived from the per-camera
87
+ // msaaActive boolean (already on the context).
88
+ const sampleCount = msaaActive ? 4 : 1;
89
+ const passKind = options?.passKind ?? 'forward';
90
+ const colorViews = options?.colorViews ?? [geometryColorView];
91
+ const colorFormats = options?.colorFormats ?? [
92
+ (c.tonemapActive ? 'rgba16float' : pipelineState.colorAttachmentFormat) as GPUTextureFormat,
93
+ ];
94
+ const targetDepthView = options?.depthView ?? geometryDepthView;
95
+ const clearColor = options?.clearColor ?? clear;
96
+ // feat-20260623-world-space-video-asset M4 / w17 (D-2 / AC-09): high-perf
97
+ // GPUExternalTexture upload availability for video sources, resolved by the
98
+ // explicit RhiCaps-based capability probe. The probe checks
99
+ // backendKind==='webgpu' AND `importExternalTexture` method presence; the
100
+ // latter is absent today (OOS-5), so this is false and the general
101
+ // copyExternalImageToTexture path (w16) is the sole route. The branch exists
102
+ // so the AC-09 two-path reserved hook is code-review-verifiable, not a TODO.
103
+ const videoHighPerfAvailable = probeVideoHighPerfUpload(runtime.device);
104
+ // feat-20260609-hdrp-cluster-fragment-ggx M4 / w16: HDRP active swaps the
105
+ // group(2) bindGroup for the unified 7-entry layout (mesh SSBO at binding 0
106
+ // + cluster 4 buffer at bindings 3..6). The dynamic offset
107
+ // (`i * MESH_PER_ENTITY_STRIDE`) stays valid because the unified BGL binds
108
+ // the SAME mesh SSBO at binding 0; the cluster-forward shader reads the
109
+ // cluster bindings off the rest of the layout. Plan D-1 (URP path zero
110
+ // change) is preserved — when `!isHdrpActive` the URP `meshBindGroup`
111
+ // path runs verbatim.
112
+ // feat-20260612-hdrp-ssao wiring fix: when the HDRP forward pass resolved a
113
+ // real `ssaoBlurred` view (stashed on ctx by the pass execute closure), build
114
+ // the unified group(2) bind group with that view at binding 7 so fs_main reads
115
+ // the actual occlusion factor instead of the 1x1 white fallback. The default
116
+ // `hdrpClusterBindGroup` (built ahead of graph.execute) always carries the
117
+ // fallback because the transient SSAO texture does not exist that early.
118
+ // Built per frame (the SSAO target is a graph transient, so no cross-frame
119
+ // cache); HDRP-only and SSAO-only, so URP and SSAO-off paths are untouched.
120
+ let hdrpSsaoBindGroup: BindGroup | null = null;
121
+ if (
122
+ frameState.isHdrpActive &&
123
+ hdrpClusterBindGroup !== null &&
124
+ c.hdrpSsaoBlurredView !== undefined
125
+ ) {
126
+ const hdrpBuffers = getOrCreateHdrpBuffers(
127
+ runtime,
128
+ frameState.installedPipelineConfig?.clusterGrid,
129
+ );
130
+ if (hdrpBuffers !== null) {
131
+ hdrpSsaoBindGroup = createHdrpUnifiedBindGroup(
132
+ runtime,
133
+ hdrpBuffers,
134
+ pipelineState.meshStorageBuffer.buffer,
135
+ { enabled: true, ssaoBlurredView: c.hdrpSsaoBlurredView },
136
+ );
137
+ }
138
+ }
139
+ const meshGroup2: BindGroup | null =
140
+ frameState.isHdrpActive && hdrpClusterBindGroup !== null
141
+ ? (hdrpSsaoBindGroup ?? hdrpClusterBindGroup)
142
+ : meshBindGroup;
143
+ // ── Geometry (main colour) pass ──────────────────────────────────
144
+ // D-2: tracks whether the geometry pass was explicitly ended inside
145
+ // the `if (validatedOrdered.length > 0)` block (sprite split path),
146
+ // to avoid a double-end at the unconditional `pass.end()` below.
147
+ let geometryPassEnded = false;
148
+ // feat-20260531-skybox-env-background M2 / w8: condition main colour
149
+ // loadOp on skyboxActive (AC-05). When skybox is active, the skybox
150
+ // pass writes the far plane + cubemap colour to hdrColor before main;
151
+ // main must load (not clear) to composite geometry on top. Depth
152
+ // loadOp stays 'clear' -- skybox does not write depth, so main's
153
+ // depth test naturally covers skybox pixels with foreground geometry.
154
+ const mainColorLoadOp = skyboxActive ? 'load' : 'clear';
155
+ // feat-20260604 M2 / w9-w10: MSAA resolve placement. When MSAA is active the
156
+ // geometry pass writes a count=4 multisample target. The resolve to the
157
+ // single-sample output (LDR swap-chain view / HDR hdrColor) happens at the
158
+ // LAST pass that writes that multisample target: the main pass itself when
159
+ // there is no LDR sprite split, or the sprite sub-pass end when there is
160
+ // (F-1 -- geometry + sprites share one multisample texture; resolving at the
161
+ // main pass would drop the sprites drawn after). The sprite sub-pass is
162
+ // LDR-only, so under HDR the main pass always resolves.
163
+ const mainPassResolves =
164
+ passKind === 'forward' && msaaActive && geometryColorResolveView !== null && !splitLdrSprite;
165
+ // forward main pass: depth24plus-stencil8 auto-emits stencil ops via the
166
+ // helper's stencil-op gate (plan-strategy M4 R3/R5 stencil-op SSOT).
167
+ // mainColorLoadOp toggles between 'clear' and 'load' (skyboxActive case).
168
+ const pass: RhiRenderPassEncoder =
169
+ graphPass ??
170
+ encoder.beginRenderPass(
171
+ buildBeginRenderPassDescriptor(
172
+ {
173
+ colorFormats,
174
+ depthFormat: 'depth24plus-stencil8',
175
+ sampleCount: msaaActive ? 4 : 1,
176
+ },
177
+ {
178
+ colorViews,
179
+ depthView: targetDepthView,
180
+ ...(mainPassResolves ? { resolveTargets: [geometryColorResolveView] } : {}),
181
+ },
182
+ passKind,
183
+ {
184
+ colorLoadOp: mainColorLoadOp,
185
+ clearColor: {
186
+ r: clearColor[0] ?? 0,
187
+ g: clearColor[1] ?? 0,
188
+ b: clearColor[2] ?? 0,
189
+ a: clearColor[3] ?? 1,
190
+ },
191
+ },
192
+ ) as never,
193
+ );
194
+
195
+ // Geometry submission block: setPipeline + 4 bind groups + per-entity
196
+ // material uploads + drawIndexed.
197
+
198
+ // feat-20260609 M2: filter entities by pass selector.
199
+ const matchedIndices =
200
+ selector !== undefined ? buildMatchedRenderableIndices(dispatch, selector) : null;
201
+ const matchedMaterials =
202
+ selector !== undefined ? buildMatchedMaterialHandlesByRenderable(dispatch, selector) : null;
203
+
204
+ if (validatedOrdered.length > 0) {
205
+ // feat-20260518-pbr-direct-lighting-mvp M5 / w22.10 (D-4 + D-9 +
206
+ // AC-07 std140): per-entity material slice grew from 32 B (legacy
207
+ // baseColor:vec4 + metallic + roughness + 8B padding) to 48 B
208
+ // mirroring the post-w22.10 `Material` WGSL struct field-for-field
209
+ // (see STANDARD_PBR_UBO_SIZE JSDoc in render-system.ts). The dynamic-
210
+ // offset stride is MATERIAL_PER_ENTITY_STRIDE; the BindGroup entry's
211
+ // `size` remains the derived material payload size.
212
+ const MATERIAL_SLICE = STANDARD_PBR_UBO_SIZE;
213
+ // feat-20260515 M3 / T-M3-05 (research F-6 fix): materialBindGroup now
214
+ // carries 3 entries -- the per-entity material UBO (binding 0,
215
+ // dynamic-offset retained from D-P9), the default sampler (binding 1,
216
+ // pipelineState.defaultSampler from createRenderer; research F-5
217
+ // linear min/mag/mipmap + repeat addressMode), and the texture-view
218
+ // (binding 2, resolved from MaterialSnapshot.baseColorTexture via
219
+ // AssetRegistry.getTextureGpuView when present, falling back to the
220
+ // pipelineState.fallbackTextureView 1x1 white pixel).
221
+ //
222
+ // The first validated renderable's material is sampled to choose the
223
+ // texture-view (M3 milestone simplification; M5 lifts this to
224
+ // per-entity slot writes once UV-driven sampling lands).
225
+ //
226
+ // feat-20260517-merge-mesh-renderer-material-renderer M3 / w10
227
+ // (this commit): the prior structural cast over `firstMaterial`
228
+ // (used to reach `baseColorTexture` before the snapshot carried
229
+ // it as a first-class field) is removed in favour of direct
230
+ // snapshot field access. `MaterialSnapshot` (extract-stage SSOT)
231
+ // already declares `baseColorTexture` (M2 / w6); record reads it
232
+ // directly with no asset registry round-trip and no cast --
233
+ // Pipeline Isolation: extract owns the asset to snapshot
234
+ // translation; record consumes the snapshot POD only (charter
235
+ // proposition 5 consistent abstraction; AC-07 reverse-grep gate
236
+ // `scripts/forgeax/check-render-record-no-material-asset-get.mjs`
237
+ // forbids both the cast pattern and a direct material asset
238
+ // typed-lookup regrowth in this file).
239
+ // bug-20260522-per-entity-material-texture-binding D-1/D-2:
240
+ // the pre-loop `firstMaterial` / `materialTextureView` / `
241
+ // baseMaterialEntries` / single shared `materialBindGroup` are
242
+ // removed. Each entity now creates its own per-entity material BG
243
+ // inside the draw loop, resolving binding=2 from its own
244
+ // `entry.source.material.baseColorTexture` (mirroring sprite path).
245
+ //
246
+ // feat-20260520-skylight-ibl-cubemap M3 round-4 / t48 amend: the
247
+ // 14-entry merged BG (7 material + 7 Skylight) is now assembled per
248
+ // entity inside the draw loop. The Skylight part stays scene-level
249
+ // (single `skylightResources` resolved once below); only the first 7
250
+ // material entries are rebuilt per-entity with the correct
251
+ // per-entity textureView at binding=2.
252
+ const skylightFallback = pipelineState.skylightFallback;
253
+ if (skylightFallback === null) {
254
+ throw new RhiError({
255
+ code: 'webgpu-runtime-error',
256
+ expected: 'pipelineState.skylightFallback != null when PBR pipeline is active',
257
+ hint: 'createRenderer must allocate skylightFallback alongside the PBR pipeline (D-5 round-4)',
258
+ });
259
+ }
260
+ // feat-20260520-skylight-ibl-cubemap M4 round-4 / t60 (D-5 round-4):
261
+ // select active vs fallback Skylight resources by `skylightCount` from
262
+ // the extract stage. Active path reaches into the per-device
263
+ // `IblPipelineCache` slots (irradianceView / prefilterView / brdfLutView)
264
+ // populated by the internal equirect-to-cubemap projection; fallback uses the
265
+ // 1x1-zero identity bundle that converges ambient to 0 (D-4 physical
266
+ // convergence -- no `if (hasSkylight)` shader branch).
267
+ // The samplers are reused from `skylightFallback.sampler` for both
268
+ // paths (linear / clamp-to-edge is correct for IBL cube + 2D LUT
269
+ // sampling either way). The intensity uniform is rewritten per-frame
270
+ // when active so `sampleIblSpecular * intensity` carries the user's
271
+ // Skylight.intensity value; fallback keeps intensity=0 (createSkylightFallback
272
+ // seed) so ambient = 0 even when the same buffer is shared.
273
+ let activeViews: { irr: TextureView; pref: TextureView; brdf: TextureView } | undefined;
274
+ // Per-frame Skylight uniform: std140 32 B = [intensity, colorR, colorG,
275
+ // colorB, rotation quaternion]. Default to all-zero so a transition from "has Skylight" ->
276
+ // "no Skylight" does not leak the prior frame's ambient (intensity 0
277
+ // muzzles everything, including the white fallback irradiance cube).
278
+ runtime.device.queue.writeBuffer(skylightFallback.intensityBuffer, 0, ZERO_SKYLIGHT_PAYLOAD);
279
+ if (skylight !== undefined && skylightCount >= 1) {
280
+ // A Skylight exists. Write its intensity + color regardless of whether
281
+ // a cubemap is bound: with a cubemap the IBL views below light the
282
+ // ambient; WITHOUT one, the white fallback irradiance cube + this color
283
+ // give an instant solid-color ambient (downstream integration #4) with
284
+ // no async precompute. The white fallback only contributes when a
285
+ // Skylight is present because the zero-payload above sets intensity 0
286
+ // when no Skylight exists.
287
+ const [cr, cg, cb] = skylight.color;
288
+ const [qx, qy, qz, qw] = skylight.rotation;
289
+ const uniformPayload = new Float32Array([skylight.intensity, cr, cg, cb, qx, qy, qz, qw]);
290
+ runtime.device.queue.writeBuffer(skylightFallback.intensityBuffer, 0, uniformPayload);
291
+ const cache = getOrCreateIblCache(runtime.deviceScope);
292
+ if (
293
+ cache.irradianceView !== undefined &&
294
+ cache.prefilterView !== undefined &&
295
+ cache.brdfLutView !== undefined
296
+ ) {
297
+ activeViews = {
298
+ irr: cache.irradianceView,
299
+ pref: cache.prefilterView,
300
+ brdf: cache.brdfLutView,
301
+ };
302
+ }
303
+ }
304
+ const skylightResources =
305
+ activeViews !== undefined
306
+ ? {
307
+ irradianceView: activeViews.irr,
308
+ irradianceSampler: skylightFallback.sampler,
309
+ prefilterView: activeViews.pref,
310
+ prefilterSampler: skylightFallback.sampler,
311
+ brdfLutView: activeViews.brdf,
312
+ brdfLutSampler: skylightFallback.sampler,
313
+ intensityBuffer: skylightFallback.intensityBuffer,
314
+ }
315
+ : {
316
+ irradianceView: skylightFallback.irradianceView,
317
+ irradianceSampler: skylightFallback.sampler,
318
+ prefilterView: skylightFallback.prefilterView,
319
+ prefilterSampler: skylightFallback.sampler,
320
+ brdfLutView: skylightFallback.brdfLutView,
321
+ brdfLutSampler: skylightFallback.sampler,
322
+ intensityBuffer: skylightFallback.intensityBuffer,
323
+ };
324
+ // Per-entity material uploads (D-P9 retained path).
325
+ // feat-20260613 fix-issue-1 (D-8 channelMap split): the payload mirrors
326
+ // the post-split sidecar paramSchema for default-standard-pbr (14 entries
327
+ // packed std140 across a 96 B schema tail):
328
+ // [0..3] baseColor vec4<f32> (offset 0)
329
+ // [4] metallic f32 (offset 16)
330
+ // [5] roughness f32 (offset 20)
331
+ // [6] metallicChannel f32 (offset 24)
332
+ // [7] roughnessChannel f32 (offset 28)
333
+ // [8] aoChannel f32 (offset 32)
334
+ // [9] extraChannel f32 (offset 36)
335
+ // [12..14] emissive vec3<f32> (offset 48, vec3 align=16)
336
+ // [15] emissiveIntensity f32 (offset 60)
337
+ // [16] occlusionStrength f32 (offset 64)
338
+ // Channel selectors default to (B,G,R,_) = (2,1,0,0) per glTF 2.0
339
+ // KHR_materials_pbrSpecularGlossiness ARM packing; the fragment casts
340
+ // each f32 to u32 at the pick_channel call site. The full 128 B bind window is
341
+ // overwritten per-entity so unlit entities still produce a deterministic
342
+ // payload (charter P3 explicit failure: zero-init via fresh ArrayBuffer).
343
+ //
344
+ // Material snapshots are interned by extract-owned identity before this
345
+ // pass. Repeated scene instances therefore share one 256-byte UBO slot;
346
+ // materialSlotIndices maps each authored submesh material to that slot.
347
+ // feat-city-glb Bug 5 (per-submesh transparency): shared per-submesh
348
+ // material bind-group assembly, called by BOTH the geometry pass and the
349
+ // LDR blend sub-pass so a transparent PBR submesh binds the identical
350
+ // metallic/roughness/normal/emissive/occlusion + Skylight layout
351
+ // the geometry pass uses (the sub-pass previously bound a sprite-only BG,
352
+ // which cannot render a PBR decal). Captures only frame-stable closure
353
+ // state; the caller passes the per-submesh material snapshot + entityKey
354
+ // (for video texture routing) and sets the dynamic UBO offset itself.
355
+ const perSubmeshMaterialBgDeps: PerSubmeshMaterialBgDeps = {
356
+ runtime,
357
+ pipelineState,
358
+ world,
359
+ store,
360
+ materialSlice: MATERIAL_SLICE,
361
+ videoHighPerfAvailable,
362
+ skylightResources,
363
+ materialBgShared: frameState.materialBgShared,
364
+ materialBgAssemblyCache: c.materialBgAssemblyCache,
365
+ bindGroupCounts,
366
+ };
367
+ const buildPerSubmeshMaterialBg = (
368
+ submeshMaterial: MaterialSnapshot,
369
+ entityKey: number,
370
+ materialWorld: World = world,
371
+ ): BindGroup =>
372
+ buildPerSubmeshMaterialBgImpl(
373
+ perSubmeshMaterialBgDeps,
374
+ submeshMaterial,
375
+ entityKey,
376
+ materialWorld,
377
+ );
378
+
379
+ const cachedMaterialUboPayload = c.materialUboPayloadCache;
380
+ let materialUboPayload: Uint8Array;
381
+ if (
382
+ cachedMaterialUboPayload?.materialSlots === materialSlots &&
383
+ cachedMaterialUboPayload.materialSlotCount === materialSlotCount
384
+ ) {
385
+ materialUboPayload = cachedMaterialUboPayload.payload;
386
+ } else {
387
+ materialUboPayload = new Uint8Array(materialSlotCount * MATERIAL_PER_ENTITY_STRIDE);
388
+ const slotPayload = new Uint8Array(STANDARD_PBR_UBO_SIZE);
389
+ const slotPayloadF32 = new Float32Array(
390
+ slotPayload.buffer,
391
+ slotPayload.byteOffset,
392
+ slotPayload.byteLength / 4,
393
+ );
394
+ for (let materialSlot = 0; materialSlot < materialSlots.length; materialSlot += 1) {
395
+ const mat = materialSlots[materialSlot];
396
+ const entry = validatedOrdered[materialSlotOwners[materialSlot] ?? -1];
397
+ if (mat === undefined || entry === undefined) continue;
398
+
399
+ // feat-20260625-refactor-sprite-as-transparent-mesh M3 / w13 (D-2):
400
+ // single unified Material UBO write path. Sprite materials now flow
401
+ // through the same `buildPbrMaterialUboPayload` baseline +
402
+ // `applyParamSnapshotToUbo` generic std140 overlay every other
403
+ // paramSchema-driven material uses. Extract folds the sprite-specific
404
+ // user inputs into the UBO-aligned paramSnapshot vec4 entries
405
+ // (colorTint / region / pivotAndSize / slicesAndMode); the writer
406
+ // walks `derive(paramSchema).uboLayout.entries` and writes each at
407
+ // its std140 offset. The legacy sprite-specific UBO builder + the
408
+ // sprite-vs-PBR branch are gone (AC-03).
409
+ writePbrMaterialUboPayload(slotPayloadF32, mat);
410
+ // Schema-driven paramSnapshot overlay generalised in feat-20260625
411
+ // M1 / w3: the writer walks `derive(paramSchema).uboLayout.entries`
412
+ // and writes each numeric field at its std140 offset (plan-strategy
413
+ // section 2 D-2). The engine's stock PBR material ships
414
+ // `paramSnapshot: undefined`, so this is a no-op on the default
415
+ // PBR path -- the explicit field writes in buildPbrMaterialUboPayload
416
+ // already cover every byte. User shaders carrying a paramSnapshot
417
+ // (including the post-ablation sprite path) get their fields
418
+ // written at the derive-computed offsets; R-H gate keeps the
419
+ // helper snapshot-only, no asset get.
420
+ const materialShaderId = mat.materialShaderId;
421
+ const schema =
422
+ mat.materialParamSchema ??
423
+ (materialShaderId !== undefined ? runtime.getParamSchema?.(materialShaderId) : undefined);
424
+ applyParamSnapshotToUbo(slotPayloadF32, schema, mat.paramSnapshot);
425
+ applyMaterialTextureUvScales(slotPayloadF32, mat, world);
426
+ // Missing-texture detection: structural debug-pink fallback overrides
427
+ // the baseColor/colorTint slot when a bound baseColorTexture handle
428
+ // resolves to no GPU view. Runs for every textured material path
429
+ // (sprite / sprite-lit / standard-pbr / pbr-skin / unlit) — the bound
430
+ // texture would otherwise silently fall back to the 1x1 white view in
431
+ // the per-submesh BG (main-pass-material.ts), rendering flat with no
432
+ // warn / RhiError. Mirroring the telemetry here makes a missing/failed
433
+ // GLB texture immediately diagnosable instead of a silent flat render
434
+ // (feat-future-pbr-missing-texture-fallback-explicit; feedback
435
+ // 2026-07-04-glb-pbr-textures-not-applied-flat-render).
436
+ //
437
+ // Reads only `mat.baseColorTexture` + the GPU view registry (plan R-H
438
+ // gate: no asset.get<MaterialAsset> reach-back). The debug-pink write
439
+ // lands on f32[0..2], which is baseColor.rgb for the PBR/skin UBO and
440
+ // colorTint.rgb for the sprite UBO — same offset, so one override
441
+ // covers both.
442
+ {
443
+ const matHandleRaw = mat.baseColorTexture as Handle<'TextureAsset', 'shared'> | undefined;
444
+ if (matHandleRaw !== undefined) {
445
+ const view = residentTextureView(entry.world ?? world, store, runtime, matHandleRaw);
446
+ if (view === undefined) {
447
+ const rawId: number = matHandleRaw;
448
+ if (!frameState.warnedMissingBaseColorTextureHandles.has(rawId)) {
449
+ frameState.warnedMissingBaseColorTextureHandles.add(rawId);
450
+ console.warn(
451
+ `[forgeax] baseColor texture ${rawId} missing GPU view, rendering debug pink (shader=${materialShaderId ?? '<none>'} entityIndex=${entry.renderableIndex})`,
452
+ );
453
+ }
454
+ runtime.errorRegistry.fire(
455
+ new RhiError({
456
+ code: 'asset-not-registered',
457
+ expected: 'material baseColor TextureAsset uploaded to GPU',
458
+ hint: 'register + uploadTexture the baseColor texture before draw([world], { cameraOwner: 0, resourceOwner: 0 }); rendering falls back to debug pink until then',
459
+ detail: { assetHandle: rawId },
460
+ }),
461
+ );
462
+ // Debug pink override on slot 0 baseColor/colorTint.rgb (alpha preserved).
463
+ slotPayloadF32[0] = 1.0;
464
+ slotPayloadF32[1] = 0.4;
465
+ slotPayloadF32[2] = 0.7;
466
+ }
467
+ }
468
+ }
469
+
470
+ materialUboPayload.set(slotPayload, materialSlot * MATERIAL_PER_ENTITY_STRIDE);
471
+ }
472
+
473
+ // Material UBO slots can share one snapshot identity, but nine-slice
474
+ // validity depends on each entity's transform. Preserve diagnostics per
475
+ // renderable instead of inheriting the first owner of a shared slot.
476
+ for (const entry of validatedOrdered) {
477
+ const mat = entry.source.material;
478
+ const materialShaderId = mat.materialShaderId;
479
+ if (materialShaderId !== 'forgeax::sprite' && materialShaderId !== 'forgeax::sprite-lit')
480
+ continue;
481
+ const slicesAndMode = mat.paramSnapshot?.slicesAndMode as readonly number[] | undefined;
482
+ if (slicesAndMode === undefined || slicesAndMode.length < 4) continue;
483
+ const slicesArr: readonly [number, number, number, number] = [
484
+ slicesAndMode[0] ?? 0,
485
+ slicesAndMode[1] ?? 0,
486
+ slicesAndMode[2] ?? 0,
487
+ slicesAndMode[3] ?? 0,
488
+ ];
489
+ if (slicesArr[0] === 0 && slicesArr[1] === 0 && slicesArr[2] === 0 && slicesArr[3] === 0)
490
+ continue;
491
+ detectNineSliceScaleTooSmall(
492
+ entry.source.transform.world,
493
+ slicesArr,
494
+ entry.renderableIndex,
495
+ frameState.warnedNineSliceScaleEntities,
496
+ runtime.metrics,
497
+ );
498
+ }
499
+ c.materialUboPayloadCache = {
500
+ materialSlots,
501
+ materialSlotCount,
502
+ payload: materialUboPayload,
503
+ };
504
+ }
505
+
506
+ // All material slots are staged before the first geometry draw. One
507
+ // stride-shaped upload preserves every dynamic offset while avoiding one
508
+ // queue call per material; the RHI still validates alignment and bounds at
509
+ // this single owner-level write boundary.
510
+ const materialUboUpload = runtime.device.queue.writeBuffer(
511
+ pipelineState.materialUniformBuffer.buffer,
512
+ 0,
513
+ materialUboPayload,
514
+ );
515
+ if (!materialUboUpload.ok) throw materialUboUpload.error;
516
+ // Static material resources are a property of the frame-local material
517
+ // slot, not of each submesh draw. Resolve them once here so the geometry
518
+ // loop only selects a prepared binding. Video fields remain entity-bound:
519
+ // their current frame view is keyed by entityKey and must be resolved at
520
+ // the draw site.
521
+ const preparedMaterialBindGroups = new Array<BindGroup | undefined>(materialSlotCount);
522
+ for (let materialSlot = 0; materialSlot < materialSlotCount; materialSlot += 1) {
523
+ const material = materialSlots[materialSlot];
524
+ if (material === undefined || (material.videoTextureFields?.size ?? 0) > 0) continue;
525
+ const owner = validatedOrdered[materialSlotOwners[materialSlot] ?? -1];
526
+ if (owner === undefined) continue;
527
+ preparedMaterialBindGroups[materialSlot] = buildPerSubmeshMaterialBg(
528
+ material,
529
+ owner.source.entityKey,
530
+ owner.world ?? world,
531
+ );
532
+ }
533
+ const resolveMaterialBindGroup = (
534
+ materialSlot: number,
535
+ material: MaterialSnapshot,
536
+ entityKey: number,
537
+ materialWorld: World = world,
538
+ ): BindGroup =>
539
+ material.materialShaderId !== POINTS_LINES_MATERIAL_SHADER_ID
540
+ ? (preparedMaterialBindGroups[materialSlot] ??
541
+ buildPerSubmeshMaterialBg(material, entityKey, materialWorld))
542
+ : buildPerSubmeshMaterialBg(material, entityKey, materialWorld);
543
+
544
+ pass.setBindGroup(0, viewBindGroup as BindGroup, [0]);
545
+
546
+ // Track which (mesh-vertex-buffer, mesh-index-buffer, pipeline) combo
547
+ // was last bound so consecutive entities sharing the same combo skip
548
+ // the redundant rebinds (cheap GPU cost; net wins on workloads where
549
+ // most entities share BUILTIN_CUBE + unlit). Initial nulls force the
550
+ // first iteration to bind unconditionally.
551
+ // M-3 / w12: vertexBuffer/indexBuffer state locals migrate to GpuBuffer.
552
+ const recordGeometry = (): void => {
553
+ recordGeometryDraws(
554
+ c,
555
+ pass,
556
+ matchedMaterials,
557
+ materialSlotIndices,
558
+ sampleCount,
559
+ meshGroup2,
560
+ meshBindGroup,
561
+ resolveMaterialBindGroup,
562
+ passKind,
563
+ );
564
+ };
565
+ if (c.profilePhase === undefined) {
566
+ recordGeometry();
567
+ } else {
568
+ const passName = passKind === 'deferred' ? 'g-buffer' : 'forward';
569
+ c.profilePhase(
570
+ `record/graph-execute/${passName}/geometry-loop` as RenderRecordPhase,
571
+ recordGeometry,
572
+ );
573
+ }
574
+
575
+ // D-2: LDR sprite pass. Runs after the geometry pass when there are
576
+ // sprite entities in the draw list and the LDR path is active.
577
+ // The geometry pass used the bgra8unorm-srgb sRGB view (hardware sRGB
578
+ // encoding for unlit/standard/pbr output). The sprite pass uses the
579
+ // bgra8unorm storage view (loadOp=load) so the sprite LDR pipeline
580
+ // (target=bgra8unorm, blend=premultiplied-alpha) can write over the
581
+ // already-encoded geometry pixels. Depth is loaded from the geometry
582
+ // pass so sprite-vs-mesh occlusion (depthCompare=less-equal) is
583
+ // preserved (plan-strategy §2 D-2 + §4 R-4).
584
+ if (passKind === 'forward') {
585
+ geometryPassEnded = recordSpritePass(
586
+ c,
587
+ pass,
588
+ matchedIndices,
589
+ materialSlotIndices,
590
+ sampleCount,
591
+ resolveMaterialBindGroup,
592
+ skylightResources,
593
+ graphPass,
594
+ );
595
+ }
596
+ } // end if (validatedOrdered.length > 0) -- Case E falls through to pass.end()
597
+
598
+ if (!geometryPassEnded && graphPass === undefined) {
599
+ pass.end();
600
+ }
601
+ }
602
+
603
+ export function encodeMainPass(
604
+ c: _InternalRenderPipelineContext,
605
+ pass: RhiRenderPassEncoder,
606
+ selector?: PassSelector,
607
+ options?: MainPassOptions,
608
+ ): void {
609
+ recordMainPass(c, selector, options, pass);
610
+ }