Allow running simple custom shaders without a pipeline file

This commit is contained in:
Kovid Goyal 2026-08-04 11:07:18 +05:30
parent ea30ecc3b9
commit dc67266fc7
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 11 additions and 3 deletions

View file

@ -1,3 +0,0 @@
startgroup
shaders sample sample
endgroup

View file

@ -253,6 +253,17 @@ class LoadShaderPrograms:
for k in self.custom_shaders:
try:
d = parse_pipeline(k)
except FileNotFoundError as e:
try:
get_custom_shader_src(k)
except Exception:
log_error(f'Failed to read custom shader pipeline definition from {k} with error: {e}')
continue
try:
d = parse_pipeline_definition(['startgroup', f' shaders {k}', 'endgroup'])
except Exception as e2:
log_error(f'Failed to build minimal shader pipeline for {k} with error: {e2}')
continue
except Exception as e:
log_error(f'Failed to read custom shader pipeline definition from {k} with error: {e}')
continue