stride3d / stride3d/stride

Vulkan backend has no multisampling at all — five independent hardcodes, not a capability gate; enabling caps turns the silent no-op into `NotImplementedException`

Open
#3,317 0 comments 0 reactions 0 assignees View on GitHub

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.3.0.2507
Platform(s): Vulkan (all)

Describe the bug
MSAA can never engage on Vulkan regardless of GPU. Five separate sites (decompiled
4.3.0.2507 Stride.Graphics.dll, Vulkan variant):

# Site Code Effect
1 GraphicsDeviceFeatures..ctor fills mapFeaturesPerFormat with MultisampleCount.None, FormatSupport.None for all 256 formats — device never queried every format reports 1 sample max (and, separately, FormatSupport.None — a latent bug for anything gating on it)
2 Texture.CreateImage() samples = (VkSampleCountFlags)1; literal — TextureDescription.MultisampleCount never read no multisampled VkImage can be created
3 PipelineState.Recreate() rasterizationSamples = 1 and every VkAttachmentDescription.samples = 1; Description.Output.MultisampleCount never read pipelines/render passes single-sample
4 Texture.GetImageView if (IsMultisample) throw new NotImplementedException(); the one that actually fires
5 CommandList.CopyMultisample throw new NotImplementedException(); no hardware resolve

Because of (1), ForwardRenderer.InitializeCore clamps any requested MSAALevel down to None
with only a warning — the caps table is the only thing standing between the user and a crash.
We verified: patching the caps entries by reflection makes the compositor request a 4× target
and the frame dies at site (4) with NotImplementedException from Texture.GetImageView.

To Reproduce

  1. Any Vulkan game, set MSAALevel = MultisampleCount.X4 on the forward renderer.
  2. Observe the "not supported, falling back" warning on every GPU (or force the caps table via
    reflection to see the underlying NotImplementedException at site 4).

Expected behavior
Either working MSAA on Vulkan, or documentation stating it is unimplemented on this backend.

Additional context
Fix is real work, not a one-liner: thread TextureDescription.MultisampleCount into
VkImageCreateInfo.samples; thread RenderOutputDescription.MultisampleCount into
rasterizationSamples and both attachment descriptions; implement CopyMultisample over
vkCmdResolveImage (+ VK_KHR_depth_stencil_resolve for depth); fill the caps table from
vkGetPhysicalDeviceImageFormatProperties. Until then, Vulkan/Linux has no hardware AA — which
makes the FXAA defect (#3316) the only AA on the platform.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Vulkan entry points named in the report: GraphicsDeviceFeatures..ctor, Texture.CreateImage, PipelineState.Recreate, Texture.GetImageView, and CommandList.CopyMultisample. Reproduce with MSAALevel = MultisampleCount.X4 and inspect the fallback or NotImplementedException. Done means Vulkan MSAA works, including resolve behavior, or the backend's limitation is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
computer-graphics, game-dev
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.