Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't set MSAA samples beyond 4 #2910

Closed
swiftcoder opened this issue Jul 23, 2022 · 1 comment · Fixed by #3140
Closed

Can't set MSAA samples beyond 4 #2910

swiftcoder opened this issue Jul 23, 2022 · 1 comment · Fixed by #3140
Labels
area: api Issues related to API surface good first issue Good for newcomers help required We need community help to make this happen. type: enhancement New feature or request

Comments

@swiftcoder
Copy link
Contributor

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

@cwfitzgerald
Copy link
Member

Thanks for the issue! We definitely want to add this, and the way I think that this should manifest is by extending the TextureFormatFeatutes and splitting multisampling into three flags, 2, 4, and 8 sample flags for each texture.

@cwfitzgerald cwfitzgerald added type: enhancement New feature or request help required We need community help to make this happen. area: api Issues related to API surface good first issue Good for newcomers labels Jul 31, 2022
wozeparrot pushed a commit to wozeparrot/wgpu that referenced this issue Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: api Issues related to API surface good first issue Good for newcomers help required We need community help to make this happen. type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants