fix(web): rebuild offscreen region buffers whose storage was lost
the 3d viewport already recreates its attachments when a WebGL texture loses live storage, but non-viewport regions only freed their offscreen on a size or format change, so a lost color attachment could never regain pixels and the region stayed blank. free and recreate the offscreen when its storage is gone, matching the viewport recovery. evidence: the mid-run blank was observed once (GPU-SOAK-20261205-185353, blank from round 21 with a selection-abort notice) and did not reproduce in two later fault soaks (each 50 rounds) or four targeted probes including a cancel-then-toggle sequence. the rebuild was checked with a 3-minute fault soak (GPU-SOAK-20261205-211912, 49 rounds, STABLE). the causal link to the observed blank is unproven; acceptance stays NOT_CLAIMED. wasm 6183479e78115f20e76dbdc6b98be5ce9e4c425a4e99abca9c3ed88972d236ae. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -826,9 +826,16 @@ static void wm_draw_region_buffer_create(Scene *scene,
|
||||
else {
|
||||
/* Free offscreen buffer on size changes. Viewport auto resizes. */
|
||||
GPUOffScreen *offscreen = region->runtime->draw_buffer->offscreen;
|
||||
bool storage_lost = false;
|
||||
#ifdef __EMSCRIPTEN__
|
||||
/* A lost color attachment can never regain pixels; the next draw must
|
||||
* allocate a fresh offscreen instead of retaining a dead texture. */
|
||||
storage_lost = offscreen &&
|
||||
!gpu::webgl_texture_has_live_storage(GPU_offscreen_color_texture(offscreen));
|
||||
#endif
|
||||
if (offscreen && (GPU_offscreen_width(offscreen) != region->winx ||
|
||||
GPU_offscreen_height(offscreen) != region->winy ||
|
||||
GPU_offscreen_format(offscreen) != desired_format))
|
||||
GPU_offscreen_format(offscreen) != desired_format || storage_lost))
|
||||
{
|
||||
wm_draw_region_buffer_free(region);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user