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

Add line numbers to merged shader sources and improve the debugging experience #2680

Open
jellysquid3 opened this issue Aug 16, 2024 · 4 comments · May be fixed by #2691
Open

Add line numbers to merged shader sources and improve the debugging experience #2680

jellysquid3 opened this issue Aug 16, 2024 · 4 comments · May be fixed by #2691
Assignees
Labels
T-enhancement Type: Enhancement

Comments

@jellysquid3
Copy link
Member

Right now, we don't add #line directives to the merged shader sources, which makes reading line numbers a lot harder. To make it easier to debug compilation errors, the following changes should be made:

  • Each included shader file (and the prelude with #version and specialization constants) should be given a unique index.
  • In the merged source code, #line <line number> <source file index> declarations should be added, and the original #include macro should be commented out (for debugging purposes).
  • The shader compilation log should include the merged source code.
@jellysquid3 jellysquid3 added the T-enhancement Type: Enhancement label Aug 16, 2024
@douira douira self-assigned this Aug 18, 2024
@douira
Copy link
Collaborator

douira commented Aug 19, 2024

Does "shader compilation log" mean that the entire shader source should be printed into the log?

@jellysquid3
Copy link
Member Author

I think so, yes. I'm not sure where else we could put it, and the error diagnostics aren't useful without it. But it might also completely flood the log file...

@douira
Copy link
Collaborator

douira commented Aug 19, 2024

If you're only concerned about making the gl errors make sense, we could capture those and re-map the source ids to import names with some effort.

@jellysquid3
Copy link
Member Author

We just want the errors to make sense. They don't, currently. If you think re-mapping the source ids would solve the problem, then I'm for it.

@douira douira linked a pull request Aug 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-enhancement Type: Enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants