Hi,
I am working with a Monogame.Forms.DX for my editor that is supposed to draw a shape for every object from a json file that will be loaded using Open File Dialog and it does it, but the problem is that I get error
“SharpDX.SharpDXException: 'HRESULT: [0x887A0005], Module: [SharpDX.DXGI], ApiCode: [DXGI_ERROR_DEVICE_REMOVED/DeviceRemoved], Message: The GPU device instance has been suspended. Use GetDeviceRemovedReason to determine the appropriate action.”
after a while from loading the file depending on how big the array is
I also notices a rapid increase in the process memory in my diagnostic tools(around 2.6-3.6 GB )when the error occurs
is it possible to fix this problem ?
for more context on my editor functionality.
I store the JArray in my main form then call it to my editor class and request an update function to update the array every frame with the update method in order to catch any change that can happen to array
//Form1
public static void UpdateArray()
{
Editor.UpdateSj(array);
}
//Editor
public static void UpdateArray(JArray updatedarray)
{
array= updatedarray;
}
protected override void Update(GameTime gameTime)
{
Form1.UpdateArray();
base.Update(gameTime);
}
protected override void Draw()
{
base.Draw();
GraphicsDevice.Clear(MBlue);
Editor.spriteBatch.Begin();
DisplayArray();
Editor.spriteBatch.End();
}
also if this might help
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
SharpDX.SharpDXException: HRESULT: [0x887A0005], Module: [SharpDX.DXGI], ApiCode: [DXGI_ERROR_DEVICE_REMOVED/DeviceRemoved], Message: The GPU device instance has been suspended. Use GetDeviceRemovedReason to determine the appropriate action.
at SharpDX.Result.CheckError() in C:\projects\sharpdx\Source\SharpDX\Result.cs:line 195
at SharpDX.Direct3D11.Device.CreateBuffer(BufferDescription& descRef, Nullable`1 initialDataRef, Buffer bufferOut) in C:\projects\sharpdx\Source\SharpDX.Direct3D11\Generated\DESKTOP_APP\Interfaces.cs:line 1236
at Microsoft.Xna.Framework.Graphics.ConstantBuffer.PlatformInitialize()
at Microsoft.Xna.Framework.Graphics.ConstantBuffer…ctor(ConstantBuffer cloneSource)
at Microsoft.Xna.Framework.Graphics.Effect.Clone(Effect cloneSource)
at Microsoft.Xna.Framework.Graphics.Effect…ctor(GraphicsDevice graphicsDevice, Byte[] effectCode, Int32 index, Int32 count)
at Microsoft.Xna.Framework.Graphics.BasicEffect…ctor(GraphicsDevice device)
at MonoGame.Forms.DX.Controls.ViewPort.DrawMiniAxes(Vector3 ParentPos, GraphicsDevice graphicsDevice, Matrix world, Matrix view, Matrix projection) in C:\Users\ahmed\source\repos\Editor1\Editor1\Controls\ViewPort.cs:line 1236
at MonoGame.Forms.DX.Controls.ViewPort.BoneDisplay() in C:\Users\ahmed\source\repos\Editor1\Editor1\Controls\ViewPort.cs:line 510
at MonoGame.Forms.DX.Controls.ViewPort.Draw() in C:\Users\ahmed\source\repos\Editor1\Editor1\Controls\ViewPort.cs:line 1208
at MonoGame.Forms.Controls.GraphicsDeviceControl.OnPaint(PaintEventArgs e)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9105.0 built by: NET481REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
Bone Json Editor
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/ahmed/source/repos/Editor1/Editor1/bin/Debug/Bone%20Json%20Editor.exe
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9075.0 built by: NET481REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
System
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9065.0 built by: NET481REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9032.0 built by: NET481REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
Newtonsoft.Json
Assembly Version: 13.0.0.0
Win32 Version: 13.0.2.27524
CodeBase: file:///C:/Users/ahmed/source/repos/Editor1/Editor1/bin/Debug/Newtonsoft.Json.DLL
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9115.0 built by: NET481REL1LAST_B
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
MonoGame.Forms.DX
Assembly Version: 2.4.0.0
Win32 Version: 2.4.0.0
CodeBase: file:///C:/Users/ahmed/source/repos/Editor1/Editor1/bin/Debug/MonoGame.Forms.DX.DLL
MonoGame.Framework
Assembly Version: 3.8.0.270
Win32 Version: 3.8.0.270
CodeBase: file:///C:/Users/ahmed/source/repos/Editor1/Editor1/bin/Debug/MonoGame.Framework.DLL
SoulsFormats
Assembly Version: 1.0.2.0
Win32 Version: 1.0.2.0
CodeBase: file:///C:/Users/ahmed/source/repos/Editor1/Editor1/bin/Debug/SoulsFormats.DLL
SharpDX.DXGI
Assembly Version: 4.2.0.0
Win32 Version: 4.2.0
CodeBase: file:///C:/Users/ahmed/source/repos/Editor1/Editor1/bin/Debug/SharpDX.DXGI.DLL
SharpDX.Direct3D11
Assembly Version: 4.2.0.0
Win32 Version: 4.2.0
CodeBase: file:///C:/Users/ahmed/source/repos/Editor1/Editor1/bin/Debug/SharpDX.Direct3D11.DLL
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9032.0 built by: NET481REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9032.0 built by: NET481REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
SharpDX
Assembly Version: 4.2.0.0
Win32 Version: 4.2.0
CodeBase: file:///C:/Users/ahmed/source/repos/Editor1/Editor1/bin/Debug/SharpDX.DLL
SharpDX.XAudio2
Assembly Version: 4.0.1.0
Win32 Version: 4.0.1
CodeBase: file:///C:/Users/ahmed/source/repos/Editor1/Editor1/bin/Debug/SharpDX.XAudio2.DLL
Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9032.0 built by: NET481REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
AssimpNet
Assembly Version: 3.3.1.0
Win32 Version: 3.3.1
CodeBase: file:///C:/Users/ahmed/source/repos/Editor1/Editor1/bin/Debug/AssimpNet.DLL
SharpDX.XInput
Assembly Version: 4.2.0.0
Win32 Version: 4.2.0
CodeBase: file:///C:/Users/ahmed/source/repos/Editor1/Editor1/bin/Debug/SharpDX.XInput.DLL
System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9032.0 built by: NET481REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
System.Runtime.Serialization
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9032.0 built by: NET481REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
Microsoft.VisualStudio.Debugger.Runtime.Desktop
Assembly Version: 17.0.0.0
Win32 Version: 17.4.11109.4
CodeBase: file:///D:/SteamLibrary/steamapps/common/Visual%20Studio/Common7/IDE/Remote%20Debugger/x86/Runtime/Microsoft.VisualStudio.Debugger.Runtime.Desktop.dll
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.