Set the. m build for the. FX file in

Source: Internet
Author: User

To compile the. FX file in d3d, you can directly use fxc.exe in d3d tools, or call the FX compiler to compile the file after loading the. FX file. However, this is inconvenient. Inspired by the Cuda file compilation settings, you can also set up custom buildfor. FX and directly call fxc.exe for compilation.

First, right-click the. FX file and choose Properties to set the properties. select Custom Build tool as the tool.



Then custom build step-> General-> command line, enter the following statement (copy directly ):

"$ (Dxsdk_dir) Utilities \ bin \ x86 \ fxc.exe"/GEC/T fx_2_0/Fc $ (inputdir) \ formats (inputname.txt/fo $ (inputdir) \ $ (inputname ). fxo % (filename ). FX $ (inputpath)

Enter the following in outputs (otherwise, the compile menu cannot be activated ):

$ (Inputname). fxo

The first half specifies the position of the fxc.exe compiler in d3d sdk. the parameters in the middle are related to fxc. You can change the parameters as needed, the following figure shows the corresponding output and the method for searching the source file. The path method can refer to the relevant description of msdn: http://msdn.microsoft.com/en-us/library/c02as0cs (V = vs.80). aspx


In this way, you can directly compile. FX and check for errors. You can double-click the output window to locate the corresponding error line:

You can also add other things you want in custom build, such as counting the number of various ASM commands for Shader performance analysis:


Note:The vs project above is the sample in the d3d SDK: irradiancevolume_2005

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.