Skip to content

Commit 2dfe9db

Browse files
committed
ExtendedTools: Add scaling for shared GPU memory graphs
1 parent 073cd33 commit 2dfe9db

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
lines changed

plugins/ExtendedTools/gpuprprp.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -551,19 +551,19 @@ INT_PTR CALLBACK EtpGpuPageDlgProc(
551551
{
552552
FLOAT max = 0;
553553

554-
if (EtGpuSharedLimit != 0)
555-
{
556-
max = (FLOAT)EtGpuSharedLimit / PAGE_SIZE;
557-
}
554+
//if (EtGpuSharedLimit != 0)
555+
//{
556+
// max = (FLOAT)EtGpuSharedLimit / PAGE_SIZE;
557+
//}
558558

559559
for (ULONG i = 0; i < drawInfo->LineDataCount; i++)
560560
{
561-
FLOAT data1;
561+
FLOAT data;
562562

563-
context->MemorySharedGraphState.Data1[i] = data1 = (FLOAT)PhGetItemCircularBuffer_ULONG(&context->Block->MemorySharedHistory, i);
563+
context->MemorySharedGraphState.Data1[i] = data = (FLOAT)PhGetItemCircularBuffer_ULONG(&context->Block->MemorySharedHistory, i);
564564

565-
if (max < data1)
566-
max = data1;
565+
if (max < data)
566+
max = data;
567567
}
568568

569569
if (max != 0)

plugins/ExtendedTools/gpusys.c

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,6 @@ VOID EtpNotifyGpuGraph(
694694
drawInfo->LabelYFunctionParameter = max;
695695
}
696696

697-
698697
GpuGraphState.Valid = TRUE;
699698
}
700699
}
@@ -841,19 +840,24 @@ VOID EtpNotifySharedGraph(
841840

842841
if (!SharedGraphState.Valid)
843842
{
843+
FLOAT max = 0;
844+
845+
//if (EtGpuSharedLimit != 0)
846+
//{
847+
// max = (FLOAT)EtGpuSharedLimit / PAGE_SIZE;
848+
//}
849+
844850
for (i = 0; i < drawInfo->LineDataCount; i++)
845851
{
846-
SharedGraphState.Data1[i] = (FLOAT)PhGetItemCircularBuffer_ULONG64(&EtGpuSharedHistory, i);
852+
FLOAT data = SharedGraphState.Data1[i] = (FLOAT)PhGetItemCircularBuffer_ULONG64(&EtGpuSharedHistory, i);
853+
854+
if (max < data)
855+
max = data;
847856
}
848857

849-
if (EtGpuSharedLimit != 0)
858+
if (max != 0)
850859
{
851-
// Scale the data.
852-
PhDivideSinglesBySingle(
853-
SharedGraphState.Data1,
854-
(FLOAT)EtGpuSharedLimit,
855-
drawInfo->LineDataCount
856-
);
860+
PhDivideSinglesBySingle(SharedGraphState.Data1, max, drawInfo->LineDataCount);
857861
}
858862

859863
SharedGraphState.Valid = TRUE;

0 commit comments

Comments
 (0)