diff --git a/src-testing/changes.patch b/src-testing/changes.patch index da6b9979c..3b02a4c5f 100644 --- a/src-testing/changes.patch +++ b/src-testing/changes.patch @@ -3874,7 +3874,7 @@ index 006bc295..eb39fca8 100644 } diff --git a/src-testing/src/renderers/common/Geometries.ts b/src-testing/src/renderers/common/Geometries.ts -index 9072f238..a8e29552 100644 +index 14c52f6f..2a170106 100644 --- a/src-testing/src/renderers/common/Geometries.ts +++ b/src-testing/src/renderers/common/Geometries.ts @@ -1,9 +1,15 @@ @@ -3961,16 +3961,18 @@ index 9072f238..a8e29552 100644 const geometry = renderObject.geometry; const geometryData = this.get(geometry); -@@ -109,7 +125,7 @@ class Geometries extends DataMap { +@@ -109,9 +125,8 @@ class Geometries extends DataMap { geometry.addEventListener('dispose', onDispose); } - updateAttributes(renderObject) { + updateAttributes(renderObject: RenderObject) { + // attributes +- const attributes = renderObject.getAttributes(); for (const attribute of attributes) { -@@ -127,10 +143,10 @@ class Geometries extends DataMap { +@@ -139,10 +154,10 @@ class Geometries extends DataMap { } } @@ -3983,7 +3985,7 @@ index 9072f238..a8e29552 100644 if (this.attributeCall.get(attribute) !== callId) { this.attributes.update(attribute, type); -@@ -141,17 +157,17 @@ class Geometries extends DataMap { +@@ -153,21 +168,21 @@ class Geometries extends DataMap { this.attributes.update(attribute, type); this.attributeCall.set(attribute, callId); @@ -3999,6 +4001,11 @@ index 9072f238..a8e29552 100644 } } +- getIndirect(renderObject) { ++ getIndirect(renderObject: RenderObject) { + return renderObject.geometry.indirect; + } + - getIndex(renderObject) { + getIndex(renderObject: RenderObject) { const { geometry, material } = renderObject; @@ -4751,7 +4758,7 @@ index 3fc3134e..c002ed0c 100644 } diff --git a/src-testing/src/renderers/common/RenderObject.ts b/src-testing/src/renderers/common/RenderObject.ts -index 55fb4318..ea297bfd 100644 +index e46d3871..a978762a 100644 --- a/src-testing/src/renderers/common/RenderObject.ts +++ b/src-testing/src/renderers/common/RenderObject.ts @@ -1,9 +1,27 @@ @@ -4874,7 +4881,7 @@ index 55fb4318..ea297bfd 100644 return true; } -@@ -118,7 +188,7 @@ export default class RenderObject { +@@ -122,7 +192,7 @@ export default class RenderObject { } getChainArray() { @@ -4883,7 +4890,7 @@ index 55fb4318..ea297bfd 100644 } getAttributes() { -@@ -127,8 +197,8 @@ export default class RenderObject { +@@ -131,8 +201,8 @@ export default class RenderObject { const nodeAttributes = this.getNodeBuilderState().nodeAttributes; const geometry = this.geometry; @@ -4894,7 +4901,7 @@ index 55fb4318..ea297bfd 100644 for (const nodeAttribute of nodeAttributes) { const attribute = -@@ -341,6 +411,6 @@ export default class RenderObject { +@@ -345,6 +415,6 @@ export default class RenderObject { dispose() { this.material.removeEventListener('dispose', this.onMaterialDispose); @@ -7724,10 +7731,10 @@ index b1e72064..40f26bf1 100644 const nodeData = this.getDataFromNode(node, shaderStage, this.globalCache); diff --git a/src-testing/src/renderers/webgpu/WebGPUBackend.ts b/src-testing/src/renderers/webgpu/WebGPUBackend.ts -index 263ccfa4..840b556c 100644 +index f14d7df5..4fe783d9 100644 --- a/src-testing/src/renderers/webgpu/WebGPUBackend.ts +++ b/src-testing/src/renderers/webgpu/WebGPUBackend.ts -@@ -947,7 +947,7 @@ class WebGPUBackend extends Backend { +@@ -963,7 +963,7 @@ class WebGPUBackend extends Backend { this.textureUtils.destroyTexture(texture); } diff --git a/three.js b/three.js index df215c82b..f4afcaa95 160000 --- a/three.js +++ b/three.js @@ -1 +1 @@ -Subproject commit df215c82bd3cc8d3f7eefaad9f12db52d205230a +Subproject commit f4afcaa95f02f1d1c73307aac41f39cb5d63acd6 diff --git a/types/three/src/Three.WebGPU.Nodes.d.ts b/types/three/src/Three.WebGPU.Nodes.d.ts index 8a4080f99..3ff7015e8 100644 --- a/types/three/src/Three.WebGPU.Nodes.d.ts +++ b/types/three/src/Three.WebGPU.Nodes.d.ts @@ -195,6 +195,7 @@ export { default as PMREMGenerator } from "./renderers/common/extras/PMREMGenera export { default as PostProcessing } from "./renderers/common/PostProcessing.js"; import * as PostProcessingUtils from "./renderers/common/PostProcessingUtils.js"; export { PostProcessingUtils }; +export { default as IndirectStorageBufferAttribute } from "./renderers/common/IndirectStorageBufferAttribute.js"; export { default as QuadMesh } from "./renderers/common/QuadMesh.js"; export type { default as Renderer } from "./renderers/common/Renderer.js"; export { default as StorageBufferAttribute } from "./renderers/common/StorageBufferAttribute.js"; diff --git a/types/three/src/Three.WebGPU.d.ts b/types/three/src/Three.WebGPU.d.ts index f1cf9f668..3c9587494 100644 --- a/types/three/src/Three.WebGPU.d.ts +++ b/types/three/src/Three.WebGPU.d.ts @@ -196,6 +196,7 @@ export { default as PMREMGenerator } from "./renderers/common/extras/PMREMGenera export { default as PostProcessing } from "./renderers/common/PostProcessing.js"; import * as PostProcessingUtils from "./renderers/common/PostProcessingUtils.js"; export { PostProcessingUtils }; +export { default as IndirectStorageBufferAttribute } from "./renderers/common/IndirectStorageBufferAttribute.js"; export { default as QuadMesh } from "./renderers/common/QuadMesh.js"; export type { default as Renderer } from "./renderers/common/Renderer.js"; export { default as StorageBufferAttribute } from "./renderers/common/StorageBufferAttribute.js"; diff --git a/types/three/src/core/BufferGeometry.d.ts b/types/three/src/core/BufferGeometry.d.ts index 82cf8ad03..e87d07e94 100644 --- a/types/three/src/core/BufferGeometry.d.ts +++ b/types/three/src/core/BufferGeometry.d.ts @@ -4,6 +4,7 @@ import { Quaternion } from "../math/Quaternion.js"; import { Sphere } from "../math/Sphere.js"; import { Vector2 } from "../math/Vector2.js"; import { Vector3, Vector3Tuple } from "../math/Vector3.js"; +import IndirectStorageBufferAttribute from "../renderers/common/IndirectStorageBufferAttribute.js"; import { BufferAttribute, BufferAttributeJSON } from "./BufferAttribute.js"; import { EventDispatcher } from "./EventDispatcher.js"; import { GLBufferAttribute } from "./GLBufferAttribute.js"; @@ -155,6 +156,8 @@ export class BufferGeometry< */ index: BufferAttribute | null; + indirect: IndirectStorageBufferAttribute | null; + /** * This hashmap has as id the name of the attribute to be set and as value the {@link THREE.BufferAttribute | buffer} to set it to. Rather than accessing this property directly, * use {@link setAttribute | .setAttribute} and {@link getAttribute | .getAttribute} to access attributes of this geometry. @@ -233,6 +236,10 @@ export class BufferGeometry< */ setIndex(index: BufferAttribute | number[] | null): this; + setIndirect(indirect: IndirectStorageBufferAttribute | null): this; + + getIndirect(): IndirectStorageBufferAttribute | null; + /** * Sets an {@link attributes | attribute} to this geometry with the specified name. * @remarks diff --git a/types/three/src/renderers/common/Geometries.d.ts b/types/three/src/renderers/common/Geometries.d.ts index 5335e6904..e0ee000ab 100644 --- a/types/three/src/renderers/common/Geometries.d.ts +++ b/types/three/src/renderers/common/Geometries.d.ts @@ -26,6 +26,7 @@ declare class Geometries extends DataMap<{ initGeometry(renderObject: RenderObject): void; updateAttributes(renderObject: RenderObject): void; updateAttribute(attribute: BufferAttribute | InterleavedBufferAttribute, type: AttributeType): void; + getIndirect(renderObject: RenderObject): import("./IndirectStorageBufferAttribute.js").default | null; getIndex(renderObject: RenderObject): BufferAttribute | null; } export default Geometries; diff --git a/types/three/src/renderers/common/RenderObject.d.ts b/types/three/src/renderers/common/RenderObject.d.ts index efbedce41..04595c3f6 100644 --- a/types/three/src/renderers/common/RenderObject.d.ts +++ b/types/three/src/renderers/common/RenderObject.d.ts @@ -71,6 +71,7 @@ export default class RenderObject { getMonitor(): NodeMaterialObserver; getBindings(): BindGroup[]; getIndex(): BufferAttribute | null; + getIndirect(): import("./IndirectStorageBufferAttribute.js").default | null; getChainArray(): readonly [ Object3D, Material,