summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/nvprogram.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/shader/nvprogram.c')
-rw-r--r--src/mesa/shader/nvprogram.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c
index 4e29e0b3f88..4f160b14312 100644
--- a/src/mesa/shader/nvprogram.c
+++ b/src/mesa/shader/nvprogram.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 6.5.2
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
@@ -77,10 +77,7 @@ _mesa_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params)
return;
}
- _mesa_init_vp_per_vertex_registers(ctx);
- _mesa_init_vp_per_primitive_registers(ctx);
- COPY_4V(ctx->VertexProgram.Inputs[VERT_ATTRIB_POS], params);
- _mesa_exec_vertex_program(ctx, vprog);
+ _mesa_exec_vertex_state_program(ctx, vprog, params);
}
@@ -89,8 +86,9 @@ _mesa_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params)
* \note Not compiled into display lists.
* \note Called from the GL API dispatcher.
*/
-GLboolean GLAPIENTRY _mesa_AreProgramsResidentNV(GLsizei n, const GLuint *ids,
- GLboolean *residences)
+GLboolean GLAPIENTRY
+_mesa_AreProgramsResidentNV(GLsizei n, const GLuint *ids,
+ GLboolean *residences)
{
GLint i, j;
GLboolean allResident = GL_TRUE;
@@ -362,7 +360,7 @@ _mesa_GetVertexAttribdvNV(GLuint index, GLenum pname, GLdouble *params)
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- if (index == 0 || index >= MAX_NV_VERTEX_PROGRAM_INPUTS) {
+ if (index >= MAX_NV_VERTEX_PROGRAM_INPUTS) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribdvNV(index)");
return;
}
@@ -378,6 +376,11 @@ _mesa_GetVertexAttribdvNV(GLuint index, GLenum pname, GLdouble *params)
params[0] = ctx->Array.ArrayObj->VertexAttrib[index].Type;
break;
case GL_CURRENT_ATTRIB_NV:
+ if (index == 0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetVertexAttribdvNV(index == 0)");
+ return;
+ }
FLUSH_CURRENT(ctx, 0);
COPY_4V(params, ctx->Current.Attrib[index]);
break;
@@ -398,7 +401,7 @@ _mesa_GetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat *params)
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- if (index == 0 || index >= MAX_NV_VERTEX_PROGRAM_INPUTS) {
+ if (index >= MAX_NV_VERTEX_PROGRAM_INPUTS) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribdvNV(index)");
return;
}
@@ -414,6 +417,11 @@ _mesa_GetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat *params)
params[0] = (GLfloat) ctx->Array.ArrayObj->VertexAttrib[index].Type;
break;
case GL_CURRENT_ATTRIB_NV:
+ if (index == 0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetVertexAttribfvNV(index == 0)");
+ return;
+ }
FLUSH_CURRENT(ctx, 0);
COPY_4V(params, ctx->Current.Attrib[index]);
break;
@@ -434,7 +442,7 @@ _mesa_GetVertexAttribivNV(GLuint index, GLenum pname, GLint *params)
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- if (index == 0 || index >= MAX_NV_VERTEX_PROGRAM_INPUTS) {
+ if (index >= MAX_NV_VERTEX_PROGRAM_INPUTS) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribdvNV(index)");
return;
}
@@ -450,6 +458,11 @@ _mesa_GetVertexAttribivNV(GLuint index, GLenum pname, GLint *params)
params[0] = ctx->Array.ArrayObj->VertexAttrib[index].Type;
break;
case GL_CURRENT_ATTRIB_NV:
+ if (index == 0) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetVertexAttribivNV(index == 0)");
+ return;
+ }
FLUSH_CURRENT(ctx, 0);
params[0] = (GLint) ctx->Current.Attrib[index][0];
params[1] = (GLint) ctx->Current.Attrib[index][1];