Skip to content

Commit

Permalink
offscreencanvas-sync.html Flush to insert the fence sync (#3640)
Browse files Browse the repository at this point in the history
Flush the commands after inserting the fence sync. Otherwise it is not
guaranteed that the implementation processes the commands.

Remove the clear commands, their results are not used.

Fixes #3639.
  • Loading branch information
kkinnunen-apple authored Apr 11, 2024
1 parent a7fa647 commit 49d8e00
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
let canvas = new OffscreenCanvas(128, 128);
let gl = canvas.getContext("webgl2");
let sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0);
gl.clearColor(0.0, 1.0, 0.0, 1.0);
gl.clear(gl.COLOR_BUFFER_BIT);
gl.flush();
tick(function() {
const status = gl.getSyncParameter(sync, gl.SYNC_STATUS);
if (status == gl.SIGNALED) {
Expand Down

0 comments on commit 49d8e00

Please sign in to comment.