FastTextRenderer crashes on Vulkan
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: GitHub
Version: master and 4.2.0.2381
Platform(s): Windows Vulkan
Describe the bug
When creating the GameProfiler it uses the FastTextRenderer which causes a crash due to trying to use WriteDiscard.
To Reproduce
Steps to reproduce the behavior:
- Add default GameProfiler class to an empty project
- Set the Graphics API to Vulkan in the csproj
- watch the shaders compile
- crash when running
Expected behavior
It should either:
- add an error for Vulkan in the GameProfiler class that explains it as incompatible
- Use an alternative to FastTextRenderer for Vulkan
Log and callstacks
[CustomGame]: Error: Unexpected exception. System.InvalidOperationException: Can't use WriteDiscard on Graphics API that doesn't support renaming
at Stride.Graphics.CommandList.MapSubresource(GraphicsResource resource, Int32 subResourceIndex, MapMode mapMode, Boolean doNotWait, Int32 offsetInBytes, Int32 lengthInBytes)
at Stride.Graphics.FastTextRenderer.End(GraphicsContext graphicsContext)
at Stride.Profiling.GameProfilingSystem.Draw(GameTime gameTime) in D:\dev\GitControlledProjects\stride\sources\engine\Stride.Engine\Profiling\GameProfilingSystem.cs:line 391
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()
System.InvalidOperationException: Can't use WriteDiscard on Graphics API that doesn't support renaming
at Stride.Graphics.CommandList.MapSubresource(GraphicsResource resource, Int32 subResourceIndex, MapMode mapMode, Boolean doNotWait, Int32 offsetInBytes, Int32 lengthInBytes)
at Stride.Graphics.FastTextRenderer.End(GraphicsContext graphicsContext)
at Stride.Profiling.GameProfilingSystem.Draw(GameTime gameTime) in D:\dev\GitControlledProjects\stride\sources\engine\Stride.Engine\Profiling\GameProfilingSystem.cs:line 391
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()
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 with Stride.Engine/Profiling/GameProfilingSystem.cs around line 391 and follow the FastTextRenderer.End and CommandList.MapSubresource calls shown in the stack trace. Reproduce the crash with the default GameProfiler in an empty Windows Vulkan project, then determine whether the completed fix should provide a Vulkan incompatibility error or avoid FastTextRenderer; verify that running no longer crashes.
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
- 35/100