Original Post
I'm trying to port some code I had written to compile shaders (using XNA 3) to use XNA 4. The whole pipeline was extensively reworked so I'm having some issues.
Specifically the bit I'm stuck on right now is CompilerIncludeHandler. Basically I have some #includes in my HLSL shader that aren't actual files, but programmatically constructed files (this is for a unit testing framework, for the curious. I isolate each test and run it in isolation in its own compiled shader). I was using the CompilerIncludeHandler to catch attempts to #include these programmatically constructed files and swap in the source code instead of going to disk (since the files don't actually exist). But I don't see a way to do that in XNA 4 using the Microsoft.Xna.Framework.Content.Pipeline.Processors.EffectProcessor. It just takes an EffectContent, which takes a string EffectCode.
I'm guessing there's something dealing with the ContentProcessorContext that I can tweak? But I don't see what.
Specifically the bit I'm stuck on right now is CompilerIncludeHandler. Basically I have some #includes in my HLSL shader that aren't actual files, but programmatically constructed files (this is for a unit testing framework, for the curious. I isolate each test and run it in isolation in its own compiled shader). I was using the CompilerIncludeHandler to catch attempts to #include these programmatically constructed files and swap in the source code instead of going to disk (since the files don't actually exist). But I don't see a way to do that in XNA 4 using the Microsoft.Xna.Framework.Content.Pipeline.Processors.EffectProcessor. It just takes an EffectContent, which takes a string EffectCode.
I'm guessing there's something dealing with the ContentProcessorContext that I can tweak? But I don't see what.