Jump to content
  • Advertisement
Sign in to follow this  
Quat

Organizing Shader Programs

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

I'm trying to rework how I organize my shader programs.  I precompile my shaders at build time.  I would like to loop through all the compiled shader files in some folder and create the corresponding d3d11 shader interface (e.g., ID3D11ComputeShader).  However, given just the compiled shader bytecode, I don't think I can figure out the shader type, so I don't know whether to call CreateComputeShader, CreateVertexShader, etc. 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites
Advertisement

use a distinctive extension per progam type ? vpo, fpo, gpo, hpo, dpo, and cpo.

 

Easy one :)

Share this post


Link to post
Share on other sites

Yeah I could do something like that.  Is that what people are doing?  I know I asked a specific question, but I was also looking for possibly better ways to manage shaders.  Do people just treat shaders like assets and lazy load them and store them in a hash table?

Share this post


Link to post
Share on other sites

Most of our shaders are packed as part of assets that are processed by our build system, so we can provide any metadata needed by the runtime. We do have some standalone shaders that are compiled via scripts. For those the runtime just loads by name and has to know what type it is. To distinguish different shader types we'll usually just add "_vs" or "_ps" suffix to the name.

Share this post


Link to post
Share on other sites
I precompile my shaders, and write out to a custom format... storing bits of information (shader type, number constant buffers, etc...)

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!