Allow shader names with underscores

This commit is contained in:
Kovid Goyal 2025-08-13 07:10:16 +05:30
parent c01df574a2
commit d7ab6ad314
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
4 changed files with 3 additions and 3 deletions

View file

@ -1,2 +1,2 @@
uniform vec4 src_rect, dest_rect;
#pragma kitty_include_shader <blit_common_vertex.glsl>
#pragma kitty_include_shader <blit_common.glsl>

View file

@ -1,2 +1,2 @@
uniform vec4 src_rect, dest_rect;
#pragma kitty_include_shader <blit_common_vertex.glsl>
#pragma kitty_include_shader <blit_common.glsl>

View file

@ -1151,7 +1151,7 @@ def find_uniform_names(raw: str) -> Iterator[str]:
for x in sorted(glob.glob('kitty/*.glsl')):
name = os.path.basename(x).partition('.')[0]
name, sep, shader_type = name.partition('_')
name, sep, shader_type = name.rpartition('_')
if not sep or shader_type not in ('fragment', 'vertex'):
continue
class_names[name] = f'{name.capitalize()}Uniforms'