Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very long compile times through the API #3776

Open
cyanreg opened this issue Oct 26, 2024 · 0 comments
Open

Very long compile times through the API #3776

cyanreg opened this issue Oct 26, 2024 · 0 comments
Assignees

Comments

@cyanreg
Copy link
Contributor

cyanreg commented Oct 26, 2024

Hi,

For the two attached compute shaders, using the API to compile takes about a full minute.

    const glslang_input_t glslc_input = {
        .language                          = GLSLANG_SOURCE_GLSL,
        .stage                             = glslc_stage[shd->stage],
        .client                            = GLSLANG_CLIENT_VULKAN,
        .client_version                    = GLSLANG_TARGET_VULKAN_1_3,
        .target_language_version           = GLSLANG_TARGET_SPV_1_6,
        .target_language                   = GLSLANG_TARGET_SPV,
        .code                              = shd->src.str,
        .default_version                   = 460,
        .default_profile                   = GLSLANG_NO_PROFILE,
        .force_default_version_and_profile = false,
        .forward_compatible                = false,
        .messages                          = GLSLANG_MSG_DEFAULT_BIT,
        .resource                          = &glslc_resource_limits,
    };

    glslang_spv_options_t glslc_opts = {
        .generate_debug_info = 1,
        .emit_nonsemantic_shader_debug_info = 1,
        .emit_nonsemantic_shader_debug_source = 1,
        .disable_optimizer = 0,
        .strip_debug_info = 0,
        .optimize_size = 0,
        .disassemble = 0,
        .validate = 1,
        .compile_only = 0,
    };

    glslang_shader_create()

    glslang_shader_preprocess()

    glslang_shader_parse()

    glslang_program_create()

    glslang_program_add_shader()

    glslang_program_link()

    glslang_program_SPIRV_generate_with_options()

slow.txt
slow2.txt

Using the compile time is much faster. But we build and compile our shaders during runtime. Hence a minute is unacceptable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants