Projects with graphics level 9 1 and level 9 graphics compositor crash at startup
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 49
Description
Release Type: Official Release
Version: 4.2.0.2122
Platform(s): Windows
Describe the bug
Projects created with Graphics level API 9_1 with DirectX crash at startup with a E_INVALIDARG SharpDX exception when creating a texture.
To Reproduce
Steps to reproduce the behavior:
- Create a new Stride project.
- Select the graphics API level to 9_1.
- Compile and run project.
- Crash at startup.
Expected behavior
Not getting crashes.
Log and callstacks
Copied from the console showing this error:
[Game]: Error: Unexpected exception. SharpDX.SharpDXException: HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: The parameter is incorrect.
at SharpDX.Result.CheckError() in C:\projects\sharpdx\Source\SharpDX\Result.cs:line 195
at SharpDX.Direct3D11.Device.CreateTexture2D(Texture2DDescription& descRef, DataBox[] initialDataRef, Texture2D texture2DOut) in C:\projects\sharpdx\Source\SharpDX.Direct3D11\Generated\REFERENCE\Interfaces.cs:line 1292
at SharpDX.Direct3D11.Texture2D..ctor(Device device, Texture2DDescription description, DataBox[] data) in C:\projects\sharpdx\Source\SharpDX.Direct3D11\Texture2D.cs:line 80
at Stride.Graphics.Texture.InitializeFromImpl(DataBox[] dataBoxes)
at Stride.Graphics.Texture.InitializeFrom(Texture parentTexture, TextureDescription description, TextureViewDescription viewDescription, DataBox[] textureDatas)
at Stride.Graphics.Texture.InitializeFrom(TextureDescription description, TextureViewDescription viewDescription, DataBox[] textureDatas)
at Stride.Graphics.Texture.New(GraphicsDevice graphicsDevice, TextureDescription description, TextureViewDescription viewDescription, DataBox[] boxes)
at Stride.Graphics.Texture.New(GraphicsDevice graphicsDevice, TextureDescription description, DataBox[] boxes)
at Stride.Graphics.GraphicsResourceAllocator.CreateTexture(TextureDescription description, PixelFormat viewFormat)
at Stride.Graphics.GraphicsResourceAllocator.GetTemporaryResource[TResource,TKey](Dictionary`2 cache, TKey description, Func`3 creator, Func`2 getDefinition, PixelFormat viewFormat)
at Stride.Graphics.GraphicsResourceAllocator.GetTemporaryTexture(TextureDescription description)
at Stride.Graphics.GraphicsResourceAllocatorExtensions.GetTemporaryTexture2D(GraphicsResourceAllocator allocator, TextureDescription description)
at Stride.Rendering.Compositing.ForwardRenderer.PrepareRenderTargets(RenderDrawContext drawContext, Texture outputRenderTarget, Texture outputDepthStencil) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\ForwardRenderer.cs:line 880
at Stride.Rendering.Compositing.ForwardRenderer.PrepareRenderTargets(RenderDrawContext drawContext, Size2 renderTargetsSize) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\ForwardRenderer.cs:line 928
at Stride.Rendering.Compositing.ForwardRenderer.DrawCore(RenderContext context, RenderDrawContext drawContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\ForwardRenderer.cs:line 740
at Stride.Rendering.Compositing.SceneRendererBase.Draw(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\Compositing\SceneRendererBase.cs:line 39
at Stride.Rendering.Compositing.SceneRendererCollection.DrawCore(RenderContext context, RenderDrawContext drawContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\Compositing\SceneRendererCollection.cs:line 28
at Stride.Rendering.Compositing.SceneRendererBase.Draw(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\Compositing\SceneRendererBase.cs:line 39
at Stride.Rendering.Compositing.SceneCameraRenderer.DrawInner(RenderDrawContext renderContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\SceneCameraRenderer.cs:line 109
at Stride.Rendering.Compositing.SceneCameraRenderer.DrawCore(RenderContext context, RenderDrawContext drawContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\SceneCameraRenderer.cs:line 72
at Stride.Rendering.Compositing.SceneRendererBase.Draw(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\Compositing\SceneRendererBase.cs:line 39
at Stride.Rendering.Compositing.GraphicsCompositor.DrawCore(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\GraphicsCompositor.cs:line 209
at Stride.Rendering.RendererBase.Draw(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\RendererBase.cs:line 51
at Stride.Engine.SceneSystem.Draw(GameTime gameTime) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Engine\SceneSystem.cs:line 234
at Stride.Games.GameSystemCollection.Draw(GameTime gameTime)
at Stride.Games.GameBase.Draw(GameTime gameTime)
at Stride.Games.GameBase.RawTick(TimeSpan elapsedTimePerUpdate, Int32 updateCount, Single drawInterpolationFactor, Boolean drawFrame)
at Stride.Games.GameBase.RawTickProducer()
SharpDX.SharpDXException: HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: The parameter is incorrect.
at SharpDX.Result.CheckError() in C:\projects\sharpdx\Source\SharpDX\Result.cs:line 195
at SharpDX.Direct3D11.Device.CreateTexture2D(Texture2DDescription& descRef, DataBox[] initialDataRef, Texture2D texture2DOut) in C:\projects\sharpdx\Source\SharpDX.Direct3D11\Generated\REFERENCE\Interfaces.cs:line 1292
at SharpDX.Direct3D11.Texture2D..ctor(Device device, Texture2DDescription description, DataBox[] data) in C:\projects\sharpdx\Source\SharpDX.Direct3D11\Texture2D.cs:line 80
at Stride.Graphics.Texture.InitializeFromImpl(DataBox[] dataBoxes)
at Stride.Graphics.Texture.InitializeFrom(Texture parentTexture, TextureDescription description, TextureViewDescription viewDescription, DataBox[] textureDatas)
at Stride.Graphics.Texture.InitializeFrom(TextureDescription description, TextureViewDescription viewDescription, DataBox[] textureDatas)
at Stride.Graphics.Texture.New(GraphicsDevice graphicsDevice, TextureDescription description, TextureViewDescription viewDescription, DataBox[] boxes)
at Stride.Graphics.Texture.New(GraphicsDevice graphicsDevice, TextureDescription description, DataBox[] boxes)
at Stride.Graphics.GraphicsResourceAllocator.CreateTexture(TextureDescription description, PixelFormat viewFormat)
at Stride.Graphics.GraphicsResourceAllocator.GetTemporaryResource[TResource,TKey](Dictionary`2 cache, TKey description, Func`3 creator, Func`2 getDefinition, PixelFormat viewFormat)
at Stride.Graphics.GraphicsResourceAllocator.GetTemporaryTexture(TextureDescription description)
at Stride.Graphics.GraphicsResourceAllocatorExtensions.GetTemporaryTexture2D(GraphicsResourceAllocator allocator, TextureDescription description)
at Stride.Rendering.Compositing.ForwardRenderer.PrepareRenderTargets(RenderDrawContext drawContext, Texture outputRenderTarget, Texture outputDepthStencil) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\ForwardRenderer.cs:line 880
at Stride.Rendering.Compositing.ForwardRenderer.PrepareRenderTargets(RenderDrawContext drawContext, Size2 renderTargetsSize) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\ForwardRenderer.cs:line 928
at Stride.Rendering.Compositing.ForwardRenderer.DrawCore(RenderContext context, RenderDrawContext drawContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\ForwardRenderer.cs:line 740
at Stride.Rendering.Compositing.SceneRendererBase.Draw(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\Compositing\SceneRendererBase.cs:line 39
at Stride.Rendering.Compositing.SceneRendererCollection.DrawCore(RenderContext context, RenderDrawContext drawContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\Compositing\SceneRendererCollection.cs:line 28
at Stride.Rendering.Compositing.SceneRendererBase.Draw(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\Compositing\SceneRendererBase.cs:line 39
at Stride.Rendering.Compositing.SceneCameraRenderer.DrawInner(RenderDrawContext renderContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\SceneCameraRenderer.cs:line 109
at Stride.Rendering.Compositing.SceneCameraRenderer.DrawCore(RenderContext context, RenderDrawContext drawContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\SceneCameraRenderer.cs:line 72
at Stride.Rendering.Compositing.SceneRendererBase.Draw(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\Compositing\SceneRendererBase.cs:line 39
at Stride.Rendering.Compositing.GraphicsCompositor.DrawCore(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\GraphicsCompositor.cs:line 209
at Stride.Rendering.RendererBase.Draw(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\RendererBase.cs:line 51
at Stride.Engine.SceneSystem.Draw(GameTime gameTime) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Engine\SceneSystem.cs:line 234
at Stride.Games.GameSystemCollection.Draw(GameTime gameTime)
at Stride.Games.GameBase.Draw(GameTime gameTime)
at Stride.Games.GameBase.RawTick(TimeSpan elapsedTimePerUpdate, Int32 updateCount, Single drawInterpolationFactor, Boolean drawFrame)
at Stride.Games.GameBase.RawTickProducer()
Unhandled exception. SharpDX.SharpDXException: HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: The parameter is incorrect.
at SharpDX.Result.CheckError() in C:\projects\sharpdx\Source\SharpDX\Result.cs:line 195
at SharpDX.Direct3D11.Device.CreateTexture2D(Texture2DDescription& descRef, DataBox[] initialDataRef, Texture2D texture2DOut) in C:\projects\sharpdx\Source\SharpDX.Direct3D11\Generated\REFERENCE\Interfaces.cs:line 1292
at SharpDX.Direct3D11.Texture2D..ctor(Device device, Texture2DDescription description, DataBox[] data) in C:\projects\sharpdx\Source\SharpDX.Direct3D11\Texture2D.cs:line 80
at Stride.Graphics.Texture.InitializeFromImpl(DataBox[] dataBoxes)
at Stride.Graphics.Texture.InitializeFrom(Texture parentTexture, TextureDescription description, TextureViewDescription viewDescription, DataBox[] textureDatas)
at Stride.Graphics.Texture.InitializeFrom(TextureDescription description, TextureViewDescription viewDescription, DataBox[] textureDatas)
at Stride.Graphics.Texture.New(GraphicsDevice graphicsDevice, TextureDescription description, TextureViewDescription viewDescription, DataBox[] boxes)
at Stride.Graphics.Texture.New(GraphicsDevice graphicsDevice, TextureDescription description, DataBox[] boxes)
at Stride.Graphics.GraphicsResourceAllocator.CreateTexture(TextureDescription description, PixelFormat viewFormat)
at Stride.Graphics.GraphicsResourceAllocator.GetTemporaryResource[TResource,TKey](Dictionary`2 cache, TKey description, Func`3 creator, Func`2 getDefinition, PixelFormat viewFormat)
at Stride.Graphics.GraphicsResourceAllocator.GetTemporaryTexture(TextureDescription description)
at Stride.Graphics.GraphicsResourceAllocatorExtensions.GetTemporaryTexture2D(GraphicsResourceAllocator allocator, TextureDescription description)
at Stride.Rendering.Compositing.ForwardRenderer.PrepareRenderTargets(RenderDrawContext drawContext, Texture outputRenderTarget, Texture outputDepthStencil) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\ForwardRenderer.cs:line 880
at Stride.Rendering.Compositing.ForwardRenderer.PrepareRenderTargets(RenderDrawContext drawContext, Size2 renderTargetsSize) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\ForwardRenderer.cs:line 928
at Stride.Rendering.Compositing.ForwardRenderer.DrawCore(RenderContext context, RenderDrawContext drawContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\ForwardRenderer.cs:line 740
at Stride.Rendering.Compositing.SceneRendererBase.Draw(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\Compositing\SceneRendererBase.cs:line 39
at Stride.Rendering.Compositing.SceneRendererCollection.DrawCore(RenderContext context, RenderDrawContext drawContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\Compositing\SceneRendererCollection.cs:line 28
at Stride.Rendering.Compositing.SceneRendererBase.Draw(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\Compositing\SceneRendererBase.cs:line 39
at Stride.Rendering.Compositing.SceneCameraRenderer.DrawInner(RenderDrawContext renderContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\SceneCameraRenderer.cs:line 109
at Stride.Rendering.Compositing.SceneCameraRenderer.DrawCore(RenderContext context, RenderDrawContext drawContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\SceneCameraRenderer.cs:line 72
at Stride.Rendering.Compositing.SceneRendererBase.Draw(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\Compositing\SceneRendererBase.cs:line 39
at Stride.Rendering.Compositing.GraphicsCompositor.DrawCore(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Rendering\Compositing\GraphicsCompositor.cs:line 209
at Stride.Rendering.RendererBase.Draw(RenderDrawContext context) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Rendering\Rendering\RendererBase.cs:line 51
at Stride.Engine.SceneSystem.Draw(GameTime gameTime) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\engine\Stride.Engine\Engine\SceneSystem.cs:line 234
at Stride.Games.GameSystemCollection.Draw(GameTime gameTime)
at Stride.Games.GameBase.Draw(GameTime gameTime)
at Stride.Games.GameBase.RawTick(TimeSpan elapsedTimePerUpdate, Int32 updateCount, Single drawInterpolationFactor, Boolean drawFrame)
at Stride.Games.GameBase.RawTickProducer()
at Stride.Games.GameBase.Tick()
at Stride.Games.GamePlatform.Tick()
at Stride.Games.GamePlatform.OnRunCallback()
at Stride.Games.GameWindowWinforms.<>c__DisplayClass19_0.<Run>b__0()
at Stride.Games.WindowsMessageLoop.Run(Control form, RenderCallback renderCallback, Boolean useApplicationDoEvents)
at Stride.Games.GameWindowWinforms.Run()
at Stride.Games.GamePlatform.Run(GameContext gameContext)
at Stride.Games.GameBase.Run(GameContext gameContext)
at Program.<Main>$(String[] args) in D:\Tests\Stride Tests\Test_Lvl9_1\Test_Lvl9_1.Windows\Test_Lvl9_1App.cs:line 4
Additional context
OpenGL seems to work.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at Stride.Engine/Rendering/Compositing/ForwardRenderer.cs, especially PrepareRenderTargets at the lines shown in the stack trace, and follow the texture description passed to GraphicsResourceAllocator.GetTemporaryTexture. Reproduce a DirectX project using graphics level 9_1 and confirm that startup completes without the E_INVALIDARG texture-creation crash.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- computer-graphics, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100