CaffeineMC / sodium-fabric

A Minecraft mod designed to improve frame rates and reduce micro-stutter
Other
4.72k stars 808 forks source link

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

Open jellysquid3 opened 3 weeks ago

jellysquid3 commented 3 weeks ago

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:

douira commented 3 weeks ago

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

jellysquid3 commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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.