Skip to content

Commit

Permalink
offscreencanvas-sync.html Flush to insert fence sync to command stream (
Browse files Browse the repository at this point in the history
#3639)

Flush the commands after inserting fence sync. Otherwise it is not
guaranteed that the implementation processes the commands.

Remove the clear commands, their results are not used.
  • Loading branch information
kkinnunen-apple committed Apr 10, 2024
1 parent a7fa647 commit 4c77e2f
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 4c77e2f

Please sign in to comment.