mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
added _mesa_alloc_instructions() utility function
This commit is contained in:
parent
a574c804a0
commit
9983a27cbe
2 changed files with 16 additions and 0 deletions
|
|
@ -1312,6 +1312,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
|
||||
|
|
|
|||
|
|
@ -114,6 +114,9 @@ _mesa_delete_program(GLcontext *ctx, struct gl_program *prog);
|
|||
extern struct gl_program *
|
||||
_mesa_lookup_program(GLcontext *ctx, GLuint id);
|
||||
|
||||
extern struct prog_instruction *
|
||||
_mesa_alloc_instructions(GLuint numInst);
|
||||
|
||||
extern struct prog_instruction *
|
||||
_mesa_realloc_instructions(struct prog_instruction *oldInst,
|
||||
GLuint numOldInst, GLuint numNewInst);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue