Skip to content

Commit

Permalink
WebGPUObjects: Add runtime error when using THREE.Geometry.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 committed Sep 24, 2020
1 parent 33acbbe commit 599eb63
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/jsm/renderers/webgpu/WebGPUObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ class WebGPUObjects {
const updateMap = this.updateMap;
const frame = this.info.render.frame;

if ( geometry.isGeometry ) {

throw 'THREE.WebGPURenderer: Geometries of type THREE.Geometry are not supported. Please use BufferGeometry.';

}

if ( updateMap.get( geometry ) !== frame ) {

this.geometries.update( geometry );
Expand Down

4 comments on commit 599eb63

@Mugen87
Copy link
Collaborator Author

@Mugen87 Mugen87 commented on 599eb63 Sep 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrdoob WebGPURenderer does not support Geometry so far. Is it okay to keep this policy?

@mrdoob
Copy link
Owner

@mrdoob mrdoob commented on 599eb63 Sep 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep!

@mrdoob
Copy link
Owner

@mrdoob mrdoob commented on 599eb63 Sep 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, I would actually do this check instead:

if ( geometry.isBufferGeometry !== true ) {

	throw 'THREE.WebGPURenderer: This renderer only supports THREE.BufferGeometry for geometries.';

}

@Mugen87
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, this is more safe.

6a57d82

Please sign in to comment.