}
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;
}
}
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) {
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) {
}
if (len <= 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "glProgramNamedParameterNV");
+ _mesa_error(ctx, GL_INVALID_VALUE, "glProgramNamedParameterNV(len)");
return;
}
return;
}
- _mesa_error(ctx, GL_INVALID_VALUE, "glProgramNamedParameterNV");
+ _mesa_error(ctx, GL_INVALID_VALUE, "glProgramNamedParameterNV(name)");
}
/* A pointer to this dummy program is put into the hash table when
* glGenPrograms is called.
*/
-static struct program DummyProgram;
+struct program _mesa_DummyProgram;
/**
else {
/* Bind user program */
prog = (struct program *) _mesa_HashLookup(ctx->Shared->Programs, id);
- if (!prog || prog == &DummyProgram) {
+ if (!prog || prog == &_mesa_DummyProgram) {
/* allocate a new program now */
prog = ctx->Driver.NewProgram(ctx, target, id);
if (!prog) {
if (ids[i] != 0) {
struct program *prog = (struct program *)
_mesa_HashLookup(ctx->Shared->Programs, ids[i]);
- if (prog == &DummyProgram) {
+ if (prog == &_mesa_DummyProgram) {
_mesa_HashRemove(ctx->Shared->Programs, ids[i]);
}
else if (prog) {
/* Insert pointer to dummy program as placeholder */
for (i = 0; i < (GLuint) n; i++) {
- _mesa_HashInsert(ctx->Shared->Programs, first + i, &DummyProgram);
+ _mesa_HashInsert(ctx->Shared->Programs, first + i, &_mesa_DummyProgram);
}
/* Return the program names */