From 9ca83924848070d02a5ac2f0aa4e20444eec2183 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 2 Oct 2004 15:16:59 +0000 Subject: fix LoadProgramNV regression when I had fixed the RefCount bug --- src/mesa/shader/nvprogram.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/mesa/shader/nvprogram.c') diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c index 070451452a..4db78a8cc7 100644 --- a/src/mesa/shader/nvprogram.c +++ b/src/mesa/shader/nvprogram.c @@ -160,12 +160,12 @@ _mesa_RequestResidentProgramsNV(GLsizei n, const GLuint *ids) } prog = (struct program *) _mesa_HashLookup(ctx->Shared->Programs, ids[i]); - if (!prog) { _mesa_error(ctx, GL_INVALID_VALUE, "glRequestResidentProgramsNV(id)"); return; } + /* XXX this is really a hardware thing we should hook out */ prog->Resident = GL_TRUE; } } @@ -529,7 +529,7 @@ _mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len, target == GL_VERTEX_STATE_PROGRAM_NV) && ctx->Extensions.NV_vertex_program) { struct vertex_program *vprog = (struct vertex_program *) prog; - if (!vprog) { + if (!vprog || prog == &_mesa_DummyProgram) { vprog = (struct vertex_program *) ctx->Driver.NewProgram(ctx, target, id); if (!vprog) { @@ -543,7 +543,7 @@ _mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len, else if (target == GL_FRAGMENT_PROGRAM_NV && ctx->Extensions.NV_fragment_program) { struct fragment_program *fprog = (struct fragment_program *) prog; - if (!fprog) { + if (!fprog || prog == &_mesa_DummyProgram) { fprog = (struct fragment_program *) ctx->Driver.NewProgram(ctx, target, id); if (!fprog) { @@ -776,7 +776,7 @@ _mesa_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte *name, } if (len <= 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glProgramNamedParameterNV"); + _mesa_error(ctx, GL_INVALID_VALUE, "glProgramNamedParameterNV(len)"); return; } @@ -790,7 +790,7 @@ _mesa_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte *name, return; } - _mesa_error(ctx, GL_INVALID_VALUE, "glProgramNamedParameterNV"); + _mesa_error(ctx, GL_INVALID_VALUE, "glProgramNamedParameterNV(name)"); } -- cgit v1.2.3