webgpu / webgpu-debugger

MIT License
69 stars 8 forks source link

add an order number for showing by call order instead of apply order? #26

Open greggman opened 1 year ago

greggman commented 1 year ago

I don't know if this would be useful or not but, the trace doesn't record what you did. It records the effect of what you did.

So,

const commandEncoder = device.createCommandEncoder();
const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor);
passEncoder.setPipeline(pipeline);
passEncoder.draw(1)
device.queue.writeBuffer()
passEncoder.end();
device.queue.submit([commandEncoder.finish()]);

Will show up in the trace as

createEncoder
writeBuffer
submit
   pass
      setPipeline
      draw

If each command recorded an order id then we could optionally display the commands in call order. Not sure how useful that is. I'm just worried that devs will want to see what they did, not just results of what they did.

Like the mapAsync being translated in bufferUpdateData, I think the user would like to see mapAsyc, getMappedRange, unmap? or not?