u/giomatfois

▲ 5 r/vulkan

Clustered Forward with/without compute shader

I've implemented clustered forward shading both on cpu and gpu with a compute shader, based on this guide https://www.aortiz.me/2018/12/21/CG.html.

When using the gpu implementation I see a little drop in fps (10-20fps), which goes a bit against my expectations since i thought the compute shader was best suited for this task.

What I'm doing is the following:

  • use a single queue for graphics/compute tasks (no aysnc compute)
  • create ssbo for light clusters (one per frames in flight) at startup, recreate when window resizes
  • for each frame:
    • dispatch clustered forward compute shader (write on clusters ssbo)
    • insert bufferbarrier on light cluster ssbo of current frame
    • graphics draw commands (read from clusters ssbo)

For the cpu implementation I used openmp to speedup things, my computer has 12 logical threads. I experimented with up to 500 dynamic point lights.

Do you think this performance gap is ok or did I mess somethings up with my shader implementation? What's your experience using clustered forward shading?

reddit.com
u/giomatfois — 10 days ago