Add "previous" to MVKPerformanceTracker and save value before capturing "latest"
This commit is contained in:
parent
10400cdaf0
commit
11bd581c8d
@ -376,6 +376,7 @@ typedef struct {
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t count; /**< The number of activities of this type. */
|
uint32_t count; /**< The number of activities of this type. */
|
||||||
double latest; /**< The latest (most recent) value of the activity. */
|
double latest; /**< The latest (most recent) value of the activity. */
|
||||||
|
double previous; /**< The previous (second most recent) value of the activity. */
|
||||||
double average; /**< The average value of the activity. */
|
double average; /**< The average value of the activity. */
|
||||||
double minimum; /**< The minimum value of the activity. */
|
double minimum; /**< The minimum value of the activity. */
|
||||||
double maximum; /**< The maximum value of the activity. */
|
double maximum; /**< The maximum value of the activity. */
|
||||||
@ -427,10 +428,6 @@ typedef struct {
|
|||||||
* than your app was, the size of this structure in your app may be larger or smaller than the
|
* than your app was, the size of this structure in your app may be larger or smaller than the
|
||||||
* struct in MoltenVK. See the description of the vkGetPerformanceStatisticsMVK() function for
|
* struct in MoltenVK. See the description of the vkGetPerformanceStatisticsMVK() function for
|
||||||
* information about how to handle this.
|
* information about how to handle this.
|
||||||
*
|
|
||||||
* TO SUPPORT DYNAMIC LINKING TO THIS STRUCTURE AS DESCRIBED ABOVE, THIS STRUCTURE SHOULD NOT
|
|
||||||
* BE CHANGED EXCEPT TO ADD ADDITIONAL MEMBERS ON THE END. EXISTING MEMBERS, AND THEIR ORDER,
|
|
||||||
* SHOULD NOT BE CHANGED.
|
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
MVKShaderCompilationPerformance shaderCompilation; /** Shader compilations activities. */
|
MVKShaderCompilationPerformance shaderCompilation; /** Shader compilations activities. */
|
||||||
|
@ -4342,6 +4342,7 @@ void MVKDevice::applyMemoryBarrier(MVKPipelineBarrier& barrier,
|
|||||||
void MVKDevice::updateActivityPerformance(MVKPerformanceTracker& activity, double currentValue) {
|
void MVKDevice::updateActivityPerformance(MVKPerformanceTracker& activity, double currentValue) {
|
||||||
lock_guard<mutex> lock(_perfLock);
|
lock_guard<mutex> lock(_perfLock);
|
||||||
|
|
||||||
|
activity.previous = activity.latest;
|
||||||
activity.latest = currentValue;
|
activity.latest = currentValue;
|
||||||
activity.minimum = ((activity.minimum == 0.0)
|
activity.minimum = ((activity.minimum == 0.0)
|
||||||
? currentValue :
|
? currentValue :
|
||||||
@ -4364,12 +4365,13 @@ void MVKDevice::logActivityInline(MVKPerformanceTracker& activity, MVKPerformanc
|
|||||||
}
|
}
|
||||||
void MVKDevice::logActivityDuration(MVKPerformanceTracker& activity, MVKPerformanceStatistics& perfStats, bool isInline) {
|
void MVKDevice::logActivityDuration(MVKPerformanceTracker& activity, MVKPerformanceStatistics& perfStats, bool isInline) {
|
||||||
const char* fmt = (isInline
|
const char* fmt = (isInline
|
||||||
? "%s performance avg: %.3f ms, latest: %.3f ms, min: %.3f ms, max: %.3f ms, count: %d"
|
? "%s performance avg: %.3f ms, latest: %.3f ms, prev: %.3f ms, min: %.3f ms, max: %.3f ms, count: %d"
|
||||||
: " %-45s avg: %.3f ms, latest: %.3f ms, min: %.3f ms, max: %.3f ms, count: %d");
|
: " %-45s avg: %.3f ms, latest: %.3f ms, prev: %.3f ms, min: %.3f ms, max: %.3f ms, count: %d");
|
||||||
MVKLogInfo(fmt,
|
MVKLogInfo(fmt,
|
||||||
getActivityPerformanceDescription(activity, perfStats),
|
getActivityPerformanceDescription(activity, perfStats),
|
||||||
activity.average,
|
activity.average,
|
||||||
activity.latest,
|
activity.latest,
|
||||||
|
activity.previous,
|
||||||
activity.minimum,
|
activity.minimum,
|
||||||
activity.maximum,
|
activity.maximum,
|
||||||
activity.count);
|
activity.count);
|
||||||
@ -4377,12 +4379,13 @@ void MVKDevice::logActivityDuration(MVKPerformanceTracker& activity, MVKPerforma
|
|||||||
|
|
||||||
void MVKDevice::logActivityByteCount(MVKPerformanceTracker& activity, MVKPerformanceStatistics& perfStats, bool isInline) {
|
void MVKDevice::logActivityByteCount(MVKPerformanceTracker& activity, MVKPerformanceStatistics& perfStats, bool isInline) {
|
||||||
const char* fmt = (isInline
|
const char* fmt = (isInline
|
||||||
? "%s avg: %5llu MB, latest: %5llu MB, min: %5llu MB, max: %5llu MB, count: %d"
|
? "%s avg: %5llu MB, latest: %5llu MB, prev: %5llu MB, min: %5llu MB, max: %5llu MB, count: %d"
|
||||||
: " %-45s avg: %5llu MB, latest: %5llu MB, min: %5llu MB, max: %5llu MB, count: %d");
|
: " %-45s avg: %5llu MB, latest: %5llu MB, prev: %5llu MB, min: %5llu MB, max: %5llu MB, count: %d");
|
||||||
MVKLogInfo(fmt,
|
MVKLogInfo(fmt,
|
||||||
getActivityPerformanceDescription(activity, perfStats),
|
getActivityPerformanceDescription(activity, perfStats),
|
||||||
uint64_t(activity.average) / KIBI,
|
uint64_t(activity.average) / KIBI,
|
||||||
uint64_t(activity.latest) / KIBI,
|
uint64_t(activity.latest) / KIBI,
|
||||||
|
uint64_t(activity.previous) / KIBI,
|
||||||
uint64_t(activity.minimum) / KIBI,
|
uint64_t(activity.minimum) / KIBI,
|
||||||
uint64_t(activity.maximum) / KIBI,
|
uint64_t(activity.maximum) / KIBI,
|
||||||
activity.count);
|
activity.count);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user