Andreas Zita
Andreas Zita

Reputation: 7580

How to compile shader fx-file for use in WPF?

I have a Shader.fx-file and want to compile it into a Shader.ps-file that can be used as input to a ShaderEffect in WPF.

I'm using the compiler in Windows 10 SDK (fxc.exe) like this:

fxc /O0 /Fc /Zi /T  fx_5_0 /Fo Shader.ps Shader.fx

This works fine but when loading it in WPF I get an exception:

Shader bytecode must be an integral number of 4-byte words.

Any idea how to solve this? How do I get it to the correct size?

Upvotes: 3

Views: 1983

Answers (1)

Andreas Zita
Andreas Zita

Reputation: 7580

The problem was this:

/T fx_5_0

Should be:

/T ps_2_0

Upvotes: 2

Related Questions