Skip to content

Commit

Permalink
offscreencanvas-sync.html Flush to insert the fence sync (#3639)
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.
  • Loading branch information
kkinnunen-apple committed Apr 10, 2024
1 parent a7fa647 commit d5a93a4
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 d5a93a4

Please sign in to comment.