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/moving_ellipse_effect.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gpu/effects/moving_ellipse_effect.cc') diff --git a/src/gpu/effects/moving_ellipse_effect.cc b/src/gpu/effects/moving_ellipse_effect.cc index b46eecd..3b73697 100644 --- a/src/gpu/effects/moving_ellipse_effect.cc +++ b/src/gpu/effects/moving_ellipse_effect.cc @@ -9,7 +9,7 @@ MovingEllipseEffect::MovingEllipseEffect(WGPUDevice device, WGPUQueue queue, WGPUTextureFormat format) : Effect(device, queue) { uniforms_ = - gpu_create_buffer(device_, sizeof(float) * 4, + gpu_create_buffer(device_, sizeof(float) * 6, WGPUBufferUsage_Uniform | WGPUBufferUsage_CopyDst); ResourceBinding bindings[] = {{uniforms_, WGPUBufferBindingType_Uniform}}; pass_ = @@ -19,8 +19,8 @@ MovingEllipseEffect::MovingEllipseEffect(WGPUDevice device, WGPUQueue queue, void MovingEllipseEffect::render(WGPURenderPassEncoder pass, float t, float b, float i, float a) { struct { - float t, b, i, a; - } u = {t, b, i, a}; + float t, b, i, a, w, h; + } u = {t, b, i, a, (float)width_, (float)height_}; wgpuQueueWriteBuffer(queue_, uniforms_.buffer, 0, &u, sizeof(u)); wgpuRenderPassEncoderSetPipeline(pass, pass_.pipeline); wgpuRenderPassEncoderSetBindGroup(pass, 0, pass_.bind_group, 0, nullptr); -- cgit v1.2.3