Concurrent Programming: Compute Shaders

Поделиться
HTML-код
  • Опубликовано: 21 авг 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

Комментарии • 6

  • @SkyFly19853
    @SkyFly19853 Месяц назад +2

    Looks like a list for a tile map...

  • @mikelevels1
    @mikelevels1 Месяц назад

    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  Месяц назад +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 Месяц назад

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

  • @okanguclu4567
    @okanguclu4567 Месяц назад +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  Месяц назад +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.