Skip to content

[Bug] Large Structures Crash Structure Placer Wand #27

@Antirhinnum

Description

@Antirhinnum

Selecting a very large structure (e.g., half of a Small world, ~2000x1200 tiles) in the UI of the Structure Placer Wand crashes the game.

Log:

[17:56:20.276] [Main Thread/ERROR] [FNA]: Texture2D creation failed! Error Code: The parameter is incorrect. (0x80070057)
[17:56:20.304] [Main Thread/WARN] [tML]: Silently Caught Exception: 
System.InvalidOperationException: Texture2D creation failed! Error Code: The parameter is incorrect. (0x80070057)
   at Microsoft.Xna.Framework.FNALoggerEXT.FNA3DLogError(IntPtr msg) in D:\a\tModLoader\tModLoader\FNA\src\FNALoggerEXT.cs:line 98
   at Microsoft.Xna.Framework.Graphics.FNA3D_Impl.FNA3D_CreateTexture2D(IntPtr device, SurfaceFormat format, Int32 width, Int32 height, Int32 levelCount, Byte isRenderTarget)
   at Microsoft.Xna.Framework.Graphics.FNA3D_Impl.FNA3D_CreateTexture2D(IntPtr device, SurfaceFormat format, Int32 width, Int32 height, Int32 levelCount, Byte isRenderTarget)
   at Microsoft.Xna.Framework.Graphics.Texture2D..ctor(GraphicsDevice graphicsDevice, Int32 width, Int32 height, Boolean mipMap, SurfaceFormat format) in D:\a\tModLoader\tModLoader\FNA\src\Graphics\Texture2D.cs:line 116
   at Microsoft.Xna.Framework.Graphics.RenderTarget2D..ctor(GraphicsDevice graphicsDevice, Int32 width, Int32 height, Boolean mipMap, SurfaceFormat preferredFormat, DepthFormat preferredDepthFormat, Int32 preferredMultiSampleCount, RenderTargetUsage usage) in D:\a\tModLoader\tModLoader\FNA\src\Graphics\RenderTarget2D.cs:line 132
   at StructureHelper.Util.StructurePreview.GeneratePreview() in StructureHelper\Util\StructurePreview.cs:line 49
   at StructureHelper.Util.PreviewRenderQueue.DrawQueuedPreview(orig_CheckMonoliths orig) in StructureHelper\Util\StructurePreview.cs:line 118
   at Hook<System.Void StructureHelper.Util.PreviewRenderQueue::DrawQueuedPreview(Terraria.On_Main+orig_CheckMonoliths)>()
   at SyncProxy<System.Void Terraria.Main:CheckMonoliths()>()
   at Terraria.Main.DoDraw(GameTime gameTime) in tModLoader\Terraria\Main.cs:line 53179
   at Terraria.Main.Draw_Inner(GameTime gameTime) in tModLoader\Terraria\Main.cs:line 53070
   at Terraria.Main.Draw(GameTime gameTime) in tModLoader\Terraria\Main.cs:line 53057
   at Microsoft.Xna.Framework.Game.Tick() in D:\a\tModLoader\tModLoader\FNA\src\Game.cs:line 562
   at Microsoft.Xna.Framework.Game.RunLoop() in D:\a\tModLoader\tModLoader\FNA\src\Game.cs:line 878
   at Microsoft.Xna.Framework.Game.Run() in D:\a\tModLoader\tModLoader\FNA\src\Game.cs:line 419
   at Terraria.Program.RunGame() in tModLoader\Terraria\Program.cs:line 266
   at Terraria.Program.LaunchGame_(Boolean isServer) in tModLoader\Terraria\Program.cs:line 240
   at Terraria.Program.LaunchGame(String[] args, Boolean monoArgs) in tModLoader\Terraria\Program.cs:line 213
   at Terraria.MonoLaunch.Main_End(String[] args) in tModLoader\Terraria\MonoLaunch.cs:line 79
   at Terraria.MonoLaunch.<>c__DisplayClass1_0.<Main>b__1() in tModLoader\Terraria\MonoLaunch.cs:line 65

