Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ps_3_0 shader parsing failed #54

Open
Joschuka opened this issue Sep 6, 2021 · 1 comment
Open

ps_3_0 shader parsing failed #54

Joschuka opened this issue Sep 6, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@Joschuka
Copy link

Joschuka commented Sep 6, 2021

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.

@flibitijibibo flibitijibibo added the bug Something isn't working label Mar 10, 2022
@icculus
Copy link
Owner

icculus commented May 28, 2022

These files both parse fine, at least on Linux, using both the HLSL and d3d profiles.

I sync'd to a random commit in 2019, too, and they worked then as well, so it doesn't appear to be something that was fixed since this was reported.

Unless building with Visual Studio breaks this in some way, I think we can close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants