Skip to content

Commit d26e804

Browse files
committed
Fix double-reading in tests. Accumulation is broken though.
1 parent 113e4bf commit d26e804

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/webgpu/p5.RendererWebGPU.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2517,7 +2517,8 @@ function rendererWebGPU(p5, fn) {
25172517
}
25182518

25192519
async readFramebufferPixels(framebuffer) {
2520-
await this.finishDraw();
2520+
this.flushDraw();
2521+
// await this.finishDraw();
25212522
// Ensure all pending GPU work is complete before reading pixels
25222523
// await this.queue.onSubmittedWorkDone();
25232524

@@ -2577,7 +2578,8 @@ function rendererWebGPU(p5, fn) {
25772578
}
25782579

25792580
async readFramebufferPixel(framebuffer, x, y) {
2580-
await this.finishDraw();
2581+
this.flushDraw();
2582+
// await this.finishDraw();
25812583
// Ensure all pending GPU work is complete before reading pixels
25822584
// await this.queue.onSubmittedWorkDone();
25832585

@@ -2612,7 +2614,8 @@ function rendererWebGPU(p5, fn) {
26122614
}
26132615

26142616
async readFramebufferRegion(framebuffer, x, y, w, h) {
2615-
await this.finishDraw();
2617+
this.flushDraw();
2618+
// await this.finishDraw();
26162619
// const wasActive = this.activeFramebuffer() === framebuffer;
26172620
// if (wasActive) {
26182621
// framebuffer.end();

0 commit comments

Comments
 (0)