webgpu / webgpu-debugger

MIT License
69 stars 8 forks source link

Frontend Thoughts #5

Open greggman opened 2 years ago

greggman commented 2 years ago

Hi @sebavan

I've made a few front end sites but I'm not an expert by any means. If you have any thoughts, ideas, advice, suggestions I'm all ears and feel free to hack on whatever.

Some random thoughts:

Looking at Safari's debugger it shows this

https://user-images.githubusercontent.com/234804/197083025-6a7c9681-e07e-47b7-80ee-879b5942d5b0.mov

So the event view (command view) is a tree of frames->commands. I'm guessing for WebGPU it would be frames->deviceCalls->commandbuffers->encoderCmds. So I'm imagining

frame1
frame2
  device.writeBuffer
  device.writeTexture
  device.submit(...)
    commandBuffer1
    commandBuffer2
      renderEncoder.beginRenderPass(desc)
      renderEncoder.setPipeline
      renderEncoder.setBindGroup
      renderEncoder.setVertexBuffer
      renderEncoder.setIndexBuffer
      renderEncoder.drawindexed

Or something like that. For the most part, the UI just needs a tree of data. I doesn't need to know details of what's in the tree, thou, for leaf it needs a list of resources. For example renderEncoder.setVertexBuffer needs the arguments (slot, buffer, offset, size) but it can probably generically make buffer clickable without having to know anything about specfically encoder.setVertexBuffer.

Anyway, just thinking out loud. Looking forward to collaborating and your thoughts and insight.

sebavan commented 2 years ago

Hey @greggman I am availble every day this week from 8 to 9 PST time and after 2PM, would be great to have a chat :-)

You can send me an invite at vandenberghe.sebastien@gmail.com

greggman commented 2 years ago

2pm PST? I can try to do that today. gman@google.com Or I can try at 8pm as well

sebavan commented 2 years ago

I am in Europe timezone :-) would 2PM PST tomorrow works as well ?

greggman commented 2 years ago

I pinged you on google chat. I'm free now (3:43pm PST) and can be available until 9pm PST though. 2pm PST tomorrow is fine too.