Handle array uniforms when fixing GLSL

This commit is contained in:
Kovid Goyal 2026-07-01 15:04:55 +05:30
parent ddc012394e
commit b656fc4ec5
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -383,6 +383,7 @@ def fixup_opengl_code(glsl_code: str) -> tuple[str, dict[str, str]]:
ans = '\n'.join(lines)
for block_name, names in uniform_blocks.items():
for u in names:
u = u.partition('[')[0]
ans = ans.replace(f'{block_name}.{u}', u)
ans = ans.replace('gl_VertexIndex', 'gl_VertexID')
ans = ans.replace('gl_BaseVertex', '0')