@@ -257,16 +257,18 @@ impl Renderer { |
| 257 | 257 | }); |
| 258 | 258 | |
| 259 | 259 | // Create vertex/index buffers |
| 260 | + // Size calculation: 300 cols × 100 rows × 4 quads/cell × 4 verts × 36 bytes = ~17MB |
| 261 | + // Use 16MB for vertices and 8MB for indices to support large/high-DPI displays |
| 260 | 262 | let vertex_buffer = gpu.device.create_buffer(&wgpu::BufferDescriptor { |
| 261 | 263 | label: Some("vertex_buffer"), |
| 262 | | - size: 1024 * 1024, // 1MB |
| 264 | + size: 16 * 1024 * 1024, // 16MB |
| 263 | 265 | usage: wgpu::BufferUsages::VERTEX | wgpu::BufferUsages::COPY_DST, |
| 264 | 266 | mapped_at_creation: false, |
| 265 | 267 | }); |
| 266 | 268 | |
| 267 | 269 | let index_buffer = gpu.device.create_buffer(&wgpu::BufferDescriptor { |
| 268 | 270 | label: Some("index_buffer"), |
| 269 | | - size: 512 * 1024, // 512KB |
| 271 | + size: 8 * 1024 * 1024, // 8MB |
| 270 | 272 | usage: wgpu::BufferUsages::INDEX | wgpu::BufferUsages::COPY_DST, |
| 271 | 273 | mapped_at_creation: false, |
| 272 | 274 | }); |
@@ -991,15 +993,25 @@ impl Renderer { |
| 991 | 993 | bg_color, |
| 992 | 994 | 0.0, |
| 993 | 995 | ); |
| 994 | | - } else if cell.bg != CellColor::Default { |
| 996 | + } else if cell.bg != CellColor::Default && cell.bg != CellColor::Indexed(0) { |
| 997 | + // Skip Default and Indexed(0) - ANSI black as background typically means |
| 998 | + // "use terminal background" in ncurses/TUI apps |
| 995 | 999 | let bg_color = self.color_to_rgba(&cell.bg, false); |
| 996 | | - self.add_quad( |
| 997 | | - to_ndc_x(x), to_ndc_y(y), |
| 998 | | - to_ndc_x(x + cell_w), to_ndc_y(y + cell_h), |
| 999 | | - 0.0, 0.0, 0.0, 0.0, |
| 1000 | | - bg_color, |
| 1001 | | - 0.0, |
| 1002 | | - ); |
| 1000 | + let default_bg = self.colors.background.to_rgba(); |
| 1001 | + // Skip if background is close to terminal default (handles editor themes |
| 1002 | + // that set their own "background" color) |
| 1003 | + let is_similar = (bg_color[0] - default_bg[0]).abs() < 0.15 |
| 1004 | + && (bg_color[1] - default_bg[1]).abs() < 0.15 |
| 1005 | + && (bg_color[2] - default_bg[2]).abs() < 0.15; |
| 1006 | + if !is_similar { |
| 1007 | + self.add_quad( |
| 1008 | + to_ndc_x(x), to_ndc_y(y), |
| 1009 | + to_ndc_x(x + cell_w), to_ndc_y(y + cell_h), |
| 1010 | + 0.0, 0.0, 0.0, 0.0, |
| 1011 | + bg_color, |
| 1012 | + 0.0, |
| 1013 | + ); |
| 1014 | + } |
| 1003 | 1015 | } |
| 1004 | 1016 | |
| 1005 | 1017 | // Character (if not space or null) |