std::ifstream shaderInFile("TestFpo2.shd", std::ios::in);
if (!shaderInFile.is_open())
{
std::cout << "Couldn't open shader file" << std::endl;
system("pause");
return 0;
}
shaderInFile.seekg(0, std::ios::end);
size_t fileSize = shaderInFile.tellg();
std::vector<char> data;
data.resize(fileSize);
shaderInFile.seekg(0, std::ios::beg);
shaderInFile.read(&data[0], fileSize);
const MOJOSHADER_parseData *test = MOJOSHADER_parse(MOJOSHADER_PROFILE_HLSL, "ShaderMain", (uint8_t*)data.data(), fileSize, nullptr, 0, nullptr, 0, 0, 0, 0);
std::ofstream outFile("out.txt", std::ios::out);
outFile.write(test->output, test->output_len);
return 0;
The first file can be parsed with both the cmdDecompiler from 3DMigoto and SlimDX while the second can only be parsed by SlimDX.
The expected disasm can be found for both of them in the enclosed folder.
Samples :
Samples.zip
Code to reproduce the error :
TestFpo.shd gives the following errors :

TestFpo2.sh gives these :

The first file can be parsed with both the cmdDecompiler from 3DMigoto and SlimDX while the second can only be parsed by SlimDX.
The expected disasm can be found for both of them in the enclosed folder.