2 // Copyright (c) Microsoft. All rights reserved.
3 // This code is licensed under the MIT License (MIT).
4 // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
5 // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
6 // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
7 // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
9 // Developed by Minigraph
11 // Author: James Stanard
20 namespace GpuTimeManager
22 void Initialize( uint32_t MaxNumTimers
= 4096 );
25 // Reserve a unique timer index
26 uint32_t NewTimer(void);
28 // Write start and stop time stamps on the GPU timeline
29 void StartTimer(CommandContext
& Context
, uint32_t TimerIdx
);
30 void StopTimer(CommandContext
& Context
, uint32_t TimerIdx
);
32 // Bookend all calls to GetTime() with Begin/End which correspond to Map/Unmap. This
33 // needs to happen either at the very start or very end of a frame.
34 void BeginReadBack(void);
35 void EndReadBack(void);
37 // Returns the time in milliseconds between start and stop queries
38 float GetTime(uint32_t TimerIdx
);