This project is read-only.

Some questions about Hardware Instancing

Sep 30, 2010 at 10:44 AM

Hi !

I have a couple of questions about Hardware Instancing :

- I noticed that HI doesn't like window resizing when used within a winform application. An InvalidOperationException occurs, telling "ResourceUsage.DynamicSequential data overwrite detected". How can I fix this issue ?

- Is there a way to make HI work with xen depth rendering shaders ? (I tried to use HI like i do when my object instances are drawn with a MaterialShader, but for depth rendering only one object is displayed so i guess the depth shader is not compatible with that trick ... )

   à Xen.Graphics.Vertices`1.Implementation.WriteBlock(DrawState state, VertexType[] data, Int32 startIndex, Int32 start, Int32 length, Object target, Object parent) dans C:\Users\Clauclaudr\Documents\Visual Studio 2008\Projects\Test\Test\Xen\xen\src\Xen\Graphics\Vertices.cs:ligne 179
   à Xen.Graphics.Bufffer`1.WriteBuffer(DrawState state, Int32 startIndex, Int32 bytesToWrite, Object target, Object parent) dans C:\Users\Clauclaudr\Documents\Visual Studio 2008\Projects\Test\Test\Xen\xen\src\Xen\Graphics\Buffer.cs:ligne 258
   à Xen.Graphics.Bufffer`1.UpdateDirtyRegions(DrawState state, Object target, Object parent) dans C:\Users\Clauclaudr\Documents\Visual Studio 2008\Projects\Test\Test\Xen\xen\src\Xen\Graphics\Buffer.cs:ligne 89
   à Xen.Graphics.Vertices`1.Xen.Graphics.IDeviceVertexBuffer.GetVertexBuffer(DrawState state) dans C:\Users\Clauclaudr\Documents\Visual Studio 2008\Projects\Test\Test\Xen\xen\src\Xen\Graphics\Vertices.cs:ligne 497
   à Xen.Graphics.VerticesGroup.Draw(DrawState state, IIndices indices, PrimitiveType primitiveType, StreamFrequency frequency, Int32 primitveCount, Int32 startIndex, Int32 vertexOffset) dans C:\Users\Clauclaudr\Documents\Visual Studio 2008\Projects\Test\Test\Xen\xen\src\Xen\Graphics\VerticesGroup.cs:ligne 636
   à Xen.Graphics.VerticesGroup.Draw(DrawState state, IIndices indices, PrimitiveType primitiveType, StreamFrequency frequency) dans C:\Users\Clauclaudr\Documents\Visual Studio 2008\Projects\Test\Test\Xen\xen\src\Xen\Graphics\VerticesGroup.cs:ligne 576
   à Xen.DrawState.DrawBatch(VerticesGroup vertices, IIndices indices, PrimitiveType primitiveType, Int32 count) dans C:\Users\Clauclaudr\Documents\Visual Studio 2008\Projects\Test\Test\Xen\xen\src\Xen\Graphics\DrawStateGeometry.cs:ligne 375
   à Xen.DrawState.DrawBatch(IVertices vertices, IIndices indices, PrimitiveType primitiveType, Callback`3 CanDrawItem, Matrix[] instances, Int32 instancesLength, Int32 startIndex) dans C:\Users\Clauclaudr\Documents\Visual Studio 2008\Projects\Test\Test\Xen\xen\src\Xen\Graphics\DrawStateGeometry.cs:ligne 226
   à Xen.DrawState.DrawBatch(IVertices vertices, IIndices indices, PrimitiveType primitiveType, Callback`3 CanDrawItem, Matrix[] instances, Int32 instancesLength) dans C:\Users\Clauclaudr\Documents\Visual Studio 2008\Projects\Test\Test\Xen\xen\src\Xen\Graphics\DrawStateGeometry.cs:ligne 157
   à Xen.DrawState.DrawBatch(IVertices vertices, IIndices indices, PrimitiveType primitiveType, Callback`3 CanDrawItem, Matrix[] instances) dans C:\Users\Clauclaudr\Documents\Visual Studio 2008\Projects\Test\Test\Xen\xen\src\Xen\Graphics\DrawStateGeometry.cs:ligne 142
   à ClauclaudrEngine.Geometry.Draw(DrawState state) dans C:\Users\Clauclaudr\Documents\Visual Studio 2008\Projects\Test\Test\ClauclaudrEngine\Source\Geometry\Geometry.cs:ligne 220
   à ClauclaudrEngine.Drawer.DrawHardwareInstancedGeometries(DrawState state) dans C:\Users\Clauclaudr\Documents\Visual Studio 2008\Projects\Test\Test\ClauclaudrEngine\Source\Drawing\Drawer.cs:ligne 1153
   à ClauclaudrEngine.Drawer.DrawBaseScene(DrawState state) dans C:\Users\Clauclaudr\Documents\Visual Studio 2008\Projects\Test\Test\ClauclaudrEngine\Source\Drawing\Drawer.cs:ligne 1085
   à ClauclaudrEngine.Drawer.DrawWithoutDOF(DrawState state) dans C:\Users\Clauclaudr\Documents\Visual Studio 2008\Projects\Test\Test\ClauclaudrEngine\Source\Drawing\Drawer.cs:ligne 1028
   à ClauclaudrEngine.Drawer.Draw(DrawState state) dans C:\Users\Clauclaudr\Documents\Visual Studio 2008\Projects\Test\Test\ClauclaudrEngine\Source\Drawing\Drawer.cs:ligne 952
   à Xen.Graphics.DrawTarget.Draw(DrawState state) dans C:\Users\Clauclaudr\Documents\Visual Studio 2008\Projects\Test\Test\Xen\xen\src\Xen\Graphics\DrawTarget.cs:ligne 346
   à ClauclaudrEngine.Drawer.PrepareDraw(DrawState state) dans C:\Users\Clauclaudr\Documents\Visual Studio 2008\Projects\Test\Test\ClauclaudrEngine\Source\Drawing\Drawer.cs:ligne 992
   à ClauclaudrEngine.GameApplication.Draw(DrawState state) dans C:\Users\Clauclaudr\Documents\Visual Studio 2008\Projects\Test\Test\ClauclaudrEngine\Source\GameApplication.cs:ligne 320
   à ClauclaudrEngineEditor.EditorGameApplication.Draw(DrawState state) dans C:\Users\Clauclaudr\Documents\Visual Studio 2008\Projects\Test\Test\ClauclaudrEngineEditor\Source\EditorGameApplication.cs:ligne 73
   à Xen.Application.OnDraw(DrawState state) dans C:\Users\Clauclaudr\Documents\Visual Studio 2008\Projects\Test\Test\Xen\xen\src\Xen\Application.cs:ligne 1050
   à Xen.XNALogic.Draw(Boolean resetState) dans C:\Users\Clauclaudr\Documents\Visual Studio 2008\Projects\Test\Test\Xen\xen\src\Xen\Application.cs:ligne 233
   à Xen.XNAWinFormsHostAppWrapper.RunMainLoop() dans C:\Users\Clauclaudr\Documents\Visual Studio 2008\Projects\Test\Test\Xen\xen\src\Xen\WinFormsHost.cs:ligne 427
   à Xen.WinFormsHostControl.OnPaint(PaintEventArgs e) dans C:\Users\Clauclaudr\Documents\Visual Studio 2008\Projects\Test\Test\Xen\xen\src\Xen\WinFormsHost.cs:ligne 63
   à System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
   à System.Windows.Forms.Control.WmPaint(Message& m)
   à System.Windows.Forms.Control.WndProc(Message& m)
   à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   à System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   à Microsoft.Xna.Framework.Input.UnsafeNativeMethods.CallWindowProc(IntPtr lpPrevWndFunc, IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
   à Microsoft.Xna.Framework.Input.WindowMessageHooker.Hook.WndProc(IntPtr msgWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
   à System.Windows.Forms.UnsafeNativeMethods.DispatchMessageA(MSG& msg)
   à System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   à System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   à System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   à System.Windows.Forms.Application.Run(Form mainForm)
   à Test.MyGame.Program.Main(String[] args) dans C:\Users\Clauclaudr\Documents\Visual Studio 2008\Projects\Test\Test\ClauclaudrEngineEditor\Program.cs:ligne 30