Skip to content
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

Multiple Windows (SwapChain) sample? #142

Closed
amerkoleci opened this issue Apr 29, 2016 · 6 comments
Closed

Multiple Windows (SwapChain) sample? #142

amerkoleci opened this issue Apr 29, 2016 · 6 comments

Comments

@amerkoleci
Copy link

Would be possible to add multiple swap chain example ( for desktop ) platforms?

Thank you

@SaschaWillems
Copy link
Owner

Nothing planned. But having multiple windows with multiple swap chains is pretty straightforward. Just create a surface for each window (passing e.g. the HWND and HINSTANCE on Windows) and use that for the swap chains.

@Ziflin
Copy link

Ziflin commented Feb 4, 2017

So the confusing part is that it seems that RenderPasses and therefore GraphicsPipelines are dependent on the Surface's format. So do you create these objects per window (super annoying for sharing materials) or do you hope the render passes are going to be compatible (meaning the surface format is always the same) and create a 'dummy' window+surface during initialization and use it's format?

Without doing this, the physical device selection can't verify with vkGetPhysicalDeviceSurfaceCapabilitiesKHR that the surface will be compatible. Then for each real window, you would need to create a surface for it and verify that its format/caps matched. I would think that they would normally be the same as the initial dummy window.

@ocornut
Copy link

ocornut commented Mar 2, 2018

@SaschaWillems @Ziflin Curious if you have any after-the-fact comment/suggestion on the problem you @Ziflin described? I'm also trying to implement multiple viewport and wondering what assumption I can make about matching surface format.

@Ziflin
Copy link

Ziflin commented Mar 2, 2018

@ocornut I never found a great example, but I just ended up going with the same (annoying) setup as I mentioned and during initialization I create a temporary window and create a surface from that that I keep around. Then during 'actual' window creation, I create a new surface for that window and verify that it has a surface format (GetPhysicalDeviceSurfaceFormatsKhr) that has a matching format and colorspace as the initialization surface.

I'm not sure why this isn't addressed better somewhere...

@DuncanHopkins
Copy link

On a related but slightly different situation, do you have an example for driving one surface over multiple devices with monitors on each? I have been looking but seem to have missed the ability to tell if the a surface is completely not on one of the devices, so can save not rendering to it.

Even just a hint to the correct API struct or func would be greatly appreciated.

Thanks.

@rhoeberg
Copy link

@ocornut and @Ziflin curious if any of you ever found a better way to go about this than creating a dummy window?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants