![]() There is also the chance of passing wrong data to the GPU (e.g. When I hit a problem I try to reproduce it on another device to see if the problem is the same which hints at a logic error (instead of a driver problem/undefined behavior). The option which I have come to use recently, is to modularize my shader code via #includes and restrict the included code to a common subset of GLSL and C++& glm. I can't comment on the situation under Windows. Let me note that, although they are available under Linux, I always had very little success with using them there. There are several offerings by GPU vendors like AMD's CodeXL or NVIDIA's nSight/ Linux GFX Debugger which allow stepping through shaders but are tied to the respective vendor's hardware. Obv, it goes without saying that if I am not "debugging" a pixel shader or compute shader, I pass this "debugColor" info throughout the pipeline without interpolating it (in GLSL with flat keyword )Īgain, this is very hacky and far from proper debugging, but is what I am stuck with not knowing any proper alternative. I've listed a couple of them as answer of this other question. If need to debug something that you cannot display on screen easily, you can always do the same and use one frame analyser tool to inspect your results. ![]() The important thing is have a good support for hot-reloading of shader code, so you can almost interactively change your tracked data/event and switch easily on/off the debug visualization. In this "framework" I also find useful to have a set of fixed conventions for common cases so that if I don't have to constantly go back and check what colour I associated with what. I usually do various tricks like lerping or blending between various "colour codes" to test various more complex events or non-binary stuff. ![]() So you can "observe" debug info this way. So I sprinkle a bunch of dynamic branches with #if DEBUG / #endif guards that basically say #if DEBUG What I personally do is a very hacky "colourful debugging". (NOTE: Renderdoc allows you to do so by selecting a specific thread/pixel) As far as I know there are no tools that allows you to steps through code in a shader (also, in that case you would have to be able to select just a pixel/vertex you want to "debug", the execution is likely to vary depending on that).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |