#include "program/program.h"
#include "program/prog_print.h"
-#ifdef _MSC_VER
-#include <stdlib.h>
-#define PATH_MAX _MAX_PATH
-#endif
-
/**
* Bind a program (make it current)
* \note Called from the GL API dispatcher by both glBindProgramNV
const char *capture_path = _mesa_get_shader_capture_path();
if (capture_path != NULL) {
FILE *file;
- char filename[PATH_MAX];
const char *shader_type =
target == GL_FRAGMENT_PROGRAM_ARB ? "fragment" : "vertex";
+ char *filename =
+ ralloc_asprintf(NULL, "%s/%cp-%u.shader_test",
+ capture_path, shader_type[0], prog->Id);
- _mesa_snprintf(filename, sizeof(filename), "%s/%cp-%u.shader_test",
- capture_path, shader_type[0], prog->Id);
file = fopen(filename, "w");
if (file) {
fprintf(file,
} else {
_mesa_warning(ctx, "Failed to open %s", filename);
}
+ ralloc_free(filename);
}
}