diff options
author | Brian Paul <[email protected]> | 2006-08-25 15:13:25 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2006-08-25 15:13:25 +0000 |
commit | 9983a27cbe4f123f4e7fcce59c0d8b61b0f73924 (patch) | |
tree | 83224b9f779828578bf6f35b864ec9f3b473b6bc /src/mesa/shader/program.c | |
parent | a574c804a09c19fdbf5f6e6eac0767d3d8f57490 (diff) |
added _mesa_alloc_instructions() utility function
Diffstat (limited to 'src/mesa/shader/program.c')
-rw-r--r-- | src/mesa/shader/program.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index f6877bd1426..b1d06bbb278 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -1313,6 +1313,19 @@ _mesa_init_instruction(struct prog_instruction *inst) /** + * 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 (struct prog_instruction *) + _mesa_calloc(numInst * sizeof(struct prog_instruction)); +} + + +/** * Reallocate memory storing an array of program instructions. * This is used when we need to append additional instructions onto an * program. |