summaryrefslogtreecommitdiff
path: root/src/gpu/effect.h
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/effect.h
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/effect.h')
-rw-r--r--src/gpu/effect.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gpu/effect.h b/src/gpu/effect.h
index e7453c7..7e5e2ce 100644
--- a/src/gpu/effect.h
+++ b/src/gpu/effect.h
@@ -33,7 +33,10 @@ class Effect {
}
virtual void render(WGPURenderPassEncoder pass, float time, float beat,
float intensity, float aspect_ratio) = 0;
- virtual void resize(int width, int height) {}
+ virtual void resize(int width, int height) {
+ width_ = width;
+ height_ = height;
+ }
virtual void end() {
}
@@ -46,6 +49,8 @@ class Effect {
WGPUDevice device_;
WGPUQueue queue_;
GpuBuffer uniforms_;
+ int width_ = 1280;
+ int height_ = 720;
};
class PostProcessEffect : public Effect {
@@ -123,6 +128,9 @@ class MainSequence {
};
std::vector<ActiveSequence> sequences_;
+ int width_ = 1280;
+ int height_ = 720;
+
WGPUTexture framebuffer_a_ = nullptr;
WGPUTextureView framebuffer_view_a_ = nullptr;
WGPUTexture framebuffer_b_ = nullptr;