summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2004-10-02 15:16:59 +0000
committerBrian Paul <[email protected]>2004-10-02 15:16:59 +0000
commit9ca83924848070d02a5ac2f0aa4e20444eec2183 (patch)
treec1379d31e2aab19bc05270a833fdd25783627641 /src/mesa
parent07dead7a51f1c35f3b6185ffba2afc09e24f6cdb (diff)
fix LoadProgramNV regression when I had fixed the RefCount bug
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/shader/nvprogram.c10
-rw-r--r--src/mesa/shader/program.c8
-rw-r--r--src/mesa/shader/program.h3
3 files changed, 12 insertions, 9 deletions
diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c
index 070451452a3..4db78a8cc74 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)");
}
diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c
index 7ec09b02563..88085f811ae 100644
--- a/src/mesa/shader/program.c
+++ b/src/mesa/shader/program.c
@@ -49,7 +49,7 @@
/* A pointer to this dummy program is put into the hash table when
* glGenPrograms is called.
*/
-static struct program DummyProgram;
+struct program _mesa_DummyProgram;
/**
@@ -938,7 +938,7 @@ _mesa_BindProgram(GLenum target, GLuint id)
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) {
@@ -995,7 +995,7 @@ _mesa_DeletePrograms(GLsizei n, const GLuint *ids)
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) {
@@ -1060,7 +1060,7 @@ _mesa_GenPrograms(GLsizei n, GLuint *ids)
/* 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 */
diff --git a/src/mesa/shader/program.h b/src/mesa/shader/program.h
index fb99a79cf6b..e8a667ddc63 100644
--- a/src/mesa/shader/program.h
+++ b/src/mesa/shader/program.h
@@ -52,6 +52,9 @@
#define SWIZZLE_ONE 5 /* keep these values together: KW */
+extern struct program _mesa_DummyProgram;
+
+
/*
* Internal functions
*/