mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
renderer/metal: don't draw with zero instances
This commit is contained in:
@ -816,7 +816,7 @@ pub fn drawFrame(self: *Metal, surface: *apprt.Surface) !void {
|
|||||||
// Wait for a frame to be available.
|
// Wait for a frame to be available.
|
||||||
const frame = self.gpu_state.nextFrame();
|
const frame = self.gpu_state.nextFrame();
|
||||||
errdefer self.gpu_state.releaseFrame();
|
errdefer self.gpu_state.releaseFrame();
|
||||||
//log.debug("drawing frame index={}", .{self.gpu_state.frame_index});
|
// log.debug("drawing frame index={}", .{self.gpu_state.frame_index});
|
||||||
|
|
||||||
// Setup our frame data
|
// Setup our frame data
|
||||||
try frame.uniforms.sync(self.gpu_state.device, &.{self.uniforms});
|
try frame.uniforms.sync(self.gpu_state.device, &.{self.uniforms});
|
||||||
@ -1227,6 +1227,10 @@ fn drawCells(
|
|||||||
buf: CellBuffer,
|
buf: CellBuffer,
|
||||||
len: usize,
|
len: usize,
|
||||||
) !void {
|
) !void {
|
||||||
|
// This triggers an assertion in the Metal API if we try to draw
|
||||||
|
// with an instance count of 0 so just bail.
|
||||||
|
if (len == 0) return;
|
||||||
|
|
||||||
// Use our shader pipeline
|
// Use our shader pipeline
|
||||||
encoder.msgSend(
|
encoder.msgSend(
|
||||||
void,
|
void,
|
||||||
|
Reference in New Issue
Block a user