From b894a4bd3438c40a7ae736f6ef1af1a412f3c60d Mon Sep 17 00:00:00 2001 From: NaliLord Date: Thu, 8 Oct 2020 00:05:33 +0200 Subject: [PATCH] Added Measures for Driver Version and Date. --- Common/adl.pas | 55 +++++++++++++++------ Common/d3dkmt.pas | 49 ++++++++++++++++--- Plugin/AMDPlugin.dpr | 108 +++++++++++++++++++---------------------- Plugin/AMDPlugin.dproj | 10 ++-- Plugin/AMDPlugin.res | Bin 904 -> 900 bytes Testing/Main.dfm | 61 +++++++++++++++++++++-- Testing/Main.pas | 13 ++++- 7 files changed, 205 insertions(+), 91 deletions(-) diff --git a/Common/adl.pas b/Common/adl.pas index add82a3..88b91c2 100644 --- a/Common/adl.pas +++ b/Common/adl.pas @@ -18,7 +18,7 @@ interface uses - Winapi.Windows, System.SysUtils, System.Generics.Collections, adl_structures, adl_defines, adl_sdk; + Winapi.Windows, System.SysUtils, System.Classes, System.Win.Registry, System.Generics.Collections, adl_structures, adl_defines, adl_sdk; type TADLAdapter = class @@ -52,6 +52,8 @@ TADLAdapter = class FBusSpeed: Integer; FBusLanes: Integer; FBusLanesMax: Integer; + FDriverDate: String; + FDriverVersion: String; public function IsLocation(ABusNumber, ADeviceNumber, AFunctionNumber: Integer): Boolean; property PNP: String read FPNP; @@ -81,6 +83,8 @@ TADLAdapter = class property BusSpeed: Integer read FBusSpeed; property BusLanes: Integer read FBusLanes; property BusLanesMax: Integer read FBusLanesMax; + property DriverDate: String read FDriverDate; + property DriverVersion: String read FDriverVersion; end; TADL = class @@ -225,6 +229,7 @@ procedure TADL.Initialize; procedure TADL.Update; var + Registry: TRegistry; Adapter: TADLAdapter; I, AdapterActive, IsSupported, IsEnabled, Version: Integer; BiosInfo: TADLBiosInfo; @@ -261,21 +266,39 @@ procedure TADL.Update; FAdapter_MemoryInfo(AdapterInfo.iAdapterIndex, MemoryInfo); Adapter:=TADLAdapter.Create; - Adapter.FBiosPartNumber:=String(AnsiString(BiosInfo.strPartNumber)); - Adapter.FBiosVersion:=String(AnsiString(BiosInfo.strVersion)); - Adapter.FBiosDate:=String(AnsiString(BiosInfo.strDate)); - Adapter.FMemorySize:=MemoryInfo.iMemorySize; - Adapter.FMemoryType:=String(AnsiString(MemoryInfo.strMemoryType)); - Adapter.FMemoryBandwidth:=MemoryInfo.iMemoryBandwidth; - Adapter.FIndex:=AdapterInfo.iAdapterIndex; - Adapter.FName:=String(AnsiString(AdapterInfo.strAdapterName)); - Adapter.FPNP:=String(AnsiString(AdapterInfo.strPNPString)); - Adapter.FDisplay:=String(AnsiString(AdapterInfo.strDisplayName)); - Adapter.FBusNumber:=AdapterInfo.iBusNumber; - Adapter.FDeviceNumber:=AdapterInfo.iDeviceNumber; - Adapter.FFunctionNumber:=AdapterInfo.iFunctionNumber; - Adapter.FUpdate:=True; - FAdapters.Add(Adapter); + try + Adapter.FUpdate:=True; + + Adapter.FBiosPartNumber:=String(AnsiString(BiosInfo.strPartNumber)); + Adapter.FBiosVersion:=String(AnsiString(BiosInfo.strVersion)); + Adapter.FBiosDate:=String(AnsiString(BiosInfo.strDate)); + Adapter.FMemorySize:=MemoryInfo.iMemorySize; + Adapter.FMemoryType:=String(AnsiString(MemoryInfo.strMemoryType)); + Adapter.FMemoryBandwidth:=MemoryInfo.iMemoryBandwidth; + Adapter.FIndex:=AdapterInfo.iAdapterIndex; + Adapter.FName:=String(AnsiString(AdapterInfo.strAdapterName)); + Adapter.FPNP:=String(AnsiString(AdapterInfo.strPNPString)); + Adapter.FDisplay:=String(AnsiString(AdapterInfo.strDisplayName)); + Adapter.FBusNumber:=AdapterInfo.iBusNumber; + Adapter.FDeviceNumber:=AdapterInfo.iDeviceNumber; + Adapter.FFunctionNumber:=AdapterInfo.iFunctionNumber; + + Registry:=TRegistry.Create(KEY_READ); + try + Registry.RootKey:=HKEY_LOCAL_MACHINE; + if Registry.OpenKey(StringReplace(String(AnsiString(PAnsiChar(@AdapterInfo.strDriverPath[0]))), '\Registry\Machine\', '', [rfIgnoreCase]), False) then + try + Adapter.FDriverDate:=Registry.ReadString('DriverDate'); + Adapter.FDriverVersion:=Registry.ReadString('DriverVersion'); + finally + Registry.CloseKey; + end; + finally + FreeAndNil(Registry); + end; + finally + FAdapters.Add(Adapter); + end; end; if Assigned(Adapter) AND Adapter.FUpdate then diff --git a/Common/d3dkmt.pas b/Common/d3dkmt.pas index 13c2408..52c11ba 100644 --- a/Common/d3dkmt.pas +++ b/Common/d3dkmt.pas @@ -16,7 +16,7 @@ interface uses - Winapi.Windows, System.SysUtils, d3dkmthk; + Winapi.Windows, System.SysUtils, System.Classes, d3dkmthk; type TD3DKMTStatistics = class @@ -24,8 +24,13 @@ TD3DKMTStatistics = class FDeviceName: String; FInitialized: Boolean; FOpenAdapter: D3DKMT_OPENADAPTERFROMDEVICENAME; - FUsedMemory: UInt64; FSegments: Cardinal; + FNodeCount: Cardinal; + FMemoryUsage: UInt64; + FSharedLimit: UInt64; + FDedicatedLimit: UInt64; + FSharedUsage: UInt64; + FDedicatedUsage: UInt64; protected procedure Initialize; procedure Finalize; @@ -33,7 +38,11 @@ TD3DKMTStatistics = class constructor Create(ADevicePNP: String); destructor Destroy; override; procedure Update; - property UsedMemory: UInt64 read FUsedMemory; + property MemoryUsage: UInt64 read FMemoryUsage; + property SharedLimit: UInt64 read FSharedLimit; + property DedicatedLimit: UInt64 read FDedicatedLimit; + property SharedUsage: UInt64 read FSharedUsage; + property DedicatedUsage: UInt64 read FDedicatedUsage; end; implementation @@ -76,14 +85,18 @@ procedure TD3DKMTStatistics.Initialize; ZeroMemory(@FOpenAdapter, SizeOf(FOpenAdapter)); FOpenAdapter.pDeviceName:=PChar(FDeviceName); + if Succeeded(D3DKMTOpenAdapterFromDeviceName(FOpenAdapter)) then begin ZeroMemory(@QueryStats, SizeOf(QueryStats)); QueryStats.Typ:=D3DKMT_QUERYSTATISTICS_ADAPTER; QueryStats.AdapterLuid:=FOpenAdapter.AdapterLuid; + if Succeeded(D3DKMTQueryStatistics(QueryStats)) then - FSegments:=QueryStats.QueryResult.AdapterInformation.NbSegments - else + begin + FSegments:=QueryStats.QueryResult.AdapterInformation.NbSegments; + FNodeCount:=QueryStats.QueryResult.AdapterInformation.NodeCount; + end else Finalize; end else Finalize; @@ -93,8 +106,13 @@ procedure TD3DKMTStatistics.Update; var I: Integer; QueryStats: D3DKMT_QUERYSTATISTICS; + CommitLimit, BytesCommitted: UInt64; begin - FUsedMemory:=0; + FMemoryUsage:=0; + FSharedLimit:=0; + FDedicatedLimit:=0; + FSharedUsage:=0; + FDedicatedUsage:=0; if FInitialized then begin @@ -104,8 +122,25 @@ procedure TD3DKMTStatistics.Update; QueryStats.Typ:=D3DKMT_QUERYSTATISTICS_SEGMENT; QueryStats.AdapterLuid:=FOpenAdapter.AdapterLuid; QueryStats.QuerySegment.SegmentId:=I; + if Succeeded(D3DKMTQueryStatistics(QueryStats)) then - Inc(FUsedMemory, QueryStats.QueryResult.SegmentInformation.BytesResident); + begin + Inc(FMemoryUsage, QueryStats.QueryResult.SegmentInformation.BytesResident); + + CommitLimit:=QueryStats.QueryResult.SegmentInformation.CommitLimit; + BytesCommitted:=QueryStats.QueryResult.SegmentInformation.BytesCommitted; + BytesCommitted:=QueryStats.QueryResult.SegmentInformation.BytesResident; + + if QueryStats.QueryResult.SegmentInformation.Aperture <> 0 then + begin + Inc(FSharedLimit, CommitLimit); + Inc(FSharedUsage, BytesCommitted); + end else + begin + Inc(FDedicatedLimit, CommitLimit); + Inc(FDedicatedUsage, BytesCommitted); + end; + end; end; end; end; diff --git a/Plugin/AMDPlugin.dpr b/Plugin/AMDPlugin.dpr index 92e37ca..bd1d2b5 100644 --- a/Plugin/AMDPlugin.dpr +++ b/Plugin/AMDPlugin.dpr @@ -2,8 +2,15 @@ { } { AMDPlugin - Rainmeter AMD GPU Plugin } { } -{ Version 0.2 } +{ Version 0.3 } { } +{ 2020-10-07 - 0.3 } +{ Added "DriverDate" Measure } +{ Added "DriverVersion" Measure } +{ Added "SharedLimit" Measure } +{ Added "SharedUsage" Measure } +{ Added "DedicatedLimit" Measure } +{ Added "DedicatedUsage" Measure } { 2020-10-05 - 0.2 } { Added "MemoryUsage" Measure } { 2020-10-03 - 0.1 } @@ -37,16 +44,16 @@ const type TMeasureID = (Unknown, Temperature, Clock, MemoryClock, Voltage, Activity, PerformanceLevel, PCIECurrentBusSpeed, PCIECurrentBusLanes, PCIEMaxBusLanes, FanSpeedRPM, FanSpeedPercent, MemoryType, - MemorySize, MemoryUsage, MemoryBandwidth, AdapterName, AdapterActive, FanSpeedPercentMin, FanSpeedPercentMax, - FanSpeedRPMMin, FanSpeedRPMMax, BiosDate, BiosVersion, BiosPartNumber, AdapterIdentifier, NumberOfAdapters, - NumberOfDisplays); + MemorySize, MemoryUsage, SharedLimit, DedicatedLimit, SharedUsage, DedicatedUsage, MemoryBandwidth, AdapterName, + AdapterActive, FanSpeedPercentMin, FanSpeedPercentMax, FanSpeedRPMMin, FanSpeedRPMMax, BiosDate, BiosVersion, + BiosPartNumber, AdapterIdentifier, NumberOfAdapters, NumberOfDisplays, DriverDate, DriverVersion); const MEASUREID_NAMES: Array[TMeasureID] of String = ('Unknown', 'Temperature', 'Clock', 'MemoryClock', 'Voltage', 'Activity', 'PerformanceLevel', 'PCIECurrentBusSpeed', 'PCIECurrentBusLanes', 'PCIEMaxBusLanes', 'FanSpeedRPM', 'FanSpeedPercent', 'MemoryType', - 'MemorySize', 'MemoryUsage', 'MemoryBandwidth', 'AdapterName', 'AdapterActive', 'FanSpeedPercentMin', 'FanSpeedPercentMax', - 'FanSpeedRPMMin', 'FanSpeedRPMMax', 'BiosDate', 'BiosVersion', 'BiosPartNumber', 'AdapterIdentifier', 'NumberOfAdapters', - 'NumberOfDisplays'); + 'MemorySize', 'MemoryUsage', 'SharedLimit', 'DedicatedLimit', 'SharedUsage', 'DedicatedUsage', 'MemoryBandwidth', 'AdapterName', + 'AdapterActive', 'FanSpeedPercentMin', 'FanSpeedPercentMax', 'FanSpeedRPMMin', 'FanSpeedRPMMax', 'BiosDate', 'BiosVersion', + 'BiosPartNumber', 'AdapterIdentifier', 'NumberOfAdapters', 'NumberOfDisplays', 'DriverDate', 'DriverVersion'); type TMeasure = class @@ -108,15 +115,17 @@ begin MeasureUpdate; Measure:=TMeasure.Create; - Measure.Name:=RmReadString(ARm, 'MeasureID', '', True); - Measure.ID:=TMeasureID(Max(0, IndexStr(Measure.Name, MEASUREID_NAMES))); - Measure.Adapter:=Trunc(RmReadFormula(ARm, 'AdapterID', 0)); - - if Measure.ID = MemoryUsage then - if (Measure.Adapter >= 0) AND (Measure.Adapter < ADL.AdapterCount) then - Measure.D3DKMT:=TD3DKMTStatistics.Create(ADL.Adapters[Measure.Adapter].PNP); - - List.Add(Measure); + try + Measure.Name:=RmReadString(ARm, 'MeasureID', '', True); + Measure.ID:=TMeasureID(Max(0, IndexStr(Measure.Name, MEASUREID_NAMES))); + Measure.Adapter:=Trunc(RmReadFormula(ARm, 'AdapterID', 0)); + + if Measure.ID IN [MemoryUsage, SharedLimit, DedicatedLimit, SharedUsage, DedicatedUsage] then + if (Measure.Adapter >= 0) AND (Measure.Adapter < ADL.AdapterCount) then + Measure.D3DKMT:=TD3DKMTStatistics.Create(ADL.Adapters[Measure.Adapter].PNP); + finally + List.Add(Measure); + end; AData:=Measure; end; @@ -141,7 +150,6 @@ begin if (Measure.Adapter >= 0) AND (Measure.Adapter < ADL.AdapterCount) then begin case Measure.ID of - Unknown : ; Temperature : Result:=ADL.Adapters[Measure.Adapter].Temp; Clock : Result:=ADL.Adapters[Measure.Adapter].Clock; MemoryClock : Result:=ADL.Adapters[Measure.Adapter].Memory; @@ -153,22 +161,18 @@ begin PCIEMaxBusLanes : Result:=ADL.Adapters[Measure.Adapter].BusLanesMax; FanSpeedRPM : Result:=ADL.Adapters[Measure.Adapter].FanRPM; FanSpeedPercent : Result:=ADL.Adapters[Measure.Adapter].Fan; - MemoryType : ; MemorySize : Result:=ADL.Adapters[Measure.Adapter].MemorySize; - MemoryUsage : if Assigned(Measure.D3DKMT) then Result:=Measure.D3DKMT.UsedMemory; + MemoryUsage : if Assigned(Measure.D3DKMT) then Result:=Measure.D3DKMT.MemoryUsage; + SharedLimit : if Assigned(Measure.D3DKMT) then Result:=Measure.D3DKMT.SharedLimit; + DedicatedLimit : if Assigned(Measure.D3DKMT) then Result:=Measure.D3DKMT.DedicatedLimit; + SharedUsage : if Assigned(Measure.D3DKMT) then Result:=Measure.D3DKMT.SharedUsage; + DedicatedUsage : if Assigned(Measure.D3DKMT) then Result:=Measure.D3DKMT.DedicatedUsage; MemoryBandwidth : Result:=ADL.Adapters[Measure.Adapter].MemoryBandwidth; - AdapterName : ; - AdapterActive : ; FanSpeedPercentMin : Result:=0; FanSpeedPercentMax : Result:=100; FanSpeedRPMMin : Result:=0; FanSpeedRPMMax : Result:=ADL.Adapters[Measure.Adapter].FanMaxRPM; - BiosDate : ; - BiosVersion : ; - BiosPartNumber : ; - AdapterIdentifier : ; NumberOfAdapters : Result:=ADL.AdapterCount; - NumberOfDisplays : ; end; end; end; @@ -189,50 +193,38 @@ begin if (Measure.Adapter >= 0) AND (Measure.Adapter < ADL.AdapterCount) then begin case Measure.ID of - Unknown : ; - Temperature : ; - Clock : ; - MemoryClock : ; - Voltage : ; - Activity : ; - PerformanceLevel : ; - PCIECurrentBusSpeed : ; - PCIECurrentBusLanes : ; - PCIEMaxBusLanes : ; - FanSpeedRPM : ; - FanSpeedPercent : ; - MemoryType : Result:=PWideChar(ADL.Adapters[Measure.Adapter].MemoryType); - MemorySize : ; - MemoryUsage : ; - MemoryBandwidth : ; - AdapterName : Result:=PWideChar(ADL.Adapters[Measure.Adapter].Name); - AdapterActive : ; - FanSpeedPercentMin : ; - FanSpeedPercentMax : ; - FanSpeedRPMMin : ; - FanSpeedRPMMax : ; - BiosDate : Result:=PWideChar(ADL.Adapters[Measure.Adapter].BiosDate); - BiosVersion : Result:=PWideChar(ADL.Adapters[Measure.Adapter].BiosVersion); - BiosPartNumber : Result:=PWideChar(ADL.Adapters[Measure.Adapter].BiosPartNumber); - AdapterIdentifier : ; - NumberOfAdapters : ; - NumberOfDisplays : ; + MemoryType : Result:=PWideChar(ADL.Adapters[Measure.Adapter].MemoryType); + AdapterName : Result:=PWideChar(ADL.Adapters[Measure.Adapter].Name); + BiosDate : Result:=PWideChar(ADL.Adapters[Measure.Adapter].BiosDate); + BiosVersion : Result:=PWideChar(ADL.Adapters[Measure.Adapter].BiosVersion); + BiosPartNumber : Result:=PWideChar(ADL.Adapters[Measure.Adapter].BiosPartNumber); + DriverDate : Result:=PWideChar(ADL.Adapters[Measure.Adapter].DriverDate); + DriverVersion : Result:=PWideChar(ADL.Adapters[Measure.Adapter].DriverVersion); end; end; end; end; -procedure Finalize(AData: Pointer); stdcall; +procedure Finalize(AData: Pointer); stdcall +var + Measure: TMeasure; begin - if Assigned(List) then + if Assigned(AData) then + begin + Measure:=List.Extract(AData); + if Assigned(Measure) then + Measure.Free; + end; + + if Assigned(List) AND (List.Count = 0) then FreeAndNil(List); - if Assigned(ADL) then + if Assigned(ADL) AND NOT Assigned(List) then FreeAndNil(ADL); end; function GetPluginVersion: Cardinal; stdcall; begin - Result:=2; + Result:=3; end; function GetPluginAuthor: PWideChar; stdcall; diff --git a/Plugin/AMDPlugin.dproj b/Plugin/AMDPlugin.dproj index aff6e48..9e584b4 100644 --- a/Plugin/AMDPlugin.dproj +++ b/Plugin/AMDPlugin.dproj @@ -124,14 +124,16 @@ 0 - FileDescription=$(MSBuildProjectName) $(Platform) $(Config);FileVersion=1.0.0.21;InternalName=$(MSBuildProjectName);LegalCopyright=(c) 2020 by NaliLord;OriginalFilename=AMDPlugin.dll;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=Rainmeter AMD GPU Plugin;ProductVersion=1.0.0.0 + FileDescription=$(MSBuildProjectName) $(Platform) $(Config);FileVersion=1.0.3.2;InternalName=$(MSBuildProjectName);LegalCopyright=(c) 2020 by NaliLord;OriginalFilename=AMDPlugin.dll;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=Rainmeter AMD GPU Plugin;ProductVersion=1.0.0.0 (None) - 21 + 2 + 3 (None) - FileDescription=$(MSBuildProjectName) $(Platform) $(Config);FileVersion=1.0.0.28;InternalName=$(MSBuildProjectName);LegalCopyright=(c) 2020 by NaliLord;OriginalFilename=AMDPlugin.dll;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=Rainmeter AMD GPU Plugin;ProductVersion=1.0.0.0 - 28 + FileDescription=$(MSBuildProjectName) $(Platform) $(Config);FileVersion=1.0.3.2;InternalName=$(MSBuildProjectName);LegalCopyright=(c) 2020 by NaliLord;OriginalFilename=AMDPlugin.dll;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=Rainmeter AMD GPU Plugin;ProductVersion=1.0.0.0 + 2 + 3 diff --git a/Plugin/AMDPlugin.res b/Plugin/AMDPlugin.res index abf1257eeee7bbd537a3d31b8e7741b1bcc273a1..0f39ad20a2516f3ae3792979febab8e265d1750b 100644 GIT binary patch delta 74 zcmeBRZ(*OHz{oODQ65M*8Z$F8Fi$L3WlWhkSDDda;=xEsV+JDz1%@DoRE8WNPGl$s ak_-$63>=e<8C6-08T1$oHzzWxGXVfx`wrOv delta 78 zcmZo+?_i&xz{oLCQ65M*8Z%2XFib30Wz3j3SDDde;=xEsGX@g|1%@DoRE8WNPGl$s ck_-$+44jjV8C5wA81#T_a|VXZv5e|W0H1shJpcdz diff --git a/Testing/Main.dfm b/Testing/Main.dfm index bf5ed44..9529f63 100644 --- a/Testing/Main.dfm +++ b/Testing/Main.dfm @@ -4,7 +4,7 @@ object frmMain: TfrmMain BorderIcons = [biSystemMenu] BorderStyle = bsSingle Caption = 'AMD GPU Info' - ClientHeight = 216 + ClientHeight = 327 ClientWidth = 185 Color = clBtnFace Font.Charset = DEFAULT_CHARSET @@ -74,7 +74,7 @@ object frmMain: TfrmMain end object btnGetInfo: TButton Left = 8 - Top = 155 + Top = 268 Width = 80 Height = 25 Caption = 'Start' @@ -106,8 +106,8 @@ object frmMain: TfrmMain Text = 'n/a' end object Button1: TButton - Left = 97 - Top = 155 + Left = 94 + Top = 268 Width = 80 Height = 25 Caption = 'Stop' @@ -132,7 +132,7 @@ object frmMain: TfrmMain end object TrackBar1: TTrackBar Left = 0 - Top = 185 + Top = 296 Width = 185 Height = 31 Align = alBottom @@ -142,6 +142,7 @@ object frmMain: TfrmMain TabOrder = 7 TickMarks = tmBoth TickStyle = tsNone + ExplicitTop = 185 end object edVRAM: TEdit Left = 56 @@ -151,6 +152,56 @@ object frmMain: TfrmMain TabOrder = 8 Text = 'n/a' end + object lblMemoryUsage: TStaticText + Left = 8 + Top = 155 + Width = 169 + Height = 17 + AutoSize = False + BorderStyle = sbsSunken + Caption = 'lblMemoryUsage' + TabOrder = 9 + end + object lblSharedLimit: TStaticText + Left = 8 + Top = 176 + Width = 169 + Height = 17 + AutoSize = False + BorderStyle = sbsSunken + Caption = 'lblSharedLimit' + TabOrder = 10 + end + object lblDedicatedLimit: TStaticText + Left = 8 + Top = 199 + Width = 169 + Height = 17 + AutoSize = False + BorderStyle = sbsSunken + Caption = 'lblDedicatedLimit' + TabOrder = 11 + end + object lblSharedUsage: TStaticText + Left = 8 + Top = 222 + Width = 169 + Height = 17 + AutoSize = False + BorderStyle = sbsSunken + Caption = 'lblSharedUsage' + TabOrder = 12 + end + object lblDedicatedUsage: TStaticText + Left = 8 + Top = 245 + Width = 169 + Height = 17 + AutoSize = False + BorderStyle = sbsSunken + Caption = 'lblDedicatedUsage' + TabOrder = 13 + end object tmrUpdate: TTimer Enabled = False OnTimer = tmrUpdateTimer diff --git a/Testing/Main.pas b/Testing/Main.pas index fe0ddd9..2aec231 100644 --- a/Testing/Main.pas +++ b/Testing/Main.pas @@ -24,6 +24,11 @@ TfrmMain = class(TForm) TrackBar1: TTrackBar; Label4: TLabel; edVRAM: TEdit; + lblMemoryUsage: TStaticText; + lblSharedLimit: TStaticText; + lblDedicatedLimit: TStaticText; + lblSharedUsage: TStaticText; + lblDedicatedUsage: TStaticText; procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure tmrUpdateTimer(Sender: TObject); @@ -76,7 +81,13 @@ procedure TfrmMain.tmrUpdateTimer(Sender: TObject); edLoad.Text:=IntToStr(FADL.Adapters[0].Activity); edClock.Text:=IntToStr(FADL.Adapters[0].Clock); edMemory.Text:=IntToStr(FADL.Adapters[0].Memory); - edVRAM.Text:=IntToStr(Round(FD3DKMT.UsedMemory / 1024 / 1024)) + '/' + IntToStr(Round(FADL.Adapters[0].MemorySize / 1024 / 1024)); + edVRAM.Text:=IntToStr(Round(FADL.Adapters[0].MemorySize / 1024 / 1024)); + + lblMemoryUsage.Caption:=IntToStr(Round(FD3DKMT.MemoryUsage / 1024 / 1024)); + lblSharedLimit.Caption:=IntToStr(Round(FD3DKMT.SharedLimit / 1024 / 1024)); + lblDedicatedLimit.Caption:=IntToStr(Round(FD3DKMT.DedicatedLimit / 1024 / 1024)); + lblSharedUsage.Caption:=IntToStr(Round(FD3DKMT.SharedUsage / 1024 / 1024)); + lblDedicatedUsage.Caption:=IntToStr(Round(FD3DKMT.DedicatedUsage / 1024 / 1024)); end; end.