Replies: 1 comment 3 replies
-
You can't "sample" from a multi-sampled texture (in either of the APIs). You can only load/fetch samples from it:
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys! I finished my toy 3D renderer and then I try to do simple multisampling, so I am wondering how I can modify my shader code to enable it to sample multi-sampled textures.
My
glsl
fragment shader code contains uniforms like:and in the shader's main, I use it like
The above code works fine when multisampling is disabled, but when I enabled multisampling, it gave me runtime errors
I think this error indicates that I got the configurations on CPU side correct, but I need to somehow modify my shader code.
When I configure
BindGroupLayout
, I see the fieldmultisampled
inBindingType::Texture
has documentation that says "If this is true, the texture must be read from shaders with texture1DMS, texture2DMS, or texture3DMS, depending on dimension.".So, I tried adding
MS
to different places, butshaderc
always complains.For the CPU-side code, basically I just modified the following two structs and their fields:
MultisampleState.count
TextureDescriptor.sample_count
Do you have any suggestions? Thank you!
Beta Was this translation helpful? Give feedback.
All reactions