From 3b2bee705cfe5a250bb6049a90b5d734d3125f73 Mon Sep 17 00:00:00 2001 From: skal Date: Mon, 16 Feb 2026 23:33:53 +0100 Subject: fix: port Hybrid3D effect to sequence v2 architecture Hybrid3D was calling Renderer3D::render() which creates its own command encoder, bypassing the sequence system. Now uses renderer_.draw() with the passed encoder. Also adds texture blit support for RotatingCube compositing. Co-Authored-By: Claude Sonnet 4.5 --- src/effects/hybrid3_d_effect.cc | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'src/effects/hybrid3_d_effect.cc') diff --git a/src/effects/hybrid3_d_effect.cc b/src/effects/hybrid3_d_effect.cc index 0e44853..c13c1e9 100644 --- a/src/effects/hybrid3_d_effect.cc +++ b/src/effects/hybrid3_d_effect.cc @@ -4,6 +4,7 @@ #include "util/fatal_error.h" #include "effects/hybrid3_d_effect.h" +#include "gpu/gpu.h" #include Hybrid3D::Hybrid3D(const GpuContext& ctx, @@ -113,6 +114,29 @@ void Hybrid3D::render(WGPUCommandEncoder encoder, WGPUTextureView color_view = nodes.get_view(output_nodes_[0]); WGPUTextureView depth_view = nodes.get_view(depth_node_); - // Render 3D scene - renderer_.render(scene_, camera_, params.time, color_view, depth_view); + // Render 3D scene using sequence encoder + WGPURenderPassColorAttachment color_attachment = {}; +#if !defined(DEMO_CROSS_COMPILE_WIN32) + color_attachment.depthSlice = WGPU_DEPTH_SLICE_UNDEFINED; +#endif + color_attachment.view = color_view; + color_attachment.loadOp = WGPULoadOp_Clear; + color_attachment.storeOp = WGPUStoreOp_Store; + color_attachment.clearValue = {0.05f, 0.05f, 0.05f, 1.0f}; + + WGPURenderPassDepthStencilAttachment depth_attachment = {}; + depth_attachment.view = depth_view; + depth_attachment.depthLoadOp = WGPULoadOp_Clear; + depth_attachment.depthStoreOp = WGPUStoreOp_Store; + depth_attachment.depthClearValue = 1.0f; + + WGPURenderPassDescriptor pass_desc = {}; + pass_desc.colorAttachmentCount = 1; + pass_desc.colorAttachments = &color_attachment; + pass_desc.depthStencilAttachment = &depth_attachment; + + WGPURenderPassEncoder pass = wgpuCommandEncoderBeginRenderPass(encoder, &pass_desc); + renderer_.draw(pass, scene_, camera_, params.time); + wgpuRenderPassEncoderEnd(pass); + wgpuRenderPassEncoderRelease(pass); } -- cgit v1.2.3