Conversation
…ise linker fails in iOS; this needs to be done better
|
Thanks @iconiqlabs. I have merged and built under Linux. This built but caused a linked error relating to the change to use vkCreateRenderPass2KHR. This also broke the automated Windows build so I've changed the code back to the original vkCreateRenderPass2KHR and added this macro to RenderPass.cpp to try and keep things compiling on the iOS build: #if !defined(VK_VERSION_1_2) Could you try VSG master to see if builds cleanly on iOS? |
|
Unfortunately, this doesn't help. I can't build with this. The VK_VERSION_1_2 macro is defined here too (even though this is wrong as they claim to support Vulkan API 1.1). I've noticed there is I was thinking to actually define a MVK_VERSION_1_1 via src/CMakeLists.txt and do what you did. Would you agree with this? |
|
On Sat, 23 Apr 2022 at 16:32, iconiqlabs ***@***.***> wrote:
Unfortunately, this doesn't help. I can't build with this. The
VK_VERSION_1_2 macro is defined here too (even though this is wrong as they
claim to support Vulkan API 1.1). I've noticed there is
#define MVK_VERSION_MAJOR 1
#define MVK_VERSION_MAJOR 1
#define MVK_VERSION_MAJOR 4
I was thinking to actually define a MVK_VERSION_1_1 via src/CMakeLists.txt
and do what you did. Would you agree with this?
If VK_VERSION_1_2 is defined then then the header at least should have the
vkCreateRenderPass2 function, so I would expect it to compile.
Is it a compile error or a link error that you are seeing? Or a runtime
error?
… Message ID: ***@***.***>
|
|
It compiles, yes. But it's a linker error: I am sure this is a MoltenVK issue. So, I think that instead of (or better said in addition of) looking for Vulkan version, we need to look for a MoltenVK version when it exists and check it is 1.1, 1.2, etc... |
|
On Sat, 23 Apr 2022 at 17:24, iconiqlabs ***@***.***> wrote:
It compiles, yes. But it's a linker error:
Undefined symbols for architecture arm64:
"_vkCreateRenderPass2", referenced from:
vsg::RenderPass:RenderPass(vsg::Device*,
std::__1::vector<vsg::AttachmentDescription, ....
I am sure this is a MoltenVK issue. So, I think that instead of (or better
said in addition of) looking for Vulkan version, we need to look for a
MoltenVK version when it exists and check it is 1.1, 1.2, etc...
Thanks for the explanation that makes it a bit clearer and explains why the
version check I added doesn't work.
Are you building against VulkanSDK headers but linking to MoltenVK libs?
Do the MoltenVK libs come with headers? Or are the MoltenVK libs now part
of the VulkanSDK?
Perhaps another workaround would be to query for the
vkCreateRenderPass2/KHR function at runtime as we do for the mesh shader
and RTX extensions.
… Message ID: ***@***.***>
|
|
MoltenVK comes with its own headers. But there, they still do define the VK_VERSION_1_2. If you can query for the function at runtime that is probably the tidiest approach. I have tried this to check I would work and it does In the src/CMakeLists.txt after the target is created which causes macros MOLTEN_VK, MVK_VERSION_1_0 and MVK_VERSION_1_1 to be defined. Then, in the RenderPass.cpp code, using this: makes it to build. Not too bad, but no doubt your approach is better. |
|
I think workaround for different MoltemVK versions could end up being
awkward to maintain. I current feel the best approach will be just treat
it as an extension and query the function pointer at runtime.
|
|
I have added a vkCreateRenderPass2 member to vsg::Extension, added use of
this to RenderPass.cpp and checked this into a ExtensionRefactor branch:
https://github.com/vsg-dev/VulkanSceneGraph/tree/ExtensionRefactor
I'm not yet finished on this as I want to replace the static variables from
the Extension.cpp, and add the ability to get the proc address of non
extensions for cases where vkRenderPass2 is actually provided by the driver
but the vkGetDeviceProcAddr function isn't locating it.
The static member issue needs to be resolved as I've get a seg fault on
exit from vsgdraw/vsgviewer etc because of this.
While I've still got more work to do the checked in changes should be
sufficient for testing under iOS. @iconiqlabs could you test whether these
changes build and runtime on iOS?
|
|
Looks good. I made the test myself with this I think it is ok to merge your code into master. I will test it as soon as it is there :-) |
|
Hi Robert. I'll make some more improvements in iOS support and let you know about them for merging them |
|
On Tue, 26 Apr 2022 at 10:12, iconiqlabs ***@***.***> wrote:
Hi Robert.
I just tested this and I confirm this is working.
Good job!
I'll make some more improvements in iOS support and let you know about
them for merging them
I haven't announced support for iOS on twitter yet, as I was waiting for
the build to work out of the box. Should I wait to these further
improvements or is it fine to go ahead?
Do you have a twitter handle?
… Message ID: ***@***.***>
|
|
I think it is fine to go ahead. The changes that are on the way are not expected immediately available. They are just 2:
I will need these two things in a framework I am writing. Will perform them when I get to the point. I blush to confess I never used Twitte. But the occasion deserves it. I created an account for the company. Here https://twitter.com/IconiqLabs |
Pull Request Template
Description
Support for iOS.
Fixes # (issue)
Type of change
How Has This Been Tested?
Tested to run in iOS
Test Configuration:
Checklist: