Coder Social home page Coder Social logo

Comments (7)

JCapucho avatar JCapucho commented on July 21, 2024 1

Apologies for getting getting back on this sooner as I previously promised. I pondered the issue a bit and believe that wgpu shouldn't crash in this case to begin with: Yes, wgpu-profiler gives up the ownership of the buffer but it's wgpu's job to ensure that all pending operations with it still finish gracefully. Just like creating a buffer, scheduling rendering with it, and then discarding the buffer before the operation is finished shouldn't fail either.

That does make sense. I've been chasing after this bug for a while and it only seems to impact wgpu-profiler so I opened the issue here but in hindsight it probably made more sense in wgpu itself.

@JCapucho Can you get the full callstack for the wgpu panic you hit?

I'll try to get it as soon as I can

from wgpu-profiler.

JCapucho avatar JCapucho commented on July 21, 2024 1

I can no longer reproduce it in any way, I think it may have been something with my machine.

from wgpu-profiler.

Wumpf avatar Wumpf commented on July 21, 2024

My first reaction is surprise over wgpu not keeping the buffers alive, but I need to think through the issue properly; I'll probably find some time over the weekend for that.
Thank you so much for the detailed report!

from wgpu-profiler.

Wumpf avatar Wumpf commented on July 21, 2024

Apologies for getting getting back on this sooner as I previously promised. I pondered the issue a bit and believe that wgpu shouldn't crash in this case to begin with: Yes, wgpu-profiler gives up the ownership of the buffer but it's wgpu's job to ensure that all pending operations with it still finish gracefully. Just like creating a buffer, scheduling rendering with it, and then discarding the buffer before the operation is finished shouldn't fail either.
@JCapucho Can you get the full callstack for the wgpu panic you hit?

Meanwhile also still trying to repro the issue reliably myself

from wgpu-profiler.

Wumpf avatar Wumpf commented on July 21, 2024

Tried replicate the crash by going through wgpu calls directly but can't get to it that way either :/
I thought the issue is that we're dropping the buffer before it's mapped, but it must be something more complex than this

{
    let buffer = device.create_buffer(&wgpu::BufferDescriptor {
        label: Some("test buffer"),
        size: 1024,
        usage: wgpu::BufferUsages::COPY_DST | wgpu::BufferUsages::MAP_READ,
        mapped_at_creation: false,
    });
    let mut encoder = device.create_command_encoder(&wgpu::CommandEncoderDescriptor::default());
    let query_set = device.create_query_set(&wgpu::QuerySetDescriptor {
        label: None,
        ty: wgpu::QueryType::Timestamp,
        count: 1,
    });
    encoder.write_timestamp(&query_set, 0);
    encoder.resolve_query_set(&query_set, 0..1, &buffer, 0);
    queue.submit([encoder.finish()]);
    buffer.slice(..).map_async(wgpu::MapMode::Read, |_| {});
}
device.poll(wgpu::Maintain::Poll);

High hopes on your panic backtrace 😅

from wgpu-profiler.

JCapucho avatar JCapucho commented on July 21, 2024

@Wumpf sorry for not responding earlier but I've been trying to reproduce the issue with debug info enabled but it doesn't seem to trigger with it enabled, it's one of those.

from wgpu-profiler.

Wumpf avatar Wumpf commented on July 21, 2024

no-darth-vader

from wgpu-profiler.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.