Profiling for material shaders
Moderator: GZDoom Developers
Profiling for material shaders
Can we have some kind of console command, similar to stat gpu, that lets us profile the performance of the material shaders currently in view?
Re: Profiling for material shaders
The gpu stat command works by taking a timestamp at the start of a pass and then again when it finishes. The delta is the time that pass took.
This is tricky for the scene passes as they tend to be CPU bound and whenever the GPU is stalled by that it will look like the scene stuff is extra expensive for the GPU to do. In any case, I fear the overhead of trying to time things at the material shader level might be too great.
This is tricky for the scene passes as they tend to be CPU bound and whenever the GPU is stalled by that it will look like the scene stuff is extra expensive for the GPU to do. In any case, I fear the overhead of trying to time things at the material shader level might be too great.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Profiling for material shaders
This is pretty much impossible.
First, the material shaders are only a tiny subfunction of the large main shader, and therefore hard to isolate and second, the way batching works, their execution is mostly asynchronous to the actual drawcall. At best you'd pretty much kill performance if you try to query a timer before the actual draw call has been performed because you'd have to repeatedly stall the render pipeline.
First, the material shaders are only a tiny subfunction of the large main shader, and therefore hard to isolate and second, the way batching works, their execution is mostly asynchronous to the actual drawcall. At best you'd pretty much kill performance if you try to query a timer before the actual draw call has been performed because you'd have to repeatedly stall the render pipeline.