interface GlslangCompiler {
    getVersion(): string;
    glsl300es_preprocess(glslSource: string, stage: "compute" | "vertex" | "fragment"): {
        info_log: string;
        preprocessed_code: string;
        success: boolean;
    };
    glsl450_combine_to_spirv(glslSource: string, stage: "compute" | "vertex" | "fragment", splitSampler: boolean): {
        info_log: string;
        spirv: Uint32Array;
        success: boolean;
    };
    glsl450_to_spirv(glslSource: string, stage: "compute" | "vertex" | "fragment"): {
        info_log: string;
        spirv: Uint32Array;
        success: boolean;
    };
    preprocess_compute(glslSource: string, stage: "compute"): {
        info_log: string;
        preprocessed_code: string;
        samplers: Map<string, {
            type: string;
        }>;
        ssbos: Map<string, "readonly" | "writeonly" | "readwrite">;
        success: boolean;
        ubos: Map<string, string>;
        uniforms: Map<string, {
            access?: "readonly" | "writeonly" | "readwrite";
            format?: string;
            type: string;
        }>;
    };
}

方法

  • 参数

    • glslSource: string
    • stage: "compute"

    返回 {
        info_log: string;
        preprocessed_code: string;
        samplers: Map<string, {
            type: string;
        }>;
        ssbos: Map<string, "readonly" | "writeonly" | "readwrite">;
        success: boolean;
        ubos: Map<string, string>;
        uniforms: Map<string, {
            access?: "readonly" | "writeonly" | "readwrite";
            format?: string;
            type: string;
        }>;
    }

    • info_log: string
    • preprocessed_code: string
    • samplers: Map<string, {
          type: string;
      }>
    • ssbos: Map<string, "readonly" | "writeonly" | "readwrite">
    • success: boolean
    • ubos: Map<string, string>
    • uniforms: Map<string, {
          access?: "readonly" | "writeonly" | "readwrite";
          format?: string;
          type: string;
      }>