[17:56:20.311] [Main Thread/ERROR] [Terraria]: System.InvalidOperationException: Texture2D creation failed! Error Code: The parameter is incorrect. (0x80070057)
   at Microsoft.Xna.Framework.FNALoggerEXT.FNA3DLogError(IntPtr msg) in D:\a\tModLoader\tModLoader\FNA\src\FNALoggerEXT.cs:line 98
   at Microsoft.Xna.Framework.Graphics.FNA3D_Impl.FNA3D_CreateTexture2D(IntPtr device, SurfaceFormat format, Int32 width, Int32 height, Int32 levelCount, Byte isRenderTarget)
   at Microsoft.Xna.Framework.Graphics.Texture2D..ctor(GraphicsDevice graphicsDevice, Int32 width, Int32 height, Boolean mipMap, SurfaceFormat format) in D:\a\tModLoader\tModLoader\FNA\src\Graphics\Texture2D.cs:line 116
   at Microsoft.Xna.Framework.Graphics.RenderTarget2D..ctor(GraphicsDevice graphicsDevice, Int32 width, Int32 height, Boolean mipMap, SurfaceFormat preferredFormat, DepthFormat preferredDepthFormat, Int32 preferredMultiSampleCount, RenderTargetUsage usage) in D:\a\tModLoader\tModLoader\FNA\src\Graphics\RenderTarget2D.cs:line 132
   at StructureHelper.Util.StructurePreview.GeneratePreview() in StructureHelper\Util\StructurePreview.cs:line 49
   at StructureHelper.Util.PreviewRenderQueue.DrawQueuedPreview(orig_CheckMonoliths orig) in StructureHelper\Util\StructurePreview.cs:line 118
   at Hook<System.Void StructureHelper.Util.PreviewRenderQueue::DrawQueuedPreview(Terraria.On_Main+orig_CheckMonoliths)>()
   at SyncProxy<System.Void Terraria.Main:CheckMonoliths()>()
   at Terraria.Main.DoDraw(GameTime gameTime) in tModLoader\Terraria\Main.cs:line 53179
   at Terraria.Main.Draw_Inner(GameTime gameTime) in tModLoader\Terraria\Main.cs:line 53070
   at Terraria.Main.Draw(GameTime gameTime) in tModLoader\Terraria\Main.cs:line 53057
[17:56:20.357] [Main Thread/FATAL] [tML]: Main engine crash

Tip: This is likely a mod's fault. Disable mods one by one and check if the issue persists

System.InvalidOperationException: Texture2D creation failed! Error Code: The parameter is incorrect. (0x80070057)
   at Microsoft.Xna.Framework.FNALoggerEXT.FNA3DLogError(IntPtr msg) in D:\a\tModLoader\tModLoader\FNA\src\FNALoggerEXT.cs:line 98
   at Microsoft.Xna.Framework.Graphics.FNA3D_Impl.FNA3D_CreateTexture2D(IntPtr device, SurfaceFormat format, Int32 width, Int32 height, Int32 levelCount, Byte isRenderTarget)
   at Microsoft.Xna.Framework.Graphics.Texture2D..ctor(GraphicsDevice graphicsDevice, Int32 width, Int32 height, Boolean mipMap, SurfaceFormat format) in D:\a\tModLoader\tModLoader\FNA\src\Graphics\Texture2D.cs:line 116
   at Microsoft.Xna.Framework.Graphics.RenderTarget2D..ctor(GraphicsDevice graphicsDevice, Int32 width, Int32 height, Boolean mipMap, SurfaceFormat preferredFormat, DepthFormat preferredDepthFormat, Int32 preferredMultiSampleCount, RenderTargetUsage usage) in D:\a\tModLoader\tModLoader\FNA\src\Graphics\RenderTarget2D.cs:line 132
   at StructureHelper.Util.StructurePreview.GeneratePreview() in StructureHelper\Util\StructurePreview.cs:line 49
   at StructureHelper.Util.PreviewRenderQueue.DrawQueuedPreview(orig_CheckMonoliths orig) in StructureHelper\Util\StructurePreview.cs:line 118
   at Hook<System.Void StructureHelper.Util.PreviewRenderQueue::DrawQueuedPreview(Terraria.On_Main+orig_CheckMonoliths)>()
   at SyncProxy<System.Void Terraria.Main:CheckMonoliths()>()
   at Terraria.Main.DoDraw(GameTime gameTime) in tModLoader\Terraria\Main.cs:line 53179
   at Terraria.Main.Draw_Inner(GameTime gameTime) in tModLoader\Terraria\Main.cs:line 53070
   at Terraria.Main.Draw(GameTime gameTime) in tModLoader\Terraria\Main.cs:line 53057
   at Microsoft.Xna.Framework.Game.Tick() in D:\a\tModLoader\tModLoader\FNA\src\Game.cs:line 562
   at Microsoft.Xna.Framework.Game.RunLoop() in D:\a\tModLoader\tModLoader\FNA\src\Game.cs:line 878
   at Microsoft.Xna.Framework.Game.Run() in D:\a\tModLoader\tModLoader\FNA\src\Game.cs:line 419
   at Terraria.Program.RunGame() in tModLoader\Terraria\Program.cs:line 266

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions