diff options
Diffstat (limited to 'src/effects/passthrough_effect_v2.cc')
| -rw-r--r-- | src/effects/passthrough_effect_v2.cc | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/effects/passthrough_effect_v2.cc b/src/effects/passthrough_effect_v2.cc index 765c1f0..38bb63a 100644 --- a/src/effects/passthrough_effect_v2.cc +++ b/src/effects/passthrough_effect_v2.cc @@ -11,9 +11,9 @@ PassthroughEffectV2::PassthroughEffectV2(const GpuContext& ctx, sampler_(nullptr) { // Init uniform buffer uniforms_buffer_.init(ctx_.device); - // Create pipeline - pipeline_ = create_post_process_pipeline(ctx_.device, WGPUTextureFormat_RGBA8Unorm, - passthrough_v2_shader_wgsl); + // Create pipeline (simple version without effect params) + pipeline_ = create_post_process_pipeline_simple(ctx_.device, WGPUTextureFormat_RGBA8Unorm, + passthrough_v2_shader_wgsl); // Create sampler WGPUSamplerDescriptor sampler_desc = {}; @@ -37,9 +37,25 @@ void PassthroughEffectV2::render(WGPUCommandEncoder encoder, // Update uniforms uniforms_buffer_.update(ctx_.queue, params); - // Update bind group using helper (handles dummy buffers) - pp_update_bind_group(ctx_.device, pipeline_, &bind_group_, input_view, - uniforms_buffer_.get(), {nullptr, 0}); + // Manually create bind group with only 3 entries (no effect params needed) + WGPUBindGroupEntry entries[3] = {}; + entries[0].binding = PP_BINDING_SAMPLER; + entries[0].sampler = sampler_; + entries[1].binding = PP_BINDING_TEXTURE; + entries[1].textureView = input_view; + entries[2].binding = PP_BINDING_UNIFORMS; + entries[2].buffer = uniforms_buffer_.get().buffer; + entries[2].size = sizeof(UniformsSequenceParams); + + WGPUBindGroupDescriptor bg_desc = {}; + bg_desc.layout = wgpuRenderPipelineGetBindGroupLayout(pipeline_, 0); + bg_desc.entryCount = 3; + bg_desc.entries = entries; + + if (bind_group_) { + wgpuBindGroupRelease(bind_group_); + } + bind_group_ = wgpuDeviceCreateBindGroup(ctx_.device, &bg_desc); // Render pass WGPURenderPassColorAttachment color_attachment = { |
