}
}
-extern "C" {
-
-/**
- * Translate a GLenum to a short shader stage name for debug printouts and
- * error messages.
- *
- * It recognizes the PROGRAM variants of the names so it can be used
- * with a struct gl_program->Target, not just a struct
- * gl_shader->Type.
- */
-const char *
-_mesa_progshader_enum_to_string(GLenum type)
-{
- switch (type) {
- case GL_VERTEX_SHADER:
- case GL_VERTEX_PROGRAM_ARB:
- return "vertex";
- case GL_FRAGMENT_SHADER:
- case GL_FRAGMENT_PROGRAM_ARB:
- return "fragment";
- case GL_GEOMETRY_SHADER:
- return "geometry";
- default:
- assert(!"Should not get here.");
- return "unknown";
- }
-}
-
-} /* extern "C" */
/**
* Translate a gl_shader_stage to a short shader stage name for debug
extern const char *
_mesa_shader_stage_to_string(unsigned stage);
-extern const char *
-_mesa_progshader_enum_to_string(GLenum type);
-
extern int glcpp_preprocess(void *ctx, const char **shader, char **info_log,
const struct gl_extensions *extensions, struct gl_context *gl_ctx);
const struct gl_program *const prog = shProg->_LinkedShaders[i]->Program;
printf("Program %d %s shader parameters:\n",
- shProg->Name, _mesa_progshader_enum_to_string(prog->Target));
+ shProg->Name, _mesa_shader_stage_to_string(i));
for (unsigned j = 0; j < prog->Parameters->NumParameters; j++) {
printf("%s: %p %f %f %f %f\n",
prog->Parameters->Parameters[j].Name,
if (ctx->Shader.Flags & GLSL_DUMP) {
printf("\n");
printf("GLSL IR for linked %s program %d:\n",
- _mesa_progshader_enum_to_string(shader->Type),
+ _mesa_shader_stage_to_string(shader->Stage),
shader_program->Name);
_mesa_print_ir(shader->ir, NULL);
printf("\n");