Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Cosmic Chip Socket
    @cosmicchipsocket
    Vulkano seems to provide no resources about how to 1. reuse buffer resources by putting them in a struct (the examples all exist in a vacuum, nothing about the types of the buffers to store them for later), 2. write data to certain structs (the tutorial seems outdated and I can't access a CpuAccessibleBuffer by index after a call to write(), and no way to rewrite the contents of a CpuBufferPool chunk), 3. use two different types of buffers for the vertex and instance buffers in a draw() call (putting them in a tuple does not compile, and putting them in a vec means both need to be an Arc type, so I have to create a new Arc for each submit, which seems to be adding a lot of overhead) - I don't understand what type the vertex parameter is looking for, and how to make something that satisfies the type with my vertex and instance buffers while still being performant
    I have so many questions. Does anyone still read the gitter?
    Will I have to contact individual project maintainers to ask for help?
    Cosmic Chip Socket
    @cosmicchipsocket
    Could anyone help answer this for me? vulkano-rs/vulkano#1429
    Faule Socke
    @faulesocke
    is it possible to adjust the mipmap count for the StorageImage?
    Cosmic Chip Socket
    @cosmicchipsocket
    Alternatively if someone could answer this for me that would also be good vulkano-rs/vulkano#1433
    Cosmic Chip Socket
    @cosmicchipsocket
    Or maybe this vulkano-rs/vulkano#1434
    Where are the maintainers?
    Will Korteland
    @korteland

    hi, i'm trying to port some code from an online tutorial to vulkano v0.19. the code looks like:

        fn create_command_buffers(&mut self) {
            let queue_family = self.graphics_queue.family();
            self.command_buffers = self.swapchain_framebuffers.iter()
                .map(|framebuffer| {
                    let vertices = BufferlessVertices { vertices: 3, instances: 1 };
                    Arc::new(AutoCommandBufferBuilder::primary_simultaneous_use(self.device.clone(), queue_family)
                             .expect("failed to initialise command buffer builder")
                             .begin_render_pass(framebuffer.clone(), false, vec![[0.0, 0.0, 1.0].into()])
                             .expect("failed to begin render pass")
                             .draw(self.graphics_pipeline.clone(), &DynamicState::none(), vertices, (), ())
                             .expect("failed to draw")
                             .end_render_pass()
                             .expect("failed to end render pass")
                             .build()
                             .expect("failed to build render pass"))
                })
                .collect();
        }

    the full source is here: https://github.com/bwasty/vulkan-tutorial-rs/blob/master/src/bin/14_command_buffers.rs

    but there's a change in v0.19 that seems to break stuff: "AutoCommandBufferBuilder methods now take a mutable reference to self instead of taking ownership"
    and sure enough, i get an error when building: error[E0507]: cannot move out of a mutable reference
    the compiler says the move is at .expect("failed to end render pass"), and the reason is "because value has type vulkano::command_buffer::AutoCommandBufferBuilder, which does not implement the Copy trait". any ideas?
    Eliah Lakhin
    @eliah_lakhin_twitter

    @cosmicchipsocket Hi!

    Regarding maintenance issue, I put a comment here: vulkano-rs/vulkano#1435 Basically, we are currently on our own. But if someone wants to merge something into the repo, if he needs and wants to fix something he can do so and I can help with merging the PR as I was granted PRs merging access recently.

    Eliah Lakhin
    @eliah_lakhin_twitter
    @korteland Well, AutoCommandBufferBuilder is not Copy, yes. I think maybe you forgot to put let mut in front of buffer builder variable declaration? Also since AutoCommandBufferBuilder accepting commands by &mut self you have to call each command on separate line. And in the end call .build() by value, not by reference: https://docs.rs/vulkano/0.19.0/vulkano/command_buffer/struct.AutoCommandBufferBuilder.html#method.build
    Ella-0
    @Ella-0
    Are there any plans to support extensions such as VK_EXT_external_memory_dma_buf and friends for writing wayland compositors?
    Will Korteland
    @korteland
    @eliah_lakhin_twitter thanks. I ended up having to rewrite similar to what you said, I ended up with this:
      fn create_command_buffers(&mut self) {
            let queue_family = self.graphics_queue.family();
            self.command_buffers = self.swapchain_framebuffers.iter()
                .map(|framebuffer| {
                    let vertices = BufferlessVertices { vertices: 3, instances: 1 };
                    let mut builder = AutoCommandBufferBuilder::primary_simultaneous_use(self.device.clone(), queue_family)
                             .expect("failed to initialise command buffer builder");
                     builder.begin_render_pass(framebuffer.clone(), false, vec![[0.0, 0.0, 1.0].into()])
                         .expect("failed to begin render pass")
                         .draw(self.graphics_pipeline.clone(), &DynamicState::none(), vertices, (), ())
                         .expect("failed to draw")
                         .end_render_pass()
                         .expect("failed to end render pass");
                     let command_buffer = builder.build().expect("failed to build render pass"));
                     Arc::new(command_buffer)
                })
                .collect();
        }
    antonino
    @pac85_gitlab

    Hi, I'm rendering a scene twice and the second time i render it I use Equal for depth testing. It works until I put a compute dispatch in between the two, the depth gets all corrupted so I guess the layout isn't being transitioned. For the second pass on the scene I'm binding it to the frame buffer but not writing to it. Any ideas?

    does anyone rember this? As it been fixed?

    I rewrote my hole app using the unsafe APIs (so I don't really need a fix), but perhaps it is something that can be worked on
    Gonçalo Soares
    @GoncaloFDS
    Hi, I'm having trouble checking if vulkan 1.2 is supported ( I want the ray tracing extension) where can i see this?
    Eliah Lakhin
    @eliah_lakhin_twitter
    @GoncaloFDS Hi, Gonçalo. As far as I know Ray tracing is not supported yet, but there was an attempt in implementation vulkano-rs/vulkano#1350 . And the developer was asking for help. So, if you would like to assist it will be very welcome! :)
    Ryan Tse
    @rytse
    What is the intended way of reading CpuBufferPoolChunk into memory? If I understand correctly, all the methods returning BufferSlices give you references to values in VRAM that aren't necessarily safely accessible by CPU.
    Allen Garrett Gelwick III
    @ChousX
    Hey this is driving me nutty I am trying to update an old project to "0.20.0" and it was going great but then I ran headfirst into the removal of "window_size_dependent_setup". I was like ok there must be a new way to do this and this but I barely know what I am doing so how do I use this new format
        let framebuffer = Framebuffer::start(render_pass.clone())
        .add(**Here**).unwrap()
        .build().unwrap();
    antonino
    @pac85_gitlab
    I'm happy to see that there's a new update. In any case vulkano-win has some trouble while compiling for android, it is using the natove_window mathod from winit that doesn't exist anymore. Instead the native_window function from ndk-glue should be used
    wangranca
    @wangranca
    Hello, what is the best way to insert pipeline barriers in vulkano? I am trying to insert a barrier between 2 compute dispatches to make sure the first dispatch finishes all writing before the 2nd dispatch starts, thanks
    chiba
    @chiba
    Hello is there a headless example in Vulkano?
    Faule Socke
    @faulesocke
    @wangranca you don't have to, vulkano does this automatically for you.
    Faule Socke
    @faulesocke
    @ChousX try Framebuffer::start(rp.clone()).add(swapchain_images[i].clone()).unwrap().build().unwrap()
    that creates a framebuffer you can use for drawing into the corresponding swapchain image
    Benjamin Blundell
    @OniDaito
    Hi folks. I have a question about vulkano_shaders if I may please?
    I'd like to build a shader programatically - have the text for the GLSL loaded in. I'm not sure how to go about that as it seems vulkano-shaders want you to hardcode the shader into a mod.
    Benjamin Blundell
    @OniDaito
    I think the big problem I'm having is this line:
    codegen::reflect("Shader", content.as_binary(), input.types_meta, input.dump) .unwrap() .into()
    Essentially, whatever this spits out, I'd like to capture. But it gets caught inside a mod. I wonder, is this being generated at compile time? Having a difficult time deciphering what this macro is doing
    Benjamin Blundell
    @OniDaito
    Ideally, I'd like to pass a string into a function and get a variable back that represents my shader, for use in other parts of the vulkano pipeline. It looks like this might be quite a hack to do with vulkano_shaders
    Benjamin Blundell
    @OniDaito
    Yes, this is perhaps more what I'm looking for. Panic over.
    shiraori
    @shiraori:matrix.org
    [m]
    Hello! I was trying to work with the openxr crate (https://crates.io/crates/openxr), but it wraps some of the resource creation (in particular, it wraps instance, physical device, and swapchain initialization). What is the "correct" way to construct the corresponding vulkano types from the raw handles that openxr (or any other api) returns?
    derivator
    @derivator

    Hey :)

    basically i can't figure out how to use a [u8; 4] instead of a [f32; 4] in the vertex struct, since i can't figure out where to specify the attribute's format

    I have the same problem, did you find a solution @ChevyRay ?

    Eliah Lakhin
    @eliah_lakhin_twitter

    @OniDaito Hi!

    Sorry for delay with the answer.

    Yes, Runtime shader example is one of the options. Current primary use-case of Vulkano is to use precompiled shaders(built in compile time through the shader! macros), but there is a way to load them manually too in which case one will have to configure all descriptors and layouts manually(which is unsafe).

    On general note, Vulkano is following a principle(but is not enforces it too strongly) that all shaders normally should be loaded in the beginning and be prepared beforehand. In this case the end-user can gain maximal benefits of GPU capabilities through Vulkan API. GPUs themselves are not very tolerate to shader programs reloading, as it breaks the entire pipeline and all related stuff set up by the device on pipeline creation. Basically GPUs are designed for static programs. That's why Vulkano in turn trying to follow the same approach.

    This is, however, not always possible, and there could be edge cases when the API user might want to generate shader's code on the fly. One of the possibility as I mentioned is to use the approach from Runtime shader example. But it could be difficult to maintain. Another approach(a limited one, though) is to use Specialization Constants. The API user in fact can prepare large code of the shader that would specialize depending on Specialization Constants values. One can even organize branching depending on the values of constants, the shader loader will optimizes particular specialization statically and eliminate dead code control flows not covered by particular specilization.

    Just as an idea for you. Please take a look at the specialization constants examples in repository for more details.

    Eliah Lakhin
    @eliah_lakhin_twitter

    @OniDaito, @shiraori:matrix.org , @derivator

    Dear fellows,

    I have to apologize I'm not able to maintain the chat regularly. I'm visiting it rarely and noticing new topics came days if not weeks ago. This is my bad, but I just don't have enough resources to response on time. Perhaps, it would be more beneficial for you and for the community if you raise questions and topics in Vulkano repository Issues section. Me and other regular users are watching it more regularly.

    dobrakmato
    @dobrakmato:matrix.org
    [m]
    Hey guys, I am trying to render something to an AttachmentImage in first renderpass and then in second renderpass use that same AttachmentImage as input attachment. However I am getting this error: SyncCommandBufferBuilderError(Conflict { command1_name: "vkCmdBeginRenderPass", command1_param: "attachment 5", command1_offset: 88, command2_name: "vkCmdBindDescriptorSets", command2_param: "Image bound to descriptor 0 of set 0", command2_offset: 92 })'. Do you have any idea what could I have done wrong?
    1 reply
    carado
    @carado:matrix.org
    [m]
    hi, uh, the assert_eq!(num, 0); at vulkano's src/command_buffer/synced/commands.rs:1046 is failing for me, and i'm not sure what that means, anyone got any idea ?
    (i have num = 1)
    carado
    @carado:matrix.org
    [m]
    well, i got that using update_buffer; so i tried using a staging buffer instead and copy_buffer, and now the panic!(); at src/command_buffer/synced/commands.rs:2247 is being called
    i guess those errors aren't thoroughly documented
    Syntaxxor
    @Syntaxxor
    Hello! Just dropping in to ask if the tutorial will be completed for this project. It's a cool project, but since I'm not super familiar with Vulkan in general, I would greatly prefer to have a full tutorial that doesn't stop in the middle of implementing swapchains.
    Syntaxxor
    @Syntaxxor
    Should I just download the triangle example and then pretend to understand it until I actually get it to really work properly? Because I guess I could do that.
    Ilya Lakhin
    @Eliah-Lakhin

    @Syntaxxor Hi Syntaxxor. Sorry, this chat is rarely maintaining. In the future you can raise questions and suggestions in the repo's Issues section. They are watching by me and the community more frequently.

    Regarding your question. Currently examples is probably the main source of truth for new comers. Site's tutorial is a bit outdated, but it also could be a place to start learning. If you want to refresh the Tutorial, this is very welcome and will be very beneficial for the community! Anyway, please raise this topic in the Issues section first.

    Braden McDorman
    @bmcdorman

    Hi, I'm having some trouble with a AccessError(AlreadyInUse) when executing a command buffer. I'm using a compute pipeline and need to copy a new image at the beginning of the queue, generate mip map levels for that image, process it through a shader, then copy the image buffer back to the host. The program worked prior to adding the mipmap generation steps, but adding the blit_image steps for mipmap generation causes the proceeding shader dispatch command to fail. (AccessError { error: AlreadyInUse, command_name: "vkCmdBindDescriptorSets", command_param: "Image bound to descriptor 0 of set 0", command_offset: 9 }')

    The execution is as follows:

    1. write image to buffer (host side)
    2. copy buffer to image
    3. generate mip map levels
    4. dispatch shader <-- this fails
    5. copy image to buffer
    6. read buffer (host side)

    It seems like this could be caused by a pipeline barrier issue, but vulkano appears to abstract those away. Any hints on how I should proceed? I can post code if that would help.

    Braden McDorman
    @bmcdorman
    I decided to use UnsafeCommandBufferBuilder directly so I could insert my own pipeline barriers. That appears to be working
    Ilya Lakhin
    @Eliah-Lakhin
    @bmcdorman Please post your question in the Issues section. Thank you.