stride icon indicating copy to clipboard operation
stride copied to clipboard

FastTextRenderer crashes on Vulkan

Open Doprez opened this issue 7 months ago • 0 comments

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:

  1. Add default GameProfiler class to an empty project
  2. Set the Graphics API to Vulkan in the csproj
  3. watch the shaders compile
  4. 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()

Doprez avatar Jun 03 '25 16:06 Doprez