| 10 | /// Object that stores various render statistics. |
| 11 | /// </summary> |
| 12 | API_STRUCT() struct RenderStatsData |
| 13 | { |
| 14 | DECLARE_SCRIPTING_TYPE_MINIMAL(RenderStatsData); |
| 15 | |
| 16 | /// <summary> |
| 17 | /// The draw calls count. |
| 18 | /// </summary> |
| 19 | API_FIELD() int64 DrawCalls; |
| 20 | |
| 21 | /// <summary> |
| 22 | /// The compute shader dispatch calls count. |
| 23 | /// </summary> |
| 24 | API_FIELD() int64 DispatchCalls; |
| 25 | |
| 26 | /// <summary> |
| 27 | /// The vertices drawn count. |
| 28 | /// </summary> |
| 29 | API_FIELD() int64 Vertices; |
| 30 | |
| 31 | /// <summary> |
| 32 | /// The triangles drawn count. |
| 33 | /// </summary> |
| 34 | API_FIELD() int64 Triangles; |
| 35 | |
| 36 | /// <summary> |
| 37 | /// The pipeline state changes count. |
| 38 | /// </summary> |
| 39 | API_FIELD() int64 PipelineStateChanges; |
| 40 | |
| 41 | /// <summary> |
| 42 | /// Initializes a new instance of the <see cref="RenderStatsData"/> struct. |
| 43 | /// </summary> |
| 44 | RenderStatsData() |
| 45 | : DrawCalls(0) |
| 46 | , DispatchCalls(0) |
| 47 | , Vertices(0) |
| 48 | , Triangles(0) |
| 49 | , PipelineStateChanges(0) |
| 50 | { |
| 51 | } |
| 52 | |
| 53 | /// <summary> |
| 54 | /// The global rendering stats counter. |
| 55 | /// </summary> |
| 56 | static RenderStatsData Counter; |
| 57 | |
| 58 | /// <summary> |
| 59 | /// Mixes the stats with the current state. Perform operation: this = currentState - this, but without additional stack allocations. |
| 60 | /// </summary> |
| 61 | /// <param name="currentState">The current state.</param> |
| 62 | void Mix(const RenderStatsData& currentState) |
| 63 | { |
| 64 | #define MIX(name) name = currentState.name - name |
| 65 | MIX(DrawCalls); |
| 66 | MIX(DispatchCalls); |
| 67 | MIX(Vertices); |
| 68 | MIX(Triangles); |
| 69 | MIX(PipelineStateChanges); |
no outgoing calls
no test coverage detected