directx – Replacing PixelShaderCompile task with fxc.exe (necessitated by moving to VS2022). Getting same functionality. Putting in resource (embedded?)

As some may know, support for PixelShaderCompile has been done away with as of VS2022. One is suppose to use fxc.exe (I believe). For a discussion of this, see:

Build pixel shader project in VS2022

I inherited a LARGE project I need to build. I’m not familiar with the DirectX parts of it, and I don’t think I need to be right away. However, I do need to build and run it.
The build line for the shader stuff was:

 <Target Name="EffectCompile" Condition="'@(Effect)' != '' ">
    <PixelShaderCompile Sources="@(Effect)">
      <Output TaskParameter="Outputs" ItemName="Resource" />
    </PixelShaderCompile>
  </Target>

Based on the article above (mostly from stackoverflow.com/users/403671/simon-mourier) I tried the following code:

<Target Name="EffectCompile" Condition="'@(Effect)' != '' ">
  <Exec Command="&quot;$(MSBuildProgramFiles32)\Windows Kits\10\bin\10.0.22621.0\x64\fxc.exe&quot; /T ps_3_0 /Fo %(Effect.Identity).ps %(Effect.Identity)"/>
</Target>

which compiles fine and produces .ps files. However, I believe the first code block is somehow embedding said .ps files in a “resource” or something? To be honest, I’m not familiar with the syntax of either command and am having trouble finding documentation and/or examples. I’m guessing this is something DirectX gurus do all the time?

Any ideas how to get started or research some more?

Dave

Read more here: Source link