summaryrefslogtreecommitdiff
path: root/src/gpu/gpu.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-02 15:55:03 +0100
committerskal <pascal.massimino@gmail.com>2026-02-02 15:55:03 +0100
commitc194f59e171a1e58ce1704f37d99ffcd09a42433 (patch)
treef77a32f2c4c23b335209b8df11cc82920388b51a /src/gpu/gpu.cc
parent316825883c705ed0fe927c32e072f98141d3eaa3 (diff)
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.
Diffstat (limited to 'src/gpu/gpu.cc')
-rw-r--r--src/gpu/gpu.cc10
1 files changed, 10 insertions, 0 deletions
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);