Search code examples
visual-studio-2013binaryfileshlsl

Building an HLSL shader with FXC.exe, what's the simplest way to get the byte code itself in a binary file?


For example, let's say I have "HLSLStructureTest.hlsl", and I want to have a binary file "HLSLStructureTestBytecode.bin" which contains the byte code for my compiled shader. Is there maybe an option I can include when running FXC.exe to get that? Or some other thing I'd need to do?

Thanks!


Solution

  • You're looking for the /Fo <file> switch, which outputs to an "object file" that contains the shader bytecode.