/**
* \file arbprogram.c
- * \brief ARB_vertex/fragment_program state management functions.
+ * ARB_vertex/fragment_program state management functions.
* \author Brian Paul
*/
#include "glheader.h"
+#include "arbprogram.h"
+#include "arbfragparse.h"
+#include "arbvertparse.h"
#include "context.h"
-#include "hash.h"
#include "imports.h"
#include "macros.h"
#include "mtypes.h"
#include "nvprogram.h"
-#include "arbprogram.h"
-
-
-/* XXX temporary */
-static void
-_mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target,
- const GLubyte *string, GLsizei len,
- struct vertex_program *prog)
-{
-}
-
-
-static void
-_mesa_parse_arb_fragment_program(GLcontext *ctx, GLenum target,
- const GLubyte *string, GLsizei len,
- struct fragment_program *prog)
-{
-}
-
-
-
-void
-_mesa_VertexAttrib1sARB(GLuint index, GLshort x)
-{
-}
-
-void
-_mesa_VertexAttrib1fARB(GLuint index, GLfloat x)
-{
-}
-
-void
-_mesa_VertexAttrib1dARB(GLuint index, GLdouble x)
-{
-}
-
-void
-_mesa_VertexAttrib2sARB(GLuint index, GLshort x, GLshort y)
-{
-}
-
-void
-_mesa_VertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y)
-{
-}
-
-void
-_mesa_VertexAttrib2dARB(GLuint index, GLdouble x, GLdouble y)
-{
-}
-
-void
-_mesa_VertexAttrib3sARB(GLuint index, GLshort x, GLshort y, GLshort z)
-{
-}
-
-void
-_mesa_VertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z)
-{
-}
-
-void
-_mesa_VertexAttrib3dARB(GLuint index, GLdouble x, GLdouble y, GLdouble z)
-{
-}
-
-void
-_mesa_VertexAttrib4sARB(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
-{
-}
-
-void
-_mesa_VertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
-{
-}
-
-void
-_mesa_VertexAttrib4dARB(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
-{
-}
-
-void
-_mesa_VertexAttrib4NubARB(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
-{
-}
-
-void
-_mesa_VertexAttrib1svARB(GLuint index, const GLshort *v)
-{
-}
-
-void
-_mesa_VertexAttrib1fvARB(GLuint index, const GLfloat *v)
-{
-}
-
-void
-_mesa_VertexAttrib1dvARB(GLuint index, const GLdouble *v)
-{
-}
-
-void
-_mesa_VertexAttrib2svARB(GLuint index, const GLshort *v)
-{
-}
-
-void
-_mesa_VertexAttrib2fvARB(GLuint index, const GLfloat *v)
-{
-}
-
-void
-_mesa_VertexAttrib2dvARB(GLuint index, const GLdouble *v)
-{
-}
-
-void
-_mesa_VertexAttrib3svARB(GLuint index, const GLshort *v)
-{
-}
-
-void
-_mesa_VertexAttrib3fvARB(GLuint index, const GLfloat *v)
-{
-}
-
-void
-_mesa_VertexAttrib3dvARB(GLuint index, const GLdouble *v)
-{
-}
-
-void
-_mesa_VertexAttrib4bvARB(GLuint index, const GLbyte *v)
-{
-}
-
-void
-_mesa_VertexAttrib4svARB(GLuint index, const GLshort *v)
-{
-}
-
-void
-_mesa_VertexAttrib4ivARB(GLuint index, const GLint *v)
-{
-}
-
-void
-_mesa_VertexAttrib4ubvARB(GLuint index, const GLubyte *v)
-{
-}
+#include "nvfragparse.h"
+#include "nvfragprog.h"
+#include "nvvertparse.h"
+#include "nvvertprog.h"
-void
-_mesa_VertexAttrib4usvARB(GLuint index, const GLushort *v)
-{
-}
-
-void
-_mesa_VertexAttrib4uivARB(GLuint index, const GLuint *v)
-{
-}
-
-void
-_mesa_VertexAttrib4fvARB(GLuint index, const GLfloat *v)
-{
-}
-
-void
-_mesa_VertexAttrib4dvARB(GLuint index, const GLdouble *v)
-{
-}
-
-void
-_mesa_VertexAttrib4NbvARB(GLuint index, const GLbyte *v)
-{
-}
-
-void
-_mesa_VertexAttrib4NsvARB(GLuint index, const GLshort *v)
-{
-}
-
-void
-_mesa_VertexAttrib4NivARB(GLuint index, const GLint *v)
-{
-}
-
-void
-_mesa_VertexAttrib4NubvARB(GLuint index, const GLubyte *v)
-{
-}
+/*
+ * Init context's program state
+ */
void
-_mesa_VertexAttrib4NusvARB(GLuint index, const GLushort *v)
+_mesa_init_program(GLcontext *ctx)
{
-}
+ GLuint i;
-void
-_mesa_VertexAttrib4NuivARB(GLuint index, const GLuint *v)
-{
-}
+ ctx->Program.ErrorPos = -1;
+ ctx->Program.ErrorString = _mesa_strdup("");
+#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
+ ctx->VertexProgram.Enabled = GL_FALSE;
+ ctx->VertexProgram.PointSizeEnabled = GL_FALSE;
+ ctx->VertexProgram.TwoSideEnabled = GL_FALSE;
+ ctx->VertexProgram.Current = NULL;
+ ctx->VertexProgram.Current = (struct vertex_program *) ctx->Shared->DefaultVertexProgram;
+ assert(ctx->VertexProgram.Current);
+ ctx->VertexProgram.Current->Base.RefCount++;
+ for (i = 0; i < VP_NUM_PROG_REGS / 4; i++) {
+ ctx->VertexProgram.TrackMatrix[i] = GL_NONE;
+ ctx->VertexProgram.TrackMatrixTransform[i] = GL_IDENTITY_NV;
+ }
+#endif
-void
-_mesa_VertexAttribPointerARB(GLuint index, GLint size, GLenum type,
- GLboolean normalized, GLsizei stride,
- const GLvoid *pointer)
-{
+#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program
+ ctx->FragmentProgram.Enabled = GL_FALSE;
+ ctx->FragmentProgram.Current = (struct fragment_program *) ctx->Shared->DefaultFragmentProgram;
+ assert(ctx->FragmentProgram.Current);
+ ctx->FragmentProgram.Current->Base.RefCount++;
+#endif
}
ctx->Array.VertexAttrib[index].Enabled = GL_FALSE;
ctx->Array._Enabled &= ~_NEW_ARRAY_ATTRIB(index);
- ctx->Array.NewState &= ~_NEW_ARRAY_ATTRIB(index);
+ ctx->Array.NewState |= _NEW_ARRAY_ATTRIB(index);
}
params[0] = ctx->Array.VertexAttrib[index].Normalized;
break;
case GL_CURRENT_VERTEX_ATTRIB_ARB:
+ FLUSH_CURRENT(ctx, 0);
COPY_4V(params, ctx->Current.Attrib[index]);
break;
default:
}
-void
-_mesa_BindProgramARB(GLenum target, GLuint program)
-{
- struct program *prog;
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (target == GL_VERTEX_PROGRAM_ARB
- && ctx->Extensions.ARB_vertex_program) {
- if (ctx->VertexProgram.Current &&
- ctx->VertexProgram.Current->Base.Id == program)
- return;
- /* decrement refcount on previously bound vertex program */
- if (ctx->VertexProgram.Current) {
- ctx->VertexProgram.Current->Base.RefCount--;
- /* and delete if refcount goes below one */
- if (ctx->VertexProgram.Current->Base.RefCount <= 0) {
- _mesa_delete_program(ctx, &(ctx->VertexProgram.Current->Base));
- _mesa_HashRemove(ctx->Shared->Programs, program);
- }
- }
- }
- else if (target == GL_FRAGMENT_PROGRAM_ARB
- && ctx->Extensions.ARB_fragment_program) {
- if (ctx->FragmentProgram.Current &&
- ctx->FragmentProgram.Current->Base.Id == program)
- return;
- /* decrement refcount on previously bound fragment program */
- if (ctx->FragmentProgram.Current) {
- ctx->FragmentProgram.Current->Base.RefCount--;
- /* and delete if refcount goes below one */
- if (ctx->FragmentProgram.Current->Base.RefCount <= 0) {
- _mesa_delete_program(ctx, &(ctx->FragmentProgram.Current->Base));
- _mesa_HashRemove(ctx->Shared->Programs, program);
- }
- }
- }
- else {
- _mesa_error(ctx, GL_INVALID_ENUM, "glBindProgramARB(target)");
- return;
- }
-
- /* NOTE: binding to a non-existant program is not an error.
- * That's supposed to be caught in glBegin.
- * NOTE: program number 0 is legal here.
- */
- if (program == 0) {
- /* default program */
- if (target == GL_VERTEX_PROGRAM_ARB)
- prog = ctx->Shared->DefaultVertexProgram;
- else
- prog = ctx->Shared->DefaultFragmentProgram;
- }
- else {
- prog = (struct program *) _mesa_HashLookup(ctx->Shared->Programs, program);
- if (prog) {
- if (prog->Target == 0) {
- /* prog was allocated with glGenProgramsARB */
- prog->Target = target;
- }
- else if (prog->Target != target) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glBindProgramARB(target mismatch)");
- return;
- }
- }
- else {
- /* allocate a new program now */
- prog = _mesa_alloc_program(ctx, target, program);
- if (!prog) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindProgramARB");
- return;
- }
- prog->Id = program;
- prog->Target = target;
- prog->Resident = GL_TRUE;
- prog->RefCount = 1;
- _mesa_HashInsert(ctx->Shared->Programs, program, prog);
- }
- }
-
- /* bind now */
- if (target == GL_VERTEX_PROGRAM_ARB) {
- ctx->VertexProgram.Current = (struct vertex_program *) prog;
- }
- else {
- ASSERT(target == GL_FRAGMENT_PROGRAM_ARB);
- ctx->FragmentProgram.Current = (struct fragment_program *) prog;
- }
-
- if (prog)
- prog->RefCount++;
-}
-
-
-void
-_mesa_DeleteProgramsARB(GLsizei n, const GLuint *programs)
-{
- _mesa_DeleteProgramsNV(n, programs);
-}
-
-
-void
-_mesa_GenProgramsARB(GLsizei n, GLuint *programs)
-{
- _mesa_GenProgramsNV(n, programs);
-}
-
-
-GLboolean
-_mesa_IsProgramARB(GLuint program)
-{
- return _mesa_IsProgramNV(program);
-}
-
-
void
_mesa_ProgramEnvParameter4dARB(GLenum target, GLuint index,
GLdouble x, GLdouble y, GLdouble z, GLdouble w)
_mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameter(index)");
return;
}
- index += MAX_NV_FRAGMENT_PROGRAM_TEMPS; /* XXX fix */
+ index += FP_PROG_REG_START;
ASSIGN_4V(ctx->FragmentProgram.Machine.Registers[index], x, y, z, w);
}
if (target == GL_VERTEX_PROGRAM_ARB
_mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameter(index)");
return;
}
- index += MAX_NV_VERTEX_PROGRAM_TEMPS; /* XXX fix */
+ index += VP_PROG_REG_START;
ASSIGN_4V(ctx->VertexProgram.Machine.Registers[index], x, y, z, w);
}
else {
GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (!ctx->_CurrentProgram)
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
if (target == GL_FRAGMENT_PROGRAM_ARB
&& ctx->Extensions.ARB_fragment_program) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetProgramEnvParameter(index)");
return;
}
- index += MAX_NV_FRAGMENT_PROGRAM_TEMPS; /* XXX fix */
+ index += FP_PROG_REG_START;
COPY_4V(params, ctx->FragmentProgram.Machine.Registers[index]);
}
if (target == GL_VERTEX_PROGRAM_ARB
_mesa_error(ctx, GL_INVALID_VALUE, "glGetProgramEnvParameter(index)");
return;
}
- index += MAX_NV_VERTEX_PROGRAM_TEMPS; /* XXX fix */
+ index += VP_PROG_REG_START;
COPY_4V(params, ctx->VertexProgram.Machine.Registers[index]);
}
else {
GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
GET_CURRENT_CONTEXT(ctx);
+ struct program *prog;
ASSERT_OUTSIDE_BEGIN_END(ctx);
if ((target == GL_FRAGMENT_PROGRAM_NV
&& ctx->Extensions.NV_fragment_program) ||
(target == GL_FRAGMENT_PROGRAM_ARB
&& ctx->Extensions.ARB_fragment_program)) {
- struct fragment_program *fprog = ctx->FragmentProgram.Current;
- if (!fprog) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glProgramLocalParameterARB");
- return;
- }
if (index >= ctx->Const.MaxFragmentProgramLocalParams) {
_mesa_error(ctx, GL_INVALID_VALUE, "glProgramLocalParameterARB");
return;
}
- fprog->Base.LocalParams[index][0] = x;
- fprog->Base.LocalParams[index][1] = y;
- fprog->Base.LocalParams[index][2] = z;
- fprog->Base.LocalParams[index][3] = w;
+ prog = &(ctx->FragmentProgram.Current->Base);
}
else if (target == GL_VERTEX_PROGRAM_ARB
&& ctx->Extensions.ARB_vertex_program) {
- struct vertex_program *vprog = ctx->VertexProgram.Current;
- if (!vprog) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glProgramLocalParameterARB");
- return;
- }
if (index >= ctx->Const.MaxVertexProgramLocalParams) {
_mesa_error(ctx, GL_INVALID_VALUE, "glProgramLocalParameterARB");
return;
}
- vprog->Base.LocalParams[index][0] = x;
- vprog->Base.LocalParams[index][1] = y;
- vprog->Base.LocalParams[index][2] = z;
- vprog->Base.LocalParams[index][3] = w;
+ prog = &(ctx->VertexProgram.Current->Base);
}
else {
_mesa_error(ctx, GL_INVALID_ENUM, "glProgramLocalParameterARB");
return;
}
+
+ ASSERT(index < MAX_PROGRAM_LOCAL_PARAMS);
+ prog->LocalParams[index][0] = x;
+ prog->LocalParams[index][1] = y;
+ prog->LocalParams[index][2] = z;
+ prog->LocalParams[index][3] = w;
}
}
ASSERT(prog);
+ ASSERT(index < MAX_PROGRAM_LOCAL_PARAMS);
COPY_4V(params, prog->LocalParams[index]);
}
{
struct program *prog;
GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (!ctx->_CurrentProgram)
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
if (target == GL_VERTEX_PROGRAM_ARB
&& ctx->Extensions.ARB_vertex_program) {
prog = &(ctx->VertexProgram.Current->Base);
}
else if (target == GL_FRAGMENT_PROGRAM_ARB
- && ctx->Extensions.ARB_vertex_program) {
+ && ctx->Extensions.ARB_fragment_program) {
prog = &(ctx->FragmentProgram.Current->Base);
}
else {
{
struct program *prog;
GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (!ctx->_CurrentProgram)
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
if (target == GL_VERTEX_PROGRAM_ARB) {
prog = &(ctx->VertexProgram.Current->Base);
MEMCPY(string, prog->String, _mesa_strlen((char *) prog->String));
}
+
+
+
+/* XXX temporary */
+void
+glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback,
+ GLvoid *data)
+{
+ _mesa_ProgramCallbackMESA(target, callback, data);
+}
+
+
+void
+_mesa_ProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback,
+ GLvoid *data)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ switch (target) {
+ case GL_FRAGMENT_PROGRAM_ARB:
+ if (!ctx->Extensions.ARB_fragment_program) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glProgramCallbackMESA(target)");
+ return;
+ }
+ ctx->FragmentProgram.Callback = callback;
+ ctx->FragmentProgram.CallbackData = data;
+ break;
+ case GL_FRAGMENT_PROGRAM_NV:
+ if (!ctx->Extensions.NV_fragment_program) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glProgramCallbackMESA(target)");
+ return;
+ }
+ ctx->FragmentProgram.Callback = callback;
+ ctx->FragmentProgram.CallbackData = data;
+ break;
+ case GL_VERTEX_PROGRAM_ARB: /* == GL_VERTEX_PROGRAM_NV */
+ if (!ctx->Extensions.ARB_vertex_program &&
+ !ctx->Extensions.NV_vertex_program) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glProgramCallbackMESA(target)");
+ return;
+ }
+ ctx->VertexProgram.Callback = callback;
+ ctx->VertexProgram.CallbackData = data;
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glProgramCallbackMESA(target)");
+ return;
+ }
+}
+
+
+/* XXX temporary */
+void
+glGetProgramRegisterfvMESA(GLenum target,
+ GLsizei len, const GLubyte *registerName,
+ GLfloat *v)
+{
+ _mesa_GetProgramRegisterfvMESA(target, len, registerName, v);
+}
+
+
+void
+_mesa_GetProgramRegisterfvMESA(GLenum target,
+ GLsizei len, const GLubyte *registerName,
+ GLfloat *v)
+{
+ char reg[1000];
+ GET_CURRENT_CONTEXT(ctx);
+
+ /* We _should_ be inside glBegin/glEnd */
+#if 0
+ if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glGetProgramRegisterfvMESA");
+ return;
+ }
+#endif
+
+ /* make null-terminated copy of registerName */
+ _mesa_memcpy(reg, registerName, len);
+ reg[len] = 0;
+
+ switch (target) {
+ case GL_VERTEX_PROGRAM_NV:
+ if (!ctx->Extensions.ARB_vertex_program &&
+ !ctx->Extensions.NV_vertex_program) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetProgramRegisterfvMESA(target)");
+ return;
+ }
+ if (!ctx->VertexProgram.Enabled) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetProgramRegisterfvMESA");
+ return;
+ }
+ /* GL_NV_vertex_program */
+ if (reg[0] == 'R') {
+ /* Temp register */
+ GLint i = _mesa_atoi(reg + 1);
+ if (i >= ctx->Const.MaxVertexProgramTemps) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glGetProgramRegisterfvMESA(registerName)");
+ return;
+ }
+ COPY_4V(v, ctx->VertexProgram.Machine.Registers
+ [VP_TEMP_REG_START + i]);
+ }
+ else if (reg[0] == 'v' && reg[1] == '[') {
+ /* Vertex Input attribute */
+ GLint i;
+ for (i = 0; i < ctx->Const.MaxVertexProgramAttribs; i++) {
+ const char *name = _mesa_nv_vertex_input_register_name(i);
+ char number[10];
+ sprintf(number, "%d", i);
+ if (_mesa_strncmp(reg + 2, name, 4) == 0 ||
+ _mesa_strncmp(reg + 2, number, _mesa_strlen(number)) == 0) {
+ COPY_4V(v, ctx->VertexProgram.Machine.Registers
+ [VP_INPUT_REG_START + i]);
+ return;
+ }
+ }
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glGetProgramRegisterfvMESA(registerName)");
+ return;
+ }
+ else if (reg[0] == 'o' && reg[1] == '[') {
+ /* Vertex output attribute */
+ }
+ /* GL_ARB_vertex_program */
+ else if (_mesa_strncmp(reg, "vertex.", 7) == 0) {
+
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glGetProgramRegisterfvMESA(registerName)");
+ return;
+ }
+ break;
+ case GL_FRAGMENT_PROGRAM_ARB:
+ if (!ctx->Extensions.ARB_fragment_program) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetProgramRegisterfvMESA(target)");
+ return;
+ }
+ if (!ctx->FragmentProgram.Enabled) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetProgramRegisterfvMESA");
+ return;
+ }
+ /* XXX to do */
+ break;
+ case GL_FRAGMENT_PROGRAM_NV:
+ if (!ctx->Extensions.NV_fragment_program) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetProgramRegisterfvMESA(target)");
+ return;
+ }
+ if (!ctx->FragmentProgram.Enabled) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetProgramRegisterfvMESA");
+ return;
+ }
+ if (reg[0] == 'R') {
+ /* Temp register */
+ GLint i = _mesa_atoi(reg + 1);
+ if (i >= ctx->Const.MaxFragmentProgramTemps) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glGetProgramRegisterfvMESA(registerName)");
+ return;
+ }
+ COPY_4V(v,
+ ctx->FragmentProgram.Machine.Registers[FP_TEMP_REG_START + i]);
+ }
+ else if (reg[0] == 'f' && reg[1] == '[') {
+ /* Fragment input attribute */
+ GLint i;
+ for (i = 0; i < ctx->Const.MaxFragmentProgramAttribs; i++) {
+ const char *name = _mesa_nv_fragment_input_register_name(i);
+ if (_mesa_strncmp(reg + 2, name, 4) == 0) {
+ COPY_4V(v, ctx->FragmentProgram.Machine.Registers
+ [FP_INPUT_REG_START + i]);
+ return;
+ }
+ }
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glGetProgramRegisterfvMESA(registerName)");
+ return;
+ }
+ else if (_mesa_strcmp(reg, "o[COLR]") == 0) {
+ /* Fragment output color */
+ COPY_4V(v, ctx->FragmentProgram.Machine.Registers
+ [FP_OUTPUT_REG_START + FRAG_OUTPUT_COLR]);
+ }
+ else if (_mesa_strcmp(reg, "o[COLH]") == 0) {
+ /* Fragment output color */
+ COPY_4V(v, ctx->FragmentProgram.Machine.Registers
+ [FP_OUTPUT_REG_START + FRAG_OUTPUT_COLH]);
+ }
+ else if (_mesa_strcmp(reg, "o[DEPR]") == 0) {
+ /* Fragment output depth */
+ COPY_4V(v, ctx->FragmentProgram.Machine.Registers
+ [FP_OUTPUT_REG_START + FRAG_OUTPUT_DEPR]);
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glGetProgramRegisterfvMESA(registerName)");
+ return;
+ }
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glGetProgramRegisterfvMESA(target)");
+ return;
+ }
+
+}