From c194f59e171a1e58ce1704f37d99ffcd09a42433 Mon Sep 17 00:00:00 2001 From: skal Date: Mon, 2 Feb 2026 15:55:03 +0100 Subject: fix(gpu): Resolve high-DPI squished rendering and 3D shadow bugs - Implemented dynamic resolution support in all shaders and effects. - Added explicit viewport setting for all render passes to ensure correct scaling. - Fixed 3D shadow mapping by adding PLANE support and standardizing soft shadow logic. - Propagated resize events through the Effect hierarchy. - Applied project-wide code formatting. --- src/gpu/effects/passthrough_effect.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/gpu/effects/passthrough_effect.cc') diff --git a/src/gpu/effects/passthrough_effect.cc b/src/gpu/effects/passthrough_effect.cc index cb92ba1..7825c0a 100644 --- a/src/gpu/effects/passthrough_effect.cc +++ b/src/gpu/effects/passthrough_effect.cc @@ -9,11 +9,15 @@ PassthroughEffect::PassthroughEffect(WGPUDevice device, WGPUQueue queue, WGPUTextureFormat format) : PostProcessEffect(device, queue) { uniforms_ = - gpu_create_buffer(device_, sizeof(float) * 4, + gpu_create_buffer(device_, sizeof(float) * 6, WGPUBufferUsage_Uniform | WGPUBufferUsage_CopyDst); pipeline_ = create_post_process_pipeline(device_, format, passthrough_shader_wgsl); } void PassthroughEffect::update_bind_group(WGPUTextureView input_view) { + struct { + float t, b, i, a, w, h; + } u = {0, 0, 0, 0, (float)width_, (float)height_}; + wgpuQueueWriteBuffer(queue_, uniforms_.buffer, 0, &u, sizeof(u)); pp_update_bind_group(device_, pipeline_, &bind_group_, input_view, uniforms_); } -- cgit v1.2.3