Wait for GPU to be idle before measuring

This commit is contained in:
Antonio Niño Díaz 2022-10-11 18:17:55 +01:00
parent 307002d616
commit 79b065d8f6

View File

@ -214,6 +214,9 @@ int main(void)
draw_and_update_models();
// Wait for geometry engine operations to end
while (GFX_STATUS & BIT(27));
uint32_t end_time = cpuEndTiming();
const float us_per_frame = 1000000.0 / 60.0;
@ -221,9 +224,6 @@ int main(void)
end_time, timerTicks2usec(end_time),
100.0 * timerTicks2usec(end_time) / us_per_frame);
// Wait for geometry engine operations to end
while (GFX_STATUS & BIT(27));
printf("\x1b[23;0HPolys: %4d Vertices: %4d",
GFX_POLYGON_RAM_USAGE, GFX_VERTEX_RAM_USAGE);