Jump to content
  • Advertisement
Sign in to follow this  
BEHOLDER192875

HLSL fxc.exe

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

I ran FXC.EXE with valid code, and it gives me nothing in return. I thought it was supposed to output an ASM version of the code for use in the SDK. If it doesn't then what is the purpose of FXC.EXE? How can I use the code in my program that isn't in ASM?

Share this post


Link to post
Share on other sites
Advertisement
If you just run fxc with no arguments it will show you all the valid switches you can use. The /Fc switch will output assembly to a file.

However typically what you want is just to output an object file, with /Fo.

Share this post


Link to post
Share on other sites
yup, you might also find adding the /Cc switch useful as well - just pretty-prints it in HTML iirc. Makes it a tiny bit easier to read [smile]

hth
Jack

Share this post


Link to post
Share on other sites
Let's say I do this in my lines of code.

if (FAILED (hr = D3DXCompileShaderFromFile (g_strVHLFile, NULL, NULL, "main", "vs_1_1", NULL, &pCode, NULL, &m_VS_ConstantTable)))
{
return hr;
}

if (FAILED (hr = m_pd3dDevice->CreateVertexShader ((DWORD*)pCode->GetBufferPointer(), &m_HLSLVertexShader)))
{
return hr;
}

If I already compiled the file prior (using FCX.EXE), then I could use that object file for the CreateVertexShader function after using D3DXAssembleShaderFromFile?

When I type:
fxc -nologo -T ps_2_0 -Fc -Vd NPRMetallic.txt

I get:


I didn't forget to put anything there. It just shows up blank with no assembly file. Like it didn't do anything at all.

Share this post


Link to post
Share on other sites
The /Fc switch to fxc takes a parameter. The name of the file you want to output the resulting assembly to. You're just passing another switch immediately after it. If you want the shader to go to stdout, don't pass /Fc. If you want the shader to go to a file, say "fxc /Fc<output.txt> input.fx".

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!