Something like compile_shader(source: str, params: GlslangParams) should be sufficient.
A good starting point would be glslang --help, afterterwards you could simply create dataclass with all necessary fields to reduce size of code that has to be generated. I imagine something along the lines of:
from __future__ import annotations
from dataclasses import dataclass
from typing import Optional
@dataclass
class GlslangParams:
"""Glslang compiler command line parameters."""
shader_source: str | Path | StringIO
cascading_erros: bool = False
is_hlsl: bool = False
define_macros: Optional[dict[str, str]] = None
...
Something like
compile_shader(source: str, params: GlslangParams)
should be sufficient. A good starting point would beglslang --help
, afterterwards you could simply createdataclass
with all necessary fields to reduce size of code that has to be generated. I imagine something along the lines of: