From 2347fcce80fb73a0535f957baf8c291f40c32785 Mon Sep 17 00:00:00 2001 From: Hesperus Date: Wed, 26 Aug 2026 00:15:09 -0700 Subject: [PATCH] WebGPU: remove leftover sync-conflict diagnostic from the uniform-set bind hot path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The scan iterated every bound texture against every framebuffer attachment on each command_bind_render_uniform_sets call, and its body only increments a local counter — the print it fed was removed. In any scene that never reaches 20 matches it runs for the whole session, on the hottest CPU path, twice per frame in two-pass XR. No behavior change. --- .../webgpu/rendering_device_driver_webgpu.cpp | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/drivers/webgpu/rendering_device_driver_webgpu.cpp b/drivers/webgpu/rendering_device_driver_webgpu.cpp index 722a25559c210..3e4acb3d0d92d 100644 --- a/drivers/webgpu/rendering_device_driver_webgpu.cpp +++ b/drivers/webgpu/rendering_device_driver_webgpu.cpp @@ -7110,42 +7110,12 @@ void RenderingDeviceDriverWebGPU::command_bind_render_uniform_sets(CommandBuffer WGShader *pipeline_shader = cmd->render_state.current_pipeline ? cmd->render_state.current_pipeline->shader : nullptr; - // Diagnostic: log texture bindings and push constant info on swap chain pass. // Invalidate bind group tracking if the pipeline shader changed. if (pipeline_shader != cmd->bound_shader) { cmd->invalidate_bind_groups(); cmd->bound_shader = pipeline_shader; } - // Diagnostic: detect the sync-scope conflict that's causing the - // "includes writable usage and another usage in the same synchronization - // scope" validation error. This fires whenever a bound texture's parent - // matches a framebuffer attachment's parent. Limited to a few prints so - // we don't spam the console after a match. - static int _sync_conflict_log_count = 0; - WGFramebuffer *_cur_fb = cmd->render_state.framebuffer; - if (_cur_fb && _sync_conflict_log_count < 20) { - for (uint32_t i = 0; i < p_set_count; i++) { - WGUniformSet *us = (WGUniformSet *)(p_uniform_sets[i].id); - if (!us) continue; - for (const KeyValue &kv : us->bound_textures) { - WGTexture *btex = kv.value; - if (!btex || !btex->view_source) continue; - for (uint32_t a = 0; a < _cur_fb->attachments.size(); a++) { - WGTexture *atex = _cur_fb->attachments[a]; - if (!atex) continue; - WGPUTexture a_src = atex->gpu_handle(); - if (a_src == btex->view_source) { - _sync_conflict_log_count++; - if (_sync_conflict_log_count >= 20) break; - } - } - if (_sync_conflict_log_count >= 20) break; - } - if (_sync_conflict_log_count >= 20) break; - } - } - // Task 7.5: Unpack 4-bit frame indices from p_dynamic_offsets as we walk the sets. // Every set with `us->dynamic_buffers.size()` entries consumes that many 4-bit // slots in the mask (in binding order, matching uniform_sets_get_dynamic_offsets).