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

vp20compiler: Forward comments from input to output #131

Merged
merged 1 commit into from
Jul 13, 2019

Conversation

JayFoxRox
Copy link
Member

The final vs.inl currently doesn't contain the VS variable / constant locations that the Cg vertex program uses. That's an issue as it's necessary to set up a working program.

This adds a small loop, which collects all comments, and forwards them from input to output.

Unfortunately, this is not position aware, so it won't interleave encoded instructions and comments. But it's still good enough to read back the #var and #const lines.

It isn't really secure, and it's probably easy to write malicious code which outputs garbage C code (like introducing /* as part of the comment).
Ideally we'd parse only those important lines and generate a float c[][4]; and code which uploads it; however, this will have to do for now.

This was barely tested, but should work fine.


As an alternative for this PR, we could also remove the deletion step for the intermediate shader files.

@thrimbor thrimbor merged commit ab134c1 into XboxDev:master Jul 13, 2019
@thrimbor
Copy link
Member

Tested and better than master. Merged.

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

Successfully merging this pull request may close these issues.

None yet

2 participants