• Runtimes
  • [XNA/Monogame] Crash on Surface RT and possible solution

  • Düzenlendi
Related Discussions
...

Hi,

I ran into a problem when running my Monogame based game on a Surface RT device (ARM).
The following exception is thrown when the MeshBatcher invokes DrawUserIndexedPrimitives.

"An exception of type 'SharpDX.SharpDXException' occurred in SharpDX.DLL but was not handled in user code

Additional information: 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."

This can be solved by switching to an array of shorts instead of an array of integers.
That would limit the batcher to render a maximum 32,767 indices instead of 2,147,483,647.

We could dynamically switch based on the MaxVertexIndex that is part of the DirectX GraphicsDeviceCapabilities class and issue an error when more than the available indices are needed or render multiple batches when more than the available indices are needed.

kind regards,

Roland Smeenk

I've committed short indices. This is pretty standard for most game toolkits, so the 32k limit on the number of vertices that can be batched is fine.

Thanks.


Roland