Jump to content
  • Advertisement
Sign in to follow this  
GameDevEnthusiast

OpenGL Shared shader uniforms are bad for parallel rendering?

This topic is 2091 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

    Hello!

 

    I'm trying to implement a stateless multithreaded renderer as described in the "Firaxis LORE" presentation about Civilization 5 renderer from GDC 2011 and their system seems to be very elegant, clean and simple to use.

    Their rendering commands are self-contained and can be submitted in any order which, among other nice things, lends itself to easy parallelization. For example, a 'COMMAND_RENDER_BATCHES' command contains a list of surfaces to render, each with shader constant payload.

    The recommended way to update uniform shader constants is to put them into uniform blocks (constant buffers in Direct3D parlance) according to their update frequency (to minimize memory transfers). Besides, uniform blocks can be shared between different programs (conserves memory).

    Let's say, I have several global uniform buffers (e.g. PerFrame, PerView, PerInstance and PerLight), which can be updated independent of any shader programs (no need to bind a program). But shader dependencies on global stuff ruin the whole 'statelessness' idea - I can no longer sort the draw calls, because I need to preserve the original update-set-draw order for correct rendering!

 

    Should I abandon the idea of using global uniform buffers and resort to the old OpenGL 2.* way of setting all shader uniforms on each batch submission (which is said to be most inefficient) ?

 

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!