How to debug a GLSL shader?

后端 未结 11 1370
青春惊慌失措
青春惊慌失措 2020-11-28 17:38

I need to debug a GLSL program but I don\'t know how to output intermediate result. Is it possible to make some debug traces (like with printf) with GLSL ?

11条回答
  •  孤街浪徒
    2020-11-28 18:25

    I have found Transform Feedback to be a useful tool for debugging vertex shaders. You can use this to capture the values of VS outputs, and read them back on the CPU side, without having to go through the rasterizer.

    Here is another link to a tutorial on Transform Feedback.

提交回复
热议问题