mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-17 12:30:33 +01:00
fix LoadProgramNV regression when I had fixed the RefCount bug
This commit is contained in:
parent
07dead7a51
commit
9ca8392484
3 changed files with 12 additions and 9 deletions
|
|
@ -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)");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -52,6 +52,9 @@
|
|||
#define SWIZZLE_ONE 5 /* keep these values together: KW */
|
||||
|
||||
|
||||
extern struct program _mesa_DummyProgram;
|
||||
|
||||
|
||||
/*
|
||||
* Internal functions
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue