diff options
author | marha <marha@users.sourceforge.net> | 2012-10-17 08:07:33 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-10-17 08:07:33 +0200 |
commit | 856fbbaf1e53303d8307bfae1761f1ba96871f1e (patch) | |
tree | e029665439ddbccfb253271a5f5290d72c2b2168 /mesalib/src/mesa/main | |
parent | f15a40afaf6d1b3a4841d25631f947da1b289f89 (diff) | |
parent | ded57b5a4131a213d57f5a20d50b819b7a8924df (diff) | |
download | vcxsrv-856fbbaf1e53303d8307bfae1761f1ba96871f1e.tar.gz vcxsrv-856fbbaf1e53303d8307bfae1761f1ba96871f1e.tar.bz2 vcxsrv-856fbbaf1e53303d8307bfae1761f1ba96871f1e.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
pixman mesa git update 17 oct 2012
Diffstat (limited to 'mesalib/src/mesa/main')
48 files changed, 90 insertions, 2149 deletions
diff --git a/mesalib/src/mesa/main/api_arrayelt.c b/mesalib/src/mesa/main/api_arrayelt.c index d530001bc..20b8ff4d1 100644 --- a/mesalib/src/mesa/main/api_arrayelt.c +++ b/mesalib/src/mesa/main/api_arrayelt.c @@ -1528,31 +1528,24 @@ static void _ae_update_state( struct gl_context *ctx ) for (i = 1; i < VERT_ATTRIB_GENERIC_MAX; i++) { /* skip zero! */ struct gl_client_array *attribArray = &arrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(i)]; if (attribArray->Enabled) { + GLint intOrNorm; at->array = attribArray; /* Note: we can't grab the _glapi_Dispatch->VertexAttrib1fvNV * function pointer here (for float arrays) since the pointer may * change from one execution of _ae_ArrayElement() to * the next. Doing so caused UT to break. */ - if (ctx->VertexProgram._Enabled - && ctx->VertexProgram.Current->IsNVProgram) { - at->func = AttribFuncsNV[at->array->Normalized] - [at->array->Size-1] - [TYPE_IDX(at->array->Type)]; - } - else { - GLint intOrNorm; - if (at->array->Integer) - intOrNorm = 2; - else if (at->array->Normalized) - intOrNorm = 1; - else - intOrNorm = 0; - - at->func = AttribFuncsARB[intOrNorm] - [at->array->Size-1] - [TYPE_IDX(at->array->Type)]; - } + if (at->array->Integer) + intOrNorm = 2; + else if (at->array->Normalized) + intOrNorm = 1; + else + intOrNorm = 0; + + at->func = AttribFuncsARB[intOrNorm] + [at->array->Size-1] + [TYPE_IDX(at->array->Type)]; + at->index = i; check_vbo(actx, at->array->BufferObj); at++; diff --git a/mesalib/src/mesa/main/api_exec.c b/mesalib/src/mesa/main/api_exec.c index f42da9438..a5e5f26d2 100644 --- a/mesalib/src/mesa/main/api_exec.c +++ b/mesalib/src/mesa/main/api_exec.c @@ -87,7 +87,6 @@ #include "mtypes.h" #include "varray.h" #include "viewport.h" -#include "nvprogram.h" #include "shaderapi.h" #include "uniforms.h" #include "syncobj.h" @@ -476,31 +475,10 @@ _mesa_create_exec_table(struct gl_context *ctx) if (ctx->API == API_OPENGL) { SET_BindProgramNV(exec, _mesa_BindProgram); SET_DeleteProgramsNV(exec, _mesa_DeletePrograms); - SET_ExecuteProgramNV(exec, _mesa_ExecuteProgramNV); SET_GenProgramsNV(exec, _mesa_GenPrograms); - SET_AreProgramsResidentNV(exec, _mesa_AreProgramsResidentNV); - SET_RequestResidentProgramsNV(exec, _mesa_RequestResidentProgramsNV); - SET_GetProgramParameterfvNV(exec, _mesa_GetProgramParameterfvNV); - SET_GetProgramParameterdvNV(exec, _mesa_GetProgramParameterdvNV); - SET_GetProgramivNV(exec, _mesa_GetProgramivNV); - SET_GetProgramStringNV(exec, _mesa_GetProgramStringNV); - SET_GetTrackMatrixivNV(exec, _mesa_GetTrackMatrixivNV); - SET_GetVertexAttribdvNV(exec, _mesa_GetVertexAttribdvNV); - SET_GetVertexAttribfvNV(exec, _mesa_GetVertexAttribfvNV); - SET_GetVertexAttribivNV(exec, _mesa_GetVertexAttribivNV); SET_IsProgramNV(exec, _mesa_IsProgramARB); - SET_LoadProgramNV(exec, _mesa_LoadProgramNV); - SET_ProgramEnvParameter4dARB(exec, _mesa_ProgramEnvParameter4dARB); /* alias to ProgramParameter4dNV */ - SET_ProgramEnvParameter4dvARB(exec, _mesa_ProgramEnvParameter4dvARB); /* alias to ProgramParameter4dvNV */ - SET_ProgramEnvParameter4fARB(exec, _mesa_ProgramEnvParameter4fARB); /* alias to ProgramParameter4fNV */ - SET_ProgramEnvParameter4fvARB(exec, _mesa_ProgramEnvParameter4fvARB); /* alias to ProgramParameter4fvNV */ - SET_ProgramParameters4dvNV(exec, _mesa_ProgramParameters4dvNV); - SET_ProgramParameters4fvNV(exec, _mesa_ProgramParameters4fvNV); - SET_TrackMatrixNV(exec, _mesa_TrackMatrixNV); - SET_VertexAttribPointerNV(exec, _mesa_VertexAttribPointerNV); /* glVertexAttrib*NV functions handled in api_loopback.c */ } - SET_GetVertexAttribPointervNV(exec, _mesa_GetVertexAttribPointervNV); /* 273. GL_APPLE_vertex_array_object */ if (ctx->API == API_OPENGL) { @@ -511,22 +489,6 @@ _mesa_create_exec_table(struct gl_context *ctx) SET_DeleteVertexArraysAPPLE(exec, _mesa_DeleteVertexArraysAPPLE); SET_IsVertexArrayAPPLE(exec, _mesa_IsVertexArrayAPPLE); - /* 282. GL_NV_fragment_program */ - if (ctx->API == API_OPENGL) { - SET_ProgramNamedParameter4fNV(exec, _mesa_ProgramNamedParameter4fNV); - SET_ProgramNamedParameter4dNV(exec, _mesa_ProgramNamedParameter4dNV); - SET_ProgramNamedParameter4fvNV(exec, _mesa_ProgramNamedParameter4fvNV); - SET_ProgramNamedParameter4dvNV(exec, _mesa_ProgramNamedParameter4dvNV); - SET_GetProgramNamedParameterfvNV(exec, _mesa_GetProgramNamedParameterfvNV); - SET_GetProgramNamedParameterdvNV(exec, _mesa_GetProgramNamedParameterdvNV); - SET_ProgramLocalParameter4dARB(exec, _mesa_ProgramLocalParameter4dARB); - SET_ProgramLocalParameter4dvARB(exec, _mesa_ProgramLocalParameter4dvARB); - SET_ProgramLocalParameter4fARB(exec, _mesa_ProgramLocalParameter4fARB); - SET_ProgramLocalParameter4fvARB(exec, _mesa_ProgramLocalParameter4fvARB); - SET_GetProgramLocalParameterdvARB(exec, _mesa_GetProgramLocalParameterdvARB); - SET_GetProgramLocalParameterfvARB(exec, _mesa_GetProgramLocalParameterfvARB); - } - /* 262. GL_NV_point_sprite */ #if _HAVE_FULL_GL if (_mesa_is_desktop_gl(ctx)) { @@ -660,7 +622,7 @@ _mesa_create_exec_table(struct gl_context *ctx) SET_GetVertexAttribfvARB(exec, _mesa_GetVertexAttribfvARB); SET_GetVertexAttribivARB(exec, _mesa_GetVertexAttribivARB); - /* glGetVertexAttribPointervARB aliases glGetVertexAttribPointervNV */ + SET_GetVertexAttribPointervNV(exec, _mesa_GetVertexAttribPointervARB); if (ctx->API == API_OPENGL) { SET_ProgramEnvParameter4dARB(exec, _mesa_ProgramEnvParameter4dARB); SET_ProgramEnvParameter4dvARB(exec, _mesa_ProgramEnvParameter4dvARB); @@ -767,10 +729,9 @@ _mesa_create_exec_table(struct gl_context *ctx) SET_RenderbufferStorageMultisample(exec, _mesa_RenderbufferStorageMultisample); } - if (ctx->API != API_OPENGLES2) { - SET_MapBufferRange(exec, _mesa_MapBufferRange); - SET_FlushMappedBufferRange(exec, _mesa_FlushMappedBufferRange); - } + /* GL_ARB_map_buffer_range / GL_EXT_map_buffer_range */ + SET_MapBufferRange(exec, _mesa_MapBufferRange); + SET_FlushMappedBufferRange(exec, _mesa_FlushMappedBufferRange); /* GL_ARB_copy_buffer */ if (ctx->API != API_OPENGLES2) { diff --git a/mesalib/src/mesa/main/api_validate.c b/mesalib/src/mesa/main/api_validate.c index db9d14a4c..6f0250800 100644 --- a/mesalib/src/mesa/main/api_validate.c +++ b/mesalib/src/mesa/main/api_validate.c @@ -148,7 +148,7 @@ check_valid_to_render(struct gl_context *ctx, const char *function) break; default: - ASSERT_NO_FEATURE(); + assert(!"Invalid API value in check_valid_to_render()"); } return GL_TRUE; diff --git a/mesalib/src/mesa/main/arbprogram.c b/mesalib/src/mesa/main/arbprogram.c index ae91fd5a3..9be86c2fe 100644 --- a/mesalib/src/mesa/main/arbprogram.c +++ b/mesalib/src/mesa/main/arbprogram.c @@ -37,33 +37,9 @@ #include "main/mtypes.h" #include "main/arbprogram.h" #include "program/arbprogparse.h" -#include "program/nvfragparse.h" -#include "program/nvvertparse.h" #include "program/program.h" - -/** - * Mixing ARB and NV vertex/fragment programs can be tricky. - * Note: GL_VERTEX_PROGRAM_ARB == GL_VERTEX_PROGRAM_NV - * but, GL_FRAGMENT_PROGRAM_ARB != GL_FRAGMENT_PROGRAM_NV - * The two different fragment program targets are supposed to be compatible - * to some extent (see GL_ARB_fragment_program spec). - * This function does the compatibility check. - */ -static GLboolean -compatible_program_targets(GLenum t1, GLenum t2) -{ - if (t1 == t2) - return GL_TRUE; - if (t1 == GL_FRAGMENT_PROGRAM_ARB && t2 == GL_FRAGMENT_PROGRAM_NV) - return GL_TRUE; - if (t1 == GL_FRAGMENT_PROGRAM_NV && t2 == GL_FRAGMENT_PROGRAM_ARB) - return GL_TRUE; - return GL_FALSE; -} - - /** * Bind a program (make it current) * \note Called from the GL API dispatcher by both glBindProgramNV @@ -77,19 +53,15 @@ _mesa_BindProgram(GLenum target, GLuint id) ASSERT_OUTSIDE_BEGIN_END(ctx); /* Error-check target and get curProg */ - if ((target == GL_VERTEX_PROGRAM_ARB) && /* == GL_VERTEX_PROGRAM_NV */ - (ctx->Extensions.NV_vertex_program || - ctx->Extensions.ARB_vertex_program)) { + if (target == GL_VERTEX_PROGRAM_ARB && ctx->Extensions.ARB_vertex_program) { curProg = &ctx->VertexProgram.Current->Base; } - else if ((target == GL_FRAGMENT_PROGRAM_NV - && ctx->Extensions.NV_fragment_program) || - (target == GL_FRAGMENT_PROGRAM_ARB - && ctx->Extensions.ARB_fragment_program)) { + else if (target == GL_FRAGMENT_PROGRAM_ARB + && ctx->Extensions.ARB_fragment_program) { curProg = &ctx->FragmentProgram.Current->Base; } else { - _mesa_error(ctx, GL_INVALID_ENUM, "glBindProgramNV/ARB(target)"); + _mesa_error(ctx, GL_INVALID_ENUM, "glBindProgramARB(target)"); return; } @@ -101,7 +73,7 @@ _mesa_BindProgram(GLenum target, GLuint id) if (id == 0) { /* Bind a default program */ newProg = NULL; - if (target == GL_VERTEX_PROGRAM_ARB) /* == GL_VERTEX_PROGRAM_NV */ + if (target == GL_VERTEX_PROGRAM_ARB) newProg = &ctx->Shared->DefaultVertexProgram->Base; else newProg = &ctx->Shared->DefaultFragmentProgram->Base; @@ -113,14 +85,14 @@ _mesa_BindProgram(GLenum target, GLuint id) /* allocate a new program now */ newProg = ctx->Driver.NewProgram(ctx, target, id); if (!newProg) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindProgramNV/ARB"); + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindProgramARB"); return; } _mesa_HashInsert(ctx->Shared->Programs, id, newProg); } - else if (!compatible_program_targets(newProg->Target, target)) { + else if (newProg->Target != target) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glBindProgramNV/ARB(target mismatch)"); + "glBindProgramARB(target mismatch)"); return; } } @@ -136,12 +108,11 @@ _mesa_BindProgram(GLenum target, GLuint id) FLUSH_VERTICES(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS); /* bind newProg */ - if (target == GL_VERTEX_PROGRAM_ARB) { /* == GL_VERTEX_PROGRAM_NV */ + if (target == GL_VERTEX_PROGRAM_ARB) { _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current, gl_vertex_program(newProg)); } - else if (target == GL_FRAGMENT_PROGRAM_NV || - target == GL_FRAGMENT_PROGRAM_ARB) { + else if (target == GL_FRAGMENT_PROGRAM_ARB) { _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current, gl_fragment_program(newProg)); } @@ -181,15 +152,13 @@ _mesa_DeletePrograms(GLsizei n, const GLuint *ids) else if (prog) { /* Unbind program if necessary */ switch (prog->Target) { - case GL_VERTEX_PROGRAM_ARB: /* == GL_VERTEX_PROGRAM_NV */ - case GL_VERTEX_STATE_PROGRAM_NV: + case GL_VERTEX_PROGRAM_ARB: if (ctx->VertexProgram.Current && ctx->VertexProgram.Current->Base.Id == ids[i]) { /* unbind this currently bound program */ _mesa_BindProgram(prog->Target, 0); } break; - case GL_FRAGMENT_PROGRAM_NV: case GL_FRAGMENT_PROGRAM_ARB: if (ctx->FragmentProgram.Current && ctx->FragmentProgram.Current->Base.Id == ids[i]) { @@ -286,11 +255,6 @@ get_local_param_pointer(struct gl_context *ctx, const char *func, prog = &(ctx->FragmentProgram.Current->Base); maxParams = ctx->Const.FragmentProgram.MaxLocalParams; } - else if (target == GL_FRAGMENT_PROGRAM_NV - && ctx->Extensions.NV_fragment_program) { - prog = &(ctx->FragmentProgram.Current->Base); - maxParams = MAX_NV_FRAGMENT_PROGRAM_PARAMS; - } else { _mesa_error(ctx, GL_INVALID_ENUM, "%s(target)", func); @@ -321,8 +285,7 @@ get_env_param_pointer(struct gl_context *ctx, const char *func, return GL_TRUE; } else if (target == GL_VERTEX_PROGRAM_ARB && - (ctx->Extensions.ARB_vertex_program || - ctx->Extensions.NV_vertex_program)) { + ctx->Extensions.ARB_vertex_program) { if (index >= ctx->Const.VertexProgram.MaxEnvParams) { _mesa_error(ctx, GL_INVALID_VALUE, "%s(index)", func); return GL_FALSE; @@ -356,28 +319,12 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len, return; } - /* The first couple cases are complicated. The same enum value is used for - * ARB and NV vertex programs. If the target is a vertex program, parse it - * using the ARB grammar if the string starts with "!!ARB" or if - * NV_vertex_program is not supported. - */ - if (target == GL_VERTEX_PROGRAM_ARB - && ctx->Extensions.ARB_vertex_program - && ((strncmp(string, "!!ARB", 5) == 0) - || !ctx->Extensions.NV_vertex_program)) { + if (target == GL_VERTEX_PROGRAM_ARB && ctx->Extensions.ARB_vertex_program) { struct gl_vertex_program *prog = ctx->VertexProgram.Current; _mesa_parse_arb_vertex_program(ctx, target, string, len, prog); base = & prog->Base; } - else if ((target == GL_VERTEX_PROGRAM_ARB - || target == GL_VERTEX_STATE_PROGRAM_NV) - && ctx->Extensions.NV_vertex_program) { - struct gl_vertex_program *prog = ctx->VertexProgram.Current; - _mesa_parse_nv_vertex_program(ctx, target, string, len, prog); - - base = & prog->Base; - } else if (target == GL_FRAGMENT_PROGRAM_ARB && ctx->Extensions.ARB_fragment_program) { struct gl_fragment_program *prog = ctx->FragmentProgram.Current; @@ -385,13 +332,6 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len, base = & prog->Base; } - else if (target == GL_FRAGMENT_PROGRAM_NV - && ctx->Extensions.NV_fragment_program) { - struct gl_fragment_program *prog = ctx->FragmentProgram.Current; - _mesa_parse_nv_fragment_program(ctx, target, string, len, prog); - - base = & prog->Base; - } else { _mesa_error(ctx, GL_INVALID_ENUM, "glProgramStringARB(target)"); return; @@ -410,8 +350,6 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len, /** * Set a program env parameter register. * \note Called from the GL API dispatcher. - * Note, this function is also used by the GL_NV_vertex_program extension - * (alias to ProgramParameterdNV) */ void GLAPIENTRY _mesa_ProgramEnvParameter4dARB(GLenum target, GLuint index, @@ -425,8 +363,6 @@ _mesa_ProgramEnvParameter4dARB(GLenum target, GLuint index, /** * Set a program env parameter register. * \note Called from the GL API dispatcher. - * Note, this function is also used by the GL_NV_vertex_program extension - * (alias to ProgramParameterdvNV) */ void GLAPIENTRY _mesa_ProgramEnvParameter4dvARB(GLenum target, GLuint index, @@ -441,8 +377,6 @@ _mesa_ProgramEnvParameter4dvARB(GLenum target, GLuint index, /** * Set a program env parameter register. * \note Called from the GL API dispatcher. - * Note, this function is also used by the GL_NV_vertex_program extension - * (alias to ProgramParameterfNV) */ void GLAPIENTRY _mesa_ProgramEnvParameter4fARB(GLenum target, GLuint index, @@ -466,8 +400,6 @@ _mesa_ProgramEnvParameter4fARB(GLenum target, GLuint index, /** * Set a program env parameter register. * \note Called from the GL API dispatcher. - * Note, this function is also used by the GL_NV_vertex_program extension - * (alias to ProgramParameterfvNV) */ void GLAPIENTRY _mesa_ProgramEnvParameter4fvARB(GLenum target, GLuint index, @@ -557,9 +489,6 @@ _mesa_GetProgramEnvParameterfvARB(GLenum target, GLuint index, } -/** - * Note, this function is also used by the GL_NV_fragment_program extension. - */ void GLAPIENTRY _mesa_ProgramLocalParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) @@ -578,9 +507,6 @@ _mesa_ProgramLocalParameter4fARB(GLenum target, GLuint index, } -/** - * Note, this function is also used by the GL_NV_fragment_program extension. - */ void GLAPIENTRY _mesa_ProgramLocalParameter4fvARB(GLenum target, GLuint index, const GLfloat *params) @@ -629,9 +555,6 @@ _mesa_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, } -/** - * Note, this function is also used by the GL_NV_fragment_program extension. - */ void GLAPIENTRY _mesa_ProgramLocalParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, @@ -642,9 +565,6 @@ _mesa_ProgramLocalParameter4dARB(GLenum target, GLuint index, } -/** - * Note, this function is also used by the GL_NV_fragment_program extension. - */ void GLAPIENTRY _mesa_ProgramLocalParameter4dvARB(GLenum target, GLuint index, const GLdouble *params) @@ -655,9 +575,6 @@ _mesa_ProgramLocalParameter4dvARB(GLenum target, GLuint index, } -/** - * Note, this function is also used by the GL_NV_fragment_program extension. - */ void GLAPIENTRY _mesa_GetProgramLocalParameterfvARB(GLenum target, GLuint index, GLfloat *params) @@ -673,9 +590,6 @@ _mesa_GetProgramLocalParameterfvARB(GLenum target, GLuint index, } -/** - * Note, this function is also used by the GL_NV_fragment_program extension. - */ void GLAPIENTRY _mesa_GetProgramLocalParameterdvARB(GLenum target, GLuint index, GLdouble *params) diff --git a/mesalib/src/mesa/main/arrayobj.c b/mesalib/src/mesa/main/arrayobj.c index 9255559d5..5959260c2 100644 --- a/mesalib/src/mesa/main/arrayobj.c +++ b/mesalib/src/mesa/main/arrayobj.c @@ -314,8 +314,6 @@ _mesa_update_array_object_max_element(struct gl_context *ctx, if (!ctx->VertexProgram._Current || ctx->VertexProgram._Current == ctx->VertexProgram._TnlProgram) { enabled = _mesa_array_object_get_enabled_ff(arrayObj); - } else if (ctx->VertexProgram._Current->IsNVProgram) { - enabled = _mesa_array_object_get_enabled_nv(arrayObj); } else { enabled = _mesa_array_object_get_enabled_arb(arrayObj); } diff --git a/mesalib/src/mesa/main/arrayobj.h b/mesalib/src/mesa/main/arrayobj.h index 4f89064bb..dfefec2a7 100644 --- a/mesalib/src/mesa/main/arrayobj.h +++ b/mesalib/src/mesa/main/arrayobj.h @@ -87,18 +87,6 @@ _mesa_array_object_get_enabled_ff(const struct gl_array_object *arrayObj) return arrayObj->_Enabled & VERT_BIT_FF_ALL; } -/** Returns the bitmask of all enabled arrays in nv shader mode. - * - * In nv shader mode, the nv generic arrays take precedence over - * the legacy arrays. - */ -static inline GLbitfield64 -_mesa_array_object_get_enabled_nv(const struct gl_array_object *arrayObj) -{ - GLbitfield64 enabled = arrayObj->_Enabled; - return enabled & ~(VERT_BIT_FF_NVALIAS & (enabled >> VERT_ATTRIB_GENERIC0)); -} - /** Returns the bitmask of all enabled arrays in arb/glsl shader mode. * * In arb/glsl shader mode all the fixed function and the arb/glsl generic diff --git a/mesalib/src/mesa/main/attrib.c b/mesalib/src/mesa/main/attrib.c index b92c4652e..48df7f16b 100644 --- a/mesalib/src/mesa/main/attrib.c +++ b/mesalib/src/mesa/main/attrib.c @@ -94,7 +94,6 @@ struct gl_enable_attrib GLboolean Map1TextureCoord4; GLboolean Map1Vertex3; GLboolean Map1Vertex4; - GLboolean Map1Attrib[16]; /* GL_NV_vertex_program */ GLboolean Map2Color4; GLboolean Map2Index; GLboolean Map2Normal; @@ -104,7 +103,6 @@ struct gl_enable_attrib GLboolean Map2TextureCoord4; GLboolean Map2Vertex3; GLboolean Map2Vertex4; - GLboolean Map2Attrib[16]; /* GL_NV_vertex_program */ GLboolean Normalize; GLboolean PixelTexture; @@ -127,7 +125,7 @@ struct gl_enable_attrib GLbitfield Texture[MAX_TEXTURE_UNITS]; GLbitfield TexGen[MAX_TEXTURE_UNITS]; - /* GL_ARB_vertex_program / GL_NV_vertex_program */ + /* GL_ARB_vertex_program */ GLboolean VertexProgram; GLboolean VertexProgramPointSize; GLboolean VertexProgramTwoSide; @@ -285,7 +283,6 @@ _mesa_PushAttrib(GLbitfield mask) attr->Map1TextureCoord4 = ctx->Eval.Map1TextureCoord4; attr->Map1Vertex3 = ctx->Eval.Map1Vertex3; attr->Map1Vertex4 = ctx->Eval.Map1Vertex4; - memcpy(attr->Map1Attrib, ctx->Eval.Map1Attrib, sizeof(ctx->Eval.Map1Attrib)); attr->Map2Color4 = ctx->Eval.Map2Color4; attr->Map2Index = ctx->Eval.Map2Index; attr->Map2Normal = ctx->Eval.Map2Normal; @@ -295,7 +292,6 @@ _mesa_PushAttrib(GLbitfield mask) attr->Map2TextureCoord4 = ctx->Eval.Map2TextureCoord4; attr->Map2Vertex3 = ctx->Eval.Map2Vertex3; attr->Map2Vertex4 = ctx->Eval.Map2Vertex4; - memcpy(attr->Map2Attrib, ctx->Eval.Map2Attrib, sizeof(ctx->Eval.Map2Attrib)); attr->Normalize = ctx->Transform.Normalize; attr->RasterPositionUnclipped = ctx->Transform.RasterPositionUnclipped; attr->PointSmooth = ctx->Point.SmoothFlag; @@ -317,7 +313,7 @@ _mesa_PushAttrib(GLbitfield mask) attr->Texture[i] = ctx->Texture.Unit[i].Enabled; attr->TexGen[i] = ctx->Texture.Unit[i].TexGenEnabled; } - /* GL_NV_vertex_program */ + /* GL_ARB_vertex_program */ attr->VertexProgram = ctx->VertexProgram.Enabled; attr->VertexProgramPointSize = ctx->VertexProgram.PointSizeEnabled; attr->VertexProgramTwoSide = ctx->VertexProgram.TwoSideEnabled; @@ -545,10 +541,6 @@ pop_enable_group(struct gl_context *ctx, const struct gl_enable_attrib *enable) GL_MAP1_VERTEX_3); TEST_AND_UPDATE(ctx->Eval.Map1Vertex4, enable->Map1Vertex4, GL_MAP1_VERTEX_4); - for (i = 0; i < 16; i++) { - TEST_AND_UPDATE(ctx->Eval.Map1Attrib[i], enable->Map1Attrib[i], - GL_MAP1_VERTEX_ATTRIB0_4_NV + i); - } TEST_AND_UPDATE(ctx->Eval.Map2Color4, enable->Map2Color4, GL_MAP2_COLOR_4); TEST_AND_UPDATE(ctx->Eval.Map2Index, enable->Map2Index, GL_MAP2_INDEX); @@ -565,10 +557,6 @@ pop_enable_group(struct gl_context *ctx, const struct gl_enable_attrib *enable) GL_MAP2_VERTEX_3); TEST_AND_UPDATE(ctx->Eval.Map2Vertex4, enable->Map2Vertex4, GL_MAP2_VERTEX_4); - for (i = 0; i < 16; i++) { - TEST_AND_UPDATE(ctx->Eval.Map2Attrib[i], enable->Map2Attrib[i], - GL_MAP2_VERTEX_ATTRIB0_4_NV + i); - } TEST_AND_UPDATE(ctx->Eval.AutoNormal, enable->AutoNormal, GL_AUTO_NORMAL); TEST_AND_UPDATE(ctx->Transform.Normalize, enable->Normalize, GL_NORMALIZE); @@ -609,7 +597,7 @@ pop_enable_group(struct gl_context *ctx, const struct gl_enable_attrib *enable) TEST_AND_UPDATE(ctx->Multisample.SampleCoverage, enable->SampleCoverage, GL_SAMPLE_COVERAGE_ARB); - /* GL_ARB_vertex_program, GL_NV_vertex_program */ + /* GL_ARB_vertex_program */ TEST_AND_UPDATE(ctx->VertexProgram.Enabled, enable->VertexProgram, GL_VERTEX_PROGRAM_ARB); diff --git a/mesalib/src/mesa/main/blend.c b/mesalib/src/mesa/main/blend.c index 5d553118c..5cd3ce244 100644 --- a/mesalib/src/mesa/main/blend.c +++ b/mesalib/src/mesa/main/blend.c @@ -256,9 +256,6 @@ _mesa_BlendFuncSeparateEXT( GLenum sfactorRGB, GLenum dfactorRGB, } -#if _HAVE_FULL_GL - - /** * Set blend source/dest factors for one color buffer/target. */ @@ -520,10 +517,6 @@ _mesa_BlendEquationSeparatei(GLuint buf, GLenum modeRGB, GLenum modeA) } - -#endif /* _HAVE_FULL_GL */ - - /** * Set the blending color. * @@ -666,7 +659,7 @@ _mesa_LogicOp( GLenum opcode ) ctx->Driver.LogicOpcode( ctx, opcode ); } -#if _HAVE_FULL_GL + void GLAPIENTRY _mesa_IndexMask( GLuint mask ) { @@ -679,7 +672,6 @@ _mesa_IndexMask( GLuint mask ) FLUSH_VERTICES(ctx, _NEW_COLOR); ctx->Color.IndexMask = mask; } -#endif /** diff --git a/mesalib/src/mesa/main/bufferobj.c b/mesalib/src/mesa/main/bufferobj.c index efb8df894..d6b886e8d 100644 --- a/mesalib/src/mesa/main/bufferobj.c +++ b/mesalib/src/mesa/main/bufferobj.c @@ -1312,20 +1312,17 @@ _mesa_GetBufferParameterivARB(GLenum target, GLenum pname, GLint *params) *params = _mesa_bufferobj_mapped(bufObj); return; case GL_BUFFER_ACCESS_FLAGS: - if ((!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_map_buffer_range) - && !_mesa_is_gles3(ctx)) + if (!ctx->Extensions.ARB_map_buffer_range) goto invalid_pname; *params = bufObj->AccessFlags; return; case GL_BUFFER_MAP_OFFSET: - if ((!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_map_buffer_range) - && !_mesa_is_gles3(ctx)) + if (!ctx->Extensions.ARB_map_buffer_range) goto invalid_pname; *params = (GLint) bufObj->Offset; return; case GL_BUFFER_MAP_LENGTH: - if ((!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_map_buffer_range) - && !_mesa_is_gles3(ctx)) + if (!ctx->Extensions.ARB_map_buffer_range) goto invalid_pname; *params = (GLint) bufObj->Length; return; @@ -1524,6 +1521,19 @@ _mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, return NULL; } + /* Page 38 of the PDF of the OpenGL ES 3.0 spec says: + * + * "An INVALID_OPERATION error is generated for any of the following + * conditions: + * + * * <length> is zero." + */ + if (_mesa_is_gles(ctx) && length == 0) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glMapBufferRange(length = 0)"); + return NULL; + } + if (access & ~(GL_MAP_READ_BIT | GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_RANGE_BIT | diff --git a/mesalib/src/mesa/main/buffers.c b/mesalib/src/mesa/main/buffers.c index 216b6ee87..cc268b67c 100644 --- a/mesalib/src/mesa/main/buffers.c +++ b/mesalib/src/mesa/main/buffers.c @@ -353,7 +353,6 @@ updated_drawbuffers(struct gl_context *ctx) { FLUSH_VERTICES(ctx, _NEW_BUFFERS); -#if FEATURE_GL if (ctx->API == API_OPENGL && !ctx->Extensions.ARB_ES2_compatibility) { struct gl_framebuffer *fb = ctx->DrawBuffer; @@ -362,7 +361,6 @@ updated_drawbuffers(struct gl_context *ctx) fb->_Status = 0; } } -#endif } diff --git a/mesalib/src/mesa/main/clear.c b/mesalib/src/mesa/main/clear.c index f07d5333b..83ffdf66b 100644 --- a/mesalib/src/mesa/main/clear.c +++ b/mesalib/src/mesa/main/clear.c @@ -41,7 +41,6 @@ -#if _HAVE_FULL_GL void GLAPIENTRY _mesa_ClearIndex( GLfloat c ) { @@ -54,7 +53,6 @@ _mesa_ClearIndex( GLfloat c ) FLUSH_VERTICES(ctx, _NEW_COLOR); ctx->Color.ClearIndex = (GLuint) c; } -#endif /** diff --git a/mesalib/src/mesa/main/config.h b/mesalib/src/mesa/main/config.h index ead1d323c..1b72b5449 100644 --- a/mesalib/src/mesa/main/config.h +++ b/mesalib/src/mesa/main/config.h @@ -204,15 +204,6 @@ #define MAX_FRAGMENT_PROGRAM_ADDRESS_REGS 0 /*@}*/ -/** For GL_NV_vertex_program */ -/*@{*/ -#define MAX_NV_VERTEX_PROGRAM_INSTRUCTIONS 128 -#define MAX_NV_VERTEX_PROGRAM_TEMPS 12 -#define MAX_NV_VERTEX_PROGRAM_PARAMS 96 -#define MAX_NV_VERTEX_PROGRAM_INPUTS 16 -#define MAX_NV_VERTEX_PROGRAM_OUTPUTS 15 -/*@}*/ - /** For GL_NV_fragment_program */ /*@{*/ #define MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS 1024 /* 72 for GL_ARB_f_p */ diff --git a/mesalib/src/mesa/main/context.c b/mesalib/src/mesa/main/context.c index 29f28bd18..b00c64233 100644 --- a/mesalib/src/mesa/main/context.c +++ b/mesalib/src/mesa/main/context.c @@ -129,9 +129,7 @@ #include "vtxfmt.h" #include "program/program.h" #include "program/prog_print.h" -#if _HAVE_FULL_GL #include "math/m_matrix.h" -#endif #include "main/dispatch.h" /* for _gloffset_COUNT */ #ifdef USE_SPARC_ASM @@ -490,7 +488,7 @@ init_program_limits(struct gl_context *ctx, GLenum type, switch (type) { case GL_VERTEX_PROGRAM_ARB: prog->MaxParameters = MAX_VERTEX_PROGRAM_PARAMS; - prog->MaxAttribs = MAX_NV_VERTEX_PROGRAM_INPUTS; + prog->MaxAttribs = MAX_VERTEX_GENERIC_ATTRIBS; prog->MaxAddressRegs = MAX_VERTEX_PROGRAM_ADDRESS_REGS; prog->MaxUniformComponents = 4 * MAX_UNIFORMS; break; @@ -501,8 +499,8 @@ init_program_limits(struct gl_context *ctx, GLenum type, prog->MaxUniformComponents = 4 * MAX_UNIFORMS; break; case MESA_GEOMETRY_PROGRAM: - prog->MaxParameters = MAX_NV_VERTEX_PROGRAM_PARAMS; - prog->MaxAttribs = MAX_NV_VERTEX_PROGRAM_INPUTS; + prog->MaxParameters = MAX_VERTEX_PROGRAM_PARAMS; + prog->MaxAttribs = MAX_VERTEX_GENERIC_ATTRIBS; prog->MaxAddressRegs = MAX_VERTEX_PROGRAM_ADDRESS_REGS; prog->MaxUniformComponents = MAX_GEOMETRY_UNIFORM_COMPONENTS; break; @@ -687,11 +685,6 @@ check_context_limits(struct gl_context *ctx) assert(ctx->Const.FragmentProgram.MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS); assert(ctx->Const.VertexProgram.MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS); - assert(MAX_NV_FRAGMENT_PROGRAM_TEMPS <= MAX_PROGRAM_TEMPS); - assert(MAX_NV_VERTEX_PROGRAM_TEMPS <= MAX_PROGRAM_TEMPS); - assert(MAX_NV_VERTEX_PROGRAM_INPUTS <= VERT_ATTRIB_MAX); - assert(MAX_NV_VERTEX_PROGRAM_OUTPUTS <= VERT_RESULT_MAX); - /* Texture unit checks */ assert(ctx->Const.MaxTextureImageUnits > 0); assert(ctx->Const.MaxTextureImageUnits <= MAX_TEXTURE_IMAGE_UNITS); @@ -1165,7 +1158,6 @@ _mesa_destroy_context( struct gl_context *ctx ) } -#if _HAVE_FULL_GL /** * Copy attribute groups from one context to another. * @@ -1286,7 +1278,6 @@ _mesa_copy_context( const struct gl_context *src, struct gl_context *dst, dst->NewState = _NEW_ALL; dst->NewDriverState = ~0; } -#endif /** @@ -1463,8 +1454,6 @@ _mesa_make_current( struct gl_context *newCtx, #if 1 /* We want to get rid of these lines: */ - -#if _HAVE_FULL_GL if (!drawBuffer->Initialized) { initialize_framebuffer_size(newCtx, drawBuffer); } @@ -1473,8 +1462,6 @@ _mesa_make_current( struct gl_context *newCtx, } _mesa_resizebuffers(newCtx); -#endif - #else /* We want the drawBuffer and readBuffer to be initialized by * the driver. diff --git a/mesalib/src/mesa/main/dd.h b/mesalib/src/mesa/main/dd.h index 0000a397a..70c53240e 100644 --- a/mesalib/src/mesa/main/dd.h +++ b/mesalib/src/mesa/main/dd.h @@ -903,7 +903,7 @@ typedef struct { void (GLAPIENTRYP Begin)( GLenum ); void (GLAPIENTRYP End)( void ); void (GLAPIENTRYP PrimitiveRestartNV)( void ); - /* GL_NV_vertex_program */ + /* Originally for GL_NV_vertex_program, now used only dlist.c and friends */ void (GLAPIENTRYP VertexAttrib1fNV)( GLuint index, GLfloat x ); void (GLAPIENTRYP VertexAttrib1fvNV)( GLuint index, const GLfloat *v ); void (GLAPIENTRYP VertexAttrib2fNV)( GLuint index, GLfloat x, GLfloat y ); diff --git a/mesalib/src/mesa/main/debug.h b/mesalib/src/mesa/main/debug.h index bc64a83bb..6bc536591 100644 --- a/mesalib/src/mesa/main/debug.h +++ b/mesalib/src/mesa/main/debug.h @@ -42,27 +42,12 @@ struct gl_context; struct gl_texture_image; -#if _HAVE_FULL_GL - extern void _mesa_print_tri_caps( const char *name, GLuint flags ); extern void _mesa_print_enable_flags( const char *msg, GLuint flags ); extern void _mesa_print_state( const char *msg, GLuint state ); extern void _mesa_print_info( void ); extern void _mesa_init_debug( struct gl_context *ctx ); -#else - -/** No-op */ -#define _mesa_print_state( m, s ) ((void)0) - -/** No-op */ -#define _mesa_print_info() ((void)0) - -/** No-op */ -#define _mesa_init_debug( c ) ((void)0) - -#endif - extern void _mesa_write_renderbuffer_image(const struct gl_renderbuffer *rb); diff --git a/mesalib/src/mesa/main/depth.h b/mesalib/src/mesa/main/depth.h index 2f428629f..fe6b33f36 100644 --- a/mesalib/src/mesa/main/depth.h +++ b/mesalib/src/mesa/main/depth.h @@ -38,8 +38,6 @@ struct gl_context; -#if _HAVE_FULL_GL - extern void GLAPIENTRY _mesa_ClearDepth( GLclampd depth ); @@ -58,11 +56,4 @@ _mesa_DepthBoundsEXT( GLclampd zmin, GLclampd zmax ); extern void _mesa_init_depth( struct gl_context * ctx ); -#else - -/** No-op */ -#define _mesa_init_depth( c ) ((void)0) - -#endif - #endif diff --git a/mesalib/src/mesa/main/dlist.c b/mesalib/src/mesa/main/dlist.c index 99519120a..28cd52a40 100644 --- a/mesalib/src/mesa/main/dlist.c +++ b/mesalib/src/mesa/main/dlist.c @@ -63,7 +63,6 @@ #include "mtypes.h" #include "varray.h" #include "arbprogram.h" -#include "nvprogram.h" #include "transformfeedback.h" #include "math/m_matrix.h" @@ -319,15 +318,9 @@ typedef enum OPCODE_SAMPLE_COVERAGE, /* GL_ARB_window_pos */ OPCODE_WINDOW_POS_ARB, - /* GL_NV_vertex_program */ - OPCODE_BIND_PROGRAM_NV, - OPCODE_EXECUTE_PROGRAM_NV, - OPCODE_REQUEST_RESIDENT_PROGRAMS_NV, - OPCODE_LOAD_PROGRAM_NV, - OPCODE_TRACK_MATRIX_NV, /* GL_NV_fragment_program */ + OPCODE_BIND_PROGRAM_NV, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, - OPCODE_PROGRAM_NAMED_PARAMETER_NV, /* GL_EXT_stencil_two_side */ OPCODE_ACTIVE_STENCIL_FACE_EXT, /* GL_EXT_depth_bounds_test */ @@ -728,18 +721,6 @@ _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist) free(n[11].data); n += InstSize[n[0].opcode]; break; - case OPCODE_LOAD_PROGRAM_NV: - free(n[4].data); /* program string */ - n += InstSize[n[0].opcode]; - break; - case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV: - free(n[2].data); /* array of program ids */ - n += InstSize[n[0].opcode]; - break; - case OPCODE_PROGRAM_NAMED_PARAMETER_NV: - free(n[3].data); /* parameter name */ - n += InstSize[n[0].opcode]; - break; case OPCODE_PROGRAM_STRING_ARB: free(n[4].data); /* program string */ n += InstSize[n[0].opcode]; @@ -4840,7 +4821,7 @@ save_SampleCoverageARB(GLclampf value, GLboolean invert) /* - * GL_NV_vertex_program + * GL_NV_fragment_program */ static void GLAPIENTRY save_BindProgramNV(GLenum target, GLuint id) @@ -4943,125 +4924,6 @@ save_ProgramEnvParameter4dvARB(GLenum target, GLuint index, static void GLAPIENTRY -save_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_EXECUTE_PROGRAM_NV, 6); - if (n) { - n[1].e = target; - n[2].ui = id; - n[3].f = params[0]; - n[4].f = params[1]; - n[5].f = params[2]; - n[6].f = params[3]; - } - if (ctx->ExecuteFlag) { - CALL_ExecuteProgramNV(ctx->Exec, (target, id, params)); - } -} - - -static void GLAPIENTRY -save_ProgramParameters4dvNV(GLenum target, GLuint index, - GLsizei num, const GLdouble *params) -{ - GLint i; - for (i = 0; i < num; i++) { - save_ProgramEnvParameter4dvARB(target, index + i, params + 4 * i); - } -} - - -static void GLAPIENTRY -save_ProgramParameters4fvNV(GLenum target, GLuint index, - GLsizei num, const GLfloat *params) -{ - GLint i; - for (i = 0; i < num; i++) { - save_ProgramEnvParameter4fvARB(target, index + i, params + 4 * i); - } -} - - -static void GLAPIENTRY -save_LoadProgramNV(GLenum target, GLuint id, GLsizei len, - const GLubyte * program) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - - n = alloc_instruction(ctx, OPCODE_LOAD_PROGRAM_NV, 4); - if (n) { - GLubyte *programCopy = malloc(len); - if (!programCopy) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); - return; - } - memcpy(programCopy, program, len); - n[1].e = target; - n[2].ui = id; - n[3].i = len; - n[4].data = programCopy; - } - if (ctx->ExecuteFlag) { - CALL_LoadProgramNV(ctx->Exec, (target, id, len, program)); - } -} - - -static void GLAPIENTRY -save_RequestResidentProgramsNV(GLsizei num, const GLuint * ids) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - - n = alloc_instruction(ctx, OPCODE_TRACK_MATRIX_NV, 2); - if (n) { - GLuint *idCopy = malloc(num * sizeof(GLuint)); - if (!idCopy) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glRequestResidentProgramsNV"); - return; - } - memcpy(idCopy, ids, num * sizeof(GLuint)); - n[1].i = num; - n[2].data = idCopy; - } - if (ctx->ExecuteFlag) { - CALL_RequestResidentProgramsNV(ctx->Exec, (num, ids)); - } -} - - -static void GLAPIENTRY -save_TrackMatrixNV(GLenum target, GLuint address, - GLenum matrix, GLenum transform) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_TRACK_MATRIX_NV, 4); - if (n) { - n[1].e = target; - n[2].ui = address; - n[3].e = matrix; - n[4].e = transform; - } - if (ctx->ExecuteFlag) { - CALL_TrackMatrixNV(ctx->Exec, (target, address, matrix, transform)); - } -} - - -/* - * GL_NV_fragment_program - */ -static void GLAPIENTRY save_ProgramLocalParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { @@ -5181,63 +5043,6 @@ save_ProgramLocalParameter4dvARB(GLenum target, GLuint index, } } -static void GLAPIENTRY -save_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte * name, - GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - - n = alloc_instruction(ctx, OPCODE_PROGRAM_NAMED_PARAMETER_NV, 6); - if (n) { - GLubyte *nameCopy = malloc(len); - if (!nameCopy) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramNamedParameter4fNV"); - return; - } - memcpy(nameCopy, name, len); - n[1].ui = id; - n[2].i = len; - n[3].data = nameCopy; - n[4].f = x; - n[5].f = y; - n[6].f = z; - n[7].f = w; - } - if (ctx->ExecuteFlag) { - CALL_ProgramNamedParameter4fNV(ctx->Exec, (id, len, name, x, y, z, w)); - } -} - - -static void GLAPIENTRY -save_ProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte * name, - const float v[]) -{ - save_ProgramNamedParameter4fNV(id, len, name, v[0], v[1], v[2], v[3]); -} - - -static void GLAPIENTRY -save_ProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte * name, - GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - save_ProgramNamedParameter4fNV(id, len, name, (GLfloat) x, (GLfloat) y, - (GLfloat) z, (GLfloat) w); -} - - -static void GLAPIENTRY -save_ProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte * name, - const double v[]) -{ - save_ProgramNamedParameter4fNV(id, len, name, (GLfloat) v[0], - (GLfloat) v[1], (GLfloat) v[2], - (GLfloat) v[3]); -} - /* GL_EXT_stencil_two_side */ static void GLAPIENTRY @@ -6135,85 +5940,6 @@ index_error(void) } -/* First level for NV_vertex_program: - * - * Check for errors at compile time?. - */ -static void GLAPIENTRY -save_VertexAttrib1fNV(GLuint index, GLfloat x) -{ - if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) - save_Attr1fNV(index, x); - else - index_error(); -} - -static void GLAPIENTRY -save_VertexAttrib1fvNV(GLuint index, const GLfloat * v) -{ - if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) - save_Attr1fNV(index, v[0]); - else - index_error(); -} - -static void GLAPIENTRY -save_VertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y) -{ - if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) - save_Attr2fNV(index, x, y); - else - index_error(); -} - -static void GLAPIENTRY -save_VertexAttrib2fvNV(GLuint index, const GLfloat * v) -{ - if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) - save_Attr2fNV(index, v[0], v[1]); - else - index_error(); -} - -static void GLAPIENTRY -save_VertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z) -{ - if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) - save_Attr3fNV(index, x, y, z); - else - index_error(); -} - -static void GLAPIENTRY -save_VertexAttrib3fvNV(GLuint index, const GLfloat * v) -{ - if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) - save_Attr3fNV(index, v[0], v[1], v[2]); - else - index_error(); -} - -static void GLAPIENTRY -save_VertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y, - GLfloat z, GLfloat w) -{ - if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) - save_Attr4fNV(index, x, y, z, w); - else - index_error(); -} - -static void GLAPIENTRY -save_VertexAttrib4fvNV(GLuint index, const GLfloat * v) -{ - if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) - save_Attr4fNV(index, v[0], v[1], v[2], v[3]); - else - index_error(); -} - - - static void GLAPIENTRY save_VertexAttrib1fARB(GLuint index, GLfloat x) @@ -8373,41 +8099,14 @@ execute_list(struct gl_context *ctx, GLuint list) case OPCODE_WINDOW_POS_ARB: /* GL_ARB_window_pos */ CALL_WindowPos3fMESA(ctx->Exec, (n[1].f, n[2].f, n[3].f)); break; - case OPCODE_BIND_PROGRAM_NV: /* GL_NV_vertex_program */ + case OPCODE_BIND_PROGRAM_NV: /* GL_ARB_vertex_program */ CALL_BindProgramNV(ctx->Exec, (n[1].e, n[2].ui)); break; - case OPCODE_EXECUTE_PROGRAM_NV: - { - GLfloat v[4]; - v[0] = n[3].f; - v[1] = n[4].f; - v[2] = n[5].f; - v[3] = n[6].f; - CALL_ExecuteProgramNV(ctx->Exec, (n[1].e, n[2].ui, v)); - } - break; - case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV: - CALL_RequestResidentProgramsNV(ctx->Exec, (n[1].ui, - (GLuint *) n[2].data)); - break; - case OPCODE_LOAD_PROGRAM_NV: - CALL_LoadProgramNV(ctx->Exec, (n[1].e, n[2].ui, n[3].i, - (const GLubyte *) n[4].data)); - break; - case OPCODE_TRACK_MATRIX_NV: - CALL_TrackMatrixNV(ctx->Exec, (n[1].e, n[2].ui, n[3].e, n[4].e)); - break; case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB: CALL_ProgramLocalParameter4fARB(ctx->Exec, (n[1].e, n[2].ui, n[3].f, n[4].f, n[5].f, n[6].f)); break; - case OPCODE_PROGRAM_NAMED_PARAMETER_NV: - CALL_ProgramNamedParameter4fNV(ctx->Exec, (n[1].ui, n[2].i, - (const GLubyte *) n[3]. - data, n[4].f, n[5].f, - n[6].f, n[7].f)); - break; case OPCODE_ACTIVE_STENCIL_FACE_EXT: CALL_ActiveStencilFaceEXT(ctx->Exec, (n[1].e)); break; @@ -10238,29 +9937,8 @@ _mesa_create_save_table(const struct gl_context *ctx) */ SET_BindProgramNV(table, save_BindProgramNV); SET_DeleteProgramsNV(table, _mesa_DeletePrograms); - SET_ExecuteProgramNV(table, save_ExecuteProgramNV); SET_GenProgramsNV(table, _mesa_GenPrograms); - SET_AreProgramsResidentNV(table, _mesa_AreProgramsResidentNV); - SET_RequestResidentProgramsNV(table, save_RequestResidentProgramsNV); - SET_GetProgramParameterfvNV(table, _mesa_GetProgramParameterfvNV); - SET_GetProgramParameterdvNV(table, _mesa_GetProgramParameterdvNV); - SET_GetProgramivNV(table, _mesa_GetProgramivNV); - SET_GetProgramStringNV(table, _mesa_GetProgramStringNV); - SET_GetTrackMatrixivNV(table, _mesa_GetTrackMatrixivNV); - SET_GetVertexAttribdvNV(table, _mesa_GetVertexAttribdvNV); - SET_GetVertexAttribfvNV(table, _mesa_GetVertexAttribfvNV); - SET_GetVertexAttribivNV(table, _mesa_GetVertexAttribivNV); - SET_GetVertexAttribPointervNV(table, _mesa_GetVertexAttribPointervNV); SET_IsProgramNV(table, _mesa_IsProgramARB); - SET_LoadProgramNV(table, save_LoadProgramNV); - SET_ProgramEnvParameter4dARB(table, save_ProgramEnvParameter4dARB); - SET_ProgramEnvParameter4dvARB(table, save_ProgramEnvParameter4dvARB); - SET_ProgramEnvParameter4fARB(table, save_ProgramEnvParameter4fARB); - SET_ProgramEnvParameter4fvARB(table, save_ProgramEnvParameter4fvARB); - SET_ProgramParameters4dvNV(table, save_ProgramParameters4dvNV); - SET_ProgramParameters4fvNV(table, save_ProgramParameters4fvNV); - SET_TrackMatrixNV(table, save_TrackMatrixNV); - SET_VertexAttribPointerNV(table, _mesa_VertexAttribPointerNV); /* 244. GL_ATI_envmap_bumpmap */ SET_TexBumpParameterivATI(table, save_TexBumpParameterivATI); @@ -10270,24 +9948,6 @@ _mesa_create_save_table(const struct gl_context *ctx) SET_BindFragmentShaderATI(table, save_BindFragmentShaderATI); SET_SetFragmentShaderConstantATI(table, save_SetFragmentShaderConstantATI); - /* 282. GL_NV_fragment_program */ - SET_ProgramNamedParameter4fNV(table, save_ProgramNamedParameter4fNV); - SET_ProgramNamedParameter4dNV(table, save_ProgramNamedParameter4dNV); - SET_ProgramNamedParameter4fvNV(table, save_ProgramNamedParameter4fvNV); - SET_ProgramNamedParameter4dvNV(table, save_ProgramNamedParameter4dvNV); - SET_GetProgramNamedParameterfvNV(table, - _mesa_GetProgramNamedParameterfvNV); - SET_GetProgramNamedParameterdvNV(table, - _mesa_GetProgramNamedParameterdvNV); - SET_ProgramLocalParameter4dARB(table, save_ProgramLocalParameter4dARB); - SET_ProgramLocalParameter4dvARB(table, save_ProgramLocalParameter4dvARB); - SET_ProgramLocalParameter4fARB(table, save_ProgramLocalParameter4fARB); - SET_ProgramLocalParameter4fvARB(table, save_ProgramLocalParameter4fvARB); - SET_GetProgramLocalParameterdvARB(table, - _mesa_GetProgramLocalParameterdvARB); - SET_GetProgramLocalParameterfvARB(table, - _mesa_GetProgramLocalParameterfvARB); - /* 262. GL_NV_point_sprite */ SET_PointParameteriNV(table, save_PointParameteriNV); SET_PointParameterivNV(table, save_PointParameterivNV); @@ -10368,7 +10028,7 @@ _mesa_create_save_table(const struct gl_context *ctx) SET_GetVertexAttribdvARB(table, _mesa_GetVertexAttribdvARB); SET_GetVertexAttribfvARB(table, _mesa_GetVertexAttribfvARB); SET_GetVertexAttribivARB(table, _mesa_GetVertexAttribivARB); - SET_GetVertexAttribPointervNV(table, _mesa_GetVertexAttribPointervNV); + SET_GetVertexAttribPointervNV(table, _mesa_GetVertexAttribPointervARB); SET_ProgramEnvParameter4dARB(table, save_ProgramEnvParameter4dARB); SET_ProgramEnvParameter4dvARB(table, save_ProgramEnvParameter4dvARB); SET_ProgramEnvParameter4fARB(table, save_ProgramEnvParameter4fARB); @@ -10924,14 +10584,6 @@ _mesa_save_vtxfmt_init(GLvertexformat * vfmt) vfmt->Vertex3fv = save_Vertex3fv; vfmt->Vertex4f = save_Vertex4f; vfmt->Vertex4fv = save_Vertex4fv; - vfmt->VertexAttrib1fNV = save_VertexAttrib1fNV; - vfmt->VertexAttrib1fvNV = save_VertexAttrib1fvNV; - vfmt->VertexAttrib2fNV = save_VertexAttrib2fNV; - vfmt->VertexAttrib2fvNV = save_VertexAttrib2fvNV; - vfmt->VertexAttrib3fNV = save_VertexAttrib3fNV; - vfmt->VertexAttrib3fvNV = save_VertexAttrib3fvNV; - vfmt->VertexAttrib4fNV = save_VertexAttrib4fNV; - vfmt->VertexAttrib4fvNV = save_VertexAttrib4fvNV; vfmt->VertexAttrib1fARB = save_VertexAttrib1fARB; vfmt->VertexAttrib1fvARB = save_VertexAttrib1fvARB; vfmt->VertexAttrib2fARB = save_VertexAttrib2fARB; diff --git a/mesalib/src/mesa/main/drawpix.c b/mesalib/src/mesa/main/drawpix.c index b5ab2cbeb..8836e0a0e 100644 --- a/mesalib/src/mesa/main/drawpix.c +++ b/mesalib/src/mesa/main/drawpix.c @@ -344,7 +344,6 @@ _mesa_Bitmap( GLsizei width, GLsizei height, ctx->Driver.Bitmap( ctx, x, y, width, height, &ctx->Unpack, bitmap ); } } -#if _HAVE_FULL_GL else if (ctx->RenderMode == GL_FEEDBACK) { FLUSH_CURRENT(ctx, 0); _mesa_feedback_token( ctx, (GLfloat) (GLint) GL_BITMAP_TOKEN ); @@ -357,7 +356,6 @@ _mesa_Bitmap( GLsizei width, GLsizei height, ASSERT(ctx->RenderMode == GL_SELECT); /* Do nothing. See OpenGL Spec, Appendix B, Corollary 6. */ } -#endif /* update raster position */ ctx->Current.RasterPos[0] += xmove; diff --git a/mesalib/src/mesa/main/enable.c b/mesalib/src/mesa/main/enable.c index a607bdc10..e60a05a9e 100644 --- a/mesalib/src/mesa/main/enable.c +++ b/mesalib/src/mesa/main/enable.c @@ -97,31 +97,6 @@ client_state(struct gl_context *ctx, GLenum cap, GLboolean state) flag = VERT_BIT_POINT_SIZE; break; - case GL_VERTEX_ATTRIB_ARRAY0_NV: - case GL_VERTEX_ATTRIB_ARRAY1_NV: - case GL_VERTEX_ATTRIB_ARRAY2_NV: - case GL_VERTEX_ATTRIB_ARRAY3_NV: - case GL_VERTEX_ATTRIB_ARRAY4_NV: - case GL_VERTEX_ATTRIB_ARRAY5_NV: - case GL_VERTEX_ATTRIB_ARRAY6_NV: - case GL_VERTEX_ATTRIB_ARRAY7_NV: - case GL_VERTEX_ATTRIB_ARRAY8_NV: - case GL_VERTEX_ATTRIB_ARRAY9_NV: - case GL_VERTEX_ATTRIB_ARRAY10_NV: - case GL_VERTEX_ATTRIB_ARRAY11_NV: - case GL_VERTEX_ATTRIB_ARRAY12_NV: - case GL_VERTEX_ATTRIB_ARRAY13_NV: - case GL_VERTEX_ATTRIB_ARRAY14_NV: - case GL_VERTEX_ATTRIB_ARRAY15_NV: - CHECK_EXTENSION(NV_vertex_program, cap); - { - GLint n = (GLint) cap - GL_VERTEX_ATTRIB_ARRAY0_NV; - ASSERT(VERT_ATTRIB_GENERIC(n) < Elements(arrayObj->VertexAttrib)); - var = &arrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(n)].Enabled; - flag = VERT_BIT_GENERIC(n); - } - break; - /* GL_NV_primitive_restart */ case GL_PRIMITIVE_RESTART_NV: if (!ctx->Extensions.NV_primitive_restart) { @@ -734,7 +709,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) } break; -#if FEATURE_ES1 case GL_TEXTURE_GEN_STR_OES: /* disable S, T, and R at the same time */ { @@ -755,7 +729,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) } } break; -#endif /* client-side state */ case GL_VERTEX_ARRAY: @@ -851,7 +824,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) case GL_VERTEX_PROGRAM_ARB: if (ctx->API != API_OPENGL) goto invalid_enum_error; - CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap); + CHECK_EXTENSION(ARB_vertex_program, cap); if (ctx->VertexProgram.Enabled == state) return; FLUSH_VERTICES(ctx, _NEW_PROGRAM); @@ -863,7 +836,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) */ if (!_mesa_is_desktop_gl(ctx)) goto invalid_enum_error; - CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap); + CHECK_EXTENSION(ARB_vertex_program, cap); if (ctx->VertexProgram.PointSizeEnabled == state) return; FLUSH_VERTICES(ctx, _NEW_PROGRAM); @@ -872,74 +845,13 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) case GL_VERTEX_PROGRAM_TWO_SIDE_ARB: if (ctx->API != API_OPENGL) goto invalid_enum_error; - CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap); + CHECK_EXTENSION(ARB_vertex_program, cap); if (ctx->VertexProgram.TwoSideEnabled == state) return; FLUSH_VERTICES(ctx, _NEW_PROGRAM); ctx->VertexProgram.TwoSideEnabled = state; break; - case GL_MAP1_VERTEX_ATTRIB0_4_NV: - case GL_MAP1_VERTEX_ATTRIB1_4_NV: - case GL_MAP1_VERTEX_ATTRIB2_4_NV: - case GL_MAP1_VERTEX_ATTRIB3_4_NV: - case GL_MAP1_VERTEX_ATTRIB4_4_NV: - case GL_MAP1_VERTEX_ATTRIB5_4_NV: - case GL_MAP1_VERTEX_ATTRIB6_4_NV: - case GL_MAP1_VERTEX_ATTRIB7_4_NV: - case GL_MAP1_VERTEX_ATTRIB8_4_NV: - case GL_MAP1_VERTEX_ATTRIB9_4_NV: - case GL_MAP1_VERTEX_ATTRIB10_4_NV: - case GL_MAP1_VERTEX_ATTRIB11_4_NV: - case GL_MAP1_VERTEX_ATTRIB12_4_NV: - case GL_MAP1_VERTEX_ATTRIB13_4_NV: - case GL_MAP1_VERTEX_ATTRIB14_4_NV: - case GL_MAP1_VERTEX_ATTRIB15_4_NV: - if (ctx->API != API_OPENGL) - goto invalid_enum_error; - CHECK_EXTENSION(NV_vertex_program, cap); - { - const GLuint map = (GLuint) (cap - GL_MAP1_VERTEX_ATTRIB0_4_NV); - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map1Attrib[map] = state; - } - break; - case GL_MAP2_VERTEX_ATTRIB0_4_NV: - case GL_MAP2_VERTEX_ATTRIB1_4_NV: - case GL_MAP2_VERTEX_ATTRIB2_4_NV: - case GL_MAP2_VERTEX_ATTRIB3_4_NV: - case GL_MAP2_VERTEX_ATTRIB4_4_NV: - case GL_MAP2_VERTEX_ATTRIB5_4_NV: - case GL_MAP2_VERTEX_ATTRIB6_4_NV: - case GL_MAP2_VERTEX_ATTRIB7_4_NV: - case GL_MAP2_VERTEX_ATTRIB8_4_NV: - case GL_MAP2_VERTEX_ATTRIB9_4_NV: - case GL_MAP2_VERTEX_ATTRIB10_4_NV: - case GL_MAP2_VERTEX_ATTRIB11_4_NV: - case GL_MAP2_VERTEX_ATTRIB12_4_NV: - case GL_MAP2_VERTEX_ATTRIB13_4_NV: - case GL_MAP2_VERTEX_ATTRIB14_4_NV: - case GL_MAP2_VERTEX_ATTRIB15_4_NV: - if (ctx->API != API_OPENGL) - goto invalid_enum_error; - CHECK_EXTENSION(NV_vertex_program, cap); - { - const GLuint map = (GLuint) (cap - GL_MAP2_VERTEX_ATTRIB0_4_NV); - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map2Attrib[map] = state; - } - break; - - case GL_FRAGMENT_PROGRAM_NV: - if (ctx->API != API_OPENGL) - goto invalid_enum_error; - CHECK_EXTENSION(NV_fragment_program, cap); - if (ctx->FragmentProgram.Enabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - ctx->FragmentProgram.Enabled = state; - break; - /* GL_NV_texture_rectangle */ case GL_TEXTURE_RECTANGLE_NV: if (ctx->API != API_OPENGL) @@ -1450,7 +1362,6 @@ _mesa_IsEnabled( GLenum cap ) } } return GL_FALSE; -#if FEATURE_ES1 case GL_TEXTURE_GEN_STR_OES: { const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); @@ -1463,7 +1374,6 @@ _mesa_IsEnabled( GLenum cap ) ? GL_TRUE : GL_FALSE; } } -#endif /* client-side state */ case GL_VERTEX_ARRAY: @@ -1501,12 +1411,10 @@ _mesa_IsEnabled( GLenum cap ) goto invalid_enum_error; CHECK_EXTENSION(EXT_secondary_color); return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Enabled != 0); -#if FEATURE_ES case GL_POINT_SIZE_ARRAY_OES: if (ctx->API != API_OPENGLES) goto invalid_enum_error; return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Enabled != 0); -#endif /* GL_ARB_texture_cube_map */ case GL_TEXTURE_CUBE_MAP_ARB: @@ -1555,7 +1463,7 @@ _mesa_IsEnabled( GLenum cap ) case GL_VERTEX_PROGRAM_ARB: if (ctx->API != API_OPENGL) goto invalid_enum_error; - CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program); + CHECK_EXTENSION(ARB_vertex_program); return ctx->VertexProgram.Enabled; case GL_VERTEX_PROGRAM_POINT_SIZE_ARB: /* This was added with ARB_vertex_program, but it is also used with @@ -1563,91 +1471,14 @@ _mesa_IsEnabled( GLenum cap ) */ if (!_mesa_is_desktop_gl(ctx)) goto invalid_enum_error; - CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program); + CHECK_EXTENSION(ARB_vertex_program); return ctx->VertexProgram.PointSizeEnabled; case GL_VERTEX_PROGRAM_TWO_SIDE_ARB: if (ctx->API != API_OPENGL) goto invalid_enum_error; - CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program); + CHECK_EXTENSION(ARB_vertex_program); return ctx->VertexProgram.TwoSideEnabled; - case GL_VERTEX_ATTRIB_ARRAY0_NV: - case GL_VERTEX_ATTRIB_ARRAY1_NV: - case GL_VERTEX_ATTRIB_ARRAY2_NV: - case GL_VERTEX_ATTRIB_ARRAY3_NV: - case GL_VERTEX_ATTRIB_ARRAY4_NV: - case GL_VERTEX_ATTRIB_ARRAY5_NV: - case GL_VERTEX_ATTRIB_ARRAY6_NV: - case GL_VERTEX_ATTRIB_ARRAY7_NV: - case GL_VERTEX_ATTRIB_ARRAY8_NV: - case GL_VERTEX_ATTRIB_ARRAY9_NV: - case GL_VERTEX_ATTRIB_ARRAY10_NV: - case GL_VERTEX_ATTRIB_ARRAY11_NV: - case GL_VERTEX_ATTRIB_ARRAY12_NV: - case GL_VERTEX_ATTRIB_ARRAY13_NV: - case GL_VERTEX_ATTRIB_ARRAY14_NV: - case GL_VERTEX_ATTRIB_ARRAY15_NV: - if (ctx->API != API_OPENGL) - goto invalid_enum_error; - CHECK_EXTENSION(NV_vertex_program); - { - GLint n = (GLint) cap - GL_VERTEX_ATTRIB_ARRAY0_NV; - ASSERT(VERT_ATTRIB_GENERIC(n) < Elements(ctx->Array.ArrayObj->VertexAttrib)); - return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(n)].Enabled != 0); - } - case GL_MAP1_VERTEX_ATTRIB0_4_NV: - case GL_MAP1_VERTEX_ATTRIB1_4_NV: - case GL_MAP1_VERTEX_ATTRIB2_4_NV: - case GL_MAP1_VERTEX_ATTRIB3_4_NV: - case GL_MAP1_VERTEX_ATTRIB4_4_NV: - case GL_MAP1_VERTEX_ATTRIB5_4_NV: - case GL_MAP1_VERTEX_ATTRIB6_4_NV: - case GL_MAP1_VERTEX_ATTRIB7_4_NV: - case GL_MAP1_VERTEX_ATTRIB8_4_NV: - case GL_MAP1_VERTEX_ATTRIB9_4_NV: - case GL_MAP1_VERTEX_ATTRIB10_4_NV: - case GL_MAP1_VERTEX_ATTRIB11_4_NV: - case GL_MAP1_VERTEX_ATTRIB12_4_NV: - case GL_MAP1_VERTEX_ATTRIB13_4_NV: - case GL_MAP1_VERTEX_ATTRIB14_4_NV: - case GL_MAP1_VERTEX_ATTRIB15_4_NV: - if (ctx->API != API_OPENGL) - goto invalid_enum_error; - CHECK_EXTENSION(NV_vertex_program); - { - const GLuint map = (GLuint) (cap - GL_MAP1_VERTEX_ATTRIB0_4_NV); - return ctx->Eval.Map1Attrib[map]; - } - case GL_MAP2_VERTEX_ATTRIB0_4_NV: - case GL_MAP2_VERTEX_ATTRIB1_4_NV: - case GL_MAP2_VERTEX_ATTRIB2_4_NV: - case GL_MAP2_VERTEX_ATTRIB3_4_NV: - case GL_MAP2_VERTEX_ATTRIB4_4_NV: - case GL_MAP2_VERTEX_ATTRIB5_4_NV: - case GL_MAP2_VERTEX_ATTRIB6_4_NV: - case GL_MAP2_VERTEX_ATTRIB7_4_NV: - case GL_MAP2_VERTEX_ATTRIB8_4_NV: - case GL_MAP2_VERTEX_ATTRIB9_4_NV: - case GL_MAP2_VERTEX_ATTRIB10_4_NV: - case GL_MAP2_VERTEX_ATTRIB11_4_NV: - case GL_MAP2_VERTEX_ATTRIB12_4_NV: - case GL_MAP2_VERTEX_ATTRIB13_4_NV: - case GL_MAP2_VERTEX_ATTRIB14_4_NV: - case GL_MAP2_VERTEX_ATTRIB15_4_NV: - if (ctx->API != API_OPENGL) - goto invalid_enum_error; - CHECK_EXTENSION(NV_vertex_program); - { - const GLuint map = (GLuint) (cap - GL_MAP2_VERTEX_ATTRIB0_4_NV); - return ctx->Eval.Map2Attrib[map]; - } - - case GL_FRAGMENT_PROGRAM_NV: - if (ctx->API != API_OPENGL) - goto invalid_enum_error; - CHECK_EXTENSION(NV_fragment_program); - return ctx->FragmentProgram.Enabled; - /* GL_NV_texture_rectangle */ case GL_TEXTURE_RECTANGLE_NV: if (ctx->API != API_OPENGL) diff --git a/mesalib/src/mesa/main/eval.c b/mesalib/src/mesa/main/eval.c index b0458a1e8..d6e45d6e8 100644 --- a/mesalib/src/mesa/main/eval.c +++ b/mesalib/src/mesa/main/eval.c @@ -77,19 +77,6 @@ GLuint _mesa_evaluator_components( GLenum target ) default: break; } - /* XXX need to check for the vertex program extension - if (!ctx->Extensions.NV_vertex_program) - return 0; - */ - - if (target >= GL_MAP1_VERTEX_ATTRIB0_4_NV && - target <= GL_MAP1_VERTEX_ATTRIB15_4_NV) - return 4; - - if (target >= GL_MAP2_VERTEX_ATTRIB0_4_NV && - target <= GL_MAP2_VERTEX_ATTRIB15_4_NV) - return 4; - return 0; } @@ -119,25 +106,6 @@ get_1d_map( struct gl_context *ctx, GLenum target ) return &ctx->EvalMap.Map1Texture3; case GL_MAP1_TEXTURE_COORD_4: return &ctx->EvalMap.Map1Texture4; - case GL_MAP1_VERTEX_ATTRIB0_4_NV: - case GL_MAP1_VERTEX_ATTRIB1_4_NV: - case GL_MAP1_VERTEX_ATTRIB2_4_NV: - case GL_MAP1_VERTEX_ATTRIB3_4_NV: - case GL_MAP1_VERTEX_ATTRIB4_4_NV: - case GL_MAP1_VERTEX_ATTRIB5_4_NV: - case GL_MAP1_VERTEX_ATTRIB6_4_NV: - case GL_MAP1_VERTEX_ATTRIB7_4_NV: - case GL_MAP1_VERTEX_ATTRIB8_4_NV: - case GL_MAP1_VERTEX_ATTRIB9_4_NV: - case GL_MAP1_VERTEX_ATTRIB10_4_NV: - case GL_MAP1_VERTEX_ATTRIB11_4_NV: - case GL_MAP1_VERTEX_ATTRIB12_4_NV: - case GL_MAP1_VERTEX_ATTRIB13_4_NV: - case GL_MAP1_VERTEX_ATTRIB14_4_NV: - case GL_MAP1_VERTEX_ATTRIB15_4_NV: - if (!ctx->Extensions.NV_vertex_program) - return NULL; - return &ctx->EvalMap.Map1Attrib[target - GL_MAP1_VERTEX_ATTRIB0_4_NV]; default: return NULL; } @@ -169,25 +137,6 @@ get_2d_map( struct gl_context *ctx, GLenum target ) return &ctx->EvalMap.Map2Texture3; case GL_MAP2_TEXTURE_COORD_4: return &ctx->EvalMap.Map2Texture4; - case GL_MAP2_VERTEX_ATTRIB0_4_NV: - case GL_MAP2_VERTEX_ATTRIB1_4_NV: - case GL_MAP2_VERTEX_ATTRIB2_4_NV: - case GL_MAP2_VERTEX_ATTRIB3_4_NV: - case GL_MAP2_VERTEX_ATTRIB4_4_NV: - case GL_MAP2_VERTEX_ATTRIB5_4_NV: - case GL_MAP2_VERTEX_ATTRIB6_4_NV: - case GL_MAP2_VERTEX_ATTRIB7_4_NV: - case GL_MAP2_VERTEX_ATTRIB8_4_NV: - case GL_MAP2_VERTEX_ATTRIB9_4_NV: - case GL_MAP2_VERTEX_ATTRIB10_4_NV: - case GL_MAP2_VERTEX_ATTRIB11_4_NV: - case GL_MAP2_VERTEX_ATTRIB12_4_NV: - case GL_MAP2_VERTEX_ATTRIB13_4_NV: - case GL_MAP2_VERTEX_ATTRIB14_4_NV: - case GL_MAP2_VERTEX_ATTRIB15_4_NV: - if (!ctx->Extensions.NV_vertex_program) - return NULL; - return &ctx->EvalMap.Map2Attrib[target - GL_MAP2_VERTEX_ATTRIB0_4_NV]; default: return NULL; } @@ -966,8 +915,6 @@ init_2d_map( struct gl_2d_map *map, int n, const float *initial ) void _mesa_init_eval( struct gl_context *ctx ) { - int i; - /* Evaluators group */ ctx->Eval.Map1Color4 = GL_FALSE; ctx->Eval.Map1Index = GL_FALSE; @@ -978,7 +925,6 @@ void _mesa_init_eval( struct gl_context *ctx ) ctx->Eval.Map1TextureCoord4 = GL_FALSE; ctx->Eval.Map1Vertex3 = GL_FALSE; ctx->Eval.Map1Vertex4 = GL_FALSE; - memset(ctx->Eval.Map1Attrib, 0, sizeof(ctx->Eval.Map1Attrib)); ctx->Eval.Map2Color4 = GL_FALSE; ctx->Eval.Map2Index = GL_FALSE; ctx->Eval.Map2Normal = GL_FALSE; @@ -988,7 +934,6 @@ void _mesa_init_eval( struct gl_context *ctx ) ctx->Eval.Map2TextureCoord4 = GL_FALSE; ctx->Eval.Map2Vertex3 = GL_FALSE; ctx->Eval.Map2Vertex4 = GL_FALSE; - memset(ctx->Eval.Map2Attrib, 0, sizeof(ctx->Eval.Map2Attrib)); ctx->Eval.AutoNormal = GL_FALSE; ctx->Eval.MapGrid1un = 1; ctx->Eval.MapGrid1u1 = 0.0; @@ -1007,7 +952,6 @@ void _mesa_init_eval( struct gl_context *ctx ) static GLfloat index[1] = { 1.0 }; static GLfloat color[4] = { 1.0, 1.0, 1.0, 1.0 }; static GLfloat texcoord[4] = { 0.0, 0.0, 0.0, 1.0 }; - static GLfloat attrib[4] = { 0.0, 0.0, 0.0, 1.0 }; init_1d_map( &ctx->EvalMap.Map1Vertex3, 3, vertex ); init_1d_map( &ctx->EvalMap.Map1Vertex4, 4, vertex ); @@ -1018,8 +962,6 @@ void _mesa_init_eval( struct gl_context *ctx ) init_1d_map( &ctx->EvalMap.Map1Texture2, 2, texcoord ); init_1d_map( &ctx->EvalMap.Map1Texture3, 3, texcoord ); init_1d_map( &ctx->EvalMap.Map1Texture4, 4, texcoord ); - for (i = 0; i < 16; i++) - init_1d_map( ctx->EvalMap.Map1Attrib + i, 4, attrib ); init_2d_map( &ctx->EvalMap.Map2Vertex3, 3, vertex ); init_2d_map( &ctx->EvalMap.Map2Vertex4, 4, vertex ); @@ -1030,16 +972,12 @@ void _mesa_init_eval( struct gl_context *ctx ) init_2d_map( &ctx->EvalMap.Map2Texture2, 2, texcoord ); init_2d_map( &ctx->EvalMap.Map2Texture3, 3, texcoord ); init_2d_map( &ctx->EvalMap.Map2Texture4, 4, texcoord ); - for (i = 0; i < 16; i++) - init_2d_map( ctx->EvalMap.Map2Attrib + i, 4, attrib ); } } void _mesa_free_eval_data( struct gl_context *ctx ) { - int i; - /* Free evaluator data */ free(ctx->EvalMap.Map1Vertex3.Points); free(ctx->EvalMap.Map1Vertex4.Points); @@ -1050,8 +988,6 @@ void _mesa_free_eval_data( struct gl_context *ctx ) free(ctx->EvalMap.Map1Texture2.Points); free(ctx->EvalMap.Map1Texture3.Points); free(ctx->EvalMap.Map1Texture4.Points); - for (i = 0; i < Elements(ctx->EvalMap.Map1Attrib); i++) - free(ctx->EvalMap.Map1Attrib[i].Points); free(ctx->EvalMap.Map2Vertex3.Points); free(ctx->EvalMap.Map2Vertex4.Points); @@ -1062,6 +998,4 @@ void _mesa_free_eval_data( struct gl_context *ctx ) free(ctx->EvalMap.Map2Texture2.Points); free(ctx->EvalMap.Map2Texture3.Points); free(ctx->EvalMap.Map2Texture4.Points); - for (i = 0; i < Elements(ctx->EvalMap.Map2Attrib); i++) - free((ctx->EvalMap.Map2Attrib[i].Points)); } diff --git a/mesalib/src/mesa/main/extensions.c b/mesalib/src/mesa/main/extensions.c index 4971ebc93..edee5967d 100644 --- a/mesalib/src/mesa/main/extensions.c +++ b/mesalib/src/mesa/main/extensions.c @@ -176,6 +176,7 @@ static const struct extension extension_table[] = { { "GL_EXT_framebuffer_sRGB", o(EXT_framebuffer_sRGB), GL, 1998 }, { "GL_EXT_gpu_program_parameters", o(EXT_gpu_program_parameters), GLL, 2006 }, { "GL_EXT_gpu_shader4", o(EXT_gpu_shader4), GL, 2006 }, + { "GL_EXT_map_buffer_range", o(ARB_map_buffer_range), ES1 | ES2, 2012 }, { "GL_EXT_multi_draw_arrays", o(dummy_true), GLL | ES1 | ES2, 1999 }, { "GL_EXT_packed_depth_stencil", o(EXT_packed_depth_stencil), GL, 2005 }, { "GL_EXT_packed_float", o(EXT_packed_float), GL, 2004 }, @@ -301,7 +302,6 @@ static const struct extension extension_table[] = { { "GL_NV_draw_buffers", o(dummy_true), ES2, 2011 }, { "GL_NV_fbo_color_attachments", o(EXT_framebuffer_object), ES2, 2010 }, { "GL_NV_fog_distance", o(NV_fog_distance), GLL, 2001 }, - { "GL_NV_fragment_program", o(NV_fragment_program), GLL, 2001 }, { "GL_NV_fragment_program_option", o(NV_fragment_program_option), GLL, 2005 }, { "GL_NV_light_max_exponent", o(NV_light_max_exponent), GLL, 1999 }, { "GL_NV_packed_depth_stencil", o(EXT_packed_depth_stencil), GL, 2000 }, @@ -312,8 +312,6 @@ static const struct extension extension_table[] = { { "GL_NV_texture_barrier", o(NV_texture_barrier), GL, 2009 }, { "GL_NV_texture_env_combine4", o(NV_texture_env_combine4), GLL, 1999 }, { "GL_NV_texture_rectangle", o(NV_texture_rectangle), GLL, 2000 }, - { "GL_NV_vertex_program1_1", o(NV_vertex_program1_1), GLL, 2001 }, - { "GL_NV_vertex_program", o(NV_vertex_program), GLL, 2000 }, { "GL_S3_s3tc", o(S3_s3tc), GL, 1999 }, { "GL_SGIS_generate_mipmap", o(dummy_true), GLL, 1997 }, { "GL_SGIS_texture_border_clamp", o(ARB_texture_border_clamp), GLL, 1997 }, @@ -475,9 +473,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) ctx->Extensions.NV_texture_env_combine4 = GL_TRUE; ctx->Extensions.NV_texture_rectangle = GL_TRUE; /*ctx->Extensions.NV_texgen_reflection = GL_TRUE;*/ - ctx->Extensions.NV_vertex_program = GL_TRUE; - ctx->Extensions.NV_vertex_program1_1 = GL_TRUE; - ctx->Extensions.NV_fragment_program = GL_TRUE; ctx->Extensions.NV_fragment_program_option = GL_TRUE; ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE; _mesa_enable_extension(ctx, "GL_3DFX_texture_compression_FXT1"); diff --git a/mesalib/src/mesa/main/extensions.h b/mesalib/src/mesa/main/extensions.h index 712c6e94d..8acbd4b68 100644 --- a/mesalib/src/mesa/main/extensions.h +++ b/mesalib/src/mesa/main/extensions.h @@ -41,8 +41,6 @@ struct gl_context; -#if _HAVE_FULL_GL - extern void _mesa_enable_sw_extensions(struct gl_context *ctx); extern void _mesa_enable_1_3_extensions(struct gl_context *ctx); @@ -71,21 +69,4 @@ _mesa_get_extension_count(struct gl_context *ctx); extern const GLubyte * _mesa_get_enabled_extension(struct gl_context *ctx, GLuint index); - -#else - -/** No-op */ -#define _mesa_extensions_dtr( ctx ) ((void)0) - -/** No-op */ -#define _mesa_extensions_ctr( ctx ) ((void)0) - -/** No-op */ -#define _mesa_extensions_get_string( ctx ) "GL_EXT_texture_object" - -/** No-op */ -#define _mesa_enable_extension( c, n ) ((void)0) - -#endif - #endif diff --git a/mesalib/src/mesa/main/feedback.c b/mesalib/src/mesa/main/feedback.c index 8a63acdf1..f45b823b1 100644 --- a/mesalib/src/mesa/main/feedback.c +++ b/mesalib/src/mesa/main/feedback.c @@ -449,7 +449,6 @@ _mesa_RenderMode( GLenum mode ) ctx->Select.Hits = 0; ctx->Select.NameStackDepth = 0; break; -#if _HAVE_FULL_GL case GL_FEEDBACK: if (ctx->Feedback.Count > ctx->Feedback.BufferSize) { /* overflow */ @@ -460,7 +459,6 @@ _mesa_RenderMode( GLenum mode ) } ctx->Feedback.Count = 0; break; -#endif default: _mesa_error( ctx, GL_INVALID_ENUM, "glRenderMode" ); return 0; @@ -475,14 +473,12 @@ _mesa_RenderMode( GLenum mode ) _mesa_error( ctx, GL_INVALID_OPERATION, "glRenderMode" ); } break; -#if _HAVE_FULL_GL case GL_FEEDBACK: if (ctx->Feedback.BufferSize==0) { /* haven't called glFeedbackBuffer yet */ _mesa_error( ctx, GL_INVALID_OPERATION, "glRenderMode" ); } break; -#endif default: _mesa_error( ctx, GL_INVALID_ENUM, "glRenderMode" ); return 0; diff --git a/mesalib/src/mesa/main/ffvertex_prog.c b/mesalib/src/mesa/main/ffvertex_prog.c index 0a98c4acf..efdca015e 100644 --- a/mesalib/src/mesa/main/ffvertex_prog.c +++ b/mesalib/src/mesa/main/ffvertex_prog.c @@ -544,7 +544,6 @@ static void emit_dst( struct prog_dst_register *dst, dst->WriteMask = mask ? mask : WRITEMASK_XYZW; dst->CondMask = COND_TR; /* always pass cond test */ dst->CondSwizzle = SWIZZLE_NOOP; - dst->CondSrc = 0; /* Check that bitfield sizes aren't exceeded */ ASSERT(dst->Index == reg.idx); } diff --git a/mesalib/src/mesa/main/fog.h b/mesalib/src/mesa/main/fog.h index 9191a4a54..20a75e96b 100644 --- a/mesalib/src/mesa/main/fog.h +++ b/mesalib/src/mesa/main/fog.h @@ -43,8 +43,6 @@ struct gl_context; -#if _HAVE_FULL_GL - extern void GLAPIENTRY _mesa_Fogf(GLenum pname, GLfloat param); @@ -59,11 +57,4 @@ _mesa_Fogiv(GLenum pname, const GLint *params ); extern void _mesa_init_fog( struct gl_context * ctx ); -#else - -/** No-op */ -#define _mesa_init_fog( c ) ((void)0) - -#endif - #endif diff --git a/mesalib/src/mesa/main/get.c b/mesalib/src/mesa/main/get.c index 7570fab96..e38d594e2 100644 --- a/mesalib/src/mesa/main/get.c +++ b/mesalib/src/mesa/main/get.c @@ -305,8 +305,6 @@ EXTRA_EXT(NV_fog_distance); EXTRA_EXT(EXT_texture_filter_anisotropic); EXTRA_EXT(IBM_rasterpos_clip); EXTRA_EXT(NV_point_sprite); -EXTRA_EXT(NV_vertex_program); -EXTRA_EXT(NV_fragment_program); EXTRA_EXT(NV_texture_rectangle); EXTRA_EXT(EXT_stencil_two_side); EXTRA_EXT(NV_light_max_exponent); @@ -330,8 +328,6 @@ EXTRA_EXT(ARB_transform_feedback3); EXTRA_EXT(EXT_pixel_buffer_object); EXTRA_EXT(ARB_vertex_program); EXTRA_EXT2(NV_point_sprite, ARB_point_sprite); -EXTRA_EXT2(ARB_fragment_program, NV_fragment_program); -EXTRA_EXT2(ARB_vertex_program, NV_vertex_program); EXTRA_EXT2(ARB_vertex_program, ARB_fragment_program); EXTRA_EXT(ARB_geometry_shader4); EXTRA_EXT(ARB_color_buffer_float); @@ -344,23 +340,6 @@ EXTRA_EXT(ARB_uniform_buffer_object); EXTRA_EXT(ARB_timer_query); static const int -extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program[] = { - EXT(ARB_vertex_program), - EXT(ARB_fragment_program), - EXT(NV_vertex_program), - EXTRA_END -}; - -static const int -extra_NV_vertex_program_ARB_vertex_program_ARB_fragment_program_NV_vertex_program[] = { - EXT(NV_vertex_program), - EXT(ARB_vertex_program), - EXT(ARB_fragment_program), - EXT(NV_vertex_program), - EXTRA_END -}; - -static const int extra_NV_primitive_restart[] = { EXT(NV_primitive_restart), EXTRA_END @@ -727,14 +706,6 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu v->value_int = ctx->CopyWriteBuffer->Name; break; - case GL_FRAGMENT_PROGRAM_BINDING_NV: - v->value_int = - ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0; - break; - case GL_VERTEX_PROGRAM_BINDING_NV: - v->value_int = - ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0; - break; case GL_PIXEL_PACK_BUFFER_BINDING_EXT: v->value_int = ctx->Pack.BufferObj->Name; break; diff --git a/mesalib/src/mesa/main/get_hash_params.py b/mesalib/src/mesa/main/get_hash_params.py index 7dde0f9e8..7a25cb10c 100644 --- a/mesalib/src/mesa/main/get_hash_params.py +++ b/mesalib/src/mesa/main/get_hash_params.py @@ -259,7 +259,7 @@ descriptor=[ { "apis": ["GL", "GL_CORE", "GLES2"], "params": [ # == GL_MAX_TEXTURE_COORDS_NV - [ "MAX_TEXTURE_COORDS_ARB", "CONTEXT_INT(Const.MaxTextureCoordUnits), extra_ARB_fragment_program_NV_fragment_program" ], + [ "MAX_TEXTURE_COORDS_ARB", "CONTEXT_INT(Const.MaxTextureCoordUnits), extra_ARB_fragment_program" ], [ "PACK_IMAGE_HEIGHT", "CONTEXT_INT(Pack.ImageHeight), NO_EXTRA" ], [ "PACK_ROW_LENGTH", "CONTEXT_INT(Pack.RowLength), NO_EXTRA" ], [ "PACK_SKIP_PIXELS", "CONTEXT_INT(Pack.SkipPixels), NO_EXTRA" ], @@ -289,7 +289,7 @@ descriptor=[ # GL_ARB_fragment_program # == GL_MAX_TEXTURE_IMAGE_UNITS_NV - [ "MAX_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.MaxTextureImageUnits), extra_ARB_fragment_program_NV_fragment_program" ], + [ "MAX_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.MaxTextureImageUnits), extra_ARB_fragment_program" ], [ "MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.MaxVertexTextureImageUnits), extra_ARB_vertex_shader" ], [ "MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.MaxCombinedTextureImageUnits), extra_ARB_vertex_shader" ], @@ -513,46 +513,6 @@ descriptor=[ [ "POINT_SPRITE_R_MODE_NV", "CONTEXT_ENUM(Point.SpriteRMode), extra_NV_point_sprite" ], [ "POINT_SPRITE_COORD_ORIGIN", "CONTEXT_ENUM(Point.SpriteOrigin), extra_NV_point_sprite_ARB_point_sprite" ], -# GL_NV_vertex_program - [ "VERTEX_PROGRAM_BINDING_NV", "LOC_CUSTOM, TYPE_INT, 0, extra_NV_vertex_program" ], - [ "VERTEX_ATTRIB_ARRAY0_NV", "ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_GENERIC(0)].Enabled), extra_NV_vertex_program" ], - [ "VERTEX_ATTRIB_ARRAY1_NV", "ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_GENERIC(1)].Enabled), extra_NV_vertex_program" ], - [ "VERTEX_ATTRIB_ARRAY2_NV", "ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_GENERIC(2)].Enabled), extra_NV_vertex_program" ], - [ "VERTEX_ATTRIB_ARRAY3_NV", "ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_GENERIC(3)].Enabled), extra_NV_vertex_program" ], - [ "VERTEX_ATTRIB_ARRAY4_NV", "ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_GENERIC(4)].Enabled), extra_NV_vertex_program" ], - [ "VERTEX_ATTRIB_ARRAY5_NV", "ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_GENERIC(5)].Enabled), extra_NV_vertex_program" ], - [ "VERTEX_ATTRIB_ARRAY6_NV", "ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_GENERIC(6)].Enabled), extra_NV_vertex_program" ], - [ "VERTEX_ATTRIB_ARRAY7_NV", "ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_GENERIC(7)].Enabled), extra_NV_vertex_program" ], - [ "VERTEX_ATTRIB_ARRAY8_NV", "ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_GENERIC(8)].Enabled), extra_NV_vertex_program" ], - [ "VERTEX_ATTRIB_ARRAY9_NV", "ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_GENERIC(9)].Enabled), extra_NV_vertex_program" ], - [ "VERTEX_ATTRIB_ARRAY10_NV", "ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_GENERIC(10)].Enabled), extra_NV_vertex_program" ], - [ "VERTEX_ATTRIB_ARRAY11_NV", "ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_GENERIC(11)].Enabled), extra_NV_vertex_program" ], - [ "VERTEX_ATTRIB_ARRAY12_NV", "ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_GENERIC(12)].Enabled), extra_NV_vertex_program" ], - [ "VERTEX_ATTRIB_ARRAY13_NV", "ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_GENERIC(13)].Enabled), extra_NV_vertex_program" ], - [ "VERTEX_ATTRIB_ARRAY14_NV", "ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_GENERIC(14)].Enabled), extra_NV_vertex_program" ], - [ "VERTEX_ATTRIB_ARRAY15_NV", "ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_GENERIC(15)].Enabled), extra_NV_vertex_program" ], - [ "MAP1_VERTEX_ATTRIB0_4_NV", "CONTEXT_BOOL(Eval.Map1Attrib[0]), extra_NV_vertex_program" ], - [ "MAP1_VERTEX_ATTRIB1_4_NV", "CONTEXT_BOOL(Eval.Map1Attrib[1]), extra_NV_vertex_program" ], - [ "MAP1_VERTEX_ATTRIB2_4_NV", "CONTEXT_BOOL(Eval.Map1Attrib[2]), extra_NV_vertex_program" ], - [ "MAP1_VERTEX_ATTRIB3_4_NV", "CONTEXT_BOOL(Eval.Map1Attrib[3]), extra_NV_vertex_program" ], - [ "MAP1_VERTEX_ATTRIB4_4_NV", "CONTEXT_BOOL(Eval.Map1Attrib[4]), extra_NV_vertex_program" ], - [ "MAP1_VERTEX_ATTRIB5_4_NV", "CONTEXT_BOOL(Eval.Map1Attrib[5]), extra_NV_vertex_program" ], - [ "MAP1_VERTEX_ATTRIB6_4_NV", "CONTEXT_BOOL(Eval.Map1Attrib[6]), extra_NV_vertex_program" ], - [ "MAP1_VERTEX_ATTRIB7_4_NV", "CONTEXT_BOOL(Eval.Map1Attrib[7]), extra_NV_vertex_program" ], - [ "MAP1_VERTEX_ATTRIB8_4_NV", "CONTEXT_BOOL(Eval.Map1Attrib[8]), extra_NV_vertex_program" ], - [ "MAP1_VERTEX_ATTRIB9_4_NV", "CONTEXT_BOOL(Eval.Map1Attrib[9]), extra_NV_vertex_program" ], - [ "MAP1_VERTEX_ATTRIB10_4_NV", "CONTEXT_BOOL(Eval.Map1Attrib[10]), extra_NV_vertex_program" ], - [ "MAP1_VERTEX_ATTRIB11_4_NV", "CONTEXT_BOOL(Eval.Map1Attrib[11]), extra_NV_vertex_program" ], - [ "MAP1_VERTEX_ATTRIB12_4_NV", "CONTEXT_BOOL(Eval.Map1Attrib[12]), extra_NV_vertex_program" ], - [ "MAP1_VERTEX_ATTRIB13_4_NV", "CONTEXT_BOOL(Eval.Map1Attrib[13]), extra_NV_vertex_program" ], - [ "MAP1_VERTEX_ATTRIB14_4_NV", "CONTEXT_BOOL(Eval.Map1Attrib[14]), extra_NV_vertex_program" ], - [ "MAP1_VERTEX_ATTRIB15_4_NV", "CONTEXT_BOOL(Eval.Map1Attrib[15]), extra_NV_vertex_program" ], - -# GL_NV_fragment_program - [ "FRAGMENT_PROGRAM_NV", "CONTEXT_BOOL(FragmentProgram.Enabled), extra_NV_fragment_program" ], - [ "FRAGMENT_PROGRAM_BINDING_NV", "LOC_CUSTOM, TYPE_INT, 0, extra_NV_fragment_program" ], - [ "MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV", "CONST(MAX_NV_FRAGMENT_PROGRAM_PARAMS), extra_NV_fragment_program" ], - # GL_NV_texture_rectangle [ "TEXTURE_RECTANGLE_NV", "LOC_CUSTOM, TYPE_BOOLEAN, 0, extra_NV_texture_rectangle" ], [ "TEXTURE_BINDING_RECTANGLE_NV", "LOC_CUSTOM, TYPE_INT, TEXTURE_RECT_INDEX, extra_NV_texture_rectangle" ], @@ -582,23 +542,23 @@ descriptor=[ # GL_ARB_vertex_program # == GL_VERTEX_PROGRAM_NV - [ "VERTEX_PROGRAM_ARB", "CONTEXT_BOOL(VertexProgram.Enabled), extra_ARB_vertex_program_NV_vertex_program" ], + [ "VERTEX_PROGRAM_ARB", "CONTEXT_BOOL(VertexProgram.Enabled), extra_ARB_vertex_program" ], # == GL_VERTEX_PROGRAM_POINT_SIZE_NV - [ "VERTEX_PROGRAM_POINT_SIZE_ARB", "CONTEXT_BOOL(VertexProgram.PointSizeEnabled), extra_ARB_vertex_program_NV_vertex_program" ], + [ "VERTEX_PROGRAM_POINT_SIZE_ARB", "CONTEXT_BOOL(VertexProgram.PointSizeEnabled), extra_ARB_vertex_program" ], # == GL_VERTEX_PROGRAM_TWO_SIDE_NV - [ "VERTEX_PROGRAM_TWO_SIDE_ARB", "CONTEXT_BOOL(VertexProgram.TwoSideEnabled), extra_ARB_vertex_program_NV_vertex_program" ], + [ "VERTEX_PROGRAM_TWO_SIDE_ARB", "CONTEXT_BOOL(VertexProgram.TwoSideEnabled), extra_ARB_vertex_program" ], # == GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV - [ "MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB", "CONTEXT_INT(Const.MaxProgramMatrixStackDepth), extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program" ], + [ "MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB", "CONTEXT_INT(Const.MaxProgramMatrixStackDepth), extra_ARB_vertex_program_ARB_fragment_program" ], # == GL_MAX_TRACK_MATRICES_NV - [ "MAX_PROGRAM_MATRICES_ARB", "CONTEXT_INT(Const.MaxProgramMatrices), extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program" ], + [ "MAX_PROGRAM_MATRICES_ARB", "CONTEXT_INT(Const.MaxProgramMatrices), extra_ARB_vertex_program_ARB_fragment_program" ], # == GL_CURRENT_MATRIX_STACK_DEPTH_NV - [ "CURRENT_MATRIX_STACK_DEPTH_ARB", "LOC_CUSTOM, TYPE_INT, 0, extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program" ], + [ "CURRENT_MATRIX_STACK_DEPTH_ARB", "LOC_CUSTOM, TYPE_INT, 0, extra_ARB_vertex_program_ARB_fragment_program" ], # == GL_CURRENT_MATRIX_NV - [ "CURRENT_MATRIX_ARB", "LOC_CUSTOM, TYPE_MATRIX, 0, extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program" ], + [ "CURRENT_MATRIX_ARB", "LOC_CUSTOM, TYPE_MATRIX, 0, extra_ARB_vertex_program_ARB_fragment_program" ], # == GL_CURRENT_MATRIX_NV [ "TRANSPOSE_CURRENT_MATRIX_ARB", "LOC_CUSTOM, TYPE_MATRIX, 0, extra_ARB_vertex_program_ARB_fragment_program" ], # == GL_PROGRAM_ERROR_POSITION_NV - [ "PROGRAM_ERROR_POSITION_ARB", "CONTEXT_INT(Program.ErrorPos), extra_NV_vertex_program_ARB_vertex_program_ARB_fragment_program_NV_vertex_program" ], + [ "PROGRAM_ERROR_POSITION_ARB", "CONTEXT_INT(Program.ErrorPos), extra_ARB_vertex_program_ARB_fragment_program" ], # GL_ARB_fragment_program [ "FRAGMENT_PROGRAM_ARB", "CONTEXT_BOOL(FragmentProgram.Enabled), extra_ARB_fragment_program" ], diff --git a/mesalib/src/mesa/main/getstring.c b/mesalib/src/mesa/main/getstring.c index 54e518d2b..a04db0dc7 100644 --- a/mesalib/src/mesa/main/getstring.c +++ b/mesalib/src/mesa/main/getstring.c @@ -137,9 +137,7 @@ _mesa_GetString( GLenum name ) return shading_language_version(ctx); case GL_PROGRAM_ERROR_STRING_NV: if (ctx->API == API_OPENGL && - (ctx->Extensions.NV_fragment_program || - ctx->Extensions.ARB_fragment_program || - ctx->Extensions.NV_vertex_program || + (ctx->Extensions.ARB_fragment_program || ctx->Extensions.ARB_vertex_program)) { return (const GLubyte *) ctx->Program.ErrorString; } diff --git a/mesalib/src/mesa/main/glformats.c b/mesalib/src/mesa/main/glformats.c index ccdf56b4f..ba79f193b 100644 --- a/mesalib/src/mesa/main/glformats.c +++ b/mesalib/src/mesa/main/glformats.c @@ -829,7 +829,6 @@ _mesa_is_compressed_format(struct gl_context *ctx, GLenum format) case GL_ETC1_RGB8_OES: return _mesa_is_gles(ctx) && ctx->Extensions.OES_compressed_ETC1_RGB8_texture; -#if FEATURE_ES case GL_PALETTE4_RGB8_OES: case GL_PALETTE4_RGBA8_OES: case GL_PALETTE4_R5_G6_B5_OES: @@ -841,7 +840,6 @@ _mesa_is_compressed_format(struct gl_context *ctx, GLenum format) case GL_PALETTE8_RGBA4_OES: case GL_PALETTE8_RGB5_A1_OES: return ctx->API == API_OPENGLES; -#endif default: return GL_FALSE; } diff --git a/mesalib/src/mesa/main/hint.h b/mesalib/src/mesa/main/hint.h index 6c6206874..ca9659d58 100644 --- a/mesalib/src/mesa/main/hint.h +++ b/mesalib/src/mesa/main/hint.h @@ -41,19 +41,10 @@ struct gl_context; -#if _HAVE_FULL_GL - extern void GLAPIENTRY _mesa_Hint( GLenum target, GLenum mode ); extern void _mesa_init_hint( struct gl_context * ctx ); -#else - -/** No-op */ -#define _mesa_init_hint( c ) ((void) 0) - -#endif - #endif diff --git a/mesalib/src/mesa/main/light.h b/mesalib/src/mesa/main/light.h index c751d6d6b..2e6a5003e 100644 --- a/mesalib/src/mesa/main/light.h +++ b/mesalib/src/mesa/main/light.h @@ -42,7 +42,6 @@ extern void GLAPIENTRY _mesa_ProvokingVertexEXT(GLenum mode); -#if _HAVE_FULL_GL extern void GLAPIENTRY _mesa_ColorMaterial( GLenum face, GLenum mode ); @@ -108,14 +107,4 @@ extern void _mesa_free_lighting_data( struct gl_context *ctx ); extern void _mesa_allow_light_in_model( struct gl_context *ctx, GLboolean flag ); -#else -#define _mesa_update_color_material( c, r ) ((void)0) -#define _mesa_material_bitmask( c, f, p, l, s ) 0 -#define _mesa_init_lighting( c ) ((void)0) -#define _mesa_free_lighting_data( c ) ((void)0) -#define _mesa_update_lighting( c ) ((void)0) -#define _mesa_update_tnl_spaces( c, n ) ((void)0) -#define GET_SHINE_TAB_ENTRY( table, dp, result ) ((result)=0) -#endif - #endif diff --git a/mesalib/src/mesa/main/matrix.c b/mesalib/src/mesa/main/matrix.c index 76f5ea7cd..28c4e2b49 100644 --- a/mesalib/src/mesa/main/matrix.c +++ b/mesalib/src/mesa/main/matrix.c @@ -179,22 +179,6 @@ _mesa_MatrixMode( GLenum mode ) ASSERT(ctx->Texture.CurrentUnit < Elements(ctx->TextureMatrixStack)); ctx->CurrentStack = &ctx->TextureMatrixStack[ctx->Texture.CurrentUnit]; break; - case GL_MATRIX0_NV: - case GL_MATRIX1_NV: - case GL_MATRIX2_NV: - case GL_MATRIX3_NV: - case GL_MATRIX4_NV: - case GL_MATRIX5_NV: - case GL_MATRIX6_NV: - case GL_MATRIX7_NV: - if (ctx->API == API_OPENGL && ctx->Extensions.NV_vertex_program) { - ctx->CurrentStack = &ctx->ProgramMatrixStack[mode - GL_MATRIX0_NV]; - } - else { - _mesa_error( ctx, GL_INVALID_ENUM, "glMatrixMode(mode)" ); - return; - } - break; case GL_MATRIX0_ARB: case GL_MATRIX1_ARB: case GL_MATRIX2_ARB: @@ -460,7 +444,6 @@ _mesa_Translatef( GLfloat x, GLfloat y, GLfloat z ) } -#if _HAVE_FULL_GL void GLAPIENTRY _mesa_LoadMatrixd( const GLdouble *m ) { @@ -503,10 +486,8 @@ _mesa_Translated( GLdouble x, GLdouble y, GLdouble z ) { _mesa_Translatef((GLfloat) x, (GLfloat) y, (GLfloat) z); } -#endif -#if _HAVE_FULL_GL void GLAPIENTRY _mesa_LoadTransposeMatrixfARB( const GLfloat *m ) { @@ -545,7 +526,6 @@ _mesa_MultTransposeMatrixdARB( const GLdouble *m ) _math_transposefd(tm, m); _mesa_MultMatrixf(tm); } -#endif diff --git a/mesalib/src/mesa/main/mfeatures.h b/mesalib/src/mesa/main/mfeatures.h index 3162a0bbf..829c0563b 100644 --- a/mesalib/src/mesa/main/mfeatures.h +++ b/mesalib/src/mesa/main/mfeatures.h @@ -35,9 +35,6 @@ #define _HAVE_FULL_GL 1 #endif -/* assert that a feature is disabled and should never be used */ -#define ASSERT_NO_FEATURE() ASSERT(0) - #ifndef FEATURE_ES1 #define FEATURE_ES1 0 #endif diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h index b154b9527..c3378cd99 100644 --- a/mesalib/src/mesa/main/mtypes.h +++ b/mesalib/src/mesa/main/mtypes.h @@ -195,8 +195,6 @@ typedef enum #define VERT_BIT_TEX(i) VERT_BIT(VERT_ATTRIB_TEX(i)) #define VERT_BIT_TEX_ALL \ BITFIELD64_RANGE(VERT_ATTRIB_TEX(0), VERT_ATTRIB_TEX_MAX) -#define VERT_BIT_FF_NVALIAS \ - BITFIELD64_RANGE(VERT_ATTRIB_POS, VERT_ATTRIB_TEX(VERT_ATTRIB_TEX_MAX)) #define VERT_BIT_GENERIC_NV(i) VERT_BIT(VERT_ATTRIB_GENERIC_NV(i)) #define VERT_BIT_GENERIC_NV_ALL \ @@ -858,7 +856,6 @@ struct gl_eval_attrib GLboolean Map1TextureCoord4; GLboolean Map1Vertex3; GLboolean Map1Vertex4; - GLboolean Map1Attrib[16]; /* GL_NV_vertex_program */ GLboolean Map2Color4; GLboolean Map2Index; GLboolean Map2Normal; @@ -868,7 +865,6 @@ struct gl_eval_attrib GLboolean Map2TextureCoord4; GLboolean Map2Vertex3; GLboolean Map2Vertex4; - GLboolean Map2Attrib[16]; /* GL_NV_vertex_program */ GLboolean AutoNormal; /*@}*/ @@ -1719,7 +1715,6 @@ struct gl_evaluators struct gl_1d_map Map1Texture2; struct gl_1d_map Map1Texture3; struct gl_1d_map Map1Texture4; - struct gl_1d_map Map1Attrib[16]; /**< GL_NV_vertex_program */ /*@}*/ /** @@ -1735,7 +1730,6 @@ struct gl_evaluators struct gl_2d_map Map2Texture2; struct gl_2d_map Map2Texture3; struct gl_2d_map Map2Texture4; - struct gl_2d_map Map2Attrib[16]; /**< GL_NV_vertex_program */ /*@}*/ }; @@ -1847,7 +1841,7 @@ struct gl_transform_feedback_state * NOTE: first four tokens must fit into 2 bits (see t_vb_arbprogram.c) * All values should fit in a 4-bit field. * - * NOTE: PROGRAM_ENV_PARAM, PROGRAM_STATE_VAR, PROGRAM_NAMED_PARAM, + * NOTE: PROGRAM_ENV_PARAM, PROGRAM_STATE_VAR, * PROGRAM_CONSTANT, and PROGRAM_UNIFORM can all be considered to * be "uniform" variables since they can only be set outside glBegin/End. * They're also all stored in the same Parameters array. @@ -1857,11 +1851,9 @@ typedef enum PROGRAM_TEMPORARY, /**< machine->Temporary[] */ PROGRAM_INPUT, /**< machine->Inputs[] */ PROGRAM_OUTPUT, /**< machine->Outputs[] */ - PROGRAM_VARYING, /**< machine->Inputs[]/Outputs[] */ PROGRAM_LOCAL_PARAM, /**< gl_program->LocalParams[] */ PROGRAM_ENV_PARAM, /**< gl_program->Parameters[] */ PROGRAM_STATE_VAR, /**< gl_program->Parameters[] */ - PROGRAM_NAMED_PARAM, /**< gl_program->Parameters[] */ PROGRAM_CONSTANT, /**< gl_program->Parameters[] */ PROGRAM_UNIFORM, /**< gl_program->Parameters[] */ PROGRAM_WRITE_ONLY, /**< A dummy, write-only register */ @@ -1928,9 +1920,8 @@ struct gl_program GLuint Id; GLubyte *String; /**< Null-terminated program text */ GLint RefCount; - GLenum Target; /**< GL_VERTEX/FRAGMENT_PROGRAM_ARB, GL_FRAGMENT_PROGRAM_NV */ + GLenum Target; /**< GL_VERTEX/FRAGMENT_PROGRAM_ARB */ GLenum Format; /**< String encoding format */ - GLboolean Resident; struct prog_instruction *Instructions; @@ -1986,7 +1977,6 @@ struct gl_program struct gl_vertex_program { struct gl_program Base; /**< base class */ - GLboolean IsNVProgram; /**< is this a GL_NV_vertex_program program? */ GLboolean IsPositionInvariant; GLboolean UsesClipDistance; }; @@ -2060,10 +2050,6 @@ struct gl_vertex_program_state GLfloat Parameters[MAX_PROGRAM_ENV_PARAMS][4]; /**< Env params */ - /* For GL_NV_vertex_program only: */ - GLenum TrackMatrix[MAX_PROGRAM_ENV_PARAMS / 4]; - GLenum TrackMatrixTransform[MAX_PROGRAM_ENV_PARAMS / 4]; - /** Should fixed-function T&L be implemented with a vertex prog? */ GLboolean _MaintainTnlProgram; @@ -2456,7 +2442,6 @@ struct gl_shader_compiler_options { /** Driver-selectable options: */ GLboolean EmitCondCodes; /**< Use condition codes? */ - GLboolean EmitNVTempInitialization; /**< 0-fill NV temp registers */ GLboolean EmitNoLoops; GLboolean EmitNoFunctions; GLboolean EmitNoCont; /**< Emit CONT opcode? */ @@ -3068,7 +3053,6 @@ struct gl_extensions GLboolean NV_blend_square; GLboolean NV_conditional_render; GLboolean NV_fog_distance; - GLboolean NV_fragment_program; GLboolean NV_fragment_program_option; GLboolean NV_light_max_exponent; GLboolean NV_point_sprite; @@ -3078,8 +3062,6 @@ struct gl_extensions GLboolean NV_texgen_reflection; GLboolean NV_texture_env_combine4; GLboolean NV_texture_rectangle; - GLboolean NV_vertex_program; - GLboolean NV_vertex_program1_1; GLboolean SGIS_texture_lod; GLboolean TDFX_texture_compression_FXT1; GLboolean S3_s3tc; diff --git a/mesalib/src/mesa/main/nvprogram.c b/mesalib/src/mesa/main/nvprogram.c deleted file mode 100644 index fc5749afc..000000000 --- a/mesalib/src/mesa/main/nvprogram.c +++ /dev/null @@ -1,917 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/** - * \file nvprogram.c - * NVIDIA vertex/fragment program state management functions. - * \author Brian Paul - */ - -/* - * Regarding GL_NV_fragment/vertex_program, GL_NV_vertex_program1_1, etc: - * - * Portions of this software may use or implement intellectual - * property owned and licensed by NVIDIA Corporation. NVIDIA disclaims - * any and all warranties with respect to such intellectual property, - * including any use thereof or modifications thereto. - */ - -#include "main/glheader.h" -#include "main/context.h" -#include "main/hash.h" -#include "main/imports.h" -#include "main/macros.h" -#include "main/mtypes.h" -#include "main/nvprogram.h" -#include "program/arbprogparse.h" -#include "program/nvfragparse.h" -#include "program/nvvertparse.h" -#include "program/program.h" -#include "program/prog_instruction.h" -#include "program/prog_parameter.h" - - - -/** - * Execute a vertex state program. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params) -{ - struct gl_vertex_program *vprog; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (target != GL_VERTEX_STATE_PROGRAM_NV) { - _mesa_error(ctx, GL_INVALID_ENUM, "glExecuteProgramNV"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - vprog = gl_vertex_program(_mesa_lookup_program(ctx, id)); - - if (!vprog || vprog->Base.Target != GL_VERTEX_STATE_PROGRAM_NV) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glExecuteProgramNV"); - return; - } - - _mesa_problem(ctx, "glExecuteProgramNV() not supported"); -} - - -/** - * Determine if a set of programs is resident in hardware. - * \note Not compiled into display lists. - * \note Called from the GL API dispatcher. - */ -GLboolean GLAPIENTRY -_mesa_AreProgramsResidentNV(GLsizei n, const GLuint *ids, - GLboolean *residences) -{ - GLint i, j; - GLboolean allResident = GL_TRUE; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - - if (n < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glAreProgramsResidentNV(n)"); - return GL_FALSE; - } - - for (i = 0; i < n; i++) { - const struct gl_program *prog; - if (ids[i] == 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glAreProgramsResidentNV"); - return GL_FALSE; - } - prog = _mesa_lookup_program(ctx, ids[i]); - if (!prog) { - _mesa_error(ctx, GL_INVALID_VALUE, "glAreProgramsResidentNV"); - return GL_FALSE; - } - if (prog->Resident) { - if (!allResident) - residences[i] = GL_TRUE; - } - else { - if (allResident) { - allResident = GL_FALSE; - for (j = 0; j < i; j++) - residences[j] = GL_TRUE; - } - residences[i] = GL_FALSE; - } - } - - return allResident; -} - - -/** - * Request that a set of programs be resident in hardware. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_RequestResidentProgramsNV(GLsizei n, const GLuint *ids) -{ - GLint i; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (n < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glRequestResidentProgramsNV(n)"); - return; - } - - /* just error checking for now */ - for (i = 0; i < n; i++) { - struct gl_program *prog; - - if (ids[i] == 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glRequestResidentProgramsNV(id)"); - return; - } - - prog = _mesa_lookup_program(ctx, 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; - } -} - - -/** - * Get a program parameter register. - * \note Not compiled into display lists. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_GetProgramParameterfvNV(GLenum target, GLuint index, - GLenum pname, GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (target == GL_VERTEX_PROGRAM_NV) { - if (pname == GL_PROGRAM_PARAMETER_NV) { - if (index < MAX_NV_VERTEX_PROGRAM_PARAMS) { - COPY_4V(params, ctx->VertexProgram.Parameters[index]); - } - else { - _mesa_error(ctx, GL_INVALID_VALUE, - "glGetProgramParameterfvNV(index)"); - return; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramParameterfvNV(pname)"); - return; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramParameterfvNV(target)"); - return; - } -} - - -/** - * Get a program parameter register. - * \note Not compiled into display lists. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_GetProgramParameterdvNV(GLenum target, GLuint index, - GLenum pname, GLdouble *params) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (target == GL_VERTEX_PROGRAM_NV) { - if (pname == GL_PROGRAM_PARAMETER_NV) { - if (index < MAX_NV_VERTEX_PROGRAM_PARAMS) { - COPY_4V(params, ctx->VertexProgram.Parameters[index]); - } - else { - _mesa_error(ctx, GL_INVALID_VALUE, - "glGetProgramParameterdvNV(index)"); - return; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramParameterdvNV(pname)"); - return; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramParameterdvNV(target)"); - return; - } -} - - -/** - * Get a program attribute. - * \note Not compiled into display lists. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_GetProgramivNV(GLuint id, GLenum pname, GLint *params) -{ - struct gl_program *prog; - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - prog = _mesa_lookup_program(ctx, id); - if (!prog) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetProgramivNV"); - return; - } - - switch (pname) { - case GL_PROGRAM_TARGET_NV: - *params = prog->Target; - return; - case GL_PROGRAM_LENGTH_NV: - *params = prog->String ?(GLint) strlen((char *) prog->String) : 0; - return; - case GL_PROGRAM_RESIDENT_NV: - *params = prog->Resident; - return; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramivNV(pname)"); - return; - } -} - - -/** - * Get the program source code. - * \note Not compiled into display lists. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_GetProgramStringNV(GLuint id, GLenum pname, GLubyte *program) -{ - struct gl_program *prog; - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (pname != GL_PROGRAM_STRING_NV) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramStringNV(pname)"); - return; - } - - prog = _mesa_lookup_program(ctx, id); - if (!prog) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetProgramStringNV"); - return; - } - - if (prog->String) { - memcpy(program, prog->String, strlen((char *) prog->String)); - } - else { - program[0] = 0; - } -} - - -/** - * Get matrix tracking information. - * \note Not compiled into display lists. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_GetTrackMatrixivNV(GLenum target, GLuint address, - GLenum pname, GLint *params) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (target == GL_VERTEX_PROGRAM_NV - && ctx->Extensions.NV_vertex_program) { - GLuint i; - - if ((address & 0x3) || address >= MAX_NV_VERTEX_PROGRAM_PARAMS) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetTrackMatrixivNV(address)"); - return; - } - - i = address / 4; - - switch (pname) { - case GL_TRACK_MATRIX_NV: - params[0] = (GLint) ctx->VertexProgram.TrackMatrix[i]; - return; - case GL_TRACK_MATRIX_TRANSFORM_NV: - params[0] = (GLint) ctx->VertexProgram.TrackMatrixTransform[i]; - return; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTrackMatrixivNV"); - return; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetTrackMatrixivNV"); - return; - } -} - - -/** - * Get a vertex (or vertex array) attribute. - * \note Not compiled into display lists. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_GetVertexAttribdvNV(GLuint index, GLenum pname, GLdouble *params) -{ - const struct gl_client_array *array; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (index >= MAX_NV_VERTEX_PROGRAM_INPUTS) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribdvNV(index)"); - return; - } - - array = &ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(index)]; - - switch (pname) { - case GL_ATTRIB_ARRAY_SIZE_NV: - params[0] = array->Size; - break; - case GL_ATTRIB_ARRAY_STRIDE_NV: - params[0] = array->Stride; - break; - case GL_ATTRIB_ARRAY_TYPE_NV: - params[0] = array->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; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetVertexAttribdvNV"); - return; - } -} - -/** - * Get a vertex (or vertex array) attribute. - * \note Not compiled into display lists. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_GetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat *params) -{ - const struct gl_client_array *array; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (index >= MAX_NV_VERTEX_PROGRAM_INPUTS) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribdvNV(index)"); - return; - } - - array = &ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(index)]; - - switch (pname) { - case GL_ATTRIB_ARRAY_SIZE_NV: - params[0] = (GLfloat) array->Size; - break; - case GL_ATTRIB_ARRAY_STRIDE_NV: - params[0] = (GLfloat) array->Stride; - break; - case GL_ATTRIB_ARRAY_TYPE_NV: - params[0] = (GLfloat) array->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; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetVertexAttribdvNV"); - return; - } -} - -/** - * Get a vertex (or vertex array) attribute. - * \note Not compiled into display lists. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_GetVertexAttribivNV(GLuint index, GLenum pname, GLint *params) -{ - const struct gl_client_array *array; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (index >= MAX_NV_VERTEX_PROGRAM_INPUTS) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribdvNV(index)"); - return; - } - - array = &ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(index)]; - - switch (pname) { - case GL_ATTRIB_ARRAY_SIZE_NV: - params[0] = array->Size; - break; - case GL_ATTRIB_ARRAY_STRIDE_NV: - params[0] = array->Stride; - break; - case GL_ATTRIB_ARRAY_TYPE_NV: - params[0] = array->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]; - params[2] = (GLint) ctx->Current.Attrib[index][2]; - params[3] = (GLint) ctx->Current.Attrib[index][3]; - break; - case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB: - params[0] = array->BufferObj->Name; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetVertexAttribdvNV"); - return; - } -} - - -/** - * Get a vertex array attribute pointer. - * \note Not compiled into display lists. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_GetVertexAttribPointervNV(GLuint index, GLenum pname, GLvoid **pointer) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (index >= MAX_NV_VERTEX_PROGRAM_INPUTS) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribPointerNV(index)"); - return; - } - - if (pname != GL_ATTRIB_ARRAY_POINTER_NV) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetVertexAttribPointerNV(pname)"); - return; - } - - *pointer = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_GENERIC(index)].Ptr; -} - -void -_mesa_emit_nv_temp_initialization(struct gl_context *ctx, - struct gl_program *program) -{ - struct prog_instruction *inst; - GLuint i; - struct gl_shader_compiler_options* options = - &ctx->ShaderCompilerOptions[_mesa_program_target_to_index(program->Target)]; - - if (!options->EmitNVTempInitialization) - return; - - /* We'll swizzle up a zero temporary so we can use it for the - * ARL. - */ - if (program->NumTemporaries == 0) - program->NumTemporaries = 1; - - _mesa_insert_instructions(program, 0, program->NumTemporaries + 1); - - for (i = 0; i < program->NumTemporaries; i++) { - struct prog_instruction *inst = &program->Instructions[i]; - - inst->Opcode = OPCODE_SWZ; - inst->DstReg.File = PROGRAM_TEMPORARY; - inst->DstReg.Index = i; - inst->DstReg.WriteMask = WRITEMASK_XYZW; - inst->SrcReg[0].File = PROGRAM_TEMPORARY; - inst->SrcReg[0].Index = 0; - inst->SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_ZERO, - SWIZZLE_ZERO, - SWIZZLE_ZERO, - SWIZZLE_ZERO); - } - - inst = &program->Instructions[i]; - inst->Opcode = OPCODE_ARL; - inst->DstReg.File = PROGRAM_ADDRESS; - inst->DstReg.Index = 0; - inst->DstReg.WriteMask = WRITEMASK_XYZW; - inst->SrcReg[0].File = PROGRAM_TEMPORARY; - inst->SrcReg[0].Index = 0; - inst->SrcReg[0].Swizzle = SWIZZLE_XXXX; - - if (program->NumAddressRegs == 0) - program->NumAddressRegs = 1; -} - -void -_mesa_setup_nv_temporary_count(struct gl_program *program) -{ - GLuint i; - - program->NumTemporaries = 0; - for (i = 0; i < program->NumInstructions; i++) { - struct prog_instruction *inst = &program->Instructions[i]; - - if (inst->DstReg.File == PROGRAM_TEMPORARY) { - program->NumTemporaries = MAX2(program->NumTemporaries, - inst->DstReg.Index + 1); - } - if (inst->SrcReg[0].File == PROGRAM_TEMPORARY) { - program->NumTemporaries = MAX2((GLint)program->NumTemporaries, - inst->SrcReg[0].Index + 1); - } - if (inst->SrcReg[1].File == PROGRAM_TEMPORARY) { - program->NumTemporaries = MAX2((GLint)program->NumTemporaries, - inst->SrcReg[1].Index + 1); - } - if (inst->SrcReg[2].File == PROGRAM_TEMPORARY) { - program->NumTemporaries = MAX2((GLint)program->NumTemporaries, - inst->SrcReg[2].Index + 1); - } - } -} - -/** - * Load/parse/compile a program. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len, - const GLubyte *program) -{ - struct gl_program *prog; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (!ctx->Extensions.NV_vertex_program - && !ctx->Extensions.NV_fragment_program) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glLoadProgramNV()"); - return; - } - - if (id == 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glLoadProgramNV(id)"); - return; - } - - if (len < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glLoadProgramNV(len)"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - prog = _mesa_lookup_program(ctx, id); - - if (prog && prog->Target != 0 && prog->Target != target) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glLoadProgramNV(target)"); - return; - } - - if ((target == GL_VERTEX_PROGRAM_NV || - target == GL_VERTEX_STATE_PROGRAM_NV) - && ctx->Extensions.NV_vertex_program) { - struct gl_vertex_program *vprog = gl_vertex_program(prog); - if (!vprog || prog == &_mesa_DummyProgram) { - vprog = gl_vertex_program(ctx->Driver.NewProgram(ctx, target, id)); - if (!vprog) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); - return; - } - _mesa_HashInsert(ctx->Shared->Programs, id, vprog); - } - - if (ctx->Extensions.ARB_vertex_program - && (strncmp((char *) program, "!!ARB", 5) == 0)) { - _mesa_parse_arb_vertex_program(ctx, target, program, len, vprog); - } else { - _mesa_parse_nv_vertex_program(ctx, target, program, len, vprog); - } - } - else if (target == GL_FRAGMENT_PROGRAM_NV - && ctx->Extensions.NV_fragment_program) { - struct gl_fragment_program *fprog = gl_fragment_program(prog); - if (!fprog || prog == &_mesa_DummyProgram) { - fprog = gl_fragment_program(ctx->Driver.NewProgram(ctx, target, id)); - if (!fprog) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); - return; - } - _mesa_HashInsert(ctx->Shared->Programs, id, fprog); - } - _mesa_parse_nv_fragment_program(ctx, target, program, len, fprog); - } - else if (target == GL_FRAGMENT_PROGRAM_ARB - && ctx->Extensions.ARB_fragment_program) { - struct gl_fragment_program *fprog = gl_fragment_program(prog); - if (!fprog || prog == &_mesa_DummyProgram) { - fprog = gl_fragment_program(ctx->Driver.NewProgram(ctx, target, id)); - if (!fprog) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); - return; - } - _mesa_HashInsert(ctx->Shared->Programs, id, fprog); - } - _mesa_parse_arb_fragment_program(ctx, target, program, len, fprog); - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glLoadProgramNV(target)"); - } -} - - - -/** - * Set a sequence of program parameter registers. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_ProgramParameters4dvNV(GLenum target, GLuint index, - GLsizei num, const GLdouble *params) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (target == GL_VERTEX_PROGRAM_NV && ctx->Extensions.NV_vertex_program) { - GLint i; - if (index + num > MAX_NV_VERTEX_PROGRAM_PARAMS) { - _mesa_error(ctx, GL_INVALID_VALUE, "glProgramParameters4dvNV"); - return; - } - for (i = 0; i < num; i++) { - ctx->VertexProgram.Parameters[index + i][0] = (GLfloat) params[0]; - ctx->VertexProgram.Parameters[index + i][1] = (GLfloat) params[1]; - ctx->VertexProgram.Parameters[index + i][2] = (GLfloat) params[2]; - ctx->VertexProgram.Parameters[index + i][3] = (GLfloat) params[3]; - params += 4; - }; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glProgramParameters4dvNV"); - return; - } -} - - -/** - * Set a sequence of program parameter registers. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_ProgramParameters4fvNV(GLenum target, GLuint index, - GLsizei num, const GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (target == GL_VERTEX_PROGRAM_NV && ctx->Extensions.NV_vertex_program) { - GLint i; - if (index + num > MAX_NV_VERTEX_PROGRAM_PARAMS) { - _mesa_error(ctx, GL_INVALID_VALUE, "glProgramParameters4fvNV"); - return; - } - for (i = 0; i < num; i++) { - COPY_4V(ctx->VertexProgram.Parameters[index + i], params); - params += 4; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glProgramParameters4fvNV"); - return; - } -} - - - -/** - * Setup tracking of matrices into program parameter registers. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_TrackMatrixNV(GLenum target, GLuint address, - GLenum matrix, GLenum transform) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - - if (target == GL_VERTEX_PROGRAM_NV && ctx->Extensions.NV_vertex_program) { - if (address & 0x3) { - /* addr must be multiple of four */ - _mesa_error(ctx, GL_INVALID_VALUE, "glTrackMatrixNV(address)"); - return; - } - - switch (matrix) { - case GL_NONE: - case GL_MODELVIEW: - case GL_PROJECTION: - case GL_TEXTURE: - case GL_COLOR: - case GL_MODELVIEW_PROJECTION_NV: - case GL_MATRIX0_NV: - case GL_MATRIX1_NV: - case GL_MATRIX2_NV: - case GL_MATRIX3_NV: - case GL_MATRIX4_NV: - case GL_MATRIX5_NV: - case GL_MATRIX6_NV: - case GL_MATRIX7_NV: - /* OK, fallthrough */ - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glTrackMatrixNV(matrix)"); - return; - } - - switch (transform) { - case GL_IDENTITY_NV: - case GL_INVERSE_NV: - case GL_TRANSPOSE_NV: - case GL_INVERSE_TRANSPOSE_NV: - /* OK, fallthrough */ - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glTrackMatrixNV(transform)"); - return; - } - - ctx->VertexProgram.TrackMatrix[address / 4] = matrix; - ctx->VertexProgram.TrackMatrixTransform[address / 4] = transform; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glTrackMatrixNV(target)"); - return; - } -} - - -void GLAPIENTRY -_mesa_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte *name, - GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - struct gl_program *prog; - struct gl_fragment_program *fragProg; - gl_constant_value *v; - - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - FLUSH_VERTICES(ctx, _NEW_PROGRAM_CONSTANTS); - - prog = _mesa_lookup_program(ctx, id); - if (!prog || prog->Target != GL_FRAGMENT_PROGRAM_NV) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glProgramNamedParameterNV"); - return; - } - - if (len <= 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glProgramNamedParameterNV(len)"); - return; - } - - fragProg = gl_fragment_program(prog); - v = _mesa_lookup_parameter_value(fragProg->Base.Parameters, len, - (char *) name); - if (v) { - v[0].f = x; - v[1].f = y; - v[2].f = z; - v[3].f = w; - return; - } - - _mesa_error(ctx, GL_INVALID_VALUE, "glProgramNamedParameterNV(name)"); -} - - -void GLAPIENTRY -_mesa_ProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte *name, - const float v[]) -{ - _mesa_ProgramNamedParameter4fNV(id, len, name, v[0], v[1], v[2], v[3]); -} - - -void GLAPIENTRY -_mesa_ProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte *name, - GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - _mesa_ProgramNamedParameter4fNV(id, len, name, (GLfloat)x, (GLfloat)y, - (GLfloat)z, (GLfloat)w); -} - - -void GLAPIENTRY -_mesa_ProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte *name, - const double v[]) -{ - _mesa_ProgramNamedParameter4fNV(id, len, name, - (GLfloat)v[0], (GLfloat)v[1], - (GLfloat)v[2], (GLfloat)v[3]); -} - - -void GLAPIENTRY -_mesa_GetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte *name, - GLfloat *params) -{ - struct gl_program *prog; - struct gl_fragment_program *fragProg; - const gl_constant_value *v; - - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - prog = _mesa_lookup_program(ctx, id); - if (!prog || prog->Target != GL_FRAGMENT_PROGRAM_NV) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetProgramNamedParameterNV"); - return; - } - - if (len <= 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetProgramNamedParameterNV"); - return; - } - - fragProg = gl_fragment_program(prog); - v = _mesa_lookup_parameter_value(fragProg->Base.Parameters, - len, (char *) name); - if (v) { - params[0] = v[0].f; - params[1] = v[1].f; - params[2] = v[2].f; - params[3] = v[3].f; - return; - } - - _mesa_error(ctx, GL_INVALID_VALUE, "glGetProgramNamedParameterNV"); -} - - -void GLAPIENTRY -_mesa_GetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte *name, - GLdouble *params) -{ - GLfloat floatParams[4]; - _mesa_GetProgramNamedParameterfvNV(id, len, name, floatParams); - COPY_4V(params, floatParams); -} diff --git a/mesalib/src/mesa/main/nvprogram.h b/mesalib/src/mesa/main/nvprogram.h deleted file mode 100644 index fc579a9fe..000000000 --- a/mesalib/src/mesa/main/nvprogram.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 5.1 - * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Authors: - * Brian Paul - */ - - -#ifndef NVPROGRAM_H -#define NVPROGRAM_H - -#include "glheader.h" - -struct gl_context; -struct gl_program; - -extern void GLAPIENTRY -_mesa_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params); - -extern GLboolean GLAPIENTRY -_mesa_AreProgramsResidentNV(GLsizei n, const GLuint *ids, GLboolean *residences); - -extern void GLAPIENTRY -_mesa_RequestResidentProgramsNV(GLsizei n, const GLuint *ids); - -extern void GLAPIENTRY -_mesa_GetProgramParameterfvNV(GLenum target, GLuint index, GLenum pname, GLfloat *params); - -extern void GLAPIENTRY -_mesa_GetProgramParameterdvNV(GLenum target, GLuint index, GLenum pname, GLdouble *params); - -extern void GLAPIENTRY -_mesa_GetProgramivNV(GLuint id, GLenum pname, GLint *params); - -extern void GLAPIENTRY -_mesa_GetProgramStringNV(GLuint id, GLenum pname, GLubyte *program); - -extern void GLAPIENTRY -_mesa_GetTrackMatrixivNV(GLenum target, GLuint address, GLenum pname, GLint *params); - -extern void GLAPIENTRY -_mesa_GetVertexAttribdvNV(GLuint index, GLenum pname, GLdouble *params); - -extern void GLAPIENTRY -_mesa_GetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat *params); - -extern void GLAPIENTRY -_mesa_GetVertexAttribivNV(GLuint index, GLenum pname, GLint *params); - -extern void GLAPIENTRY -_mesa_GetVertexAttribPointervNV(GLuint index, GLenum pname, GLvoid **pointer); - -extern void GLAPIENTRY -_mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len, const GLubyte *program); - -extern void GLAPIENTRY -_mesa_ProgramParameters4dvNV(GLenum target, GLuint index, GLsizei num, - const GLdouble *params); - -extern void GLAPIENTRY -_mesa_ProgramParameters4fvNV(GLenum target, GLuint index, GLsizei num, - const GLfloat *params); - -extern void GLAPIENTRY -_mesa_TrackMatrixNV(GLenum target, GLuint address, GLenum matrix, GLenum transform); - - -extern void GLAPIENTRY -_mesa_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte *name, - GLfloat x, GLfloat y, GLfloat z, GLfloat w); - -extern void GLAPIENTRY -_mesa_ProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte *name, - const float v[]); - -extern void GLAPIENTRY -_mesa_ProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte *name, - GLdouble x, GLdouble y, GLdouble z, GLdouble w); - -extern void GLAPIENTRY -_mesa_ProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte *name, - const double v[]); - -extern void GLAPIENTRY -_mesa_GetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte *name, - GLfloat *params); - -extern void GLAPIENTRY -_mesa_GetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte *name, - GLdouble *params); - -extern void -_mesa_setup_nv_temporary_count(struct gl_program *program); - -extern void -_mesa_emit_nv_temp_initialization(struct gl_context *ctx, - struct gl_program *program); - -#endif diff --git a/mesalib/src/mesa/main/points.c b/mesalib/src/mesa/main/points.c index 538f3cf44..7d6e5a5e1 100644 --- a/mesalib/src/mesa/main/points.c +++ b/mesalib/src/mesa/main/points.c @@ -62,9 +62,6 @@ _mesa_PointSize( GLfloat size ) } -#if _HAVE_FULL_GL - - void GLAPIENTRY _mesa_PointParameteri( GLenum pname, GLint param ) { @@ -221,7 +218,6 @@ _mesa_PointParameterfv( GLenum pname, const GLfloat *params) if (ctx->Driver.PointParameterfv) (*ctx->Driver.PointParameterfv)(ctx, pname, params); } -#endif diff --git a/mesalib/src/mesa/main/polygon.c b/mesalib/src/mesa/main/polygon.c index d7d52daa8..eb53f8a4a 100644 --- a/mesalib/src/mesa/main/polygon.c +++ b/mesalib/src/mesa/main/polygon.c @@ -184,8 +184,6 @@ _mesa_PolygonMode( GLenum face, GLenum mode ) ctx->Driver.PolygonMode(ctx, face, mode); } -#if _HAVE_FULL_GL - /** * This routine updates the ctx->Polygon.Stipple state. @@ -298,7 +296,6 @@ _mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias ) _mesa_PolygonOffset(factor, bias * ctx->DrawBuffer->_DepthMaxF ); } -#endif /**********************************************************************/ diff --git a/mesalib/src/mesa/main/shaderapi.c b/mesalib/src/mesa/main/shaderapi.c index 6ee41f2b6..d40a35376 100644 --- a/mesalib/src/mesa/main/shaderapi.c +++ b/mesalib/src/mesa/main/shaderapi.c @@ -105,6 +105,7 @@ _mesa_init_shader_state(struct gl_context *ctx) memset(&options, 0, sizeof(options)); options.MaxUnrollIterations = 32; + options.MaxIfDepth = UINT_MAX; /* Default pragma settings */ options.DefaultPragmas.Optimize = GL_TRUE; diff --git a/mesalib/src/mesa/main/stencil.c b/mesalib/src/mesa/main/stencil.c index f47b57b8d..8d2948b8e 100644 --- a/mesalib/src/mesa/main/stencil.c +++ b/mesalib/src/mesa/main/stencil.c @@ -382,7 +382,6 @@ _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass) -#if _HAVE_FULL_GL /* GL_EXT_stencil_two_side */ void GLAPIENTRY _mesa_ActiveStencilFaceEXT(GLenum face) @@ -406,7 +405,6 @@ _mesa_ActiveStencilFaceEXT(GLenum face) _mesa_error(ctx, GL_INVALID_ENUM, "glActiveStencilFaceEXT(face)"); } } -#endif diff --git a/mesalib/src/mesa/main/texcompress.c b/mesalib/src/mesa/main/texcompress.c index bb61e6eda..957cc6df6 100644 --- a/mesalib/src/mesa/main/texcompress.c +++ b/mesalib/src/mesa/main/texcompress.c @@ -275,7 +275,6 @@ _mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats) } } -#if FEATURE_ES1 if (ctx->API == API_OPENGLES) { if (formats) { formats[n++] = GL_PALETTE4_RGB8_OES; @@ -293,7 +292,6 @@ _mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats) n += 10; } } -#endif return n; } diff --git a/mesalib/src/mesa/main/texcompress.h b/mesalib/src/mesa/main/texcompress.h index 34f4fae7a..359b9168a 100644 --- a/mesalib/src/mesa/main/texcompress.h +++ b/mesalib/src/mesa/main/texcompress.h @@ -31,8 +31,6 @@ struct gl_context; -#if _HAVE_FULL_GL - extern GLenum _mesa_gl_compressed_format_base_format(GLenum format); @@ -55,13 +53,4 @@ _mesa_decompress_image(gl_format format, GLuint width, GLuint height, const GLubyte *src, GLint srcRowStride, GLfloat *dest); -#else /* _HAVE_FULL_GL */ - -/* no-op macros */ -#define _mesa_get_compressed_formats( c, f ) 0 -#define _mesa_compressed_image_address(c, r, i, f, w, i2 ) 0 -#define _mesa_compress_teximage( c, w, h, sF, s, sRS, dF, d, drs ) ((void)0) - -#endif /* _HAVE_FULL_GL */ - #endif /* TEXCOMPRESS_H */ diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c index 6c8bb85b8..b88931743 100644 --- a/mesalib/src/mesa/main/teximage.c +++ b/mesalib/src/mesa/main/teximage.c @@ -1966,7 +1966,6 @@ compressed_texture_error_check(struct gl_context *ctx, GLint dimensions, } switch (internalFormat) { -#if FEATURE_ES case GL_PALETTE4_RGB8_OES: case GL_PALETTE4_RGBA8_OES: case GL_PALETTE4_R5_G6_B5_OES: @@ -2005,7 +2004,6 @@ compressed_texture_error_check(struct gl_context *ctx, GLint dimensions, */ level = -level; break; -#endif default: /* check level */ diff --git a/mesalib/src/mesa/main/texobj.c b/mesalib/src/mesa/main/texobj.c index 513f3bb05..224d8a825 100644 --- a/mesalib/src/mesa/main/texobj.c +++ b/mesalib/src/mesa/main/texobj.c @@ -769,6 +769,9 @@ _mesa_get_fallback_texture(struct gl_context *ctx, gl_texture_index tex) target = GL_TEXTURE_BUFFER; break; case TEXTURE_EXTERNAL_INDEX: + dims = 2; + target = GL_TEXTURE_EXTERNAL_OES; + break; default: /* no-op */ return NULL; diff --git a/mesalib/src/mesa/main/texstate.c b/mesalib/src/mesa/main/texstate.c index 1fd09e985..0e5ba44ed 100644 --- a/mesalib/src/mesa/main/texstate.c +++ b/mesalib/src/mesa/main/texstate.c @@ -600,6 +600,13 @@ update_texture_state( struct gl_context *ctx ) texTarget = (gl_texture_index) (ffs(enabledTargets) - 1); texObj = _mesa_get_fallback_texture(ctx, texTarget); + + assert(texObj); + if (!texObj) { + /* invalid fallback texture: don't enable the texture unit */ + continue; + } + _mesa_reference_texobj(&texUnit->_Current, texObj); texUnit->_ReallyEnabled = 1 << texTarget; } diff --git a/mesalib/src/mesa/main/varray.c b/mesalib/src/mesa/main/varray.c index 9a2dec61b..522f5a704 100644 --- a/mesalib/src/mesa/main/varray.c +++ b/mesalib/src/mesa/main/varray.c @@ -432,38 +432,6 @@ _mesa_PointSizePointer(GLenum type, GLsizei stride, const GLvoid *ptr) /** - * Set a vertex attribute array. - * Note that these arrays DO alias the conventional GL vertex arrays - * (position, normal, color, fog, texcoord, etc). - * The generic attribute slots at #16 and above are not touched. - */ -void GLAPIENTRY -_mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr) -{ - const GLbitfield legalTypes = (UNSIGNED_BYTE_BIT | SHORT_BIT | - FLOAT_BIT | DOUBLE_BIT); - GLboolean normalized = GL_FALSE; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (index >= MAX_NV_VERTEX_PROGRAM_INPUTS) { - _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribPointerNV(index)"); - return; - } - - if (type == GL_UNSIGNED_BYTE && size != 4) { - _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribPointerNV(size!=4)"); - return; - } - - update_array(ctx, "glVertexAttribPointerNV", VERT_ATTRIB_GENERIC(index), - legalTypes, 1, BGRA_OR_4, - size, type, stride, normalized, GL_FALSE, ptr); -} - - -/** * Set a generic vertex attribute array. * Note that these arrays DO NOT alias the conventional GL vertex arrays * (position, normal, color, fog, texcoord, etc). diff --git a/mesalib/src/mesa/main/varray.h b/mesalib/src/mesa/main/varray.h index d48361256..b54e2f7df 100644 --- a/mesalib/src/mesa/main/varray.h +++ b/mesalib/src/mesa/main/varray.h @@ -65,8 +65,6 @@ _mesa_update_array_max_element(struct gl_client_array *array) } -#if _HAVE_FULL_GL - extern void GLAPIENTRY _mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr); @@ -142,11 +140,6 @@ _mesa_PointSizePointer(GLenum type, GLsizei stride, const GLvoid *ptr); extern void GLAPIENTRY -_mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type, - GLsizei stride, const GLvoid *pointer); - - -extern void GLAPIENTRY _mesa_VertexAttribPointerARB(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); @@ -271,12 +264,4 @@ _mesa_init_varray( struct gl_context * ctx ); extern void _mesa_free_varray_data(struct gl_context *ctx); -#else - -/** No-op */ -#define _mesa_init_varray( c ) ((void)0) -#define _mesa_free_varray_data( c ) ((void)0) - -#endif - #endif diff --git a/mesalib/src/mesa/main/vtxfmt.c b/mesalib/src/mesa/main/vtxfmt.c index aa6cf286a..462cc8849 100644 --- a/mesalib/src/mesa/main/vtxfmt.c +++ b/mesalib/src/mesa/main/vtxfmt.c @@ -135,7 +135,7 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, vfmt->DrawTransformFeedbackStreamInstanced); } - /* GL_NV_vertex_program */ + /* Originally for GL_NV_vertex_program, this is also used by dlist.c */ if (ctx->API == API_OPENGL) { SET_VertexAttrib1fNV(tab, vfmt->VertexAttrib1fNV); SET_VertexAttrib1fvNV(tab, vfmt->VertexAttrib1fvNV); |