Skip to content

Commit

Permalink
[Graphics] - Added more object tracking reporting.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tape-Worm committed Jan 13, 2022
1 parent 7ef3cc8 commit 06cb25b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 0 additions & 3 deletions Examples/Gorgon.Renderers.2D/Balls/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -715,9 +715,6 @@ static void Main()
{
try
{
GorgonGraphics.IsObjectTrackingEnabled = true;
GorgonGraphics.IsDebugEnabled = true;

Application.SetHighDpiMode(HighDpiMode.PerMonitorV2);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Expand Down
12 changes: 9 additions & 3 deletions Gorgon/Gorgon.Graphics.Core/GorgonGraphics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ private GorgonMultisampleInfo GetMultisampleSupport(D3D11.Device5 device, Format

using (var factory2 = new Factory2(IsDebugEnabled))
{
resultFactory = factory2.QueryInterface<Factory5>();
resultFactory = factory2.QueryInterface<Factory5>();

using Adapter adapter = (adapterInfo.VideoDeviceType == VideoDeviceType.Hardware
? resultFactory.GetAdapter1(adapterInfo.Index)
Expand Down Expand Up @@ -596,11 +596,10 @@ private void SetDrawStates(D3DState state, in GorgonColor factor, int blendSampl
/// </summary>
private void ReportLiveObjectsInternal(D3D11.Device device)
{
using D3D11.DeviceDebug debugDevice = new(device);
using D3D11.DeviceDebug debugDevice = new(device);
debugDevice.ReportLiveDeviceObjects(D3D11.ReportingLevel.IgnoreInternal);
}


/// <summary>
/// Function to check for the minimum windows 10 build that Gorgon Graphics supports.
/// </summary>
Expand Down Expand Up @@ -1302,6 +1301,13 @@ public void Dispose()
device?.Dispose();
adapter?.Dispose();
factory?.Dispose();

#if DEBUG
if ((IsObjectTrackingEnabled) && (IsDebugEnabled))
{
Debug.WriteLine($"\nFinal:\n{DX.Diagnostics.ObjectTracker.ReportActiveObjects()}");
}
#endif
}
#endregion

Expand Down

0 comments on commit 06cb25b

Please sign in to comment.