From 5c735c123ae407920d49b7ed39689fe5317145c6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 20 Jun 2023 17:31:25 +0530 Subject: [PATCH] Fix defines in loading of graphics shader --- kitty/shaders.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kitty/shaders.py b/kitty/shaders.py index 1e6204fbd..8f8b5c6d0 100644 --- a/kitty/shaders.py +++ b/kitty/shaders.py @@ -195,14 +195,14 @@ class LoadShaderPrograms: graphics = program_for('graphics') def resolve_graphics_fragment_defines(which: str, f: str) -> str: - return f.replace('ALPHA_TYPE', which) + return f.replace('#define ALPHA_TYPE', f'#define {which}', 1) for which, p in { 'SIMPLE': GRAPHICS_PROGRAM, 'PREMULT': GRAPHICS_PREMULT_PROGRAM, 'ALPHA_MASK': GRAPHICS_ALPHA_MASK_PROGRAM, }.items(): - graphics.apply_to_sources(frag=partial(resolve_cell_fragment_defines, which)) + graphics.apply_to_sources(frag=partial(resolve_graphics_fragment_defines, which)) graphics.compile(p, allow_recompile) program_for('bgimage').compile(BGIMAGE_PROGRAM, allow_recompile)