Pass:getStats
EditReturns statistics for the Pass.
stats = Pass:getStats()
Arguments
None
Returns
Name | Type | Description |
stats | table | A table with statistics. |
.draws | number | The number of draws added to the Pass. |
.computes | number | The number of compute calls added to the Pass. |
.drawsCulled | number | The number of draw calls that were culled the last time the Pass was submitted. |
.cpuMemoryReserved | number | The amount of CPU memory the Pass has reserved, in bytes. |
.cpuMemoryUsed | number | The amount of CPU memory the Pass is currently using, in bytes. |
.submitTime | number |
The amount of time taken on the CPU to submit the Pass the last time it was submitted, in seconds. Only updates when timing stats have been enabled with lovr.graphics.setTimingEnabled , and has a few frames of delay.
|
.gpuTime | number |
The amount of time taken on the GPU to process the Pass, in seconds. Only updates when timing stats have been enabled with lovr.graphics.setTimingEnabled , and has a few frames of delay.
|
Example
See how long it takes the GPU to render a cube.
lovr.graphics.setTimingEnabled(true)
function lovr.draw(pass)
pass:cube(0, 1.7, -1, .5, lovr.timer.getTime() * .2, 0, 1, 0)
local stats = pass:getStats()
print(('Rendering a cube takes %f microseconds'):format(stats.gpuTime * 1e6))
end