Skip to content

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

Description

@jpenberthy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions