Skip to content

ps_3_0 shader parsing failed #54

Description

@Joschuka

Samples :
Samples.zip

Code to reproduce the error :

        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;

TestFpo.shd gives the following errors :
TestFpo

TestFpo2.sh gives these :
TestFpo2 shd

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions