Search Unity

Question How to use ShaderWarmup.WarmupShaderFromCollection

Discussion in 'Shaders' started by TomTheMan59, Dec 15, 2023.

  1. TomTheMan59

    TomTheMan59

    Joined:
    Mar 8, 2021
    Posts:
    356
    I am trying hard to use this:

    https://docs.unity3d.com/ScriptRefe....ShaderWarmup.WarmupShaderFromCollection.html

    I don't know why it's asking for a ShaderVariantCollection and then asking for a shader? The shaders are in the collection.

    I also am confused about the

    Unity needs more information to correctly build GPU representations of the shader variants ('pipeline state objects' or PSOs) if your application runs on one of the following graphics APIs:

    • DirectX 12
    • Metal
    • Vulkan
    How do I know what graphics API and then how to get the vertex data for each shader?

    Help please anyone!
     
    alexandre-fiset likes this.
  2. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,028
    This method is there to warmup a single shader.

    https://docs.unity3d.com/ScriptReference/SystemInfo-graphicsDeviceType.html

    https://docs.unity3d.com/ScriptReference/Mesh-vertexAttributeCount.html
     
    TomTheMan59 likes this.
  3. TomTheMan59

    TomTheMan59

    Joined:
    Mar 8, 2021
    Posts:
    356
    Thank you sir!