KhronosGroup / glslang

Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.
Other
3.02k stars 833 forks source link

How to view AST in a graph #2871

Open xiaoqiang-wang opened 2 years ago

xiaoqiang-wang commented 2 years ago

Hello, my frineds Does glslang can print a AST as graph?

some thing like .dot file, and use graphviz to view what the AST really is?

or can we use other tools to view a AST in a graph?

jeremy-lunarg commented 2 years ago

Have you looked at the command-line argument -i?

-i intermediate tree (glslang AST) is printed out

It might have the information you're looking for.

xiaoqiang-wang commented 2 years ago

@jeremy-lunarg thanks alot my friend, the argument -i is print AST as text file.

I want to view it as graph, some node connected with edges.

jeremy-lunarg commented 2 years ago

That's the closest thing we have at this time. Sorry.

greg-lunarg commented 2 years ago

We would be open to someone contributing such code!