Skip to content

Commit

Permalink
feat: add backend info to data-engine attribute instead
Browse files Browse the repository at this point in the history
  • Loading branch information
jclaessens97 committed Oct 16, 2024
1 parent e34bf8f commit 9031cd3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/renderers/common/Backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Color4 from './Color4.js';
import { Vector2 } from '../../math/Vector2.js';
import { Vector4 } from '../../math/Vector4.js';
import { createCanvasElement } from '../../utils.js';
import { REVISION } from '../../constants.js';
import { REVISION, WebGPUCoordinateSystem } from '../../constants.js';

class Backend {

Expand Down Expand Up @@ -147,8 +147,10 @@ class Backend {

domElement = ( this.parameters.canvas !== undefined ) ? this.parameters.canvas : createCanvasElement();

const backend = ( this.coordinateSystem === WebGPUCoordinateSystem ) ? 'webgpu' : 'webgl';

// OffscreenCanvas does not have setAttribute, see #22811
if ( 'setAttribute' in domElement ) domElement.setAttribute( 'data-engine', `three.js r${REVISION} webgpu` );
if ( 'setAttribute' in domElement ) domElement.setAttribute( 'data-engine', `three.js r${REVISION} WebGPURenderer ${backend}` );

this.domElement = domElement;

Expand Down

0 comments on commit 9031cd3

Please sign in to comment.