Sodium Reloaded (Unofficial)

Sodium Reloaded (Unofficial)

0 Downloads

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

jellysquid3 opened this issue ยท 4 comments

commented

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.
commented

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

commented

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...

commented

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.

commented

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.