Skip to main content
GameDev.net gamedev.net
🔒 Locked

HLSL fxc.exe

Started by BEHOLDER192875 Nov 17, 2008 at 6:49 PM 3 replies 6.6k views
Original Post
BEHOLDER192875
BEHOLDER192875
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?
MJP
MJP
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.
jollyjeffers
jollyjeffers
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
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ |
BEHOLDER192875
BEHOLDER192875
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.
Neverender
Neverender
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 input.fx".

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.