Search Unity

We have 'pragma skip_variants', can we also have a 'pragma only_variants' ?

Discussion in 'Shaders' started by Prodigga, Feb 25, 2018.

  1. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    We are making an 'uber' shader for the characters in our game. Just 5-6 keywords in and the compilation times are excruciatingly long.

    In our case, we know for a fact that we will only ever require variants of the shader that contain the DIRECTIONAL keyword.

    We can use skip_variants to skip specific variants, but there is no way to make the shader compiler skip all variants that do not contain a specific keyword.

    ie #pragma only_variants DIRECTIONAL

    This is already the case with the api for skipping specific renderers. We have pragma exclude_renderers and pragma only_renderers.
     
  2. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123