From 5c7bad2f7d64b7fdfd5e225b20009e6f2cc036dc Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 17 Nov 2023 20:46:23 -0800 Subject: [PATCH] renderer/opengl: resize the screen texture --- src/renderer/opengl/custom.zig | 13 +++++++++++++ src/renderer/shaders/shadertoy_prefix.glsl | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/renderer/opengl/custom.zig b/src/renderer/opengl/custom.zig index cb75cfd54..6e0dd8d2a 100644 --- a/src/renderer/opengl/custom.zig +++ b/src/renderer/opengl/custom.zig @@ -148,6 +148,19 @@ pub const State = struct { 1, }; try self.syncUniforms(); + + // Update our texture + const texbind = try self.fb_texture.bind(.@"2D"); + try texbind.image2D( + 0, + .rgb, + @intCast(size.width), + @intCast(size.height), + 0, + .rgb, + .UnsignedByte, + null, + ); } /// Call this prior to drawing a frame to update the time diff --git a/src/renderer/shaders/shadertoy_prefix.glsl b/src/renderer/shaders/shadertoy_prefix.glsl index d62e19605..a1a220bd4 100644 --- a/src/renderer/shaders/shadertoy_prefix.glsl +++ b/src/renderer/shaders/shadertoy_prefix.glsl @@ -13,7 +13,7 @@ layout(binding = 0) uniform Globals { uniform float iSampleRate; }; -layout(binding = 1) uniform sampler2D iChannel0; +layout(binding = 0) uniform sampler2D iChannel0; // These are unused currently by Ghostty: // layout(binding = 1) uniform sampler2D iChannel1;