0

Using the FXC Shader compiler a macro could be defined like this:

#define OUT_MACRO(index) SV_Target##index

float4 PSMain(VSOutput In) : OUT_MACRO(0)
{...}

This fails using the DXC compiler though with various errors messages which basically are always a result of it just straight up ignoring the macro.

Giving DXC the "-flegacy-macro-expansion" flag did not seem to resolve the issue either. I am unsure how I can make the above macro work using DXC for Shader Model 6 and above.

0 Answers0