Jump to content
  • Advertisement
Sign in to follow this  
Aqua Costa

Render Context design and pipeline management

This topic is 2157 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

Bitsquid engine uses something called RenderContexts (slide 24) that, for what I understand, contains the complete pipeline state (resources, render targets, blend states, etc to be bound and the appropriate draw call), I also read here on GameDev.net a post (I think it was written by Hodgman) saying that the pipeline states should not 'bleed' to the next draw calls (so every render context must know what blending mode it needs, etc).

So I'm wondering if the RenderContext struct should contain variables of all shader resource slots/render targets/etc, because that will most likely result in a waste of memory because no project will need 128 shader resources bound simultaneously...

Or is there a better way to design a RenderContext struct?

Share this post


Link to post
Share on other sites
Advertisement
One way to go about this would be to set up a sort of tag system. Like structure your context as a stream of data where each chunk contains a tag that represents it's usage, then bind it appropriately. For example:

ContextChunk[] =
{
{kContextAlphaTest, 0},
{kContextTextureFilterMag, kLinear},
...
};

The advantage of this is that it's platform agnostic and you can add new context chunks without having the rebuild a library or what not.

Share this post


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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!