@forgeax/engine-render 0.1.34 → 0.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -3
- package/dist/assembly/device-feature-admission.d.ts +2 -2
- package/dist/assembly/host-contract.d.ts +3 -2
- package/dist/assembly/host-contract.d.ts.map +1 -1
- package/dist/assembly/recovery/renderer-recover.d.ts.map +1 -1
- package/dist/assembly/render-target-host.d.ts +5 -0
- package/dist/assembly/render-target-host.d.ts.map +1 -1
- package/dist/assembly/renderer-facade.d.ts.map +1 -1
- package/dist/assembly/webgpu-renderer.d.ts +1 -0
- package/dist/assembly/webgpu-renderer.d.ts.map +1 -1
- package/dist/assembly/webgpu-vertex-layouts.d.ts.map +1 -1
- package/dist/authoring.mjs +2 -4
- package/dist/authoring.mjs.map +1 -1
- package/dist/chunk-2OZAS3WU.mjs +3489 -0
- package/dist/chunk-2OZAS3WU.mjs.map +1 -0
- package/dist/{chunk-UI5SFODX.mjs → chunk-BZQ4CDRF.mjs} +2338 -1991
- package/dist/chunk-BZQ4CDRF.mjs.map +1 -0
- package/dist/{chunk-MKDIT2EM.mjs → chunk-CJOV2XLO.mjs} +216 -261
- package/dist/chunk-CJOV2XLO.mjs.map +1 -0
- package/dist/chunk-D6WSBXJ2.mjs +1842 -0
- package/dist/chunk-D6WSBXJ2.mjs.map +1 -0
- package/dist/{chunk-HEB564WF.mjs → chunk-DRF6OULX.mjs} +4 -4
- package/dist/{chunk-HEB564WF.mjs.map → chunk-DRF6OULX.mjs.map} +1 -1
- package/dist/{chunk-OCDLEI6I.mjs → chunk-OB5WAFYH.mjs} +117 -5
- package/dist/chunk-OB5WAFYH.mjs.map +1 -0
- package/dist/{chunk-ODZWR6JQ.mjs → chunk-OEYKKMXG.mjs} +2042 -27
- package/dist/chunk-OEYKKMXG.mjs.map +1 -0
- package/dist/chunk-RIPAEGI6.mjs +48 -0
- package/dist/chunk-RIPAEGI6.mjs.map +1 -0
- package/dist/{chunk-ELJFJ2BU.mjs → chunk-X2KA6WHM.mjs} +29 -4
- package/dist/chunk-X2KA6WHM.mjs.map +1 -0
- package/dist/{chunk-BLXGONR2.mjs → chunk-XSFB7XXQ.mjs} +51 -4
- package/dist/chunk-XSFB7XXQ.mjs.map +1 -0
- package/dist/cloud/frame-context.d.ts +2 -2
- package/dist/cloud/frame-context.d.ts.map +1 -1
- package/dist/construct-renderer.mjs +936 -2140
- package/dist/construct-renderer.mjs.map +1 -1
- package/dist/device/device-scope.d.ts.map +1 -1
- package/dist/device/gpu-residency.d.ts +19 -19
- package/dist/device/gpu-residency.d.ts.map +1 -1
- package/dist/errors/render.d.ts +3 -2
- package/dist/errors/render.d.ts.map +1 -1
- package/dist/extract/material-context.d.ts +7 -0
- package/dist/extract/material-context.d.ts.map +1 -0
- package/dist/features/host.d.ts +5 -0
- package/dist/features/host.d.ts.map +1 -1
- package/dist/features/particle-mesh-layout.d.ts +19 -0
- package/dist/features/particle-mesh-layout.d.ts.map +1 -0
- package/dist/features/plan.d.ts +2 -0
- package/dist/features/plan.d.ts.map +1 -1
- package/dist/features/types.d.ts +8 -0
- package/dist/features/types.d.ts.map +1 -1
- package/dist/glyph-text-layout-system.d.ts +1 -1
- package/dist/glyph-text-layout-system.d.ts.map +1 -1
- package/dist/gpu-driven/production-raster.d.ts +1 -1
- package/dist/gpu-driven/production-raster.d.ts.map +1 -1
- package/dist/gpu-driven/shadow-ownership.d.ts +3 -3
- package/dist/gpu-driven/shadow-ownership.d.ts.map +1 -1
- package/dist/gpu-driven/shadow-views.d.ts +1 -1
- package/dist/gpu-driven/shadow-views.d.ts.map +1 -1
- package/dist/gpu-driven/view-gpu.d.ts +1 -1
- package/dist/gpu-driven/view-gpu.d.ts.map +1 -1
- package/dist/ibl/frame-resources.d.ts.map +1 -1
- package/dist/ibl/skylight-bind-group.d.ts +4 -4
- package/dist/ibl/skylight-bind-group.d.ts.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +542 -9
- package/dist/index.mjs.map +1 -1
- package/dist/instances.d.ts +3 -4
- package/dist/instances.d.ts.map +1 -1
- package/dist/internal.mjs +7 -8
- package/dist/internal.mjs.map +1 -1
- package/dist/pbr-pipeline.d.ts +3 -3
- package/dist/pbr-pipeline.d.ts.map +1 -1
- package/dist/pipeline/standard-output/lut-gpu.d.ts +2 -2
- package/dist/pipeline/standard-output/lut-gpu.d.ts.map +1 -1
- package/dist/pipeline/standard-output/resources.d.ts +2 -2
- package/dist/pipeline/standard-output/resources.d.ts.map +1 -1
- package/dist/publication/contract.d.ts +77 -0
- package/dist/publication/contract.d.ts.map +1 -0
- package/dist/publication/dependencies.d.ts +7 -0
- package/dist/publication/dependencies.d.ts.map +1 -0
- package/dist/publication/prepare-geometry.d.ts +9 -0
- package/dist/publication/prepare-geometry.d.ts.map +1 -0
- package/dist/publication/programs.d.ts +5 -0
- package/dist/publication/programs.d.ts.map +1 -0
- package/dist/publication/publisher.d.ts +34 -0
- package/dist/publication/publisher.d.ts.map +1 -0
- package/dist/publication/receiver.d.ts +29 -0
- package/dist/publication/receiver.d.ts.map +1 -0
- package/dist/publication/resource-scope.d.ts +18 -0
- package/dist/publication/resource-scope.d.ts.map +1 -0
- package/dist/publication/targets.d.ts +33 -0
- package/dist/publication/targets.d.ts.map +1 -0
- package/dist/publication/video.d.ts +5 -0
- package/dist/publication/video.d.ts.map +1 -0
- package/dist/record/fold-buckets.d.ts +3 -3
- package/dist/record/fold-buckets.d.ts.map +1 -1
- package/dist/record/frame-snapshot.d.ts +6 -6
- package/dist/record/frame-snapshot.d.ts.map +1 -1
- package/dist/record/frame.d.ts +5 -4
- package/dist/record/frame.d.ts.map +1 -1
- package/dist/record/helpers.d.ts +2 -2
- package/dist/record/helpers.d.ts.map +1 -1
- package/dist/record/main-pass-geometry.d.ts +2 -2
- package/dist/record/main-pass-geometry.d.ts.map +1 -1
- package/dist/record/main-pass-material.d.ts +7 -9
- package/dist/record/main-pass-material.d.ts.map +1 -1
- package/dist/record/main-pass-sprite-draws.d.ts +3 -16
- package/dist/record/main-pass-sprite-draws.d.ts.map +1 -1
- package/dist/record/main-pass.d.ts.map +1 -1
- package/dist/record/prepared-material-bindings.d.ts +2 -3
- package/dist/record/prepared-material-bindings.d.ts.map +1 -1
- package/dist/record/render-context.d.ts +4 -2
- package/dist/record/render-context.d.ts.map +1 -1
- package/dist/record/shadow-pass.d.ts +2 -2
- package/dist/record/shadow-pass.d.ts.map +1 -1
- package/dist/record/sprite-instance-buffer.d.ts +31 -0
- package/dist/record/sprite-instance-buffer.d.ts.map +1 -0
- package/dist/record/target-capture-graph.d.ts +19 -0
- package/dist/record/target-capture-graph.d.ts.map +1 -0
- package/dist/record/typed-frame-graph.d.ts +2 -13
- package/dist/record/typed-frame-graph.d.ts.map +1 -1
- package/dist/record/view-ubo.d.ts.map +1 -1
- package/dist/record/volume-params.d.ts +2 -2
- package/dist/record/volume-params.d.ts.map +1 -1
- package/dist/recovery/render-system-candidate.d.ts +5 -12
- package/dist/recovery/render-system-candidate.d.ts.map +1 -1
- package/dist/render-contract.d.ts +4 -1
- package/dist/render-contract.d.ts.map +1 -1
- package/dist/render-system-extract-tail.d.ts.map +1 -1
- package/dist/render-system-extract.d.ts +2 -0
- package/dist/render-system-extract.d.ts.map +1 -1
- package/dist/render-system-presentation.d.ts +2 -2
- package/dist/render-system-presentation.d.ts.map +1 -1
- package/dist/render-system-projections.d.ts +3 -2
- package/dist/render-system-projections.d.ts.map +1 -1
- package/dist/render-system-residency.d.ts +2 -2
- package/dist/render-system-residency.d.ts.map +1 -1
- package/dist/render-system.d.ts +3 -7
- package/dist/render-system.d.ts.map +1 -1
- package/dist/scene/render-scene.d.ts +8 -4
- package/dist/scene/render-scene.d.ts.map +1 -1
- package/dist/scene/render-source.d.ts +42 -0
- package/dist/scene/render-source.d.ts.map +1 -0
- package/dist/scene/source-systems.d.ts +6 -0
- package/dist/scene/source-systems.d.ts.map +1 -0
- package/dist/systems/skin-palette-allocator.d.ts.map +1 -1
- package/dist/systems/skin-palette-types.d.ts +10 -0
- package/dist/systems/skin-palette-types.d.ts.map +1 -1
- package/dist/systems/transparent-dispatch.d.ts +2 -2
- package/dist/systems/transparent-dispatch.d.ts.map +1 -1
- package/dist/systems/transparent-sort-config.d.ts +2 -1
- package/dist/systems/transparent-sort-config.d.ts.map +1 -1
- package/dist/temporal/index.mjs +6 -7
- package/dist/typed-shadow-passes.d.ts.map +1 -1
- package/package.json +21 -21
- package/src/__tests__/auto-exposure-transaction.integration.test.ts +4 -9
- package/src/__tests__/device-feature-admission.unit.test.ts +3 -2
- package/src/__tests__/device-scope-lifecycle.unit.test.ts +26 -0
- package/src/__tests__/gpu-driven-pbr.dawn.test.ts +3 -4
- package/src/__tests__/gpu-driven-production.integration.test.ts +18 -1
- package/src/__tests__/gpu-driven-shadow-views.unit.test.ts +23 -0
- package/src/__tests__/ktx2-basis-gpu-consumer.dawn.test.ts +4 -1
- package/src/__tests__/main-pass-material-medium-selection.unit.test.ts +0 -1
- package/src/__tests__/material-vertex-texture.browser.test.ts +7 -0
- package/src/__tests__/material-vertex-texture.dawn.test.ts +7 -0
- package/src/__tests__/material-vertex-texture.fixture.ts +31 -0
- package/src/__tests__/materials-standard-contract.unit.test.ts +0 -1
- package/src/__tests__/physical-clearcoat.integration.test.ts +23 -23
- package/src/__tests__/physical-material-budget.unit.test.ts +40 -0
- package/src/__tests__/recovery-candidate-prepare.contract.test.ts +5 -0
- package/src/__tests__/render-error-code-owner.test-d.ts +1 -0
- package/src/__tests__/renderer-factory-material-contract.unit.test.ts +107 -5
- package/src/__tests__/runtime-material-program.integration.test.ts +79 -0
- package/src/__tests__/vertex-layouts-ssot.unit.test.ts +23 -3
- package/src/assembly/device-feature-admission.ts +2 -2
- package/src/assembly/host-contract.ts +5 -2
- package/src/assembly/recovery/renderer-recover.ts +9 -0
- package/src/assembly/render-target-host.ts +57 -47
- package/src/assembly/renderer-facade.ts +3 -1
- package/src/assembly/webgpu-ready.ts +1 -1
- package/src/assembly/webgpu-renderer.ts +101 -70
- package/src/assembly/webgpu-vertex-layouts.ts +2 -9
- package/src/cloud/frame-context.ts +2 -2
- package/src/device/device-scope.ts +3 -0
- package/src/device/gpu-residency.ts +26 -25
- package/src/errors/render.ts +3 -1
- package/src/extract/material-context.ts +21 -0
- package/src/features/host.ts +13 -5
- package/src/features/particle-mesh-layout.ts +25 -0
- package/src/features/plan.ts +2 -0
- package/src/features/types.ts +8 -0
- package/src/glyph-text-layout-system.ts +2 -2
- package/src/gpu-driven/production-raster.ts +9 -3
- package/src/gpu-driven/shadow-ownership.ts +3 -3
- package/src/gpu-driven/shadow-views.ts +27 -2
- package/src/gpu-driven/view-gpu.ts +5 -0
- package/src/ibl/frame-resources.ts +0 -1
- package/src/ibl/skylight-bind-group.ts +13 -25
- package/src/index.ts +9 -0
- package/src/instances.ts +9 -6
- package/src/pbr-pipeline.ts +15 -18
- package/src/pipeline/standard-output/lut-gpu.ts +3 -3
- package/src/pipeline/standard-output/resources.ts +2 -2
- package/src/publication/__tests__/derived-geometry.integration.test.ts +177 -0
- package/src/publication/__tests__/features.integration.test.ts +173 -0
- package/src/publication/__tests__/programs.unit.test.ts +25 -0
- package/src/publication/__tests__/publication.integration.test.ts +415 -0
- package/src/publication/__tests__/targets.integration.test.ts +120 -0
- package/src/publication/__tests__/video.browser.test.ts +50 -0
- package/src/publication/contract.ts +104 -0
- package/src/publication/dependencies.ts +54 -0
- package/src/publication/prepare-geometry.ts +94 -0
- package/src/publication/programs.ts +45 -0
- package/src/publication/publisher.ts +645 -0
- package/src/publication/receiver.ts +297 -0
- package/src/publication/resource-scope.ts +31 -0
- package/src/publication/targets.ts +182 -0
- package/src/publication/video.ts +33 -0
- package/src/record/__tests__/material-bg-cache.unit.test.ts +15 -1
- package/src/record/__tests__/prepared-runtime-material.integration.test.ts +134 -0
- package/src/record/__tests__/sprite-material-abi.unit.test.ts +8 -10
- package/src/record/__tests__/video-texture-view.unit.test.ts +9 -9
- package/src/record/fold-buckets.ts +8 -5
- package/src/record/frame-snapshot.ts +6 -6
- package/src/record/frame.ts +87 -28
- package/src/record/helpers.ts +2 -2
- package/src/record/main-pass-geometry.ts +21 -2
- package/src/record/main-pass-material.ts +37 -33
- package/src/record/main-pass-sprite-draws.ts +6 -152
- package/src/record/main-pass.ts +8 -7
- package/src/record/prepared-material-bindings.ts +16 -37
- package/src/record/render-context.ts +4 -2
- package/src/record/shadow-pass.ts +65 -7
- package/src/record/sprite-instance-buffer.ts +155 -0
- package/src/record/target-capture-graph.ts +258 -0
- package/src/record/typed-frame-graph.ts +11 -207
- package/src/record/view-ubo.ts +1 -1
- package/src/record/volume-params.ts +6 -6
- package/src/recovery/render-system-candidate.ts +10 -18
- package/src/render-contract.ts +6 -1
- package/src/render-system-extract-tail.ts +48 -23
- package/src/render-system-extract.ts +11 -2
- package/src/render-system-presentation.ts +2 -2
- package/src/render-system-projections.ts +3 -2
- package/src/render-system-residency.ts +2 -2
- package/src/render-system.ts +82 -54
- package/src/scene/render-scene.ts +110 -100
- package/src/scene/render-source.ts +90 -0
- package/src/scene/source-systems.ts +33 -0
- package/src/systems/skin-palette-allocator.ts +1 -0
- package/src/systems/skin-palette-types.ts +11 -0
- package/src/systems/transparent-dispatch.ts +2 -2
- package/src/systems/transparent-sort-config.ts +3 -1
- package/src/typed-shadow-passes.ts +36 -5
- package/dist/chunk-BLXGONR2.mjs.map +0 -1
- package/dist/chunk-ELJFJ2BU.mjs.map +0 -1
- package/dist/chunk-ILQ5MEZF.mjs +0 -32
- package/dist/chunk-ILQ5MEZF.mjs.map +0 -1
- package/dist/chunk-MKDIT2EM.mjs.map +0 -1
- package/dist/chunk-OCDLEI6I.mjs.map +0 -1
- package/dist/chunk-ODZWR6JQ.mjs.map +0 -1
- package/dist/chunk-RXZ3RGOU.mjs +0 -53
- package/dist/chunk-RXZ3RGOU.mjs.map +0 -1
- package/dist/chunk-SHFUFJ5N.mjs +0 -1781
- package/dist/chunk-SHFUFJ5N.mjs.map +0 -1
- package/dist/chunk-UI5SFODX.mjs.map +0 -1
- package/dist/chunk-UINHLCZA.mjs +0 -2389
- package/dist/chunk-UINHLCZA.mjs.map +0 -1
- package/dist/chunk-WEX45HKH.mjs +0 -1524
- package/dist/chunk-WEX45HKH.mjs.map +0 -1
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { GPU_SHADER_STAGE_COMPUTE, GPU_BUFFER_USAGE_STORAGE, GPU_BUFFER_USAGE_COPY_DST, GPU_BUFFER_USAGE_UNIFORM, createHdrpBindGroupLayoutDescriptor, COOKIE_MATRIX_BYTES, IES_SLICE_WIDTH, IES_SLICE_HEIGHT, COOKIE_SLICE_SIZE, GPU_SHADER_STAGE_VERTEX, GPU_SHADER_STAGE_FRAGMENT, GPU_BUFFER_USAGE_INDEX, GPU_BUFFER_USAGE_VERTEX, isStandardPbrMaterialShader,
|
|
5
|
-
import { GPU_TEXTURE_USAGE_RENDER_ATTACHMENT, GPU_TEXTURE_USAGE_COPY_SRC, VertexColorVariantConflictError, EquirectProjectionFailedError, SHADOW_ATLAS_DEFAULT_LAYERS, SHADOW_ATLAS_DEFAULT_FACE_SIZE, ShadowAtlas, PointShadowAtlasUninitializedError, PointShadowAtlasBoundsViolationError, StandardClusterTransportUnavailableError, GPU_TEXTURE_USAGE_RENDER_ATTACHMENT_AND_TEXTURE_BINDING, GPU_TEXTURE_USAGE_COPY_DST, GPU_TEXTURE_USAGE_TEXTURE_BINDING, instanceUploadRangesForResident, createVisibilityBudget, STANDARD_OUTPUT_TRANSFORM_FEATURE_ID, StandardLightBudgetExceededError, RendererOperationError, VideoUploadUnsupportedError, StandardClusterIndexOverflowError, FXAA_POST_PROCESS_ID } from './chunk-WEX45HKH.mjs';
|
|
1
|
+
import { DEFAULT_CLUSTER_GRID, DEFAULT_STANDARD_PROFILE, createIblKernelCache, STANDARD_PBR_UBO_SIZE, MATERIAL_PER_ENTITY_STRIDE, MAX_LIGHTS, CLUSTER_GRID_STRIDE_U32, LIGHT_INDEX_LIST_CAPACITY, createStandardClusterLayout } from './chunk-OB5WAFYH.mjs';
|
|
2
|
+
import { TRANSPARENT_SORT_MODE_LAYER_Z, TRANSPARENT_SORT_MODE_LAYER_Y, SPRITE_PREMULTIPLIED_ALPHA_BLEND } from './chunk-XSFB7XXQ.mjs';
|
|
3
|
+
import { probeBlendRecordOffset, PROBE_BLEND_RECORD_BYTE_SIZE, PROBE_BLEND_RECORD_STRIDE } from './chunk-RIPAEGI6.mjs';
|
|
4
|
+
import { GPU_TEXTURE_USAGE_RENDER_ATTACHMENT, GPU_TEXTURE_USAGE_COPY_SRC, VertexColorVariantConflictError, GPU_SHADER_STAGE_COMPUTE, GPU_BUFFER_USAGE_STORAGE, GPU_BUFFER_USAGE_COPY_DST, GPU_BUFFER_USAGE_UNIFORM, createHdrpBindGroupLayoutDescriptor, EquirectProjectionFailedError, SHADOW_ATLAS_DEFAULT_LAYERS, COOKIE_MATRIX_BYTES, SHADOW_ATLAS_DEFAULT_FACE_SIZE, ShadowAtlas, PointShadowAtlasUninitializedError, PointShadowAtlasBoundsViolationError, IES_SLICE_WIDTH, IES_SLICE_HEIGHT, COOKIE_SLICE_SIZE, StandardClusterTransportUnavailableError, GPU_SHADER_STAGE_VERTEX, GPU_SHADER_STAGE_FRAGMENT, GPU_TEXTURE_USAGE_RENDER_ATTACHMENT_AND_TEXTURE_BINDING, GPU_TEXTURE_USAGE_COPY_DST, GPU_TEXTURE_USAGE_TEXTURE_BINDING, GPU_BUFFER_USAGE_INDEX, GPU_BUFFER_USAGE_VERTEX, isStandardPbrMaterialShader, worldEntityKey, instanceCollectionCacheKey, instanceUploadRangesForResident, createVisibilityBudget, GPU_BUFFER_USAGE_MAP_READ, getOpaqueResourceIdentity, pbrSkinMeshDynamicOffsets, gpuDrivenShadowDrawKey, SHADOW_CASTER_SHADER_ID, shadowCasterVariantSet, buildPbrMaterialUserRegionEntries, buildBindGroupLayoutDescriptor, STANDARD_OUTPUT_TRANSFORM_FEATURE_ID, GPU_BUFFER_USAGE_COPY_SRC, GPU_BUFFER_USAGE_INDIRECT, StandardLightBudgetExceededError, EXTENDED_LIGHTING_REQUIRED_SAMPLED_TEXTURES, gpuDrivenSourceDrawItemIndex, matchPass, deriveInstancesUnionBounds, createPbrSkinMeshBindGroupEntries, physicalTextureFields, isCanonicalStandardPbrMaterialShader, RendererOperationError, resolveRenderTargetMaterialSource, VideoUploadUnsupportedError, SPRITE_PASS_PER_INSTANCE_REGION_VARIANT_SET, StandardClusterIndexOverflowError, isStandardPbrSkinMaterialShader, SKIN_MATERIAL_SHADER_ID, FXAA_POST_PROCESS_ID, gpuDrivenDrawKey, materialBindGroupLayoutIdentity } from './chunk-2OZAS3WU.mjs';
|
|
6
5
|
import { derive, ok, err as err$1, toShared, ASSET_ERROR_HINTS, deriveTextureLayout, handleSlot, resolveMaterialTextureCoordinates, KNOWN_PASS_KINDS } from '@forgeax/engine-types';
|
|
7
6
|
import { RenderGraphError } from '@forgeax/engine-render-graph';
|
|
8
7
|
import { ok as ok$1, err, RhiError } from '@forgeax/engine-rhi';
|
|
9
|
-
import { mat3, vec3, mat4 } from '@forgeax/engine-math';
|
|
8
|
+
import { mat3, vec3, mat4, box3, frustum } from '@forgeax/engine-math';
|
|
10
9
|
import { deriveVertexLayoutProjection, DEFAULT_VERTEX_ATTRIBUTE_MAP, deriveVertexBufferLayout, deriveVertexBufferLayoutFromProjection } from '@forgeax/engine-geometry';
|
|
11
10
|
import { resolveAssetHandle } from '@forgeax/engine-assets-runtime';
|
|
12
|
-
import { probeVideoHighPerfUpload,
|
|
13
|
-
import {
|
|
11
|
+
import { probeVideoHighPerfUpload, VIDEO_SOURCE_PROVIDER_KEY, videoSourceExtent } from '@forgeax/engine-graphics-extras';
|
|
12
|
+
import { STANDARD_PIPELINE_PARAM_SCHEMA, GPU_DRIVEN_MATERIAL_ROW_BYTES, findVariantByKey, DEFAULT_MSDF_TEXT_PARAM_SCHEMA, DEFAULT_SPRITE_PARAM_SCHEMA, DEFAULT_UNLIT_PARAM_SCHEMA, STANDARD_PHYSICAL_TEXTURE_FIELDS, STANDARD_TEXTURE_MASK_OVERRIDE } from '@forgeax/engine-shader';
|
|
14
13
|
import { isCompressedFormat, bytesPerRow, blockParamsForFormat } from '@forgeax/engine-codec';
|
|
15
14
|
|
|
16
15
|
// src/pipeline/render-extent.ts
|
|
@@ -2520,7 +2519,7 @@ var POINTS_LINES_VIEW_BUFFER_SIZE = POINTS_LINES_VIEW_SLOT_STRIDE * POINTS_LINES
|
|
|
2520
2519
|
var VIEW_UNIFORM_SLOT_STRIDE = 1024;
|
|
2521
2520
|
var POINT_SHADOW_VIEW_SLOT_COUNT = 24;
|
|
2522
2521
|
var CUBE_CAPTURE_VIEW_SLOT_BASE = 1 + POINT_SHADOW_VIEW_SLOT_COUNT;
|
|
2523
|
-
var REFLECTION_PROBE_VIEW_SLOT_BASE = CUBE_CAPTURE_VIEW_SLOT_BASE + 6;
|
|
2522
|
+
var REFLECTION_PROBE_VIEW_SLOT_BASE = CUBE_CAPTURE_VIEW_SLOT_BASE + 6 + 1;
|
|
2524
2523
|
var REFLECTION_PROBE_VIEW_SLOT_COUNT = 16;
|
|
2525
2524
|
var VIEW_UNIFORM_BUFFER_SIZE = VIEW_UNIFORM_SLOT_STRIDE * (REFLECTION_PROBE_VIEW_SLOT_BASE + REFLECTION_PROBE_VIEW_SLOT_COUNT);
|
|
2526
2525
|
function pointShadowViewOffset(layer, face) {
|
|
@@ -4408,6 +4407,108 @@ var GpuTexture = class {
|
|
|
4408
4407
|
}
|
|
4409
4408
|
};
|
|
4410
4409
|
|
|
4410
|
+
// src/record/sprite-instance-buffer.ts
|
|
4411
|
+
function interleaveSpriteInstanceBuffer(transforms, regions, includePrevious = false) {
|
|
4412
|
+
const count = transforms.length / 16;
|
|
4413
|
+
const stride = includePrevious ? 36 : 20;
|
|
4414
|
+
const regionOffset = includePrevious ? 32 : 16;
|
|
4415
|
+
const out = new Float32Array(count * stride);
|
|
4416
|
+
for (let i = 0; i < count; i++) {
|
|
4417
|
+
const dstBase = i * stride;
|
|
4418
|
+
const transformBase = i * 16;
|
|
4419
|
+
const regionBase = i * 4;
|
|
4420
|
+
for (let k = 0; k < 16; k++) out[dstBase + k] = transforms[transformBase + k] ?? 0;
|
|
4421
|
+
if (includePrevious) {
|
|
4422
|
+
for (let k = 0; k < 16; k++) {
|
|
4423
|
+
out[dstBase + 16 + k] = transforms[transformBase + k] ?? 0;
|
|
4424
|
+
}
|
|
4425
|
+
}
|
|
4426
|
+
for (let k = 0; k < 4; k++) {
|
|
4427
|
+
out[dstBase + regionOffset + k] = regions[regionBase + k] ?? 0;
|
|
4428
|
+
}
|
|
4429
|
+
}
|
|
4430
|
+
return out;
|
|
4431
|
+
}
|
|
4432
|
+
function spriteInstancesCacheHit(entry, snapshot, requestedBytes) {
|
|
4433
|
+
return entry !== void 0 && entry.uploadedArchVersion === snapshot.archVersion && entry.uploadedByteLength === requestedBytes;
|
|
4434
|
+
}
|
|
4435
|
+
function resolveSpriteInstancesBuffer(c, spriteEntry, fallbackBuffer, fallbackCount) {
|
|
4436
|
+
const { runtime, frameState } = c;
|
|
4437
|
+
let buffer = fallbackBuffer;
|
|
4438
|
+
let count = fallbackCount;
|
|
4439
|
+
const spriteInstancesSnap = spriteEntry.source.spriteInstances;
|
|
4440
|
+
if (spriteInstancesSnap !== void 0) {
|
|
4441
|
+
if (spriteInstancesSnap.instanceCount === 0) return { buffer, count: 0 };
|
|
4442
|
+
const uniformFallback = runtime.device.caps.storageBuffer === false;
|
|
4443
|
+
const interleaved = interleaveSpriteInstanceBuffer(
|
|
4444
|
+
spriteInstancesSnap.transforms,
|
|
4445
|
+
spriteInstancesSnap.regions,
|
|
4446
|
+
!uniformFallback
|
|
4447
|
+
);
|
|
4448
|
+
const requestedBytes = interleaved.byteLength;
|
|
4449
|
+
const cap = runtime.device.limits.maxStorageBufferBindingSize;
|
|
4450
|
+
if (typeof cap === "number" && requestedBytes > cap) {
|
|
4451
|
+
runtime.errorRegistry.fire(
|
|
4452
|
+
new RhiError({
|
|
4453
|
+
code: "limit-exceeded",
|
|
4454
|
+
expected: `requestedBytes (${requestedBytes}) <= maxStorageBufferBindingSize (${cap})`,
|
|
4455
|
+
hint: "reduce SpriteInstances instance count to fit within device.limits.maxStorageBufferBindingSize (144 bytes per instance: current mat4 64B + previous mat4 64B + region 16B)",
|
|
4456
|
+
detail: {
|
|
4457
|
+
maxStorageBufferBindingSize: cap,
|
|
4458
|
+
requestedBytes
|
|
4459
|
+
}
|
|
4460
|
+
})
|
|
4461
|
+
);
|
|
4462
|
+
} else {
|
|
4463
|
+
const cachedSpriteInst = frameState.instanceBuffers.get(
|
|
4464
|
+
worldEntityKey(spriteEntry.source.worldId, spriteInstancesSnap.cacheKey)
|
|
4465
|
+
);
|
|
4466
|
+
let activeSpriteInst = null;
|
|
4467
|
+
if (spriteInstancesCacheHit(cachedSpriteInst, spriteInstancesSnap, requestedBytes)) {
|
|
4468
|
+
activeSpriteInst = cachedSpriteInst ?? null;
|
|
4469
|
+
} else if (requestedBytes > 0) {
|
|
4470
|
+
const bufRes = runtime.device.createBuffer({
|
|
4471
|
+
size: requestedBytes,
|
|
4472
|
+
usage: (uniformFallback ? GPU_BUFFER_USAGE_UNIFORM : GPU_BUFFER_USAGE_STORAGE) | GPU_BUFFER_USAGE_COPY_DST,
|
|
4473
|
+
mappedAtCreation: false
|
|
4474
|
+
});
|
|
4475
|
+
if (!bufRes.ok) {
|
|
4476
|
+
runtime.errorRegistry.fire(bufRes.error);
|
|
4477
|
+
} else {
|
|
4478
|
+
if (cachedSpriteInst !== void 0 && !cachedSpriteInst.buffer.isDestroyed) {
|
|
4479
|
+
const r = cachedSpriteInst.buffer.destroy();
|
|
4480
|
+
if (!r.ok) runtime.errorRegistry.fire(r.error);
|
|
4481
|
+
}
|
|
4482
|
+
const newBuf = new GpuBuffer(runtime.device, bufRes.value);
|
|
4483
|
+
activeSpriteInst = {
|
|
4484
|
+
buffer: newBuf,
|
|
4485
|
+
uploadedArchVersion: spriteInstancesSnap.archVersion,
|
|
4486
|
+
uploadedByteLength: requestedBytes
|
|
4487
|
+
};
|
|
4488
|
+
frameState.instanceBuffers.set(
|
|
4489
|
+
worldEntityKey(spriteEntry.source.worldId, spriteInstancesSnap.cacheKey),
|
|
4490
|
+
activeSpriteInst
|
|
4491
|
+
);
|
|
4492
|
+
}
|
|
4493
|
+
}
|
|
4494
|
+
if (activeSpriteInst !== null && requestedBytes > 0) {
|
|
4495
|
+
const writeRes = runtime.device.queue.writeBuffer(
|
|
4496
|
+
activeSpriteInst.buffer.handle,
|
|
4497
|
+
0,
|
|
4498
|
+
interleaved
|
|
4499
|
+
);
|
|
4500
|
+
if (!writeRes.ok) {
|
|
4501
|
+
runtime.errorRegistry.fire(writeRes.error);
|
|
4502
|
+
} else {
|
|
4503
|
+
buffer = activeSpriteInst.buffer.handle;
|
|
4504
|
+
count = spriteInstancesSnap.instanceCount;
|
|
4505
|
+
}
|
|
4506
|
+
}
|
|
4507
|
+
}
|
|
4508
|
+
}
|
|
4509
|
+
return { buffer, count };
|
|
4510
|
+
}
|
|
4511
|
+
|
|
4411
4512
|
// src/record/fold-instance-buffer.ts
|
|
4412
4513
|
function resolveFoldInstanceBuffer(c, bucket, headIndex) {
|
|
4413
4514
|
const { runtime, frameState } = c;
|
|
@@ -4526,7 +4627,7 @@ var COMPRESSION_FEATURES = [
|
|
|
4526
4627
|
function transmissionBackdropAvailable(limit) {
|
|
4527
4628
|
return limit === void 0 || limit >= STANDARD_PBR_REQUIRED_SAMPLED_TEXTURES;
|
|
4528
4629
|
}
|
|
4529
|
-
var STANDARD_PHYSICAL_REQUIRED_SAMPLED_TEXTURES =
|
|
4630
|
+
var STANDARD_PHYSICAL_REQUIRED_SAMPLED_TEXTURES = 23;
|
|
4530
4631
|
function deriveDeviceFeatureAdmission(adapter, options) {
|
|
4531
4632
|
const requiredFeatures = COMPRESSION_FEATURES.filter((feature) => adapter.features.has(feature));
|
|
4532
4633
|
const timestampRequested = options?.gpuPassTiming !== void 0 || options?.captureGpuTimings === true;
|
|
@@ -4577,10 +4678,6 @@ function assembleMaterialWithSkylightEntries(materialEntries, skylight, transmis
|
|
|
4577
4678
|
},
|
|
4578
4679
|
{
|
|
4579
4680
|
binding: iblStart + 5,
|
|
4580
|
-
resource: { kind: "sampler", value: skylight.brdfLutSampler }
|
|
4581
|
-
},
|
|
4582
|
-
{
|
|
4583
|
-
binding: iblStart + 6,
|
|
4584
4681
|
resource: { kind: "buffer", value: { buffer: skylight.intensityBuffer } }
|
|
4585
4682
|
}
|
|
4586
4683
|
];
|
|
@@ -4915,116 +5012,6 @@ function deriveRenderDataCubemap(source) {
|
|
|
4915
5012
|
cubeUsage: GPU_TEXTURE_USAGE_RENDER_ATTACHMENT_AND_TEXTURE_BINDING | GPU_TEXTURE_USAGE_COPY_DST | GPU_TEXTURE_USAGE_COPY_SRC
|
|
4916
5013
|
});
|
|
4917
5014
|
}
|
|
4918
|
-
var STANDARD_PBR_UBO_SIZE = derive(DEFAULT_STANDARD_PBR_PARAM_SCHEMA).uboLayout.totalBytes;
|
|
4919
|
-
var MATERIAL_PER_ENTITY_STRIDE = Math.ceil(STANDARD_PBR_UBO_SIZE / 256) * 256;
|
|
4920
|
-
function resolveSurfaceProfile(storageFormat, viewFormat, facts) {
|
|
4921
|
-
if (facts.surfaceViewFormats) {
|
|
4922
|
-
return ok$1({
|
|
4923
|
-
kind: "dual-view",
|
|
4924
|
-
storageFormat,
|
|
4925
|
-
viewFormat,
|
|
4926
|
-
viewFormats: [viewFormat],
|
|
4927
|
-
hasDisplayEndpoint: true
|
|
4928
|
-
});
|
|
4929
|
-
}
|
|
4930
|
-
if (!facts.rawAttachment || !facts.floatRenderAttachment) {
|
|
4931
|
-
return err(
|
|
4932
|
-
new RhiError({
|
|
4933
|
-
code: "webgpu-runtime-error",
|
|
4934
|
-
expected: "raw surface attachment and rgba16float render attachment capabilities",
|
|
4935
|
-
hint: "surface profile cannot establish a raw-only linear output route",
|
|
4936
|
-
detail: {
|
|
4937
|
-
error: {
|
|
4938
|
-
code: "surface-raw-endpoint-failed",
|
|
4939
|
-
message: "raw-only surface capabilities are incomplete"
|
|
4940
|
-
}
|
|
4941
|
-
}
|
|
4942
|
-
})
|
|
4943
|
-
);
|
|
4944
|
-
}
|
|
4945
|
-
return ok$1({
|
|
4946
|
-
kind: "raw-only",
|
|
4947
|
-
storageFormat,
|
|
4948
|
-
viewFormat: storageFormat,
|
|
4949
|
-
viewFormats: [],
|
|
4950
|
-
hasDisplayEndpoint: false
|
|
4951
|
-
});
|
|
4952
|
-
}
|
|
4953
|
-
function resolveSurfaceFormatPair(_backendKind, storage, view) {
|
|
4954
|
-
return { storage, view };
|
|
4955
|
-
}
|
|
4956
|
-
function surfaceCapabilityFacts(device, storageFormat) {
|
|
4957
|
-
const internal = device;
|
|
4958
|
-
return {
|
|
4959
|
-
surfaceViewFormats: internal.surfaceViewFormats ?? device.caps?.backendKind !== "wgpu-webgl2",
|
|
4960
|
-
rawAttachment: storageFormat === "rgba8unorm" || storageFormat === "bgra8unorm",
|
|
4961
|
-
floatRenderAttachment: device.caps?.rgba16floatRenderable ?? true
|
|
4962
|
-
};
|
|
4963
|
-
}
|
|
4964
|
-
function configureSurface(context, device, format, colorAttachmentFormat) {
|
|
4965
|
-
const backendKind = device.caps?.backendKind ?? "webgpu";
|
|
4966
|
-
const isWebGl2 = backendKind === "wgpu-webgl2";
|
|
4967
|
-
const surfaceFormats = resolveSurfaceFormatPair(
|
|
4968
|
-
backendKind,
|
|
4969
|
-
format,
|
|
4970
|
-
colorAttachmentFormat
|
|
4971
|
-
);
|
|
4972
|
-
const profile = resolveSurfaceProfile(
|
|
4973
|
-
surfaceFormats.storage,
|
|
4974
|
-
surfaceFormats.view,
|
|
4975
|
-
surfaceCapabilityFacts(device, surfaceFormats.storage)
|
|
4976
|
-
);
|
|
4977
|
-
if (!profile.ok) return profile;
|
|
4978
|
-
const supportsTextureBinding = backendKind !== "wgpu-webgl2" && (device.caps?.storageBuffer ?? true);
|
|
4979
|
-
const configured = context.configure({
|
|
4980
|
-
device,
|
|
4981
|
-
format: surfaceFormats.storage,
|
|
4982
|
-
alphaMode: isWebGl2 ? "opaque" : "premultiplied",
|
|
4983
|
-
usage: GPU_TEXTURE_USAGE_RENDER_ATTACHMENT | (supportsTextureBinding ? GPU_TEXTURE_USAGE_TEXTURE_BINDING : 0) | (isWebGl2 ? 0 : GPU_TEXTURE_USAGE_COPY_SRC),
|
|
4984
|
-
viewFormats: [...profile.value.viewFormats]
|
|
4985
|
-
});
|
|
4986
|
-
if (!configured.ok) return configured;
|
|
4987
|
-
if (isWebGl2 && (context.presentationProof === void 0 || !context.presentationProof.descriptor || !context.presentationProof.acquisition || !context.presentationProof.validation || typeof context.presentationProof.surfaceIdentity !== "string" || context.presentationProof.surfaceIdentity.length === 0 || context.presentationProof.requested === void 0 || context.presentationProof.validated === void 0 || JSON.stringify(context.presentationProof.requested) !== JSON.stringify(context.presentationProof.validated))) {
|
|
4988
|
-
return err(
|
|
4989
|
-
new RhiError({
|
|
4990
|
-
code: "webgpu-runtime-error",
|
|
4991
|
-
expected: "WebGL2 surface storage has descriptor, acquisition, and validation proof",
|
|
4992
|
-
hint: "run the concrete presentation probe and retain the last-known-good graph when proof is absent",
|
|
4993
|
-
detail: {
|
|
4994
|
-
error: {
|
|
4995
|
-
code: "surface-raw-endpoint-failed",
|
|
4996
|
-
message: "surface storage raw endpoint proof is incomplete"
|
|
4997
|
-
}
|
|
4998
|
-
}
|
|
4999
|
-
})
|
|
5000
|
-
);
|
|
5001
|
-
}
|
|
5002
|
-
return ok$1(void 0);
|
|
5003
|
-
}
|
|
5004
|
-
function selectSwapChainFormat(storageBufferCapable, surfaceViewFormats = true) {
|
|
5005
|
-
if (!storageBufferCapable) {
|
|
5006
|
-
return {
|
|
5007
|
-
storage: "rgba8unorm",
|
|
5008
|
-
view: surfaceViewFormats ? "rgba8unorm-srgb" : "rgba8unorm"
|
|
5009
|
-
};
|
|
5010
|
-
}
|
|
5011
|
-
const nav = globalThis.navigator;
|
|
5012
|
-
const gpu = nav?.gpu;
|
|
5013
|
-
const getPreferred = gpu?.getPreferredCanvasFormat;
|
|
5014
|
-
if (gpu !== void 0 && typeof getPreferred === "function") {
|
|
5015
|
-
const storage = getPreferred.call(gpu);
|
|
5016
|
-
const view = storage === "rgba8unorm" ? "rgba8unorm-srgb" : storage === "bgra8unorm" ? "bgra8unorm-srgb" : storage;
|
|
5017
|
-
return {
|
|
5018
|
-
storage,
|
|
5019
|
-
view: surfaceViewFormats ? view : storage
|
|
5020
|
-
};
|
|
5021
|
-
}
|
|
5022
|
-
return {
|
|
5023
|
-
storage: "rgba8unorm",
|
|
5024
|
-
view: surfaceViewFormats ? "rgba8unorm-srgb" : "rgba8unorm",
|
|
5025
|
-
fallbackReason: "preferred-canvas-format-missing"
|
|
5026
|
-
};
|
|
5027
|
-
}
|
|
5028
5015
|
|
|
5029
5016
|
// src/record/main-pass-material.ts
|
|
5030
5017
|
function selectMaterialGroup2(clusterGroup, meshGroup, group2Contract) {
|
|
@@ -5163,8 +5150,8 @@ function clearVideoUploadFailureEpisode(store, entityKey, clip) {
|
|
|
5163
5150
|
}
|
|
5164
5151
|
function videoTextureView(world, store, runtime, entityKey, clip, highPerfAvailable) {
|
|
5165
5152
|
if (store === void 0) return void 0;
|
|
5166
|
-
const provider = world.hasResource(
|
|
5167
|
-
const element = provider?.
|
|
5153
|
+
const provider = !("resolveAsset" in world) && world.hasResource(VIDEO_SOURCE_PROVIDER_KEY) ? world.getResource(VIDEO_SOURCE_PROVIDER_KEY) : void 0;
|
|
5154
|
+
const element = "resolveAsset" in world ? world.videoFrame(entityKey, clip) : provider?.getSource(entityKey, clip);
|
|
5168
5155
|
if (element === void 0 && !highPerfAvailable) {
|
|
5169
5156
|
if (markVideoUploadFailureEpisode(store, entityKey, clip)) {
|
|
5170
5157
|
runtime.errorRegistry.fire(new VideoUploadUnsupportedError());
|
|
@@ -5175,9 +5162,9 @@ function videoTextureView(world, store, runtime, entityKey, clip, highPerfAvaila
|
|
|
5175
5162
|
clearVideoUploadFailureEpisode(store, entityKey, clip);
|
|
5176
5163
|
return store.getView(clip);
|
|
5177
5164
|
}
|
|
5178
|
-
const
|
|
5179
|
-
|
|
5180
|
-
|
|
5165
|
+
const extent = videoSourceExtent(element);
|
|
5166
|
+
if (extent === void 0) return store.getView(clip);
|
|
5167
|
+
const { width, height } = extent;
|
|
5181
5168
|
const uploaded = store.uploadFrame(clip, element, width, height);
|
|
5182
5169
|
if (uploaded === void 0) return store.getView(clip);
|
|
5183
5170
|
if (!uploaded.ok) {
|
|
@@ -5431,7 +5418,7 @@ function recordIblMaterialBinding(frameState, materialBgl, bindGroup, entries, i
|
|
|
5431
5418
|
if (receipt === void 0) return;
|
|
5432
5419
|
const skylightBindingStart = entries.findIndex((entry) => entry.binding === iblStart);
|
|
5433
5420
|
if (skylightBindingStart < 0) return;
|
|
5434
|
-
const iblEntries = entries.slice(skylightBindingStart, skylightBindingStart +
|
|
5421
|
+
const iblEntries = entries.slice(skylightBindingStart, skylightBindingStart + 6);
|
|
5435
5422
|
const projected = [];
|
|
5436
5423
|
for (const entry of iblEntries) {
|
|
5437
5424
|
if (entry.resource.kind === "externalTexture") continue;
|
|
@@ -5457,8 +5444,9 @@ function recordIblMaterialBinding(frameState, materialBgl, bindGroup, entries, i
|
|
|
5457
5444
|
};
|
|
5458
5445
|
}
|
|
5459
5446
|
function isMaterialBgAssemblyCacheHit(cached, material, materialBgl, materialBuffer, skylightResources, materialResourceEpoch, transmissionBackdropView, sceneMaterialBuffer, surfaceRawDepthView) {
|
|
5460
|
-
if (transmissionBackdropView != null || surfaceRawDepthView != null)
|
|
5461
|
-
|
|
5447
|
+
if (transmissionBackdropView != null || surfaceRawDepthView != null || (material.textureSources?.size ?? 0) > 0)
|
|
5448
|
+
return false;
|
|
5449
|
+
return cached?.material === material && cached.materialResourceEpoch === materialResourceEpoch && cached.materialBgl === materialBgl && cached.materialBuffer === materialBuffer && cached.sceneMaterialBuffer === sceneMaterialBuffer && cached.skylightResources.irradianceView === skylightResources.irradianceView && cached.skylightResources.irradianceSampler === skylightResources.irradianceSampler && cached.skylightResources.prefilterView === skylightResources.prefilterView && cached.skylightResources.skylightPrefilterView === skylightResources.skylightPrefilterView && cached.skylightResources.prefilterSampler === skylightResources.prefilterSampler && cached.skylightResources.brdfLutView === skylightResources.brdfLutView && cached.skylightResources.intensityBuffer === skylightResources.intensityBuffer;
|
|
5462
5450
|
}
|
|
5463
5451
|
function buildPerSubmeshMaterialBg(deps, submeshMaterial, entityKey, materialWorld = deps.world, materialShaderId = submeshMaterial.materialShaderId) {
|
|
5464
5452
|
const {
|
|
@@ -5564,10 +5552,6 @@ function buildPerSubmeshMaterialBg(deps, submeshMaterial, entityKey, materialWor
|
|
|
5564
5552
|
},
|
|
5565
5553
|
{
|
|
5566
5554
|
binding: 6 + smUserRegionFields.length * 2,
|
|
5567
|
-
resource: { kind: "sampler", value: effectiveSkylightResources.brdfLutSampler }
|
|
5568
|
-
},
|
|
5569
|
-
{
|
|
5570
|
-
binding: 7 + smUserRegionFields.length * 2,
|
|
5571
5555
|
resource: {
|
|
5572
5556
|
kind: "buffer",
|
|
5573
5557
|
value: { buffer: effectiveSkylightResources.intensityBuffer }
|
|
@@ -5760,7 +5744,7 @@ function buildPerSubmeshMaterialBg(deps, submeshMaterial, entityKey, materialWor
|
|
|
5760
5744
|
"miss"
|
|
5761
5745
|
);
|
|
5762
5746
|
}
|
|
5763
|
-
if (smMaterialHandle !== void 0 && !smHasVideoFields && materialResourcesResident && !hasActiveTransmissionBackdrop) {
|
|
5747
|
+
if (smMaterialHandle !== void 0 && !smHasVideoFields && (submeshMaterial.textureSources?.size ?? 0) === 0 && materialResourcesResident && !hasActiveTransmissionBackdrop) {
|
|
5764
5748
|
if (materialCacheKey !== void 0) {
|
|
5765
5749
|
materialBgAssemblyCache.set(materialCacheKey, {
|
|
5766
5750
|
material: submeshMaterial,
|
|
@@ -5814,7 +5798,6 @@ function resolveMaterialSkylight(runtime, pipelineState, skylight, skylightCount
|
|
|
5814
5798
|
prefilterView: activeViews.pref,
|
|
5815
5799
|
prefilterSampler: skylightFallback.sampler,
|
|
5816
5800
|
brdfLutView: activeViews.brdf,
|
|
5817
|
-
brdfLutSampler: skylightFallback.sampler,
|
|
5818
5801
|
intensityBuffer: skylightFallback.intensityBuffer
|
|
5819
5802
|
} : {
|
|
5820
5803
|
irradianceView: skylightFallback.irradianceView,
|
|
@@ -5822,7 +5805,6 @@ function resolveMaterialSkylight(runtime, pipelineState, skylight, skylightCount
|
|
|
5822
5805
|
prefilterView: skylightFallback.prefilterView,
|
|
5823
5806
|
prefilterSampler: skylightFallback.sampler,
|
|
5824
5807
|
brdfLutView: skylightFallback.brdfLutView,
|
|
5825
|
-
brdfLutSampler: skylightFallback.sampler,
|
|
5826
5808
|
intensityBuffer: skylightFallback.intensityBuffer
|
|
5827
5809
|
};
|
|
5828
5810
|
return { skylightResources, activeViews };
|
|
@@ -7000,6 +6982,22 @@ function resolveStorageInstanceChunks(c, entry, inst, cap, probeBuffer, probeOff
|
|
|
7000
6982
|
function resolveGeometryInstanceBuffer(c, entry, identityInstanceDraws, useProbeBlend) {
|
|
7001
6983
|
const { runtime, pipelineState, frameState } = c;
|
|
7002
6984
|
const inst = entry.source.instances;
|
|
6985
|
+
if (entry.source.spriteInstances !== void 0) {
|
|
6986
|
+
const { buffer, count } = resolveSpriteInstancesBuffer(
|
|
6987
|
+
c,
|
|
6988
|
+
entry,
|
|
6989
|
+
pipelineState.identityInstanceBuffer,
|
|
6990
|
+
0
|
|
6991
|
+
);
|
|
6992
|
+
return count === 0 ? [] : [
|
|
6993
|
+
{
|
|
6994
|
+
instanceBuffer: buffer,
|
|
6995
|
+
instanceBindGroup: resolveGeometryInstancesBindGroup(c, buffer, void 0),
|
|
6996
|
+
probeOffset: -1,
|
|
6997
|
+
instanceCount: count
|
|
6998
|
+
}
|
|
6999
|
+
];
|
|
7000
|
+
}
|
|
7003
7001
|
const probeBinding = !useProbeBlend || !runtime.device.caps.storageBuffer || entry.source.probeBlendRecord === void 0 ? void 0 : resolveProbeBlendBuffer(
|
|
7004
7002
|
c,
|
|
7005
7003
|
entry.source.probeBlendRecord,
|
|
@@ -7357,30 +7355,6 @@ function resolveGeometryInstancesBindGroup(c, instanceBuffer, probeBuffer) {
|
|
|
7357
7355
|
bindGroupCounts
|
|
7358
7356
|
);
|
|
7359
7357
|
}
|
|
7360
|
-
function interleaveSpriteInstanceBuffer(transforms, regions, includePrevious = false) {
|
|
7361
|
-
const count = transforms.length / 16;
|
|
7362
|
-
const stride = includePrevious ? 36 : 20;
|
|
7363
|
-
const regionOffset = includePrevious ? 32 : 16;
|
|
7364
|
-
const out = new Float32Array(count * stride);
|
|
7365
|
-
for (let i = 0; i < count; i++) {
|
|
7366
|
-
const dstBase = i * stride;
|
|
7367
|
-
const transformBase = i * 16;
|
|
7368
|
-
const regionBase = i * 4;
|
|
7369
|
-
for (let k = 0; k < 16; k++) out[dstBase + k] = transforms[transformBase + k] ?? 0;
|
|
7370
|
-
if (includePrevious) {
|
|
7371
|
-
for (let k = 0; k < 16; k++) {
|
|
7372
|
-
out[dstBase + 16 + k] = transforms[transformBase + k] ?? 0;
|
|
7373
|
-
}
|
|
7374
|
-
}
|
|
7375
|
-
for (let k = 0; k < 4; k++) {
|
|
7376
|
-
out[dstBase + regionOffset + k] = regions[regionBase + k] ?? 0;
|
|
7377
|
-
}
|
|
7378
|
-
}
|
|
7379
|
-
return out;
|
|
7380
|
-
}
|
|
7381
|
-
function spriteInstancesCacheHit(entry, snapshot, requestedBytes) {
|
|
7382
|
-
return entry !== void 0 && entry.uploadedArchVersion === snapshot.archVersion && entry.uploadedByteLength === requestedBytes;
|
|
7383
|
-
}
|
|
7384
7358
|
function computeSplitLdrSprite(validatedOrdered, tonemapActive, dispatch) {
|
|
7385
7359
|
if (tonemapActive) return false;
|
|
7386
7360
|
if (dispatch !== void 0 && dispatch.length > 0) {
|
|
@@ -7767,81 +7741,6 @@ function recordSpriteEntityDraws(c, spritePass, matchedIndices, resolveMaterialB
|
|
|
7767
7741
|
c.onRenderableDraw?.(spriteEntry, 0);
|
|
7768
7742
|
}
|
|
7769
7743
|
}
|
|
7770
|
-
function resolveSpriteInstancesBuffer(c, spriteEntry, fallbackBuffer, fallbackCount) {
|
|
7771
|
-
const { runtime, frameState } = c;
|
|
7772
|
-
let buffer = fallbackBuffer;
|
|
7773
|
-
let count = fallbackCount;
|
|
7774
|
-
const spriteInstancesSnap = spriteEntry.source.spriteInstances;
|
|
7775
|
-
if (spriteInstancesSnap !== void 0) {
|
|
7776
|
-
const uniformFallback = runtime.device.caps.storageBuffer === false;
|
|
7777
|
-
const interleaved = interleaveSpriteInstanceBuffer(
|
|
7778
|
-
spriteInstancesSnap.transforms,
|
|
7779
|
-
spriteInstancesSnap.regions,
|
|
7780
|
-
!uniformFallback
|
|
7781
|
-
);
|
|
7782
|
-
const requestedBytes = interleaved.byteLength;
|
|
7783
|
-
const cap = runtime.device.limits.maxStorageBufferBindingSize;
|
|
7784
|
-
if (typeof cap === "number" && requestedBytes > cap) {
|
|
7785
|
-
runtime.errorRegistry.fire(
|
|
7786
|
-
new RhiError({
|
|
7787
|
-
code: "limit-exceeded",
|
|
7788
|
-
expected: `requestedBytes (${requestedBytes}) <= maxStorageBufferBindingSize (${cap})`,
|
|
7789
|
-
hint: "reduce SpriteInstances instance count to fit within device.limits.maxStorageBufferBindingSize (144 bytes per instance: current mat4 64B + previous mat4 64B + region 16B)",
|
|
7790
|
-
detail: {
|
|
7791
|
-
maxStorageBufferBindingSize: cap,
|
|
7792
|
-
requestedBytes
|
|
7793
|
-
}
|
|
7794
|
-
})
|
|
7795
|
-
);
|
|
7796
|
-
} else {
|
|
7797
|
-
const cachedSpriteInst = frameState.instanceBuffers.get(
|
|
7798
|
-
worldEntityKey(spriteEntry.source.worldId, spriteInstancesSnap.cacheKey)
|
|
7799
|
-
);
|
|
7800
|
-
let activeSpriteInst = null;
|
|
7801
|
-
if (spriteInstancesCacheHit(cachedSpriteInst, spriteInstancesSnap, requestedBytes)) {
|
|
7802
|
-
activeSpriteInst = cachedSpriteInst ?? null;
|
|
7803
|
-
} else if (requestedBytes > 0) {
|
|
7804
|
-
const bufRes = runtime.device.createBuffer({
|
|
7805
|
-
size: requestedBytes,
|
|
7806
|
-
usage: (uniformFallback ? GPU_BUFFER_USAGE_UNIFORM : GPU_BUFFER_USAGE_STORAGE) | GPU_BUFFER_USAGE_COPY_DST,
|
|
7807
|
-
mappedAtCreation: false
|
|
7808
|
-
});
|
|
7809
|
-
if (!bufRes.ok) {
|
|
7810
|
-
runtime.errorRegistry.fire(bufRes.error);
|
|
7811
|
-
} else {
|
|
7812
|
-
if (cachedSpriteInst !== void 0 && !cachedSpriteInst.buffer.isDestroyed) {
|
|
7813
|
-
const r = cachedSpriteInst.buffer.destroy();
|
|
7814
|
-
if (!r.ok) runtime.errorRegistry.fire(r.error);
|
|
7815
|
-
}
|
|
7816
|
-
const newBuf = new GpuBuffer(runtime.device, bufRes.value);
|
|
7817
|
-
activeSpriteInst = {
|
|
7818
|
-
buffer: newBuf,
|
|
7819
|
-
uploadedArchVersion: spriteInstancesSnap.archVersion,
|
|
7820
|
-
uploadedByteLength: requestedBytes
|
|
7821
|
-
};
|
|
7822
|
-
frameState.instanceBuffers.set(
|
|
7823
|
-
worldEntityKey(spriteEntry.source.worldId, spriteInstancesSnap.cacheKey),
|
|
7824
|
-
activeSpriteInst
|
|
7825
|
-
);
|
|
7826
|
-
}
|
|
7827
|
-
}
|
|
7828
|
-
if (activeSpriteInst !== null && requestedBytes > 0) {
|
|
7829
|
-
const writeRes = runtime.device.queue.writeBuffer(
|
|
7830
|
-
activeSpriteInst.buffer.handle,
|
|
7831
|
-
0,
|
|
7832
|
-
interleaved
|
|
7833
|
-
);
|
|
7834
|
-
if (!writeRes.ok) {
|
|
7835
|
-
runtime.errorRegistry.fire(writeRes.error);
|
|
7836
|
-
} else {
|
|
7837
|
-
buffer = activeSpriteInst.buffer.handle;
|
|
7838
|
-
count = spriteInstancesSnap.instanceCount;
|
|
7839
|
-
}
|
|
7840
|
-
}
|
|
7841
|
-
}
|
|
7842
|
-
}
|
|
7843
|
-
return { buffer, count };
|
|
7844
|
-
}
|
|
7845
7744
|
function transparentPassColorFormat(c, pipelineState = c.pipelineState) {
|
|
7846
7745
|
if (c.transparentColorFormat !== void 0) return c.transparentColorFormat;
|
|
7847
7746
|
if (!c.runtime.device.caps.storageBuffer) return pipelineState.colorAttachmentFormat;
|
|
@@ -9993,7 +9892,7 @@ var GpuDrivenView = class _GpuDrivenView {
|
|
|
9993
9892
|
mapped.value.unmap();
|
|
9994
9893
|
}
|
|
9995
9894
|
}
|
|
9996
|
-
addPasses(builder, labelPrefix = "gpu-driven", includeCompute = true, surfaceSubmissionObservation) {
|
|
9895
|
+
addPasses(builder, labelPrefix = "gpu-driven", includeCompute = true, surfaceSubmissionObservation, executeIf) {
|
|
9997
9896
|
const buffers = this.buffers;
|
|
9998
9897
|
const bindGroup = this.bindGroup;
|
|
9999
9898
|
const plan = this.plan;
|
|
@@ -10107,6 +10006,7 @@ var GpuDrivenView = class _GpuDrivenView {
|
|
|
10107
10006
|
{ resource: view.value, usage: "uniform-read" },
|
|
10108
10007
|
{ resource: counters.value, usage: "storage-read-write" }
|
|
10109
10008
|
],
|
|
10009
|
+
...executeIf === void 0 ? {} : { executeIf },
|
|
10110
10010
|
encode: ({ pass }) => {
|
|
10111
10011
|
pass.setPipeline(this.resetPipeline);
|
|
10112
10012
|
pass.setBindGroup(0, bindGroup);
|
|
@@ -10124,6 +10024,7 @@ var GpuDrivenView = class _GpuDrivenView {
|
|
|
10124
10024
|
{ resource: counters.value, usage: "storage-read-write" },
|
|
10125
10025
|
{ resource: visible.value, usage: "storage-read-write" }
|
|
10126
10026
|
],
|
|
10027
|
+
...executeIf === void 0 ? {} : { executeIf },
|
|
10127
10028
|
encode: ({ pass }) => {
|
|
10128
10029
|
pass.setPipeline(this.cullPipeline);
|
|
10129
10030
|
pass.setBindGroup(0, bindGroup);
|
|
@@ -10138,6 +10039,7 @@ var GpuDrivenView = class _GpuDrivenView {
|
|
|
10138
10039
|
{ resource: counters.value, usage: "storage-read" },
|
|
10139
10040
|
{ resource: indirect.value, usage: "storage-read-write" }
|
|
10140
10041
|
],
|
|
10042
|
+
...executeIf === void 0 ? {} : { executeIf },
|
|
10141
10043
|
encode: ({ pass }) => {
|
|
10142
10044
|
pass.setPipeline(this.finalizePipeline);
|
|
10143
10045
|
pass.setBindGroup(0, bindGroup);
|
|
@@ -10155,6 +10057,7 @@ var GpuDrivenView = class _GpuDrivenView {
|
|
|
10155
10057
|
{ resource: indirect.value, usage: "copy-src" },
|
|
10156
10058
|
{ resource: lodReadback.value, usage: "copy-dst" }
|
|
10157
10059
|
],
|
|
10060
|
+
...executeIf === void 0 ? {} : { executeIf },
|
|
10158
10061
|
encode: ({ encoder, resources }) => {
|
|
10159
10062
|
const mapState = buffers.lodReadback.mapState;
|
|
10160
10063
|
if (mapState !== void 0 && mapState !== "unmapped") return;
|
|
@@ -10585,14 +10488,29 @@ var ShadowViewStatePool = class _ShadowViewStatePool {
|
|
|
10585
10488
|
view: record.view
|
|
10586
10489
|
});
|
|
10587
10490
|
}
|
|
10588
|
-
project(builder, identity) {
|
|
10491
|
+
project(builder, identity, forceCompute = false) {
|
|
10589
10492
|
const record = this.records.get(identityKey(identity));
|
|
10590
10493
|
if (record === void 0) return err(graphStateError(identity));
|
|
10591
10494
|
const cacheHit = record.cache === "hit" && !record.invalidated;
|
|
10495
|
+
const includeCompute = forceCompute || !cacheHit;
|
|
10496
|
+
let forceComputePending = forceCompute;
|
|
10497
|
+
let lastFrame;
|
|
10498
|
+
let executeForFrame = false;
|
|
10499
|
+
const executeCompute = (frame) => {
|
|
10500
|
+
if (frame !== lastFrame) {
|
|
10501
|
+
lastFrame = frame;
|
|
10502
|
+
const currentRecord = this.records.get(identityKey(record.identity));
|
|
10503
|
+
executeForFrame = forceComputePending || currentRecord === void 0 || currentRecord.cache !== "hit" || currentRecord.invalidated;
|
|
10504
|
+
forceComputePending = false;
|
|
10505
|
+
}
|
|
10506
|
+
return executeForFrame;
|
|
10507
|
+
};
|
|
10592
10508
|
const projected = record.view.addPasses(
|
|
10593
10509
|
builder,
|
|
10594
10510
|
shadowViewLabelPrefix(record.identity),
|
|
10595
|
-
|
|
10511
|
+
includeCompute,
|
|
10512
|
+
void 0,
|
|
10513
|
+
includeCompute ? executeCompute : void 0
|
|
10596
10514
|
);
|
|
10597
10515
|
if (!projected.ok) return projected;
|
|
10598
10516
|
return ok$1({
|
|
@@ -10601,7 +10519,7 @@ var ShadowViewStatePool = class _ShadowViewStatePool {
|
|
|
10601
10519
|
generation: record.generation,
|
|
10602
10520
|
plan: record.plan,
|
|
10603
10521
|
view: record.view,
|
|
10604
|
-
passNames:
|
|
10522
|
+
passNames: includeCompute ? passNames(record.identity) : Object.freeze([]),
|
|
10605
10523
|
graphResources: projected.value
|
|
10606
10524
|
});
|
|
10607
10525
|
}
|
|
@@ -11154,20 +11072,53 @@ function shadowCasterKeys(c) {
|
|
|
11154
11072
|
}
|
|
11155
11073
|
return c.gpuDrivenShadowDrawKeys ?? /* @__PURE__ */ new Set();
|
|
11156
11074
|
}
|
|
11075
|
+
function shadowViewContains(source, planes) {
|
|
11076
|
+
if (planes === void 0 || planes.length === 0 || source.localAabb === void 0) return true;
|
|
11077
|
+
if (source.skin !== void 0) return true;
|
|
11078
|
+
if (source.spriteInstances !== void 0) return true;
|
|
11079
|
+
let worldBounds;
|
|
11080
|
+
if (source.instances !== void 0) {
|
|
11081
|
+
if (source.instances.instanceCount === 0) return false;
|
|
11082
|
+
const derived = deriveInstancesUnionBounds({
|
|
11083
|
+
meshAabb: source.localAabb,
|
|
11084
|
+
entityWorld: source.transform.world,
|
|
11085
|
+
transforms: source.instances.transforms
|
|
11086
|
+
});
|
|
11087
|
+
if (derived === void 0) return true;
|
|
11088
|
+
worldBounds = derived;
|
|
11089
|
+
} else {
|
|
11090
|
+
worldBounds = box3.transformBox3(box3.create(), source.localAabb, source.transform.world);
|
|
11091
|
+
}
|
|
11092
|
+
return frustum.intersectsBox(planes, worldBounds);
|
|
11093
|
+
}
|
|
11157
11094
|
function validateShadowOwnership(c, identity, claimedKeys, recordedKeys) {
|
|
11158
11095
|
if (c.shadowCasterMembership === void 0 && (c.gpuDrivenShadowDrawKeys === void 0 || c.gpuDrivenShadowDrawKeys.size === 0))
|
|
11159
11096
|
return;
|
|
11160
|
-
const
|
|
11097
|
+
const viewPlanes = c.shadowViewPlanesByView?.get(shadowViewIdentityKey(identity));
|
|
11098
|
+
const visibleRenderableIndices = viewPlanes === void 0 ? void 0 : new Set(
|
|
11099
|
+
(c.shadowValidatedOrdered ?? c.validatedOrdered).filter((entry) => shadowViewContains(entry.source, viewPlanes)).map((entry) => entry.renderableIndex)
|
|
11100
|
+
);
|
|
11101
|
+
const allExpectedKeys = shadowCasterKeys(c);
|
|
11102
|
+
const visibleExpectedKeys = visibleRenderableIndices === void 0 || c.shadowCasterMembership === void 0 ? allExpectedKeys : new Set(
|
|
11103
|
+
c.shadowCasterMembership.filter((membership) => visibleRenderableIndices.has(membership.renderableIndex)).map(
|
|
11104
|
+
(membership) => gpuDrivenShadowDrawKey(
|
|
11105
|
+
membership.worldEntity,
|
|
11106
|
+
membership.materialHandle,
|
|
11107
|
+
membership.drawItemIndex,
|
|
11108
|
+
membership.passIndex
|
|
11109
|
+
)
|
|
11110
|
+
)
|
|
11111
|
+
);
|
|
11161
11112
|
const claimed = claimedKeys ?? /* @__PURE__ */ new Set();
|
|
11162
11113
|
const overlap = [...claimed].filter((key) => recordedKeys.has(key));
|
|
11163
11114
|
const union = /* @__PURE__ */ new Set([...claimed, ...recordedKeys]);
|
|
11164
|
-
const missing = [...
|
|
11165
|
-
const unexpectedClaims = [...claimed].filter((key) => !
|
|
11115
|
+
const missing = [...visibleExpectedKeys].filter((key) => !union.has(key));
|
|
11116
|
+
const unexpectedClaims = [...claimed].filter((key) => !allExpectedKeys.has(key));
|
|
11166
11117
|
if (overlap.length === 0 && missing.length === 0 && unexpectedClaims.length === 0) return;
|
|
11167
11118
|
throw new RhiError({
|
|
11168
11119
|
code: "internal-error",
|
|
11169
11120
|
expected: `disjoint ShadowCaster ownership for ${shadowViewIdentityKey(identity)}`,
|
|
11170
|
-
hint: `claimed=${[...claimed].sort().join(",")} recorded=${[...recordedKeys].sort().join(",")} missing=${missing.sort().join(",")} unexpectedClaims=${unexpectedClaims.sort().join(",")}`
|
|
11121
|
+
hint: `expected=${[...allExpectedKeys].sort().join(",")} visibleExpected=${[...visibleExpectedKeys].sort().join(",")} claimed=${[...claimed].sort().join(",")} recorded=${[...recordedKeys].sort().join(",")} missing=${missing.sort().join(",")} unexpectedClaims=${unexpectedClaims.sort().join(",")}`
|
|
11171
11122
|
});
|
|
11172
11123
|
}
|
|
11173
11124
|
function hasUnclaimedShadowCasters(c, claimedKeys) {
|
|
@@ -11301,9 +11252,9 @@ function recordGpuDrivenShadowIfPublished(c, pass, identity) {
|
|
|
11301
11252
|
claimedKeys: viewClaims === void 0 ? c.gpuDrivenShadowDrawKeys ?? /* @__PURE__ */ new Set() : viewClaims.get(viewKey) ?? /* @__PURE__ */ new Set()
|
|
11302
11253
|
};
|
|
11303
11254
|
}
|
|
11304
|
-
function encodeDirectionalShadowPass(c, pass, cascadeIndex, viewport, drawFeatures) {
|
|
11255
|
+
function encodeDirectionalShadowPass(c, pass, cascadeIndex, viewport, drawFeatures, forceRaster = false) {
|
|
11305
11256
|
const directionalIdentity = { kind: "directional", index: cascadeIndex };
|
|
11306
|
-
if ((c.gpuDrivenShadowViews?.cacheHit(directionalIdentity) === true || c.gpuDrivenShadowViews === void 0 && c.directionalShadowCacheReuse) && drawFeatures === void 0)
|
|
11257
|
+
if (!forceRaster && (c.gpuDrivenShadowViews?.cacheHit(directionalIdentity) === true || c.gpuDrivenShadowViews === void 0 && c.directionalShadowCacheReuse) && drawFeatures === void 0)
|
|
11307
11258
|
return;
|
|
11308
11259
|
const pipeline = shadowPipeline(c);
|
|
11309
11260
|
const viewBg = ensureTypedShadowViewBg(
|
|
@@ -11395,7 +11346,9 @@ function encodeDirectionalShadowPass(c, pass, cascadeIndex, viewport, drawFeatur
|
|
|
11395
11346
|
LightMode: ["ShadowCaster"]
|
|
11396
11347
|
}),
|
|
11397
11348
|
shadowShaderMap(c),
|
|
11398
|
-
claimedKeys
|
|
11349
|
+
claimedKeys,
|
|
11350
|
+
false,
|
|
11351
|
+
c.shadowViewPlanesByView?.get(shadowViewIdentityKey(directionalIdentity))
|
|
11399
11352
|
);
|
|
11400
11353
|
validateShadowOwnership(c, directionalIdentity, claimedKeys, recordedKeys);
|
|
11401
11354
|
c.frameState.directionalShadowCacheRecorded = cascadeIndex === 0 ? true : c.frameState.directionalShadowCacheRecorded;
|
|
@@ -11493,7 +11446,8 @@ function encodePointShadowPass(c, pass, snapshotIndex, face, drawFeatures) {
|
|
|
11493
11446
|
}),
|
|
11494
11447
|
shadowShaderMap(c),
|
|
11495
11448
|
claimedKeys,
|
|
11496
|
-
true
|
|
11449
|
+
true,
|
|
11450
|
+
c.shadowViewPlanesByView?.get(shadowViewIdentityKey(pointIdentity))
|
|
11497
11451
|
);
|
|
11498
11452
|
validateShadowOwnership(c, pointIdentity, claimedKeys, recordedKeys);
|
|
11499
11453
|
}
|
|
@@ -11603,7 +11557,9 @@ function encodeSpotShadowPass(c, pass, snapshotIndex, drawFeatures) {
|
|
|
11603
11557
|
LightMode: ["ShadowCaster"]
|
|
11604
11558
|
}),
|
|
11605
11559
|
shadowShaderMap(c),
|
|
11606
|
-
claimedKeys
|
|
11560
|
+
claimedKeys,
|
|
11561
|
+
false,
|
|
11562
|
+
c.shadowViewPlanesByView?.get(shadowViewIdentityKey(spotIdentity))
|
|
11607
11563
|
);
|
|
11608
11564
|
validateShadowOwnership(c, spotIdentity, claimedKeys, recordedKeys);
|
|
11609
11565
|
}
|
|
@@ -11647,7 +11603,7 @@ function buildMatchedMaterialHandlesByRenderable(dispatch, selector, excludeSele
|
|
|
11647
11603
|
}
|
|
11648
11604
|
return handlesByRenderable;
|
|
11649
11605
|
}
|
|
11650
|
-
function recordShadowCasterDraws(c, shadowPass, shadowPipeline2, shadowMeshBindGroup, matchedIndices, matchedMaterialHandles, shadowDispatchByRenderableIdx, gpuDrivenShadowDrawKeys, reflected = false) {
|
|
11606
|
+
function recordShadowCasterDraws(c, shadowPass, shadowPipeline2, shadowMeshBindGroup, matchedIndices, matchedMaterialHandles, shadowDispatchByRenderableIdx, gpuDrivenShadowDrawKeys, reflected = false, viewPlanes) {
|
|
11651
11607
|
const {
|
|
11652
11608
|
runtime,
|
|
11653
11609
|
pipelineState,
|
|
@@ -11664,6 +11620,7 @@ function recordShadowCasterDraws(c, shadowPass, shadowPipeline2, shadowMeshBindG
|
|
|
11664
11620
|
for (let i = 0; i < validatedOrdered.length; i++) {
|
|
11665
11621
|
const entry = validatedOrdered[i];
|
|
11666
11622
|
if (entry === void 0) continue;
|
|
11623
|
+
if (!shadowViewContains(entry.source, viewPlanes)) continue;
|
|
11667
11624
|
if (matchedIndices !== null && !matchedIndices.has(entry.renderableIndex)) continue;
|
|
11668
11625
|
const drawIndices = shadowDrawIndicesBySubmesh(entry.source, entry.mesh);
|
|
11669
11626
|
const shadowSubmeshes = entry.mesh.submeshes.flatMap((submesh, submeshIndex) => {
|
|
@@ -12116,7 +12073,6 @@ function ensureSpotShadowMaterialBg(c) {
|
|
|
12116
12073
|
prefilterView: fb.prefilterView,
|
|
12117
12074
|
prefilterSampler: fb.sampler,
|
|
12118
12075
|
brdfLutView: fb.brdfLutView,
|
|
12119
|
-
brdfLutSampler: fb.sampler,
|
|
12120
12076
|
intensityBuffer: fb.intensityBuffer
|
|
12121
12077
|
},
|
|
12122
12078
|
transmissionBackdropAvailable(runtime.device.limits.maxSampledTexturesPerShaderStage) ? void 0 : null
|
|
@@ -12170,7 +12126,6 @@ function ensureGpuDrivenAlphaMaskMaterialBg(c, projection) {
|
|
|
12170
12126
|
prefilterView: fallback.prefilterView,
|
|
12171
12127
|
prefilterSampler: fallback.sampler,
|
|
12172
12128
|
brdfLutView: fallback.brdfLutView,
|
|
12173
|
-
brdfLutSampler: fallback.sampler,
|
|
12174
12129
|
intensityBuffer: fallback.intensityBuffer
|
|
12175
12130
|
};
|
|
12176
12131
|
const deps = {
|
|
@@ -12222,7 +12177,6 @@ function ensureGpuDrivenCustomShadowMaterialBg(c, projection) {
|
|
|
12222
12177
|
prefilterView: fallback.prefilterView,
|
|
12223
12178
|
prefilterSampler: fallback.sampler,
|
|
12224
12179
|
brdfLutView: fallback.brdfLutView,
|
|
12225
|
-
brdfLutSampler: fallback.sampler,
|
|
12226
12180
|
intensityBuffer: fallback.intensityBuffer
|
|
12227
12181
|
};
|
|
12228
12182
|
const deps = {
|
|
@@ -12484,7 +12438,7 @@ function recordMainPass(c, selector, options, graphPass) {
|
|
|
12484
12438
|
identities: [
|
|
12485
12439
|
getOpaqueResourceIdentity(skylightResources.irradianceSampler),
|
|
12486
12440
|
getOpaqueResourceIdentity(skylightResources.prefilterSampler),
|
|
12487
|
-
getOpaqueResourceIdentity(skylightResources.
|
|
12441
|
+
getOpaqueResourceIdentity(skylightResources.irradianceSampler)
|
|
12488
12442
|
]
|
|
12489
12443
|
},
|
|
12490
12444
|
resources: {
|
|
@@ -12504,7 +12458,9 @@ function recordMainPass(c, selector, options, graphPass) {
|
|
|
12504
12458
|
},
|
|
12505
12459
|
brdfLut: {
|
|
12506
12460
|
viewIdentity: getOpaqueResourceIdentity(skylightResources.brdfLutView),
|
|
12507
|
-
samplerIdentity: getOpaqueResourceIdentity(
|
|
12461
|
+
samplerIdentity: getOpaqueResourceIdentity(
|
|
12462
|
+
skylightResources.irradianceSampler
|
|
12463
|
+
),
|
|
12508
12464
|
deviceGeneration: runtime.deviceScope.generation
|
|
12509
12465
|
},
|
|
12510
12466
|
intensityBufferIdentity: getOpaqueResourceIdentity(
|
|
@@ -12549,7 +12505,6 @@ function recordMainPass(c, selector, options, graphPass) {
|
|
|
12549
12505
|
skylightPrefilterView: skylightResources.prefilterView,
|
|
12550
12506
|
prefilterSampler: row.sampler,
|
|
12551
12507
|
brdfLutView: skylightResources.brdfLutView,
|
|
12552
|
-
brdfLutSampler: skylightResources.brdfLutSampler,
|
|
12553
12508
|
intensityBuffer: row.uniformBuffer
|
|
12554
12509
|
};
|
|
12555
12510
|
return { resources: probeResources, probeIndex: row.index };
|
|
@@ -14916,6 +14871,6 @@ function addTaaResolvePass(graph, current, currentTemporal, previousColor, previ
|
|
|
14916
14871
|
});
|
|
14917
14872
|
}
|
|
14918
14873
|
|
|
14919
|
-
export { BLOOM_COMPOSITE_PARAMS_BYTES, BLOOM_DOWNSAMPLE_PARAMS_BYTES, BLOOM_UPSAMPLE_PARAMS_BYTES, BYTES_PER_DIRECT_LIGHT_SLOT, BatchTopology, CAPTURE_VIEW_PROJS, CLOUD_HISTORY_FORMATS, CUBEMAP_FACE_VERTICES, CUBE_CAPTURE_VIEW_SLOT_BASE, DEFERRED_COLOR_FORMATS, DEPTH_MIN_PARAMS_BYTE_SIZE, DEPTH_TEXTURE_FORMAT, FALLBACK_BYTES_PER_ROW, GPU_DRIVEN_VIEW_WGSL, GPU_SCENE_LAYOUTS, GpuBuffer, GpuDrivenView, GpuResourceAllocationLedger, GpuTexture, HDR_COLOR_ATTACHMENT_FORMAT,
|
|
14920
|
-
//# sourceMappingURL=chunk-
|
|
14921
|
-
//# sourceMappingURL=chunk-
|
|
14874
|
+
export { BLOOM_COMPOSITE_PARAMS_BYTES, BLOOM_DOWNSAMPLE_PARAMS_BYTES, BLOOM_UPSAMPLE_PARAMS_BYTES, BYTES_PER_DIRECT_LIGHT_SLOT, BatchTopology, CAPTURE_VIEW_PROJS, CLOUD_HISTORY_FORMATS, CUBEMAP_FACE_VERTICES, CUBE_CAPTURE_VIEW_SLOT_BASE, DEFERRED_COLOR_FORMATS, DEPTH_MIN_PARAMS_BYTE_SIZE, DEPTH_TEXTURE_FORMAT, FALLBACK_BYTES_PER_ROW, GPU_DRIVEN_VIEW_WGSL, GPU_SCENE_LAYOUTS, GpuBuffer, GpuDrivenView, GpuResourceAllocationLedger, GpuTexture, HDR_COLOR_ATTACHMENT_FORMAT, MESH_PER_ENTITY_STRIDE, MESH_SSBO_BYTES, MIPMAP_PREWARM_FORMATS, OcclusionConfidenceScheduler, POINTS_LINES_MATERIAL_SHADER_ID, POINTS_LINES_VIEW_BUFFER_SIZE, PREFILTER_MIP_LEVELS, PREFILTER_SIZE, PipelineSpecError, PostProcessError, REFLECTION_PROBE_VIEW_SLOT_BASE, SHADOW_CASTER_BUFFER_SIZE, STANDARD_PBR_REQUIRED_SAMPLED_TEXTURES, ShadowViewStatePool, SurfaceSubmissionObservationOwner, TEMPORAL_HISTORY_FORMATS, TYPED_BLOOM_PASS_NAMES, VIEW_UBO_BYTES, VIEW_UNIFORM_BYTES, VIEW_UNIFORM_SLOT_STRIDE, abortTemporalGpuSubmit, addReflectionFallbackObservationPass, addStandardSceneDataPass, addTaaResolvePass, addTypedBloomPasses, addTypedCompositePostEffects, addTypedFrameObservationPass, addTypedFullscreenPass, addTypedOutputTransformPass, addTypedScenePass, addTypedSkyboxPass, addTypedSsaoPasses, addTypedTemporalResolvePass, aggregateTemporalDemand, applyMaterialTextureUvScales, applyParamSchemaDefaultsToUbo, applyParamSnapshotToUbo, assembleMaterialWithSkylightEntries, assertStorageBufferCap, buildFoldDispatchPlan, buildFullscreenPostProcessPass, buildLinearLdrMaterialSpecTable, buildPerFrameBindGroups, buildSpecConstTable, cacheKeyOf, cleanPerEntityCache, colorFormatsForPassKind, combineGpuResourceAllocationInspections, commitTemporalGpuSubmit, computeProjectionMatrix, computeSplitLdrSprite, computeViewMatrix, createClusterBinScratch, createFullscreenBindGroup, createHdrpClusterMembershipBindGroupLayoutDescriptor, createIblPipelines, createPointsLinesLaneAdapter, createPointsLinesLaneContract, createRenderPipelineTarget, createSkylightFallback, createStandardSceneDataTarget, createStandardSurfaceLightingBindGroup, decideVisibility, defaultViewForUserRegionField, deriveRenderDataCubemap, deriveRenderDataMesh, deriveRenderDataTexture, deriveRenderExtent, describeTemporalDemand, detectNineSliceScaleTooSmall, deviceOptionsForAdapter, driveLazyEquirectProjection, encodeDirectionalShadowPass, encodeMainPass, encodePointShadowPass, encodeSpotShadowPass, ensureMeshSsboCapacity, ensureProbeBlendRecordBuffer, entryHasDepthRead, evaluateFoldBucketUniformCap, foldDispatchBuckets, geometryRenderStateForPass, geometryRenderStateForTopology, getIblProbeBackgroundSource, getOrBuildPipeline, getOrCreateFromChain, getOrCreateHdrpBuffers, getOrCreateIblCache, getTemporalBindGroupResources, getTemporalGpuState, getTemporalParamsBuffer, gpuSceneFieldOffset, hasPendingTemporalGpuSubmit, importRenderPipelineSurface, incrementFoldedDrawsMetric, inspectResourceClassSplits, isTemporalFullscreenBinding, packInstanceStorageBuffer, passKindPolicyTable, postProcessShaderEntrySignature, postProcessShaderModuleLabel, postProcessShaderPipelineLabel, prepareFrameLighting, prepareMaterialSkylight, prewarmMaterialShaderVariants, projectedHeightForCandidate, renderExtentSize, renderPipelineCloudHistoryTargets, resetHdrpBuffers, resetSsaoResources, residentTextureView, resolveGeometryInstanceBuffer, resolveMaterialSkylight, resolveOutputDither, resolveReflectionProbeBinding, resolveSkyboxActive, resolveSsaoParameters, retireTemporalGpuState, retireTemporalGpuStateAfterFence, runIblPrecompute, selectGpuDrivenSceneIndexVariant, selectGpuLodLane, selectHdrpPbrPrewarmVariants, selectLazyEquirectHandle, selectLod, selectProbePrewarmVariants, selectSkinPrewarmVariants, selectStandardPbrTransmissionPrewarmVariants, setIblComposedShaders, shadowViewIdentityKey, shadowViewRasterAccesses, shouldIssueRetest, stageTemporalGpuSubmit, standardBloomAdmitted, standardStorageVariantSet, standardTemporalLaneAdmission, standardTemporalPostOrder, standardTopologyVariantSet, temporalReadIndex, temporalWriteIndex, transmissionBackdropAvailable, uploadMeshSsboBatch, variantSetFromDefines, variantSetFromVertexLayoutProjection, warnMultiSkybox, warnMultiSkylight, warnZeroLightStandard, writeHdrpClusterAndSsaoBuffers, writePbrMaterialUboPayload, writePointsLinesViewUbo, writeShadowCasterUniforms, writeShadowParamsBuffer, writeSpotModifierTextures, writeViewUbo };
|
|
14875
|
+
//# sourceMappingURL=chunk-CJOV2XLO.mjs.map
|
|
14876
|
+
//# sourceMappingURL=chunk-CJOV2XLO.mjs.map
|