gentoobro,
@gentoobro@gleasonator.com avatar

@icedquinn @crunklord420 @splitshockvirus Draw calls are different. You need to have a shader bound already to issue a draw call. Shader changes go into the graphics queue, yes, but they aren't that scarce, and can be even cheaper if you do it carefully. Swapping the executable code is rather fast; reconfiguring the layout of the cache (uniforms) is the expensive part. In Vulkan you can carefully manage these costs independently. In OpenGL you can do some voodoo and the driver will probably hopefully maybe get it right. (Dunno about DirectX. Fuck Microshaft.)

A modern game might have a dozen shader changes each frame just due to the render pipeline alone. The main thing is to not just change shaders willy-nilly between each model or primitive.

On a side note, draw calls themselves aren't that expensive per-se. There can be some CPU overhead, but the main thing to remember is that the GPU is extremely pipelined and you want to let it crunch on as much data at one time as you can. You also don't want to cross the driver barrier too much with OpenGL, but that's a different story.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • Hentai
  • doujinshi
  • announcements
  • general
  • All magazines