Search Unity

How to Measure Shader Performance without Profiler?

Discussion in 'Shaders' started by nativehfQ, Apr 25, 2019.

  1. nativehfQ

    nativehfQ

    Joined:
    Nov 1, 2017
    Posts:
    11
    Hi, Is there a way to measure how long a Shader takes to perform a certain action, e.g. apply color or add 100000 times? And trying to do that without any external tools (Unity Profiler and such)

    What I am trying to do right now is to get _Time.y difference between when a function starts and ends, but I don't know how to pull that information from Shader to C#. Is there a way to do that? In fact, is that even something that makes sense for what I am trying to do? Thank you!

    Would really appreciate examples and/or suggestions.