Jump to content
  • Advertisement
Sign in to follow this  

Offline shader compiling

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

When compling the shaders with fxc there is the option of using "Fo" for outputing object file. Is the output fxo file pure binary code of the shader?
when using "Fh" it outputs header file containing the binary code, what is the purpose of this file? For embedding the code in c++?

Share this post


Link to post
Share on other sites
Advertisement
You're spot on.

[font="'Lucida Console"]/Fo[/font] outputs a binary blob, which you can load into a piece of memory, and cast to a "[font="'Lucida Console"]const DWORD *[/font]" (or whatever the shader creation functions take) to give to D3D.

[font="'Lucida Console"]/Fh[/font] outputs the same blob, but encoded as an array of bytes in a C++ header file, in case you want to compile your shaders into your project instead of loading them as data-files. In MSVC, you can set up a "pre-build step" which converts your shaders to headers so they're automatically compiled via [font="'Courier New"]FXC[/font] every time you build your project.

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!