From 97f5849f13990e828e9406202938e7bb3dbd4df6 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sun, 29 May 2016 00:26:44 -0400 Subject: [PATCH] Report the main function name in testparse. --- mojoshader.h | 8 +++++--- utils/testparse.c | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mojoshader.h b/mojoshader.h index 5accf74e..852b0ed7 100644 --- a/mojoshader.h +++ b/mojoshader.h @@ -538,9 +538,11 @@ typedef struct MOJOSHADER_parseData 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; diff --git a/utils/testparse.c b/utils/testparse.c index dc85507c..29853e2d 100644 --- a/utils/testparse.c +++ b/utils/testparse.c @@ -296,6 +296,7 @@ static void print_shader(const char *fname, const MOJOSHADER_parseData *pd, 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);