Skip to content

Shader compilation in a Unity Build will fail if it exceeds the default compilation time limit #743

@sam-ln

Description

@sam-ln

Context

During a Unity Build, when trying to compile a complex shader that takes a lot of time to process, the operation will fail.
Shader error in 'Shader Graphs/ComplexShader': Compiler timed out. This can happen with extremely complex shaders or when the processing resources are limited. Try overriding the timeout with UNITY_SHADER_COMPILER_TASK_TIMEOUT_MINUTES environment variable. Error code 0x80000008 (Timed out).

Suggested solution

A parameter in the GitHub Action to set the UNITY_SHADER_COMPILER_TASK_TIMEOUT_MINUTES in the underlying docker container would be very helpful.

Considered alternatives

Alternatively, a feature to set ANY environment variable in the build container could work as well.

Additional details

This environment variable is not well documented, but a mention by Unity staff can be found here:
https://discussions.unity.com/t/long-shader-import-times-and-timeouts-when-too-many-variants-are-used/816566/2

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions