diff options
Diffstat (limited to 'src/effects')
| -rw-r--r-- | src/effects/flash_effect.cc | 6 | ||||
| -rw-r--r-- | src/effects/gaussian_blur_effect.cc | 6 | ||||
| -rw-r--r-- | src/effects/heptagon_effect.cc | 6 | ||||
| -rw-r--r-- | src/effects/hybrid3_d_effect.cc | 7 | ||||
| -rw-r--r-- | src/effects/particles_effect.cc | 8 | ||||
| -rw-r--r-- | src/effects/passthrough_effect.cc | 8 | ||||
| -rw-r--r-- | src/effects/peak_meter_effect.cc | 5 | ||||
| -rw-r--r-- | src/effects/placeholder_effect.cc | 8 | ||||
| -rw-r--r-- | src/effects/rotating_cube_effect.cc | 6 |
9 files changed, 15 insertions, 45 deletions
diff --git a/src/effects/flash_effect.cc b/src/effects/flash_effect.cc index c8638f0..7baf6a2 100644 --- a/src/effects/flash_effect.cc +++ b/src/effects/flash_effect.cc @@ -67,11 +67,7 @@ void Flash::render(WGPUCommandEncoder encoder, // Render pass WGPURenderPassColorAttachment color_attachment = {}; - color_attachment.view = output_view; - color_attachment.depthSlice = WGPU_DEPTH_SLICE_UNDEFINED; - color_attachment.loadOp = WGPULoadOp_Clear; - color_attachment.storeOp = WGPUStoreOp_Store; - color_attachment.clearValue = {0.0, 0.0, 0.0, 1.0}; + gpu_init_color_attachment(color_attachment, output_view); WGPURenderPassDescriptor pass_desc = {}; pass_desc.colorAttachmentCount = 1; diff --git a/src/effects/gaussian_blur_effect.cc b/src/effects/gaussian_blur_effect.cc index 02cd77e..7304321 100644 --- a/src/effects/gaussian_blur_effect.cc +++ b/src/effects/gaussian_blur_effect.cc @@ -68,11 +68,7 @@ void GaussianBlur::render(WGPUCommandEncoder encoder, // Render pass WGPURenderPassColorAttachment color_attachment = {}; - color_attachment.view = output_view; - color_attachment.depthSlice = WGPU_DEPTH_SLICE_UNDEFINED; - color_attachment.loadOp = WGPULoadOp_Clear; - color_attachment.storeOp = WGPUStoreOp_Store; - color_attachment.clearValue = {0.0, 0.0, 0.0, 1.0}; + gpu_init_color_attachment(color_attachment, output_view); WGPURenderPassDescriptor pass_desc = {}; pass_desc.colorAttachmentCount = 1; diff --git a/src/effects/heptagon_effect.cc b/src/effects/heptagon_effect.cc index 13d7aad..c472f2f 100644 --- a/src/effects/heptagon_effect.cc +++ b/src/effects/heptagon_effect.cc @@ -72,11 +72,7 @@ void Heptagon::render(WGPUCommandEncoder encoder, // Render pass WGPURenderPassColorAttachment color_attachment = {}; - color_attachment.view = output_view; - color_attachment.depthSlice = WGPU_DEPTH_SLICE_UNDEFINED; - color_attachment.loadOp = WGPULoadOp_Clear; - color_attachment.storeOp = WGPUStoreOp_Store; - color_attachment.clearValue = {0.0, 0.0, 0.0, 1.0}; + gpu_init_color_attachment(color_attachment, output_view); WGPURenderPassDescriptor pass_desc = {}; pass_desc.colorAttachmentCount = 1; diff --git a/src/effects/hybrid3_d_effect.cc b/src/effects/hybrid3_d_effect.cc index 1dd1c05..5832b57 100644 --- a/src/effects/hybrid3_d_effect.cc +++ b/src/effects/hybrid3_d_effect.cc @@ -106,12 +106,7 @@ void Hybrid3D::render(WGPUCommandEncoder encoder, // 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; + gpu_init_color_attachment(color_attachment, color_view); color_attachment.clearValue = {0.05f, 0.05f, 0.05f, 1.0f}; WGPURenderPassDepthStencilAttachment depth_attachment = {}; diff --git a/src/effects/particles_effect.cc b/src/effects/particles_effect.cc index 22e41e9..d83f303 100644 --- a/src/effects/particles_effect.cc +++ b/src/effects/particles_effect.cc @@ -84,12 +84,8 @@ void Particles::render(WGPUCommandEncoder encoder, // Run render pass (draw particles to output) WGPUTextureView output_view = nodes.get_view(output_nodes_[0]); - WGPURenderPassColorAttachment color_attachment = { - .view = output_view, - .depthSlice = WGPU_DEPTH_SLICE_UNDEFINED, - .loadOp = WGPULoadOp_Clear, - .storeOp = WGPUStoreOp_Store, - .clearValue = {0.0, 0.0, 0.0, 1.0}}; + WGPURenderPassColorAttachment color_attachment = {}; + gpu_init_color_attachment(color_attachment, output_view); WGPURenderPassDescriptor render_desc = { .colorAttachmentCount = 1, .colorAttachments = &color_attachment}; diff --git a/src/effects/passthrough_effect.cc b/src/effects/passthrough_effect.cc index 392102d..b9d9337 100644 --- a/src/effects/passthrough_effect.cc +++ b/src/effects/passthrough_effect.cc @@ -63,12 +63,8 @@ void Passthrough::render(WGPUCommandEncoder encoder, bind_group_ = wgpuDeviceCreateBindGroup(ctx_.device, &bg_desc); // Render pass - WGPURenderPassColorAttachment color_attachment = { - .view = output_view, - .depthSlice = WGPU_DEPTH_SLICE_UNDEFINED, - .loadOp = WGPULoadOp_Clear, - .storeOp = WGPUStoreOp_Store, - .clearValue = {0.0, 0.0, 0.0, 1.0}}; + WGPURenderPassColorAttachment color_attachment = {}; + gpu_init_color_attachment(color_attachment, output_view); WGPURenderPassDescriptor pass_desc = {}; pass_desc.colorAttachmentCount = 1; diff --git a/src/effects/peak_meter_effect.cc b/src/effects/peak_meter_effect.cc index 63be2c0..d823e20 100644 --- a/src/effects/peak_meter_effect.cc +++ b/src/effects/peak_meter_effect.cc @@ -81,11 +81,8 @@ void PeakMeter::render(WGPUCommandEncoder encoder, uniforms_buffer_.get(), {nullptr, 0}); WGPURenderPassColorAttachment color_attachment = {}; - color_attachment.view = output_view; - color_attachment.depthSlice = WGPU_DEPTH_SLICE_UNDEFINED; + gpu_init_color_attachment(color_attachment, output_view); color_attachment.loadOp = WGPULoadOp_Load; - color_attachment.storeOp = WGPUStoreOp_Store; - color_attachment.clearValue = {0.0, 0.0, 0.0, 1.0}; WGPURenderPassDescriptor pass_desc = {}; pass_desc.colorAttachmentCount = 1; diff --git a/src/effects/placeholder_effect.cc b/src/effects/placeholder_effect.cc index 6ba665a..3367f1c 100644 --- a/src/effects/placeholder_effect.cc +++ b/src/effects/placeholder_effect.cc @@ -45,12 +45,8 @@ void Placeholder::render(WGPUCommandEncoder encoder, pp_update_bind_group(ctx_.device, pipeline_, &bind_group_, input_view, uniforms_buffer_.get(), {nullptr, 0}); - WGPURenderPassColorAttachment color_attachment = { - .view = output_view, - .depthSlice = WGPU_DEPTH_SLICE_UNDEFINED, - .loadOp = WGPULoadOp_Clear, - .storeOp = WGPUStoreOp_Store, - .clearValue = {0.0, 0.0, 0.0, 1.0}}; + WGPURenderPassColorAttachment color_attachment = {}; + gpu_init_color_attachment(color_attachment, output_view); WGPURenderPassDescriptor pass_desc = {}; pass_desc.colorAttachmentCount = 1; diff --git a/src/effects/rotating_cube_effect.cc b/src/effects/rotating_cube_effect.cc index 0f1781d..6c350a7 100644 --- a/src/effects/rotating_cube_effect.cc +++ b/src/effects/rotating_cube_effect.cc @@ -163,9 +163,9 @@ void RotatingCube::render(WGPUCommandEncoder encoder, WGPUTexture input_tex = nodes.get_texture(input_nodes_[0]); WGPUTexture output_tex = nodes.get_texture(output_nodes_[0]); if (input_tex && output_tex) { - WGPUTexelCopyTextureInfo src = { + GpuTextureCopyInfo src = { .texture = input_tex, .mipLevel = 0, .aspect = WGPUTextureAspect_All}; - WGPUTexelCopyTextureInfo dst = {.texture = output_tex, + GpuTextureCopyInfo dst = {.texture = output_tex, .mipLevel = 0, .aspect = WGPUTextureAspect_All}; WGPUExtent3D copy_size = {(uint32_t)params.resolution.x, @@ -181,7 +181,9 @@ void RotatingCube::render(WGPUCommandEncoder encoder, // Render pass with depth WGPURenderPassColorAttachment color_attachment = { .view = color_view, + #if !defined(DEMO_CROSS_COMPILE_WIN32) .depthSlice = WGPU_DEPTH_SLICE_UNDEFINED, +#endif // .loadOp = WGPULoadOp_Clear, .loadOp = WGPULoadOp_Load, .storeOp = WGPUStoreOp_Store, |
