-
-
Notifications
You must be signed in to change notification settings - Fork 306
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
[wgpu] Validation error when sampling multisampled texture in capture_hi_res.rs
example
#462
Comments
Your shader expects the texture to be non-multisampled:
The proper type would be texture2DMS .
So from |
Aaaahhhhhhhhh I see! TIL Thank you as usual! |
For the reference, keep this around: https://github.com/KhronosGroup/GLSL/blob/master/extensions/khr/GL_KHR_vulkan_glsl.txt I think in the future we'll have WGSL specified much better and will be able to recommend it. |
Previously a validation error was occurring due to passing a sampled texture to the bind group without declaring that the texture was multisampled in the fragment shader. This adds some new multisampled shaders that correctly declare the texture and do the multisampling resolve manually. Dedicated shaders have been added for common sample counts with unrolled loops to avoid having the shader deal with conditions based on uniform data. A fallback shader is provided for all other sample counts. Closes nannou-org#462.
Okydoke, just pushed a fix in this commit! |
Some Context
The new
capture_hi_res.rs
example demonstrates the following steps each frame:During step 4, we use a
TextureReshaper
to write the larger mulstisampled texture to the smaller multisampled window texture (see here). TheTextureReshaper
does this by treating thesrc_texture
as a shader input and rendering it with two triangles to thedst_texture
. TheTextureReshaper
src can be found here.The Issue
An issue is occurring where the following validation error is being produced when
render_pass.draw
is called within theTextureReshaper::encode_render_pass
method:It seems that, for some reason, the texture binding in the descriptor set is expected to have a sample count of
1
, even though we specify that theSampledTexture
is multisampled when creating the bind group layout.@kvark do you have any thoughts on what I might be doing wrong here? You mentioned yesterday that it should be fine to use a multisampled texture as a shader input, so I'm guessing I must be failing to specify the src sample count in a field somewhere or something along these lines. Or is it possible that the
multisampled
field of theBindGroupLayoutBinding
is accidentally being ignored by wgpu? Let me know if I can provide more info!Sorry to keep bugging you! This is the last known wgpu related error I'm running into before #452 is ready to land but I'm struggling to crack this one.
The text was updated successfully, but these errors were encountered: