Replies: 3 comments
-
The vsg::RecordTraversal records vsg::Command nodes to the vk/vsg::CommandBuffer in top down, left right traversal order, except with a subgraph leverages binning such as with the vsg::DepthSorted node which is useful for binning and depth sorting transparent objects. The vsg::StateCommand like vsg::BindGraphicsPipeline are usually attached to a vsg::StateGroup but they can actually be placed directly into the scene graph like other vsg::Command nodes like vsg::BindVertexBuffers etc. This means you could do: auto commands = vsg::Commands::create();
commands->addChild( bindVertexBuffers );
commands->addChild( bindGraphicsPipeline1 );
commands->addChild( draw1 );
commands->addChild( bindGraphicsPipeline2 );
commands->addChild( draw2 ) Another alternative on this theme is to create a graphics pipeline with dynamic state so that you can use override the polygon mode, but looking at include/vsg/commands I can see the following Set commands, but not one assocaited with polygon state: $ ls include/vsg/commands/Set* -1
include/vsg/commands/SetDepthBias.h
include/vsg/commands/SetLineWidth.h
include/vsg/commands/SetScissor.h
include/vsg/commands/SetViewport.h So... it may be worth adding a few more set commands to override the polygon state. |
Beta Was this translation helpful? Give feedback.
-
Looking a Vulkan docs it looks changing the primitive topology is a feature added in Vulkan 1.3: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkDynamicState.html So it will have been added after I wrote the original dynamic states support. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the input. I've gravitated towards StateGroup, perhaps because it feels familar coming from the Open Scene Graph StateSet scheme, but I'll try adding the StateCommand objects directly to the scene graph like you suggest. Vulkan 1.3 is tempting, but it's still not supported well on mobile platforms. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I want to programmaticaly create a simple geometry with lines and triangles. It occured to me that it would be best to store all the vertex attributes in one buffer, instead of rebinding the buffers for each draw call. I'm thinking of a graph structure like this:
My question is this: will the order of the commands always be preserved in the record traversal? I think I know the answer for trhe current state of the VSG: recording happens mostly in order, and any reordering for transparency would happen at a higher level in the scene graph. I'm curious of @robertosfield thinks this will always be so.
Beta Was this translation helpful? Give feedback.
All reactions