Back doing another MonoGame port, I have an FX shader that parsed correctly in MG 3.2, but MG 3.4 introduced a shader parsing error.
Firstly I discovered because if a missing null check.
ShaderData.writer.cs failed to check before writing a null samplerName.
if (null == sampler.samplerName)
{
System.Console.Error.WriteLine("Error FX parsing, sampler name is null!");
writer.Write(string.Empty);
}
else
{
writer.Write(sampler.samplerName);
}
Okay the more I look at this it seems to be a noted MojoShader bug. And I’ll try either updating to the latest, or fix the MojoShader code so it sets the proper index and name.
Well actually that should never be null… the fact it is null is the bug to worry about. Samplers need to have names for the GL path to work.
But this error sounds familiar to me…
I eventually found the bug was caused by someone checking in a bad version of MojoShader. I ended up rebuilding the 64bit version of it and updating it to fix the issue.
Note the version of MojoShader used by MonoGame is modified from the original source. The code for the version used in MonoGame is here:
If you use a different version of MojoShader it can cause weird problems like the issue linked above.
I copied the libmojoshader_32.dll from MonoGame 3.2 and used that instead of the 64-bit one. I set the build of 2MGFX to 32-bit. And I set the debug symbol for OLD_CONTENT_PROCESSORS.
That let the FX compile without the null sampler name.
Ah sweet that fixed the character issue! Okay that did it!