Parcourir la source

WebGPURenderer: `TimestampQuery` constant (#30375)

Renaud Rohlinger il y a 1 an
Parent
commit
b18d74c6d8

+ 1 - 1
examples/webgpu_compute_birds.html

@@ -505,7 +505,7 @@
 
 
 				renderer.compute( computeVelocity );
 				renderer.compute( computeVelocity );
 				renderer.compute( computePosition );
 				renderer.compute( computePosition );
-				renderer.resolveTimestampsAsync( 'compute' );
+				renderer.resolveTimestampsAsync( THREE.TimestampQuery.COMPUTE );
 				renderer.render( scene, camera );
 				renderer.render( scene, camera );
 
 
 				// Move pointer away so we only affect birds when moving the mouse
 				// Move pointer away so we only affect birds when moving the mouse

+ 1 - 1
examples/webgpu_compute_particles_snow.html

@@ -350,7 +350,7 @@
 				// compute
 				// compute
 
 
 				renderer.compute( computeParticles );
 				renderer.compute( computeParticles );
-				renderer.resolveTimestampsAsync( 'compute' );
+				renderer.resolveTimestampsAsync( THREE.TimestampQuery.COMPUTE );
 
 
 				// result
 				// result
 
 

+ 1 - 1
examples/webgpu_compute_points.html

@@ -176,7 +176,7 @@
 			function animate() {
 			function animate() {
 
 
 				renderer.compute( computeNode );
 				renderer.compute( computeNode );
-				renderer.resolveTimestampsAsync( 'compute' );
+				renderer.resolveTimestampsAsync( THREE.TimestampQuery.COMPUTE );
 
 
 				renderer.render( scene, camera );
 				renderer.render( scene, camera );
 
 

+ 1 - 1
examples/webgpu_performance.html

@@ -160,7 +160,7 @@
 			async function render() {
 			async function render() {
 
 
 				await renderer.renderAsync( scene, camera );
 				await renderer.renderAsync( scene, camera );
-				renderer.resolveTimestampsAsync( 'render' );
+				renderer.resolveTimestampsAsync( THREE.TimestampQuery.RENDER );
 
 
 				stats.update();
 				stats.update();
 
 

+ 5 - 0
src/constants.js

@@ -209,3 +209,8 @@ export const GLSL3 = '300 es';
 
 
 export const WebGLCoordinateSystem = 2000;
 export const WebGLCoordinateSystem = 2000;
 export const WebGPUCoordinateSystem = 2001;
 export const WebGPUCoordinateSystem = 2001;
+
+export const TimestampQuery = {
+	COMPUTE: 'compute',
+	RENDER: 'render'
+};

+ 2 - 2
src/nodes/accessors/Arrays.js

@@ -9,7 +9,7 @@ import { getLengthFromType, getTypedArrayFromType } from '../core/NodeUtils.js';
  * TSL function for creating a storage buffer node with a configured `StorageBufferAttribute`.
  * TSL function for creating a storage buffer node with a configured `StorageBufferAttribute`.
  *
  *
  * @function
  * @function
- * @param {Number|TypedArray} count - The data count.
+ * @param {Number|TypedArray} count - The data count. It is also valid to pass a typed array as an argument.
  * @param {String} [type='float'] - The data type.
  * @param {String} [type='float'] - The data type.
  * @returns {StorageBufferNode}
  * @returns {StorageBufferNode}
  */
  */
@@ -29,7 +29,7 @@ export const attributeArray = ( count, type = 'float' ) => {
  * TSL function for creating a storage buffer node with a configured `StorageInstancedBufferAttribute`.
  * TSL function for creating a storage buffer node with a configured `StorageInstancedBufferAttribute`.
  *
  *
  * @function
  * @function
- * @param {Number|TypedArray} count - The data count.
+ * @param {Number|TypedArray} count - The data count. It is also valid to pass a typed array as an argument.
  * @param {String} [type='float'] - The data type.
  * @param {String} [type='float'] - The data type.
  * @returns {StorageBufferNode}
  * @returns {StorageBufferNode}
  */
  */

粤ICP备19079148号