Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    antonino
    @pac85_gitlab
    How exactly is one supposed to use AutoCommandBuffer when an image is used multiple times in the same command buffer? (Read only so there shouldn't really be any conflict).
    Something strange is happening, it works for the first frame that I render and then it throws out an error.
    @eliah_lakhin_twitter NP
    Eliah Lakhin
    @eliah_lakhin_twitter
    @pac85_gitlab Can you show a code?
    the errror is thread 'main' panicked at 'called Result::unwrap() on an Err value: SyncCommandBufferBuilderError(Conflict { command1_name: "vkCmdBindDescriptorSets", command1_param: "Image bound to descriptor 1 of set 0", command1_offset: 3, command2_name: "vkCmdBindDescriptorSets", command2_param: "Image bound to descriptor 1 of set 0", command2_offset: 8 })', /mnt/void/home/archdata/cose/GameKernel/src/game_kernel/subsystems/video/renderer/mod.rs:1470:22
    Eliah Lakhin
    @eliah_lakhin_twitter
    @pac85_gitlab Is it possible that you are changing texture set on the second frame?
    Eliah Lakhin
    @eliah_lakhin_twitter
    @pac85_gitlab To be more specific this line confuses me: https://gitlab.com/pac85/GameKernel/-/blob/master/src/game_kernel/subsystems/video/renderer/mod.rs#L1431 if you are adding additional entry to the descriptor set conditionally I suppose it shouldn't work either in true or false branches of the condition. As far as I understand the descriptor set should always be described completely, you can't miss an entry based on some condition. In one of two cases it will fail
    Eliah Lakhin
    @eliah_lakhin_twitter

    @pac85_gitlab The error message is also showing something strange. It's saying there is something with descriptor 1 of set 0. I suppose it should complain about descriptor No 3, but anyway there is something with descriptors and layouts. The set's layout itself described here: https://gitlab.com/pac85/GameKernel/-/blob/master/data/engine/shaders/third_pbr/frag.glsl#L10 First thing that seem to be mistaken here is numeration of bindings. The bindings should start with Zero, not with One. The might be a cause of a strange numeration in the error.

    Most likely what really happened is that first time you run the frame you read an image from iterator here: https://gitlab.com/pac85/GameKernel/-/blob/master/src/game_kernel/subsystems/video/renderer/mod.rs#L1429 So, the entire number of entries was 3(as required by the shader's layout) and Vulkan/Vulkano somehow resolved it. The second time you run this code the iterator(or a source of the iterator) was already exceeded/emptied so the descriptor set was described with 2 entries only, which contradicts shader's layout.

    The resolution is you need to somehow pass a sampler attachment in both cases of that condition. Even if you don't have an image you need to put a dummy image(like 1x1 pixel) to fill the gap in the layout, or use different shader with the different layout. Also, if you want to change "albedo" texture sampler often and don't want to touch "diffuse" and "specular" as often as "albedo", you can split descriptor set into two independent sets, and describe them independently too caching the first set(with diffuse and specular). It would be more efficient than recreating descriptor sets every frame which is expensive operation per se.

    left_adjoint
    @leftadjoint
    @eleanor-em @eliah_lakhin_twitter, regarding rebuilding on a shader change, I use a build script to handle this situation, i.e. with
    println!("cargo:rerun-if-changed=src/shaders/shader.fs");
    Though, I'm actually rebuilding the SPIRV as a part of my build script and loading it at runtime. I'm not sure offhand if this will rebuild the module that loads the shader source by path.
    Sergey
    @DuckerMan
    Hey guys! Can I use Vulkano on android?
    antonino
    @pac85_gitlab

    @pac85_gitlab The error message is also showing something strange. It's saying there is something with descriptor 1 of set 0. I suppose it should complain about descriptor No 3, but anyway there is something with descriptors and layouts. The set's layout itself described here: https://gitlab.com/pac85/GameKernel/-/blob/master/data/engine/shaders/third_pbr/frag.glsl#L10 First thing that seem to be mistaken here is numeration of bindings. The bindings should start with Zero, not with One. The might be a cause of a strange numeration in the error.

    Most likely what really happened is that first time you run the frame you read an image from iterator here: https://gitlab.com/pac85/GameKernel/-/blob/master/src/game_kernel/subsystems/video/renderer/mod.rs#L1429 So, the entire number of entries was 3(as required by the shader's layout) and Vulkan/Vulkano somehow resolved it. The second time you run this code the iterator(or a source of the iterator) was already exceeded/emptied so the descriptor set was described with 2 entries only, which contradicts shader's layout.

    The resolution is you need to somehow pass a sampler attachment in both cases of that condition. Even if you don't have an image you need to put a dummy image(like 1x1 pixel) to fill the gap in the layout, or use different shader with the different layout. Also, if you want to change "albedo" texture sampler often and don't want to touch "diffuse" and "specular" as often as "albedo", you can split descriptor set into two independent sets, and describe them independently too caching the first set(with diffuse and specular). It would be more efficient than recreating descriptor sets every frame which is expensive operation per se.

    sorry i just saw this, the purpose of that condition was to allow materials that either have or haven't a texture, in my case it always evaluated true because I only had a material with a texture

    antonino
    @pac85_gitlab
    in any case while hunting for perfomance I rewrote almost the hole thing with UnsafeCommandBuffers, I'm still not happy with the amount of time it takes to build the command buffers, could it be because of some checks slowing it down? I have ~400 objects (the scene is sponza) and I'm issuing a draw call for each of them. I've saved some time by reusing pipelines(which is really important and I planned on doing anyway) and also by reusing descriptor sets but it still takes around 6ms to build the hole command buffer
    Christopher Cordero
    @cs-cordero
    Hi I am a new vulkan user on MacOS. I followed the instructions on the tutorial here: http://vulkano.rs/guide/example-operation and the assert_eq! statement is failing. It doesn't seem like the buffer is properly being copied over, as the dest buffer still contains zeroes after executing the command buffer.
    Does anyone know why this part would fail? I followed the instructions to install the Vulkan SDK, which I believe should come with MoltenVK already, then installed vulkano using Cargo.toml.
    Eliah Lakhin
    @eliah_lakhin_twitter
    @cs-cordero Hi Chris! Well, the guide might be outdated a little, but anyway it would be easier to determine actual issue if you show us your code.
    Jonathan Woollett-Light
    @JonathanWoollett-Light
    A few questions:
    1. Posting questions here Vs as issues on the repo, which is preffered?
    2. I've got a bit stuck trying to pass RawDeviceExtensions instead of DeviceExtensions to intialise a device, anyone got examples of this?
    3. Has anyone used many GLSL extensions with Vulkano? Does Vulkano handle these or are they simply handled by the underlying shaderc? (pretty much if I've got an issue with one, where do I need to start working to fix it)
    Eliah Lakhin
    @eliah_lakhin_twitter
    @JonathanWoollett-Light
    1. Imo, Issues are preferred. It's more likely they will be noticed eventually.
    2. Can you show the code, please?
    3. As far as I understand it's all on the shaderc side. Vulkano currently have limited support of GLSL extensions, but maybe I'm wrong
    Jonathan Woollett-Light
    @JonathanWoollett-Light
    Sorry about a bit of a late reply here, sorta forgot about this. On that issue I mentioned in point 2, sorta just moved past it.
    Jonathan Woollett-Light
    @JonathanWoollett-Light
    (my current new issue: vulkano-rs/vulkano#1409)
    matrixbot
    @matrixbot
    balenol hello
    Eric Trombly
    @etrombly
    I'm trying to write some compute shaders to help with a 3D printing slicer. I'm new to vulkan but struggling with how to load the model data dynamically. The buffers require a static lifetime to load them with from_iter(). Code is here https://github.com/etrombly/printer_geo/blob/master/src/compute.rs (I just copied the example compute shader code, haven't modified it to do what I want yet.)
    Eric Trombly
    @etrombly
    @leftadjoint I've figured out how to load the buffers (probably not in the best way, but it works). But now I'm running into the same issue with the GL_EXT_nonuniform_qualifier extension you mentioned earlier. Do you have a reference for how to compile to spirv then load it?
    Eric Trombly
    @etrombly

    So I got everything working, but having a weird issue with the memory layout. Not sure what I'm doing wrong. If I run it with this general code:

    #[derive(Default, Debug, Copy, Clone)]
    pub struct PointVk {
        pub position: [f32; 3],
    }
    
    #[derive(Default, Debug, Copy, Clone)]
    pub struct LineVk {
        pub p1: PointVk,
        pub p2: PointVk,
    }
    
    
    #version 450
    
    layout(local_size_x = 128, local_size_y = 1, local_size_z = 1) in;
    
    struct Line {
        vec3 p1;
        vec3 p2;
    };
    
    layout(set = 0, binding = 0) buffer LineVk {
        Line line[];
    } lines;
    
    void main() {
        uint idx = gl_GlobalInvocationID.x;
        lines.line[idx].p1 = vec3(1, 2, 3);
        lines.line[idx].p2 = vec3(4, 5, 6);
    }"
        }
    }

    I get output like:

    LineVk { p1: PointVk { position: [1.0, 2.0, 3.0,] }, p2: PointVk { position: [0.0, 4.0, 5.0,] } }

    So it looks like it's outputting as a vec4, not vec3. If I change PointVk to [f32;4] and change everything to vec4 with a dummy value for the 4th element everything is aligned correctly. Any idea whats going on?

    James Lucas
    @AtheMathmo

    I'm trying to complete the guide on the vulkano website --- the windowed part that's incomplete.

    I managed to figure out how to get vulkan to render to a winit window, but the performance is pretty poor on resizing. Is someone willing to take a look at my code and tell me what I'm doing wrong? :D

    https://gist.github.com/AtheMathmo/3fed0665400fd6850cf0d144bb9b9070

    James Lucas
    @AtheMathmo
    Just found this example: https://github.com/vulkano-rs/vulkano/blob/master/examples/src/bin/triangle.rs . I should be able to figure it out from here!
    Eric Trombly
    @etrombly
    this issue fixed my alignment problem vulkano-rs/vulkano#1111 . setting PointVk to#[repr(C, align(16))]
    left_adjoint
    @leftadjoint
    @etrombly there's an vulkano example for loading shaders at runtime here
    If you want to compile to spirv at runtime, check out shaderc-rs
    James Lucas
    @AtheMathmo

    I'm trying to put together a basic render pipeline but there's one thing (at least) that is still really tripping me up. I can't figure out how to handle my graphics pipelines. Sorry for message length.

    I've looked through all the examples now and took a lot of inspiration from them (especially the deferred rendering one). But I want to be able to draw multiple meshes and I can't figure out how to organize the pipelines.

    If I understand correctly, generally, each rendered mesh needs its own graphics pipeline as they may use different shaders. The pipeline may also need to be recreated if the window size changes. The teapot example says as much, but then uses .viewports_dynamic_scissors_irrelevant(1) which I think implies a dynamic viewport?

    Eric Trombly
    @etrombly
    Thank you, I ended up not needing the extension, but that should help in the future
    left_adjoint
    @leftadjoint
    @AtheMathmo I think what you're looking for is a "material system". If you want different materials, you can paramaterize your shaders by providing push constants and uniform buffers, for example.
    3 replies
    antonino
    @pac85_gitlab
    I'm trying to load mip maps into an unitialized image, the ImmutableImageInitialization object can only be used once and copy_image_to_buffer only copies one mip_map level. How am I supposed to load all of them?
    Eliah Lakhin
    @eliah_lakhin_twitter
    antonino
    @pac85_gitlab

    @pac85_gitlab I think this function might be helpful: https://docs.rs/vulkano/0.19.0/vulkano/command_buffer/struct.AutoCommandBufferBuilder.html#method.copy_image_to_buffer_dimensions

    that only allows me to copy one mip level as I said, that won't do beacuse after that I can't write to the image any more

    antonino
    @pac85_gitlab
    I've noticed that commits suddently stoppeted on the 12th of June, is everything alright with the project?
    Alexandre Kawan
    @AlexandreKawan
    I am a complete beginner in graphics programming, I want to learn vulkan and vulkano, do you have any suggestion of how to learn it in an efficient way, guys?
    Eliah Lakhin
    @eliah_lakhin_twitter

    I've noticed that commits suddently stoppeted on the 12th of June, is everything alright with the project?

    @pac85_gitlab Well, I'm not a maintainer of the project, just an active user and a minor contributor. @AustinJ235 has disappeared, unfortunately. I didn't see any activity in his own projects too for the past time. Hopefully, he will get back, but in worst case I think we can ask Tomaka to assign another one maintainer, or maybe even do our own fork. But in this moment there are no urgent PR pendings or bugs to be fixed urgently. The codebase is quite stable.

    @AlexandreKawan It depends on the tasks that you want to work. I would suggest to start from the practical things, something you want to implement. The repo examples and the Guide were very helpful for me when I start learning this stuff.
    Zacxalot
    @Zacxalot
    Hey @AlexandreKawan I've just started learning too, I've been going through the guide for the last few days and it's been really good so far!
    Roy Wellington Ⅳ
    @thanatos
    Hi; is there a reason there is no bind_descriptor_sets on an AutoCommandBufferBuilder?
    Roy Wellington Ⅳ
    @thanatos
    Oh, I'm supposed to pass them straight to .draw*
    Cosmic Chip Socket
    @cosmicchipsocket
    Hi all, I'm trying to get a vulkano renderer working in my engine (currently there's a glium renderer, but texture switches are very slow so I'm hoping vulkano will give a nice boost). I'm in the process of getting a swapchain working. I used the triangle example code as a reference for this. Unfortunately, when I call into vulkano::swapchain::acquire_next_image(), my entire desktop freezes for a few seconds and then it errors with "no image is available for acquiring yet". Then I have to kill the process manually, which freezes my desktop for several seconds again, despite it being a panic. How should I go about troubleshooting this?
    Cosmic Chip Socket
    @cosmicchipsocket
    Got the validation layer running. When I create the swapchain, I get: vkCreateSwapchainKHR(): pCreateInfo->surface is not known at this time to be supported for presentation by this device. The vkGetPhysicalDeviceSurfaceSupportKHR() must be called beforehand, and it must return VK_TRUE support with this surface for at least one queue family of this device.
    Even though I am filtering on family.supports_graphics() and using khr_swapchain: true
    Looks like I was calling present before drawing anything oops
    It's no longer locking up and erroring, but I am still getting the Vulkan validation error above
    Cosmic Chip Socket
    @cosmicchipsocket
    Slowly figuring this out thanks to the validation layer