Skip to content

Commit 1e40a6a

Browse files
author
Avaer Kazmer
committed
Remove atomics usage
1 parent 643da0b commit 1e40a6a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Graphics.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ HTMLCanvasElement.prototype.getContext = (oldGetContext => function getContext(t
120120
const canvas = this;
121121
const gl = oldGetContext.call(canvas, type, init);
122122
// gl.version = match[1] === 'webgl2' ? 2 : 1;
123-
gl.id = Atomics.add(GlobalContext.xrState.id, 0) + 1;
123+
gl.id = ++GlobalContext.xrState.id[0];
124124
gl._proxyContext = null;
125125
Object.defineProperty(gl, 'canvas', { // Object.defineProperty to avoid proxying
126126
get() {

src/WindowVm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ const _clean = o => {
232232
return result;
233233
};
234234
const _makeWindow = (options = {}) => {
235-
const id = Atomics.add(GlobalContext.xrState.id, 0, 1) + 1;
235+
const id = ++GlobalContext.xrState.id[0];
236236
const window = new WorkerVm({
237237
initModule: './Window.js',
238238
args: {

0 commit comments

Comments
 (0)