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 ๐
#Validation: Sampler descriptor using image with msaa, but opimagetype marked as single-sampled
1 messages ยท Page 1 of 1 (latest)
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
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?
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
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 ๐
@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?
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
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?
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
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 ๐
if you had it working then why are you now using renderpasses?
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?
which part of this requires renderpasses and not dynamic rendering?
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
does dynamic rendering supersede renderpasses?
or are they still required for deferred/g buffer related techniques?
dynamic rendering completely replaces renderpasses, yes, tho on mobile you need an additional extension for subpasses
ah ok, well bugger
effectively feature wise, they are the same, except dynamic is well more dynamic
right ok then, guess I have a lot of Ctrl + Z-ing to do ๐
yes you do lol
thank you for opening my eyes
the hardest thing is to change the barriers but everything else is exactly the same but sub swpchain with offscreen image
so where previously I have ColourImage + DepthImage > Resolve to - SwapchainImage
I would have ColourImage + DepthImage > Resolve to - IntermediateImage > Resolve to - SwapchainImage
you resolve one time
then it's (IntermediateImage) just a regular image
oh so I would do a separate commandBuffer and render my UI and use the IntermediateImage as a regular texture?
if that's your goal, yeah
awesome!
but you don't need a separate cb
ah yeah, can just reuse
i mean you can put them into the same one
and transition in the different set of images?
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
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?
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
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 ๐
yeahh but please do a new thread for that so other people have a chance to reply to you
a new thread for a different topic or to continue on this one?
a new thread for the new problem ๐