*/
+#include <stdio.h>
+#include <assert.h>
+
#include "main/glheader.h"
-#include "main/imports.h"
-#include "main/mtypes.h"
#include "prog_instruction.h"
+#include "prog_parameter.h"
/**
}
-/**
- * Allocate an array of program instructions.
- * \param numInst number of instructions
- * \return pointer to instruction memory
- */
-struct prog_instruction *
-_mesa_alloc_instructions(GLuint numInst)
-{
- return
- calloc(numInst, sizeof(struct prog_instruction));
-}
-
-
/**
* Copy an array of program instructions.
* \param dest pointer to destination.
_mesa_copy_instructions(struct prog_instruction *dest,
const struct prog_instruction *src, GLuint n)
{
- GLuint i;
memcpy(dest, src, n * sizeof(struct prog_instruction));
- for (i = 0; i < n; i++) {
- if (src[i].Comment)
- dest[i].Comment = strdup(src[i].Comment);
- }
return dest;
}
-/**
- * Free an array of instructions
- */
-void
-_mesa_free_instructions(struct prog_instruction *inst, GLuint count)
-{
- GLuint i;
- for (i = 0; i < count; i++) {
- free((char *)inst[i].Comment);
- }
- free(inst);
-}
-
-
/**
* Basic info about each instruction
*/
return InstInfo[opcode].Name;
else {
static char s[20];
- _mesa_snprintf(s, sizeof(s), "OP%u", opcode);
+ snprintf(s, sizeof(s), "OP%u", opcode);
return s;
}
}