Rendering to Layered Texture using Subpasses?

Hi,

I want to render to a cubemap without using the geometry shader for layer selection.

I have read that subpasses might be helpful but I would need to configure the subpass attachments to select the proper layer.

But I have only very limited knowledge about the entire proceedings.

As I understand the dependencies:

I create a commandbuffer using a renderpass and framebuffer

the framebuffer knows about the same renderpass AND about the view to the render target

the view and the framebuffer contain knowledge about a layer count

the views image shoul contain the same number of layers

The view also allows me to select a baseArrayLayer to which I can write.

Now, I would have hoped to find som layer correspondece during subpass creation, but I fail to see any connection.

I hope for some help and explanation or a statement on whether what I try to do makes sense.
Best Regards

I want to render to a cubemap without using the geometry shader for layer selection.

You can’t. Only the GS can select a layer.

I have read that subpasses might be helpful

They won’t. While you could provide several layers as color attachments (by making separate a image view for each layer) and use different layers in different subpasses, that’s not layered rendering. You would be limited by the number of color attachments you can use.

Thank you for that definitive answer

To clarify, how would I render to the individual cube faces.

Do I need 6 pipelines? 6 attachments? 6 renderpasses? 6 framebuffers?

Best Regards