Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGPURenderer: TimestampQuery constant #30375

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/webgpu_compute_birds.html
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@

renderer.compute( computeVelocity );
renderer.compute( computePosition );
renderer.resolveTimestampsAsync( 'compute' );
renderer.resolveTimestampsAsync( THREE.TimestampQuery.COMPUTE );
renderer.render( scene, camera );

// Move pointer away so we only affect birds when moving the mouse
Expand Down
2 changes: 1 addition & 1 deletion examples/webgpu_compute_particles_snow.html
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@
// compute

renderer.compute( computeParticles );
renderer.resolveTimestampsAsync( 'compute' );
renderer.resolveTimestampsAsync( THREE.TimestampQuery.COMPUTE );

// result

Expand Down
2 changes: 1 addition & 1 deletion examples/webgpu_compute_points.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
function animate() {

renderer.compute( computeNode );
renderer.resolveTimestampsAsync( 'compute' );
renderer.resolveTimestampsAsync( THREE.TimestampQuery.COMPUTE );

renderer.render( scene, camera );

Expand Down
2 changes: 1 addition & 1 deletion examples/webgpu_performance.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
async function render() {

await renderer.renderAsync( scene, camera );
renderer.resolveTimestampsAsync( 'render' );
renderer.resolveTimestampsAsync( THREE.TimestampQuery.RENDER );

stats.update();

Expand Down
5 changes: 5 additions & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,8 @@ export const GLSL3 = '300 es';

export const WebGLCoordinateSystem = 2000;
export const WebGPUCoordinateSystem = 2001;

export const TimestampQuery = {
COMPUTE: 'compute',
RENDER: 'render'
};
4 changes: 2 additions & 2 deletions src/nodes/accessors/Arrays.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { getLengthFromType, getTypedArrayFromType } from '../core/NodeUtils.js';
* TSL function for creating a storage buffer node with a configured `StorageBufferAttribute`.
*
* @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.
* @returns {StorageBufferNode}
*/
Expand All @@ -29,7 +29,7 @@ export const attributeArray = ( count, type = 'float' ) => {
* TSL function for creating a storage buffer node with a configured `StorageInstancedBufferAttribute`.
*
* @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.
* @returns {StorageBufferNode}
*/
Expand Down
Loading