#Validation: Sampler descriptor using image with msaa, but opimagetype marked as single-sampled

1 messages ยท Page 1 of 1 (latest)

raven narwhal
#

After implementing a render pass to render my scene to a texture to display in ImGui, using an MSAAx8 image with the sampler results in this error:
validation layer: type { Validation } Error: vkCmdDrawIndexed(): the combined image sampler descriptor [VkDescriptorSet 0x5a000000005a, Set 0, Binding 0, Index 0, variable "sTexture"] has VkImage 0x220000000022 created with VK_SAMPLE_COUNT_8_BIT, but OpTypeImage has marked it as single-sampled.
I'm not exactly sure where the issue lies and therefore what information would be required to troubleshoot, so included is the ImageCreateInfo arguments and SamplerCreateInfo.
(Understand that this could be an ImGui issue which isnt in the vulkan scope, but would be great to understand how this error manifests for my own knowledge)
Any help is massively appreciated ๐Ÿ™‚

frosty shuttle
#

do you intend to read the final render as a normal image or do you really intend to read it as a multi sampled image?

#

if the intention is "display renderpass results" you're passing the wrong image

raven narwhal
#

my thinking was to multisample the scene and display it in the UI and not the multisample the UI
what other image should I be passing?

#

should it be the frame buffer's image?

frosty shuttle
#

you pass it the resolve attachment, i.e. the one you replaced the swapchain's image in the tutorial you're following

#

MSAA renderpasses involves 3 images if doing depth buffering, 4 if you also want to read the final depth values

#

you should not be trying to sample the multi sampled attachment if your intention is to display the result

#

it is like the intermediate or "working" image, not the final render

raven narwhal
#

ah ok!
that explains it
because the code I'm referencing is for only using the image as input for a shader

#

it all makes sense now
thank you very much ๐Ÿ˜„

raven narwhal
#

@frosty shuttle I am thinking best practice for my situation would be to only MSAA in the final stage?
RenderScene (Colour + Depth)
Render UI using colour image (Resolving to swapchain with msaa)

Or have I misunderstood?

frosty shuttle
#

I mean if you do that you're only msaaing the UI

#

you need to MSAA every pass that you want to be MSAAed

#

you can't MSAA a texture

raven narwhal
#

ok then I'm confused ๐Ÿ™
in my original presentation to the swap chain it was like you said, using a resolve attachment that was passed to cmdBuffer->beginRendering
in the renderpass, I pass a RenderPassBeginInfo to beginRenderPass, but that only takes a few things
I am assuming the resolve image needs to be in the renderpass object itself?

frosty shuttle
#

I feel like you should go read a MSAA example that draws to the swapchain and then replace the swapchain image with the image you want to use to display

raven narwhal
#

well I had msaa working fine before working in a renderpass ๐Ÿ˜›
I think I am slowly understanding what you are saying though
in my recording of the command buffers, I am transitioning the images before starting rendering
but in a renderpass I need to inform much sooner in the renderpass object creation phase

#

I'll keep hacking away ๐Ÿ˜„
very appreciative for the help ๐Ÿ™‚

frosty shuttle
#

if you had it working then why are you now using renderpasses?

raven narwhal
#

because my UI was rendering on top of the scene where as I wanted to render the scene into a viewport and as my old knowledge rational would devise, I needed a render texture setup
which lead me to offscreen rendering and renderpasses

#

is that not the best way?

frosty shuttle
#

the only thing you had to do for dynamic rendering to go from swapchain to offscreen is you do everything exactly the same except pass in the offscreen image and change the barrier going to the present layout

raven narwhal
#

does dynamic rendering supersede renderpasses?
or are they still required for deferred/g buffer related techniques?

frosty shuttle
#

dynamic rendering completely replaces renderpasses, yes, tho on mobile you need an additional extension for subpasses

raven narwhal
#

ah ok, well bugger

frosty shuttle
#

effectively feature wise, they are the same, except dynamic is well more dynamic

raven narwhal
#

right ok then, guess I have a lot of Ctrl + Z-ing to do ๐Ÿ˜„

frosty shuttle
#

yes you do lol

raven narwhal
#

thank you for opening my eyes

frosty shuttle
#

the hardest thing is to change the barriers but everything else is exactly the same but sub swpchain with offscreen image

raven narwhal
#

so where previously I have ColourImage + DepthImage > Resolve to - SwapchainImage
I would have ColourImage + DepthImage > Resolve to - IntermediateImage > Resolve to - SwapchainImage

frosty shuttle
#

then it's (IntermediateImage) just a regular image

raven narwhal
#

oh so I would do a separate commandBuffer and render my UI and use the IntermediateImage as a regular texture?

frosty shuttle
#

if that's your goal, yeah

raven narwhal
#

awesome!

frosty shuttle
#

but you don't need a separate cb

raven narwhal
#

ah yeah, can just reuse

frosty shuttle
#

i mean you can put them into the same one

raven narwhal
#

and transition in the different set of images?

frosty shuttle
#

not sure why you have different set of images here, but whatever you do with 2 cbs submitted sequentially, you can do by recording all the commands in the same cb

#

cuz that's effectively what queues do

raven narwhal
#

I was assuming maybe I would need to transition colour, depth and intermediate > render scene > transition swapchain

#

but since its linear I guess you would just do all the transitions then render

#

or you call beginRendering multiple times within CB begin/end I guess?

frosty shuttle
#

the full thing is:
barrier colour, depth and intermediate > render scene > barrier intermediate >
barrier swapchain > render UI > barrier swapchain

#

you only don't need to barrier color and depth after rendering here cuz you do not use them again until the next frame

#

if you need to use them again then you need to barrier them too

raven narwhal
#

ok great, I'll give that a go
will take me a while, but no doubt I'll be pestering you more ๐Ÿ™‚

#

thank you for your patience and for sharing your knowledge ๐Ÿ™‚

frosty shuttle
#

yeahh but please do a new thread for that so other people have a chance to reply to you

raven narwhal
#

a new thread for a different topic or to continue on this one?

frosty shuttle
#

a new thread for the new problem ๐Ÿ˜