Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Wylie Кулик
    @kulicuu
    i'll have to look into it more today and get back. hopefully i can start to plan some contribuions to the core Vulkano as I get more into this.
    as for your question about my model indices, i have a model downloaded from the internet, loaded into my trial 3ds max, and exported as wavefront object. it's format is a bunch of i guess they call them objects, using the tinyobj (rust crate) loader, and each object is a normals array, a positions array, and an indices array. it may be possible to combine them but i don't know the mapping, and even if i could, eventually i'm leading to a complexity level in my maps where i'll need to simultaneously render a large collection of objects, so it makes sense to figure out how to do that in a combined way. i'll update later today after pursuing these leads you've given me. i think UssafeCommandBufferBuilder is a great backstop. last night i was wondering how to get down to the Vulkan level, if it is accessible. apparently it is that's great.
    Wylie Кулик
    @kulicuu
    Yeah the approach in your code block is one I've been trying, to no success. good to see you reference it as a possibility. I've been getting various type mismatch errors, so maybe i just need to find the soln to that issue. You can see actually already in my code block March 19, 21:11.
    the idea with that block of code is if the draw-indexed call works like that i can wrap it in a function that takes a collection and calls it as many times as needed.
    you demo with if statements, same demo.
    i guess the timestamp i see on the messages here is not universal, sorry. it's my code block up there preceded by the words "altererd to this:"
    Wylie Кулик
    @kulicuu
    This code:
    
                    let mut command_buffer = AutoCommandBufferBuilder::new(device.clone(), queue.family()).unwrap()
                    .begin_render_pass(
                        framebuffers[image_num].clone(), false,
                        vec![
                            [0.0, 0.0, 1.0, 1.0].into(),
                            1f32.into()
                        ]
                    ).unwrap();
    
    
    
                    command_buffer.end_render_pass().unwrap()
                    .build().unwrap();
    gives this error:
    error[E0277]: the trait bound `vulkano::command_buffer::auto::AutoCommandBufferBuilder: vulkano::SafeDeref` is not satisfied
       --> examples\src\bin\scratch\main.rs:369:50
        |
    369 |                     .then_execute(queue.clone(), command_buffer).unwrap()
        |                                                  ^^^^^^^^^^^^^^ the trait `vulkano::SafeDeref` is not implemented for `vulkano::command_buffer::auto::AutoCommandBufferBuilder`
    it's like i need to access the builder but getting the buffer or something wrong with the polymorphism inherent in that pattern.
    For reference, this minimal example from which the above was derived works fine:
                    let mut command_buffer = AutoCommandBufferBuilder::new(device.clone(), queue.family()).unwrap()
                    .begin_render_pass(
                        framebuffers[image_num].clone(), false,
                        vec![
                            [0.0, 0.0, 1.0, 1.0].into(),
                            1f32.into()
                        ]
                    ).unwrap()
                    .end_render_pass().unwrap()
                    .build().unwrap();
    do i need to access the builder and i'm getting the buffer or something ?
    Wylie Кулик
    @kulicuu
    when i try like this:
                    let mut command_buffer = AutoCommandBufferBuilder::new(device.clone(), queue.family()).unwrap()
                    .begin_render_pass(
                        framebuffers[image_num].clone(), false,
                        vec![
                            [0.0, 0.0, 1.0, 1.0].into(),
                            1f32.into()
                        ]
                    ).unwrap();
    
                    command_buffer = command_buffer.end_render_pass().unwrap()
                    .build().unwrap();
    error is:
    error[E0308]: mismatched types
       --> examples\src\bin\scratch\main.rs:313:34
        |
    313 |                   command_buffer = command_buffer.end_render_pass().unwrap()
        |  __________________________________^
    314 | |                 .build().unwrap();
        | |_________________________________^ expected struct `vulkano::command_buffer::auto::AutoCommandBufferBuilder`, found struct `vulkano::command_buffer::auto::AutoCommandBuffer`
        |
        = note: expected struct `vulkano::command_buffer::auto::Aut
    Maybe I need to resurrect the builder object ?
    whats going through the chain is some builder constructor payload, whereas what is assigned to command-buffer is not the builder type but the buffer type.
    that doesn't make sense.
    Wylie Кулик
    @kulicuu
    Hey I got something that worked!
                    let command_buffer_1 = AutoCommandBufferBuilder::new(device.clone(), queue.family()).unwrap()
                    .begin_render_pass(
                        framebuffers[image_num].clone(), false,
                        vec![
                            [0.0, 0.0, 1.0, 1.0].into(),
                            1f32.into()
                        ]
                    ).unwrap();
    
                    let command_buffer = command_buffer_1.end_render_pass().unwrap()
                    .build().unwrap();
    I could name that better but should be able to do something intermediary there with draw_indexed. Will see.
    the code is still a mess, but that worked great.
    I have a question about the teapot example: What is controlling the refresh rate? Is it just as soon as the previous frame finishes ?
    Austin Johnson
    @AustinJ235
    When you acquire an image via swapchain::acquire_next_image you are gettin a future in return. So in all this code:
    previous_frame_end.take().unwrap()
                        .join(acquire_future)
                        .then_execute(queue.clone(), command_buffer).unwrap()
                        .then_swapchain_present(queue.clone(), swapchain.clone(), image_num)
                        .then_signal_fence_and_flush();
    you are taking the last frames future previous_frame_end.take().unwrap() joining the future where you acquire the image you are presenting to .join(acquire_future). This is the one that can limit frame rate. Then you are saying with .then_execute(queue.clone(), command_buffer).unwrap() after the acquire excute the command that you built. .then_swapchain_present(queue.clone(), swapchain.clone(), image_num) after the command you built finishes present it to the image. note the swapchain and image_num are from the acquire. The present I think also can limit frame rate. Finally the .then_signal_fence_and_flush(); is saying that with the combination of all previous futures wait for all them to complete before doing anything else.
    Austin Johnson
    @AustinJ235
    When you break everything down vulkano's code will follow the general flow of other vulkan how to's, just that ours will have more saftey and simify some of the operations.
    Wylie Кулик
    @kulicuu
    yeah I made a lot of progress, thank you.
    Right now I'm trying to figure out how to then_execute (in the future = previous_frame_end.take()[...] multiple command buffers. I have a terrain mesh I want routed to one vertex shader, and my aircraft model routed to another shader.
    Wylie Кулик
    @kulicuu
    When I write two .then_executes in the same previous_frame_end chain, the final one overrides the initial.
    Wylie Кулик
    @kulicuu
    I see I need to use a secondary cb, what I was trying is using two primary cbs.
    Wylie Кулик
    @kulicuu
    I need to pass a RenderPassAbstract, so how to get that? how to invoke this secondary command buffer ?
    Wylie Кулик
    @kulicuu
    Everything solved... except the RenderPassAbstract reference for the secondary command buffer definition.
    Wylie Кулик
    @kulicuu
    I'm trying to use Subpass and give it like framebuffers[image_num] stuff like that...
    That's for the secondary_graphics
    Wylie Кулик
    @kulicuu
    My framerates are pretty good btw.
    I was just wondering if there was a default or something.
    Wylie Кулик
    @kulicuu
    Solved the Subpass reference issue. Full steam ahead and all that...
    I have no more questions or comments at this time...
    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?
    Wylie Кулик
    @kulicuu
    I'd be interested if the design of the API assumed people would be doing graphics or compute applications. I hadn't considered doing both in the same application. Interesting.
    Austin Johnson
    @AustinJ235
    @pac85_gitlab dispatches don't automatically insert any pipeline barriers atm. I don't think anyways. You may have to split the command up and put a fence in there.
    Wylie Кулик
    @kulicuu
    I'm working with the example "runtime-shader" in order to set up a live reload development studio. I've gotten my source compiled to spirv with shaderc but can't figure out how to write this to file. &[u32] doesn't write... Was using fs::write then switched to File object let mut f = File::create(...) and f.write_all(binary_result.as_binary());
    Austin Johnson
    @AustinJ235
    f.write_all(binary_result.as_binary().to_vec())
    hmm
    nvm
    still a u32
    f.write_all(binary_result.as_binary_u8()).unwrap()
    Wylie Кулик
    @kulicuu
    ah thanks !
    Works Thankyou!!!
    antonino
    @pac85_gitlab
    @AustinJ235 this seems very strange to me, the various passes that i described are all on different command buffers and there are fences between their submissions. Your are telling me that dispatches don't involve layout transtion and yet wether i execute that particular compute shader that only reads the depth buffer makes a difference on wether the depth buffers screws up.
    Austin Johnson
    @AustinJ235
    I haven't really looked to deeply into the command code, only enough to fix the one bug. More eyes would be helpful.