summaryrefslogtreecommitdiff
path: root/src/effects/passthrough_effect.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/effects/passthrough_effect.cc')
-rw-r--r--src/effects/passthrough_effect.cc20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/effects/passthrough_effect.cc b/src/effects/passthrough_effect.cc
index b9d9337..02f14da 100644
--- a/src/effects/passthrough_effect.cc
+++ b/src/effects/passthrough_effect.cc
@@ -10,26 +10,14 @@ Passthrough::Passthrough(const GpuContext& ctx,
const std::vector<std::string>& outputs,
float start_time, float end_time)
: Effect(ctx, inputs, outputs, start_time, end_time), pipeline_(nullptr),
- bind_group_(nullptr), sampler_(nullptr) {
- // Headless mode: skip GPU resource creation (compiled out in STRIP_ALL)
+ bind_group_(nullptr) {
HEADLESS_RETURN_IF_NULL(ctx_.device);
- // Init uniform buffer
- uniforms_buffer_.init(ctx_.device);
- // Create pipeline (simple version without effect params)
+ init_uniforms_buffer();
+ create_linear_sampler();
+
pipeline_ = create_post_process_pipeline_simple(
ctx_.device, WGPUTextureFormat_RGBA8Unorm, passthrough_shader_wgsl);
-
- // Create sampler
- WGPUSamplerDescriptor sampler_desc = {};
- sampler_desc.addressModeU = WGPUAddressMode_ClampToEdge;
- sampler_desc.addressModeV = WGPUAddressMode_ClampToEdge;
- sampler_desc.addressModeW = WGPUAddressMode_ClampToEdge;
- sampler_desc.magFilter = WGPUFilterMode_Linear;
- sampler_desc.minFilter = WGPUFilterMode_Linear;
- sampler_desc.mipmapFilter = WGPUMipmapFilterMode_Nearest;
- sampler_desc.maxAnisotropy = 1;
- sampler_ = wgpuDeviceCreateSampler(ctx_.device, &sampler_desc);
}
void Passthrough::render(WGPUCommandEncoder encoder,