summaryrefslogtreecommitdiff
path: root/src/gui/Post.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/Post.zig')
-rw-r--r--src/gui/Post.zig5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/Post.zig b/src/gui/Post.zig
index f715965f..45798f8d 100644
--- a/src/gui/Post.zig
+++ b/src/gui/Post.zig
@@ -98,6 +98,9 @@ ping: [2]?*c.SDL_GPUTexture = .{ null, null },
ping_w: u32 = 0,
ping_h: u32 = 0,
uniforms: Uniforms = .{},
+/// The display's density, for a pass whose pattern is in logical pixels
+/// (pardesScale); the shell sets it.
+scale: f32 = 1,
started_ns: ?u64 = null,
last_ns: u64 = 0,
@@ -422,7 +425,7 @@ pub fn draw(post: *Post, device: *c.SDL_GPUDevice, cmd: *c.SDL_GPUCommandBuffer,
const binding = c.SDL_GPUTextureSamplerBinding{ .texture = input, .sampler = sampler };
c.SDL_BindGPUFragmentSamplers(pass_rp, 0, &binding, 1);
c.SDL_PushGPUFragmentUniformData(cmd, 0, u, @sizeOf(Uniforms));
- const own: [4]f32 = .{ @floatFromInt(@intFromBool(opaque_window)), @floatFromInt(pass.level), 0, 0 };
+ const own: [4]f32 = .{ @floatFromInt(@intFromBool(opaque_window)), @floatFromInt(pass.level), post.scale, 0 };
c.SDL_PushGPUFragmentUniformData(cmd, 1, &own, @sizeOf(@TypeOf(own)));
c.SDL_DrawGPUPrimitives(pass_rp, 3, 1, 0, 0);
c.SDL_EndGPURenderPass(pass_rp);