What is the correct way to BindVertexBuffer for a Buffer?
I am trying to render a point cloud, but the vertices are computed in a
compute shader, therefore my vertices comes from a buffer, and not a Data.
Hi Robert,
Thanks for your prompt feedback as always.
I am running into some difficulties because of line BindVertexBuffers.cpp:129
119 void BindVertexBuffers::compile(Context& context)
120 {
121 // nothing to compile
122 if (arrays.empty()) return;
123
124 auto deviceID = context.deviceID;
125
126 bool requiresCreateAndCopy = false;
127 for (auto& array : arrays)
128 {
129 if (array->requiresCopy(deviceID))
130 {
131 requiresCreateAndCopy = true;
132 break;
133 }
134 }
Since I don't use Data, requiresCopy returns false, and it doesn't get to the bit of the code where it sets vkd.vkBuffers and vkd.offsets. I could set a dummy Data, but that seems a little hacky. Any guru advise?
Once I get this working I am glad to provide a vsgExample
illustrating this use case.
Cheers,
Denis
--
You received this message because you are subscribed to the Google Groups "vsg-users : VulkanSceneGraph Developer Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vsg-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vsg-users/585787f4-4773-47d7-bc57-f8ba14bde855n%40googlegroups.com.
Hi Robert,
Thanks for your prompt feedback as always.
I am running into some difficulties because of line BindVertexBuffers.cpp:129
119 void BindVertexBuffers::compile(Context& context)
120 {
121 // nothing to compile
122 if (arrays.empty()) return;
123
124 auto deviceID = context.deviceID;
125
126 bool requiresCreateAndCopy = false;
127 for (auto& array : arrays)
128 {
129 if (array->requiresCopy(deviceID))
130 {
131 requiresCreateAndCopy = true;
132 break;
133 }
134 }
Since I don't use Data, requiresCopy returns false, and it doesn't get to the bit of the code where it sets vkd.vkBuffers and vkd.offsets. I could set a dummy Data, but that seems a little hacky. Any guru advise?
Once I get this working I am glad to provide a vsgExample illustrating this use case.
Hi Robert,
Related to this, is there an easy way to verify the contents of a Buffer? Can I use CopyAndReleaseBuffer to copy from a Buffer to a space in CPU memory so I can print it out?
Cheers,
Denis
--
You received this message because you are subscribed to the Google Groups "vsg-users : VulkanSceneGraph Developer Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vsg-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vsg-users/CAFN7Y%2BXs2OOgGdm989uzNiLkDaT5kTk_J9HMoS80c45h%3DgJm4Q%40mail.gmail.com.
Related to this, is there an easy way to verify the contents of a Buffer? Can I use CopyAndReleaseBuffer to copy from a Buffer to a space in CPU memory so I can print it out?
Hi Robert,
I was finally able to setup a simple example for this.
In order for it to work, you need to apply the attached patch to vsg.
I didn't use barriers, so you might see some hiccups at times. Whenever I try to set one (BufferMemoryBarrier for instance) I get this error:
VUID-vkCmdPipelineBarrier-pDependencies-02285(ERROR / SPEC):
msgNum: 959888396 - Validation Error: [
VUID-vkCmdPipelineBarrier-pDependencies-02285 ] Object 0: handle =
0xf56c9b0000000004, type = VK_OBJECT_TYPE_RENDER_PASS; | MessageID
= 0x3936bc0c | vkCmdPipelineBarrier(): Barriers cannot be set
during subpass 0 of VkRenderPass 0xf56c9b0000000004[] with no
self-dependency specified. The Vulkan spec states: If
fname:vkCmdPipelineBarrier is called within a render pass
instance, the render pass must have been created with at least one
VkSubpassDependency instance in
VkRenderPassCreateInfo::pDependencies that expresses a dependency
from the current subpass to itself, with synchronization scopes
and access scopes that are all supersets of the scopes defined in
this command
(https://vulkan.lunarg.com/doc/view/1.3.211.0/linux/1.3-extensions/vkspec.html#VUID-vkCmdPipelineBarrier-pDependencies-02285)
Cheers,
Denis
--
You received this message because you are subscribed to the Google Groups "vsg-users : VulkanSceneGraph Developer Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vsg-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vsg-users/CAFN7Y%2BUsu0OzqJqCrpe-gBwRqA9i2QN_eexCEw8rw4%2B3na2_tg%40mail.gmail.com.
Hi Robert,
The example code (with the vsg patch applied) shows this:

The points position are setup in the compute shader. I think the question is how we make BindVertexBuffers class accept buffers created outside the class. Seems like the interface was made only to support assigning vertex data through Data. You you push_back a Buffer to BindVertexBuffers::arrays it will fail in BindVertexBuffers::compile to set vkd.vkBuffers which are used during BindVertexBuffers::record. Not sure if the best place to make changes is BindVertexBuffers::compile or in BufferInfo::createBufferAndTransferData, to account to the fact that the user can manually push back Buffers into arrays.
Cheers,
Denis
Thanks Denis, I'm heading out right now, but later should have an opportunity to review the code. How much is functionality right, and what parts still need to be completed?
--
You received this message because you are subscribed to the Google Groups "vsg-users : VulkanSceneGraph Developer Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vsg-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vsg-users/CAFN7Y%2BU3tGG%2BgLAEEXscFnVJ0oJ78sMewRUxaRqRz2pgHRUzqQ%40mail.gmail.com.
Oh, and we need to add proper memory barriers. The ones that I
tried added some nasty vulkan errors.
Thanks Denis, I'm heading out right now, but later should have an opportunity to review the code. How much is functionality right, and what parts still need to be completed?
--
You received this message because you are subscribed to the Google Groups "vsg-users : VulkanSceneGraph Developer Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vsg-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vsg-users/CAFN7Y%2BU3tGG%2BgLAEEXscFnVJ0oJ78sMewRUxaRqRz2pgHRUzqQ%40mail.gmail.com.
Yes! The compute shader is able to modify the buffer that is
subsequently used by a graphics pipeline as a vertex input, that
is the minimal use case. I am not as good as you in setting up
examples Robert, I know it looks awful. :)
Thanks for the screenshot. Apart of the issues with the BindVertexBuffers API being awkward for this usage and the memory barrier issues, does this example behave as you intend?
--
You received this message because you are subscribed to the Google Groups "vsg-users : VulkanSceneGraph Developer Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vsg-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vsg-users/CAFN7Y%2BXcV%2BcvziUe41v6hGVsVW8WFuYvRRdtU3OeOCfOkmzu5w%40mail.gmail.com.
Oh, I was just forking vsgExamples into my personal github... No,
Linux! Not sure what happened...
Running dos2unx on the path file looks to have made git happier when applying the patch. Are you working under Windows right now?
--
You received this message because you are subscribed to the Google Groups "vsg-users : VulkanSceneGraph Developer Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vsg-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vsg-users/CAFN7Y%2BVcQuvnu3Tbdto7RgeccTZ0uyzCVQfFdutj1svNYN2nKA%40mail.gmail.com.
That's great Robert, thanks!
ps: Removing [External]s...
--
You received this message because you are subscribed to the Google Groups "vsg-users : VulkanSceneGraph Developer Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vsg-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vsg-users/CAFN7Y%2BUq%3DCGoTLGo6osGg0asUubr-Me1CaZdEJXzTW-idYWnug%40mail.gmail.com.
Hi Robert,
Great, thanks for letting me know!
Cheers,
Denis
--
You received this message because you are subscribed to the Google Groups "vsg-users : VulkanSceneGraph Developer Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vsg-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vsg-users/CAFN7Y%2BV9byvMqdFujwfA3f5QkomaS%2BTRvpcSqotoLa8q_tKmBg%40mail.gmail.com.
Hi Robert,
Tested the branches and everything is working fine on my end.
Nudge me if I can be of any assistance.
Cheers,
Denis
--
You received this message because you are subscribed to the Google Groups "vsg-users : VulkanSceneGraph Developer Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vsg-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vsg-users/CAFN7Y%2BXwb0Fj%2BXdFxoM4qMYFve%2BmrUtxUCOLwTihLHisQjZDkg%40mail.gmail.com.
That is brilliant Robert, thanks a lot!
Cheers,
Denis
--
You received this message because you are subscribed to a topic in the Google Groups "vsg-users : VulkanSceneGraph Developer Discussion Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vsg-users/AAMs6XtxUJs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vsg-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vsg-users/f7f634f0-0ce2-41f6-a431-09741dcdae7fn%40googlegroups.com.