diff options
author | Brian Paul <[email protected]> | 2004-06-20 20:57:22 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2004-06-20 20:57:22 +0000 |
commit | 0590786f8af98bb849cee11fffd51be7db04f1b5 (patch) | |
tree | 1f42b0afde14dff2531bf655475bc79acbe13666 /src/mesa | |
parent | 26359143b673db7793d06ff2b4217198aa0266d6 (diff) |
call ctx->Driver.NewProgram() instead of CALLOC/etc in _mesa_LoadProgramNV. Fixes problems found with Cg demos.
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/shader/nvprogram.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c index 4aaa74250a5..070451452a3 100644 --- a/src/mesa/shader/nvprogram.c +++ b/src/mesa/shader/nvprogram.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.0 + * Version: 6.1 * * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. * @@ -530,13 +530,12 @@ _mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len, && ctx->Extensions.NV_vertex_program) { struct vertex_program *vprog = (struct vertex_program *) prog; if (!vprog) { - vprog = CALLOC_STRUCT(vertex_program); + vprog = (struct vertex_program *) + ctx->Driver.NewProgram(ctx, target, id); if (!vprog) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); return; } - vprog->Base.RefCount = 1; - vprog->Base.Resident = GL_TRUE; _mesa_HashInsert(ctx->Shared->Programs, id, vprog); } _mesa_parse_nv_vertex_program(ctx, target, program, len, vprog); @@ -545,13 +544,12 @@ _mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len, && ctx->Extensions.NV_fragment_program) { struct fragment_program *fprog = (struct fragment_program *) prog; if (!fprog) { - fprog = CALLOC_STRUCT(fragment_program); + fprog = (struct fragment_program *) + ctx->Driver.NewProgram(ctx, target, id); if (!fprog) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); return; } - fprog->Base.RefCount = 1; - fprog->Base.Resident = GL_TRUE; _mesa_HashInsert(ctx->Shared->Programs, id, fprog); } _mesa_parse_nv_fragment_program(ctx, target, program, len, fprog); |