From ca8acd5e7c0556bee7cb21f5ff280c5fd1f47801 Mon Sep 17 00:00:00 2001 From: skal Date: Wed, 20 May 2026 23:12:08 +0200 Subject: fix: audio & effects cleanup — dead code removal, simplifications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/effects/rotating_cube_effect.cc | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src/effects/rotating_cube_effect.cc') diff --git a/src/effects/rotating_cube_effect.cc b/src/effects/rotating_cube_effect.cc index 82f90c5..000d177 100644 --- a/src/effects/rotating_cube_effect.cc +++ b/src/effects/rotating_cube_effect.cc @@ -84,7 +84,7 @@ RotatingCube::RotatingCube(const GpuContext& ctx, pipeline_desc.multisample.mask = 0xFFFFFFFF; pipeline_desc.fragment = &fragment; - pipeline_ = wgpuDeviceCreateRenderPipeline(ctx_.device, &pipeline_desc); + pipeline_.set(wgpuDeviceCreateRenderPipeline(ctx_.device, &pipeline_desc)); wgpuShaderModuleRelease(shader_module); wgpuPipelineLayoutRelease(pipeline_layout); @@ -103,17 +103,10 @@ RotatingCube::RotatingCube(const GpuContext& ctx, .entryCount = 2, .entries = entries, }; - bind_group_ = wgpuDeviceCreateBindGroup(ctx_.device, &bg_desc); + bind_group_.set(wgpuDeviceCreateBindGroup(ctx_.device, &bg_desc)); wgpuBindGroupLayoutRelease(bgl); } -RotatingCube::~RotatingCube() { - if (bind_group_) - wgpuBindGroupRelease(bind_group_); - if (pipeline_) - wgpuRenderPipelineRelease(pipeline_); -} - void RotatingCube::declare_nodes(NodeRegistry& registry) { // Declare depth buffer node registry.declare_node(depth_node_, NodeType::DEPTH24, -1, -1); @@ -201,8 +194,8 @@ void RotatingCube::render(WGPUCommandEncoder encoder, WGPURenderPassEncoder pass = wgpuCommandEncoderBeginRenderPass(encoder, &pass_desc); - wgpuRenderPassEncoderSetPipeline(pass, pipeline_); - wgpuRenderPassEncoderSetBindGroup(pass, 0, bind_group_, 0, nullptr); + wgpuRenderPassEncoderSetPipeline(pass, pipeline_.get()); + wgpuRenderPassEncoderSetBindGroup(pass, 0, bind_group_.get(), 0, nullptr); wgpuRenderPassEncoderDraw(pass, 36, 1, 0, 0); // 36 vertices for cube wgpuRenderPassEncoderEnd(pass); wgpuRenderPassEncoderRelease(pass); -- cgit v1.2.3