fix(web): force CPU compositor preview evaluation
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled

Temporarily select the CPU compositor device for the embedded preview so the
GPU-context requirement no longer aborts. A valid RGB→Composite graph still
returns COMPOSITOR_RESULT_MISSING; recorded as a residual.

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
mes123456
2026-11-14 07:48:55 +08:00
parent 71a8e8c95e
commit fe253bd9b2
8 changed files with 236 additions and 15 deletions

View File

@@ -20721,16 +20721,29 @@ bool web_engine_blend_main_compositor_evaluate(WebBlendMainState *state,
error = "COMPOSITOR_RENDER_UNAVAILABLE";
return false;
}
RE_compositor_execute(*render,
*state->main,
*scene,
scene->r,
*tree,
"",
nullptr,
/* NodeGroupOutputTypes::GroupOutputNode (1); the compositor
* header is not on the web_engine include path. */
static_cast<compositor::NodeGroupOutputTypes>(1));
/* The embedded host can run without an active WM GPU context (for example the
* Compositing workspace has no 3D viewport). The GPU compositor path calls
* DRW_gpu_context_enable and fails in that state; force CPU for this preview
* evaluation and restore the scene setting immediately afterwards. */
const eCompositorDevice previous_device = scene->r.compositor_device;
scene->r.compositor_device = SCE_COMPOSITOR_DEVICE_CPU;
try {
RE_compositor_execute(*render,
*state->main,
*scene,
scene->r,
*tree,
"",
nullptr,
/* NodeGroupOutputTypes::GroupOutputNode (1); the compositor
* header is not on the web_engine include path. */
static_cast<compositor::NodeGroupOutputTypes>(1));
}
catch (...) {
scene->r.compositor_device = previous_device;
throw;
}
scene->r.compositor_device = previous_device;
RenderResult *result = RE_AcquireResultRead(render);
if (result == nullptr || !result->have_combined) {
if (result != nullptr) {