fix(web): force CPU compositor preview evaluation
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user