Skip to content

Can't set MSAA samples beyond 4 #2910

@swiftcoder

Description

@swiftcoder

Description
A clear and concise description of what the bug is.

The Vulkan capabilities viewer says that my hardware/driver supports MSAA samples up to 8 for all targets:

image

Setting MSAA samples to 1 or 4 works correctly, however increasing the samples to 8 causes the following error:

     Running `C:\...\msaa-line.exe`
Using NVIDIA GeForce GTX 1080 (Vulkan)
[2022-07-23T09:22:55Z ERROR wgpu::backend::direct] Handling wgpu errors as fatal by default
thread 'main' panicked at 'wgpu error: Validation Error

Caused by:
    In a RenderPass
      note: encoder = `<CommandBuffer-(0, 1, Vulkan)>`
    In a pass parameter
      note: command buffer = `<CommandBuffer-(0, 1, Vulkan)>`
    attachment's sample count 8 is invalid

', wgpu\src\backend\direct.rs:2391:5

Repro steps
Modify the msaa-line sample to set the number of samples to 8, and run it.

Expected vs observed behavior
Clearly describe what you get, and how it goes across your expectations.

I appreciate that the current web spec only supports sample counts of 1 or 4, but I don't think this limitation should be enforced as a strict validation (especially for desktop builds, where the driver likely supports at least 8, and one can always query against the underlying API directly).

Extra materials
This appears to be failing a hardcoded validation.

All other hardcoded validations I can find only check that the number of samples are less than 32.

Platform
Information about your OS, version of wgpu, your tech stack, etc.

Windows 10, Vulkan, v0.13.1 of wgpu

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: apiIssues related to API surfacegood first issueGood for newcomershelp requiredWe need community help to make this happen.type: enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions