Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Correct compiler syntax for compiling shader using fxc

4: Adsense

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 lipsryme   Members   

1522
Like
0Likes
Like

Posted 18 March 2013 - 01:44 PM

Hi,

Since I'm now precompiling my shaders using the fxc.exe I'm wondering which parameters I should set when compiling for debug / release.

I'm also not sure what enum translates to which parameter. Using D3DX11CompileFromFile I'd use flags like D3D10_SHADER_DEBUG | D3D10_SHADER_SKIP_OPTIMIZATION | D3D10_SHADER_WARNINGS_ARE_ERRORS for the DEBUG build.

The msdn page tells me it should be /Od /Zi for debug, and just leaving it away for release build. Something tells me though that there's more to it...any secrets I should know ? xD


Edited by lipsryme, 18 March 2013 - 01:46 PM.


#2 MJP   Moderators   

19415
Like
2Likes
Like

Posted 18 March 2013 - 03:11 PM

Just run fxc /?, it will give you a list of all of the parameters that you can pass. All of the flags have direct mappings to command-line parameters.

 

D3D10_SHADER_DEBUG = /Zi
D3D10_SHADER_SKIP_OPTIMIZATION = /Od
D3D10_SHADER_WARNINGS_ARE_ERRORS = /WX



#3 lipsryme   Members   

1522
Like
0Likes
Like

Posted 19 March 2013 - 07:51 AM

Ok so while that does provide me with a better description to those parameters what I was trying to ask was if there were specific parameters I should use for either debug or release. Like maybe /Vd (disabled validation) for release builds ? Or e.g. what does force IEEE strictness mean, or enable strict mode?


Edited by lipsryme, 19 March 2013 - 09:44 AM.


#4 Hodgman   Moderators   

50606
Like
1Likes
Like

Posted 19 March 2013 - 06:31 PM

IEEE strictness will prevent any optimization that doesn't exactly comply with the floating point specification, for if you need deterministic processing. E.g. The compiler can fuse a multiply and an add into a single mul-and-add operation, but the result will be rounded ever so slightly differently than if you'd done them separately.

For release, I use /O3

#5 lipsryme   Members   

1522
Like
0Likes
Like

Posted 19 March 2013 - 06:47 PM

Does /Vd (disable validation) do anything to build time or performance ?

Not sure exactly what it does but it sounds to me like it's a check if the shader is "valid", meaning without errors?






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.