Jump to content

  • Log In with Google      Sign In   
  • Create Account

How to compile an hlsl code with fxc.exe


Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
4 replies to this topic

#1   Members   

1184
Like
0Likes
Like

Posted 22 August 2012 - 12:30 AM

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

Edited by lucky6969b, 22 August 2012 - 12:36 AM.


#2   Moderators   

49403
Like
1Likes
Like

Posted 22 August 2012 - 12:40 AM

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 technique 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, 22 August 2012 - 12:44 AM.


#3   Members   

1184
Like
0Likes
Like

Posted 22 August 2012 - 08:59 PM

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

#4   Moderators   

49403
Like
0Likes
Like

Posted 22 August 2012 - 09:06 PM

You always need to specify a target profile with "/T" before your input file. For D3D9 FX files, you'll want "/T fx_2_0"

#5   Members   

1184
Like
0Likes
Like

Posted 22 August 2012 - 09:17 PM

Okay, it got it going on now




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.