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
    Also, I'm having difficulty using BufferSlice, because I want to only draw the portion of the buffer that has been filled with data. If I try BufferSlice::from() and use an &Arc<CpuAccessibleBuffer<T>> as suggested in the documentation, I'm told instead that it's expecting another BufferSlice
    Cosmic Chip Socket
    @cosmicchipsocket
    Finally, I can't seem to figure out how to write to an already-created buffer. I can do write().map() but use of this seems to be undocumented
    Cosmic Chip Socket
    @cosmicchipsocket
    So I'm trying to replace the CpuAccessibleBuffer for instances with a CpuBufferPool. However, I can't use it in draw() because it's not an Arc type (it in fact wraps one)
    Cosmic Chip Socket
    @cosmicchipsocket
    Think I got it working now
    Vivian Leigh Stewart
    @vivichrist
    In order to first do a compute operation to prepare an image and then blit that image to the current swapchain framebuffer for display. What are the steps necessary to swap between pipelines in the eventloop? I know that synchronisation is one of them.
    Cosmic Chip Socket
    @cosmicchipsocket
    I'm trying to figure out some performance issues with my new Vulkano renderer - the drawing overhead currently is even worse than glium. Seems like if I call CpuBufferPool::chunk() about 3000 times a frame performance just dies, not only in try_next_impl() but also cleanup_finished() dropping lots and lots of Arcs. What is the correct way to use CpuBufferPool? It doesn't seem like it's doing any reusing of resources at all!
    CpuBufferPool::chunk() is being called every time I submit a draw
    What is the best way to resolve this?
    Cosmic Chip Socket
    @cosmicchipsocket
    Would posting a question via the bug tracker be an appropriate way to ask about this? Because I'd really like to fix this performance bottleneck and am looking for help from someone who is more familiar with buffers in Vulkano
    The performance is really bad and the existing tutorial resource about buffer usage is insufficient
    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.