Profiling for material shaders

Moderator: GZDoom Developers

Post Reply
User avatar
Nash
 
 
Posts: 17439
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Profiling for material shaders

Post by Nash »

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?
dpJudas
 
 
Posts: 3040
Joined: Sat May 28, 2016 1:01 pm

Re: Profiling for material shaders

Post by dpJudas »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49066
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Profiling for material shaders

Post by Graf Zahl »

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.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”