Report the main function name in testparse.
authorRyan C. Gordon <icculus@icculus.org>
Sun, 29 May 2016 00:26:44 -0400
changeset 1171 9f27482a2f58
parent 1170 6e9659bf396f
child 1172 55700e64bd8c
Report the main function name in testparse.
mojoshader.h
utils/testparse.c
--- a/mojoshader.h	Sun May 29 00:21:34 2016 -0400
+++ b/mojoshader.h	Sun May 29 00:26:44 2016 -0400
@@ -538,9 +538,11 @@
     int minor_ver;
 
     /*
-     * This is the main function name of the shader. On profiles that need
-     *  the caller to supply this, this will be the caller-supplied string.
-     *  Otherwise, it'll be the name chosen by the profile ("main") or
+     * This is the main function name of the shader. This will be the
+     *  caller-supplied string even if a given profile ignores it (GLSL,
+     *  for example, always uses "main" in the shader output out of necessity,
+     *  and Direct3D assembly has no concept of a "main function", etc).
+     *  Otherwise, it'll be a default name chosen by the profile ("main") or
      *  whatnot.
      */
     const char *mainfn;
--- a/utils/testparse.c	Sun May 29 00:21:34 2016 -0400
+++ b/utils/testparse.c	Sun May 29 00:26:44 2016 -0400
@@ -296,6 +296,7 @@
         INDENT(); printf("SHADER TYPE: %s\n", shader_type(pd->shader_type));
         INDENT(); printf("VERSION: %d.%d\n", pd->major_ver, pd->minor_ver);
         INDENT(); printf("INSTRUCTION COUNT: %d\n", (int) pd->instruction_count);
+        INDENT(); printf("MAIN FUNCTION: %s\n", pd->mainfn);
         print_attrs("INPUTS", pd->attribute_count, pd->attributes, indent);
         print_attrs("OUTPUTS", pd->output_count, pd->outputs, indent);