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

Attachments only support sample counts 1 and 4 #1832

Closed
phoekz opened this issue Aug 19, 2021 · 5 comments
Closed

Attachments only support sample counts 1 and 4 #1832

phoekz opened this issue Aug 19, 2021 · 5 comments
Labels
area: api Issues related to API surface type: enhancement New feature or request

Comments

@phoekz
Copy link
Contributor

phoekz commented Aug 19, 2021

Description
When starting a render pass which has multisampling enabled, I get this validation error:

[2021-08-19T16:28:25Z ERROR wgpu::backend::direct] wgpu error: Validation Error

    Caused by:
        In a RenderPass
          note: encoder = `Encoder`
        In a pass parameter
          note: command buffer = `Encoder`
        attachment's sample count 2 is invalid

Sample counts 1 and 4 work, while 2 and 8 do not, even though my GPU definitely supports those. I looked around and I suspect this condition is the problem:

if sample_count != 1 && sample_count != 4 {
return Err(RenderPassErrorInner::InvalidSampleCount(sample_count));
}

@kvark kvark added area: api Issues related to API surface type: enhancement New feature or request labels Aug 19, 2021
@kvark
Copy link
Member

kvark commented Aug 19, 2021

That's what WebGPU exposes today. We can think of a way to expose this in a non-portable native-only way.

@phoekz
Copy link
Contributor Author

phoekz commented Aug 19, 2021

Ah my bad. I was actually trying to look up from the spec if this was intentional. Looks like I missed this under section 6.1.1:

image

@phoekz
Copy link
Contributor Author

phoekz commented Aug 19, 2021

To avoid further confusion, it might be a good idea to throw a more specific error which states that only 1 and 4 are valid values.

Or you can go down Vulkan path of defining enums for sample counts, and only allowing for 1 and 4 for example.

bors bot pushed a commit to bevyengine/bevy that referenced this issue Oct 29, 2021
Adds support for MSAA to the new renderer. This is done using the new [pipeline specialization](#3031) support to specialize on sample count. This is an alternative implementation to #2541 that cuts out the need for complicated render graph edge management by moving the relevant target information into View entities. This reuses @superdump's clever MSAA bitflag range code from #2541.

Note that wgpu currently only supports 1 or 4 samples due to those being the values supported by WebGPU. However they do plan on exposing ways to [enable/query for natively supported sample counts](gfx-rs/wgpu#1832). When this happens we should integrate
@daxpedda
Copy link
Contributor

Is this not fixed by #3140?

@cwfitzgerald
Copy link
Member

It was!

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 type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants