summaryrefslogtreecommitdiff
path: root/pkg/opengl
diff options
context:
space:
mode:
authorMitchell Hashimoto <mitchell.hashimoto@gmail.com>2024-08-03 21:35:56 -0700
committerMitchell Hashimoto <mitchell.hashimoto@gmail.com>2024-08-03 21:56:19 -0700
commitea551990eb1877617b329e1f9cf235e9ff0e08f2 (patch)
treee368d9f2c0a03ba4af11a8fde4c390d6df61c795 /pkg/opengl
parent2d418171df1099bec48fb7d07f31c52e81fd1d02 (diff)
renderer: disable window-padding-color=extend in certain scenarios
There are scenarios where this configuration looks bad. This commit introduces some heuristics to prevent it. Here are the heuristics: * Extension is always enabled on alt screen. * Extension is disabled if a row contains any default bg color. The thinking is that in this scenario, using the default bg color looks just fine. * Extension is disabled if a row is marked as a prompt (using semantic prompt sequences). The thinking here is that prompts often contain perfect fit glyphs such as Powerline glyphs and those look bad when extended. This introduces some CPU cost to the extension feature but it should be minimal and respects dirty tracking. This is unfortunate but the feature makes many terminal scenarios look much better and the performance cost is minimal so I believe it is worth it. Further heuristics are likely warranted but this should be a good starting set.
Diffstat (limited to 'pkg/opengl')
-rw-r--r--pkg/opengl/Program.zig1
1 files changed, 1 insertions, 0 deletions
diff --git a/pkg/opengl/Program.zig b/pkg/opengl/Program.zig
index 3a2f2036a..824687e83 100644
--- a/pkg/opengl/Program.zig
+++ b/pkg/opengl/Program.zig
@@ -104,6 +104,7 @@ pub fn setUniform(
// Perform the correct call depending on the type of the value.
switch (@TypeOf(value)) {
+ bool => glad.context.Uniform1i.?(loc, if (value) 1 else 0),
comptime_int => glad.context.Uniform1i.?(loc, value),
f32 => glad.context.Uniform1f.?(loc, value),
@Vector(2, f32) => glad.context.Uniform2f.?(loc, value[0], value[1]),