Skip to content

Create interface for VulkanSceneGraph #144

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

Open
dov opened this issue Dec 2, 2024 · 2 comments
Open

Create interface for VulkanSceneGraph #144

dov opened this issue Dec 2, 2024 · 2 comments
Labels
TODO to do..

Comments

@dov
Copy link

dov commented Dec 2, 2024

VulkanSceneGraph (VSG) is a high level interface to Vulkan under active development. I'd love to see an adapter for VKVG to VSG similar to the existing ImGui adapter.

References

@jpbruyere jpbruyere added the TODO to do.. label Dec 3, 2024
@dov
Copy link
Author

dov commented Mar 11, 2025

I tried looking at this myself, but I need some guidance:

  • As far as I understand in Vulkan Scene Graph (vsg) the infrastructure already creates a CommandBuffer that you should record to. My problem is how I can interface this command buffer to the vkvgContext?

I'm trying to base my solution on the vsgImGui which interfaces VSG to imgGUI, which when recording calls out to:

            ImGui_ImplVulkan_RenderDrawData(ImDrawData *draw_data, VkCommandBuffer commandBuffer);

Is there a function doing the corresponding call to record the vkvg commands?

To me it seems like vkvg is currently hardcoded to create its own command buffer through vkvg_create(). Am I missing something?

@jpbruyere
Copy link
Owner

jpbruyere commented Mar 12, 2025

Here are some notes on the internal use of buffers: https://github.com/jpbruyere/vkvg/wiki/Internals.
I use 2 buffers and swap them for rendering. Could those buffers be declared as secondary buffers? There are multiple things to consider here:

  • the target texture to draw on: vkvg handles textures and renderpasses.
  • the synchronizations: I use one fence in the context or one timeline semaphore (compile option)
    vkvg is not designed to interface with existing command buffers, so there is no way in the api to do that. The use of 2 command buffers looks to me a blocking point for that idea.

Sharing the command buffer with the host app looks to me quiet invasive, if targeting secure applications, this looks a bad option for me. If cmd are passed as secondary buffers, this could be better maybe. The point is to be able to keep track of command buffers debug counters and timing.

I plan to crate a new structure: vkvg_path to holds multiple stroking and filling algorithms, that addition to the existing model could ease to implement such an idea.....

The error handling model of vkvg follows cairo principles: api could continue to be called even after faulting without halting host application, if vkvg is completely in error, the only problem must be a black screen, but the host operations should be able to continue. The status field in each structure must keep track of current error.

Feel free to expose more of your questioning so that I could help you.

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

No branches or pull requests

2 participants