HLSL fxc.exe

Started by
3 comments, last by Neverender 15 years, 5 months ago
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?
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.
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 | MVP Profile | Developer Journal ]</small>

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.
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".

This topic is closed to new replies.

Advertisement