Debug printf how to print a matrix?

Hi! I’ve set up the debug printf extension to debug my shaders…

But I don’t find on the internet how to print a mat4.

This is not printing :

if (gl_VertexIndex == 0) {
                                                                            debugPrintfEXT("view matrix : %1.2m16f\n", pushConsts.viewMatrix);
                                                                         }

Thanks.

There is no direct format support for matrices in GLSL. Implementations for GL_EXT_debug_printf are only required to support int, uint and float types.

So for printing a matrix, you split it into one of the above types. E.g. 4 x 4 component floats.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.