Jump to content
  • Advertisement
Sign in to follow this  
lucky6969b

How to compile an hlsl code with fxc.exe

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

How do I compile a .fx file without the "main" function/procedure?
Thanks
Jack Edited by lucky6969b

Share this post


Link to post
Share on other sites
Advertisement
How do I compile a .fx file without the "main" function/procedure?
Can you explain your problem a bit more? Every shader needs an "entry point" / "main function" (though with the Effects Framework, this is written in your [font=courier new,courier,monospace]technique[/font] block).

Are you compiling your shader for use with the Effects Framework, or as raw pixel/vertex shaders for use with the raw D3D APIs directly?
Also, what version of D3D are you targetting? Edited by Hodgman

Share this post


Link to post
Share on other sites
Okay, I am using D3D9, when I compile my shader without the main function, like fxc shader.fx, it replies with 'main' entry point not defined or something like that.
The main purpose of this move is to test the validity [spell wrong?], of the shader before applying to the main C++ program.
Thanks
Jack

Share this post


Link to post
Share on other sites
You always need to specify a target profile with "[font=courier new,courier,monospace]/T[/font]" before your input file. For D3D9 FX files, you'll want "[font=courier new,courier,monospace]/T fx_2_0[/font]"

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!