Skip to content

Commit

Permalink
[webgpu] Remove redundant check in initManagers. NFC
Browse files Browse the repository at this point in the history
initManagers already has a reentrancey check at the top (which itself
I believe in not necessary).
  • Loading branch information
sbc100 committed Oct 9, 2024
1 parent 94c3f85 commit e927517
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/library_webgpu.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
// Helper functions for code generation
globalThis.gpu = {
makeInitManager: function(type) {
var mgr = `WebGPU.mgr${type}`;
return `${mgr} = ${mgr} || new Manager();`;
return `WebGPU.mgr${type} = new Manager();`;
},

makeReferenceRelease: function(type) {
Expand Down Expand Up @@ -201,7 +200,9 @@ var LibraryWebGPU = {
},

initManagers: () => {
if (WebGPU.mgrDevice) return;
#if ASSERTIONS
assert(!WebGPU.mgrDevice, 'initManagers already called');
#endif

/** @constructor */
function Manager() {
Expand Down

0 comments on commit e927517

Please sign in to comment.