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

Adding structs to VkRenderPassCreateInfo::pNext #79

Open
tmayoff opened this issue May 10, 2023 · 8 comments
Open

Adding structs to VkRenderPassCreateInfo::pNext #79

tmayoff opened this issue May 10, 2023 · 8 comments

Comments

@tmayoff
Copy link

tmayoff commented May 10, 2023

Hello, I'm currently using this library to help with the vulkan work in a OpenXR renderer, I'd like to be able to use this vulkan extension, but requires that I pass extra info into the VkRenderPassCreateInfo::pNext. Is this possible with vuk, right now?

@martty
Copy link
Owner

martty commented Jul 25, 2023

Hi, very sorry, I must've read this and put off replying, then completely forgot.

Currently this is not possible - but it could be added if this is still something you are interested in.

@tmayoff
Copy link
Author

tmayoff commented Jul 25, 2023

This is something I'm interested in, if you're busy I don't mind adding it myself and contributing if you can give some info on where to start

@martty
Copy link
Owner

martty commented Jul 28, 2023

Could you describe how do you intend to use this?

While it would be easy to pass the pNext so that it ends up on the renderpass, if you need guaranteed subpass layout then it will require more thought.

@tmayoff
Copy link
Author

tmayoff commented Jul 28, 2023

Reading the extension, it seems I only need the structure to exist on the pNext chain, this causes the renderpass to be executed twice with some variables changed in the shaders. So access to the pNext (or someway to add to the chain) is all I need.

This is an example implementation, I was basing this off of, maybe I'm missing something but pretty sure no

@martty
Copy link
Owner

martty commented Aug 13, 2023

Hi,
I made a branch that lets you begin renderpasses yourself:
https://github.com/martty/vuk/tree/manual_rps

I modified example 2 to showcase how you would do it, but I am not sure how to test properly, so I didn't fill the extension struct with proper values.

Please let me know if this works for you, or if you need any help!

@tmayoff
Copy link
Author

tmayoff commented Aug 28, 2023

Sorry for the delay, I tested the PR really quick, and will hopefully test more next week. The changes seem to work (although I'm fighting with some other VR application things preventing much more testing being done). Is it necessary to manually start the Render Pass for something like this, I'm not too familiar with vulkan extensions nor the inner workings of vuk, but would it be possible to have a .next like option to a render graph's add_pass or another function that accumulates a list of structs, then have vuk build the chain of .next's when it's time to start the pass?

@martty
Copy link
Owner

martty commented Aug 28, 2023

No worries, take your time.

The reason I implemented it this way is because I am unsure the amount of flexibility you need here - vuk should let you dip to calling Vulkan whenever you need to, and in this case it was not possible.

It might be possible to have something like you describe, but it would be tricky to make it both generic and easy to use I think - I'd rather integrate some specific functionality when it turns out to be useful.

@tmayoff
Copy link
Author

tmayoff commented Nov 9, 2023

It's been a while, but I did manage to test it, and nope. Turns out it changes more than I assumed. Normally in VR you create two sets of swapchain+images (one for each eye), with this extension you're only supposed to need one, however the images need to be an array of images (one for each eye). I'm not sure if this might push the scope of this library, but for now I'm not in need of major performance improvements, so I'm okay with my current approach without the extension.

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

No branches or pull requests

2 participants