mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
renderer/opengl: small tweaks
This commit is contained in:
@ -2365,13 +2365,10 @@ fn drawCustomPrograms(self: *OpenGL, custom_state: *custom.State) !void {
|
|||||||
|
|
||||||
// Go through each custom shader and draw it.
|
// Go through each custom shader and draw it.
|
||||||
for (custom_state.programs) |program| {
|
for (custom_state.programs) |program| {
|
||||||
// Bind our cell program state, buffers
|
|
||||||
const bind = try program.bind();
|
const bind = try program.bind();
|
||||||
defer bind.unbind();
|
defer bind.unbind();
|
||||||
try bind.draw();
|
try bind.draw();
|
||||||
|
try custom_state.copyFramebuffer();
|
||||||
// copy main and custom fbo
|
|
||||||
try custom_state.copy();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -230,12 +230,19 @@ pub const State = struct {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// copy the fbo's attached texture to the backbuffer
|
/// Copy the fbo's attached texture to the backbuffer.
|
||||||
pub fn copy(self: *State) !void {
|
pub fn copyFramebuffer(self: *State) !void {
|
||||||
const texbind = try self.fb_texture.bind(.@"2D");
|
const texbind = try self.fb_texture.bind(.@"2D");
|
||||||
errdefer texbind.unbind();
|
errdefer texbind.unbind();
|
||||||
|
try texbind.copySubImage2D(
|
||||||
try texbind.copySubImage2D(0, 0, 0, 0, 0, @intFromFloat(self.uniforms.resolution[0]), @intFromFloat(self.uniforms.resolution[1]));
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
@intFromFloat(self.uniforms.resolution[0]),
|
||||||
|
@intFromFloat(self.uniforms.resolution[1]),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const Binding = struct {
|
pub const Binding = struct {
|
||||||
|
Reference in New Issue
Block a user