def _add_shader_defines(shaderstr, defines):
    """
    Add Define for enabling some functions
    Args:
        shaderstr:
        defines:

    Returns:

    """
    shaderlines = shaderstr.split('\n')

    for line in shaderlines:
        if '#version' in line:
            version_line = line
            break
    else:
        raise RuntimeError('Failed to find GLSL version string')
    shaderlines.remove(version_line)

    define_lines = [f'#define {define} {value}' for define, value in defines.items()]

    return '\n'.join([version_line] + define_lines + ['#line 1'] + shaderlines)

    Add Define for enabling some functions
    Args:
        shaderstr:
        defines:

    Returns:

    
metadrive/third_party/simplepbr/__init__.py