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/gpu.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/gpu/gpu.cc') diff --git a/src/gpu/gpu.cc b/src/gpu/gpu.cc index 7b8e012..5537433 100644 --- a/src/gpu/gpu.cc +++ b/src/gpu/gpu.cc @@ -367,6 +367,7 @@ void gpu_init(PlatformState* platform_state) { g_config.usage = WGPUTextureUsage_RenderAttachment; g_config.width = platform_state->width; g_config.height = platform_state->height; + printf("WebGPU Init: %dx%d\n", g_config.width, g_config.height); g_config.presentMode = WGPUPresentMode_Fifo; g_config.alphaMode = WGPUCompositeAlphaMode_Opaque; wgpuSurfaceConfigure(g_surface, &g_config); @@ -381,6 +382,15 @@ void gpu_draw(float audio_peak, float aspect_ratio, float time, float beat) { g_main_sequence.render_frame(time, beat, audio_peak, aspect_ratio, g_surface); } +void gpu_resize(int width, int height) { + if (width <= 0 || height <= 0) + return; + g_config.width = width; + g_config.height = height; + wgpuSurfaceConfigure(g_surface, &g_config); + g_main_sequence.resize(width, height); +} + #if !defined(STRIP_ALL) void gpu_simulate_until(float time) { g_main_sequence.simulate_until(time, 1.0f / 60.0f); -- cgit v1.2.3