Concurrent Programming: Compute Shaders

Sdílet
Vložit
  • čas přidán 20. 08. 2024
  • #gamedev #gamedevelopment #programming
    Lodev's Tutorial: lodev.org/cgtu...
    code: github.com/ame...
    Playlist: • Concurrent Programming
    Discord: / discord
    Patreon: patreon.com/us...
    X: @blindspotsoft

Komentáře • 6

  • @SkyFly19853
    @SkyFly19853 Před měsícem +2

    Looks like a list for a tile map...

  • @okanguclu4567
    @okanguclu4567 Před měsícem +1

    Why are you uploading the colours buffer to the gpu. Couldn't you just define constants in the shader for it? Would be faster, since you don't need to transfer it from CPU to GPU anymore.

    • @GetIntoGameDev
      @GetIntoGameDev  Před měsícem +2

      Fair point! Defining as a shader constant may speed things up further, not on the memory bus since I’m only transferring once at program creation, but by reducing the number of memory reads.

  • @mikelevels1
    @mikelevels1 Před měsícem

    Loving this content! Will compute shaders be added to the C++ Vulkan tutorial?
    Additionally, is it possible to pass the result from a compute pass straight into a vertex shader? I mean without transferring the memory back to the host?

    • @GetIntoGameDev
      @GetIntoGameDev  Před měsícem +1

      1: Yes! I'll probably use them for visibility tests.
      2: Yes! In OpenGL this is actually the default behaviour. In this code I bind the storage buffer once at creation, the compute shader writes to it and the geometry shader (but could be any shader module at all) reads from it, no host involvement beyond synchronisation of shaders.

    • @mikelevels1
      @mikelevels1 Před měsícem

      @@GetIntoGameDev thank you so much! Looking forward to the corresponding Vulkan implementation. As always love the content!