Profiling a graphics rendering without a profiler

前端 未结 2 1860
天涯浪人
天涯浪人 2021-02-03 12:37

Nowadays we have pretty advanced tools to iron out rendering, allowing to see the different stages, time taken by draw calls, etc. But without them the graphics pipeline is quit

2条回答
  •  灰色年华
    2021-02-03 13:25

    Frame time rendering time

    Absolute time spent for small code/stage/etc. is not that relevant as GPU driver optimization/batching/parallelism/version makes it nearly impossible to have precise code measure without GPU counters. (which you can get if you use with vendors libs)

    What you can measure easily is each single code change impact. You'll only get relative impact, and it's what you really need anyway. And that just using frame rendering time.

    Ideally you should aim be able can edit shader or pipeline code during runtime, and have a direct way to check impact over a whole typical scene, like just comparing graphs between several code path. (beware of static scenes, otherwise you'll end with highly optimized static views, but poor dynamic scenes performance)

    Here's the swiss army knife list:

    • scene states loader
    • scene recorder (camera paths/add-remove entities,texture, mesh, fake input, etc.) using scene states.
    • scene states saver
    • scene frame time logger (not just final average but each frame rendering time)
    • on-the-fly shader code reload
    • on-the-fly codepath switch
    • frame time log reader+graphs+statistic framework

    Note that scene state load/save/record are handy for a lot of other things, from debugging to undo/redo to on-the-fly reload, not to mention savegames. Add a screenshot taker + image diff, and you can unit test graphic code too.

    If you can, add that to your CI server so that huge code impact doesn't go unnoticed. (helps also artists when they check-in their assets, without evaluating rendering impact) A must read on that related CI graphic test work is there : http://aras-p.info/blog/2011/06/17/testing-graphics-code-4-years-later/

提交回复
热议问题