#include "mtypes.h"
#include "varray.h"
#include "viewport.h"
-#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
#include "nvprogram.h"
-#endif
#include "shaderapi.h"
#include "uniforms.h"
#include "syncobj.h"
#endif
/* 233. GL_NV_vertex_program */
-#if FEATURE_NV_vertex_program
if (ctx->API == API_OPENGL) {
SET_BindProgramNV(exec, _mesa_BindProgram);
SET_DeleteProgramsNV(exec, _mesa_DeletePrograms);
SET_VertexAttribPointerNV(exec, _mesa_VertexAttribPointerNV);
/* glVertexAttrib*NV functions handled in api_loopback.c */
}
-#endif
SET_GetVertexAttribPointervNV(exec, _mesa_GetVertexAttribPointervNV);
/* 273. GL_APPLE_vertex_array_object */
SET_IsVertexArrayAPPLE(exec, _mesa_IsVertexArrayAPPLE);
/* 282. GL_NV_fragment_program */
-#if FEATURE_NV_fragment_program
if (ctx->API == API_OPENGL) {
SET_ProgramNamedParameter4fNV(exec, _mesa_ProgramNamedParameter4fNV);
SET_ProgramNamedParameter4dNV(exec, _mesa_ProgramNamedParameter4dNV);
SET_GetProgramLocalParameterdvARB(exec, _mesa_GetProgramLocalParameterdvARB);
SET_GetProgramLocalParameterfvARB(exec, _mesa_GetProgramLocalParameterfvARB);
}
-#endif
/* 262. GL_NV_point_sprite */
#if _HAVE_FULL_GL
#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
#include "arbprogram.h"
#endif
-#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
#include "nvprogram.h"
-#endif
#if FEATURE_EXT_transform_feedback
#include "transformfeedback.h"
#endif
free(n[11].data);
n += InstSize[n[0].opcode];
break;
-#if FEATURE_NV_vertex_program
case OPCODE_LOAD_PROGRAM_NV:
free(n[4].data); /* program string */
n += InstSize[n[0].opcode];
free(n[2].data); /* array of program ids */
n += InstSize[n[0].opcode];
break;
-#endif
-#if FEATURE_NV_fragment_program
case OPCODE_PROGRAM_NAMED_PARAMETER_NV:
free(n[3].data); /* parameter name */
n += InstSize[n[0].opcode];
break;
-#endif
#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
case OPCODE_PROGRAM_STRING_ARB:
free(n[4].data); /* program string */
/*
* GL_NV_vertex_program
*/
-#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
static void GLAPIENTRY
save_BindProgramNV(GLenum target, GLuint id)
{
(GLfloat) params[2], (GLfloat) params[3]);
}
-#endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program */
-#if FEATURE_NV_vertex_program
static void GLAPIENTRY
save_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params)
{
CALL_TrackMatrixNV(ctx->Exec, (target, address, matrix, transform));
}
}
-#endif /* FEATURE_NV_vertex_program */
/*
* GL_NV_fragment_program
*/
-#if FEATURE_NV_fragment_program
static void GLAPIENTRY
save_ProgramLocalParameter4fARB(GLenum target, GLuint index,
GLfloat x, GLfloat y, GLfloat z, GLfloat w)
(GLfloat) v[3]);
}
-#endif /* FEATURE_NV_fragment_program */
-
-
/* GL_EXT_stencil_two_side */
static void GLAPIENTRY
case OPCODE_WINDOW_POS_ARB: /* GL_ARB_window_pos */
CALL_WindowPos3fMESA(ctx->Exec, (n[1].f, n[2].f, n[3].f));
break;
-#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
case OPCODE_BIND_PROGRAM_NV: /* GL_NV_vertex_program */
CALL_BindProgramNV(ctx->Exec, (n[1].e, n[2].ui));
break;
-#endif
-#if FEATURE_NV_vertex_program
case OPCODE_EXECUTE_PROGRAM_NV:
{
GLfloat v[4];
case OPCODE_TRACK_MATRIX_NV:
CALL_TrackMatrixNV(ctx->Exec, (n[1].e, n[2].ui, n[3].e, n[4].e));
break;
-#endif
-
-#if FEATURE_NV_fragment_program
case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB:
CALL_ProgramLocalParameter4fARB(ctx->Exec,
(n[1].e, n[2].ui, n[3].f, n[4].f,
data, n[4].f, n[5].f,
n[6].f, n[7].f));
break;
-#endif
-
case OPCODE_ACTIVE_STENCIL_FACE_EXT:
CALL_ActiveStencilFaceEXT(ctx->Exec, (n[1].e));
break;
(n[1].e, n[2].e, n[3].i, n[4].data));
break;
#endif
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program
case OPCODE_PROGRAM_ENV_PARAMETER_ARB:
CALL_ProgramEnvParameter4fARB(ctx->Exec, (n[1].e, n[2].ui, n[3].f,
n[4].f, n[5].f,
n[6].f));
break;
-#endif
case OPCODE_BEGIN_QUERY_ARB:
CALL_BeginQueryARB(ctx->Exec, (n[1].e, n[2].ui));
break;
SET_MultiModeDrawArraysIBM(table, exec_MultiModeDrawArraysIBM);
SET_MultiModeDrawElementsIBM(table, exec_MultiModeDrawElementsIBM);
-#if FEATURE_NV_vertex_program
/* 233. GL_NV_vertex_program */
/* The following commands DO NOT go into display lists:
* AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
SET_ProgramParameters4fvNV(table, save_ProgramParameters4fvNV);
SET_TrackMatrixNV(table, save_TrackMatrixNV);
SET_VertexAttribPointerNV(table, _mesa_VertexAttribPointerNV);
-#endif
/* 244. GL_ATI_envmap_bumpmap */
SET_TexBumpParameterivATI(table, save_TexBumpParameterivATI);
#endif
/* 282. GL_NV_fragment_program */
-#if FEATURE_NV_fragment_program
SET_ProgramNamedParameter4fNV(table, save_ProgramNamedParameter4fNV);
SET_ProgramNamedParameter4dNV(table, save_ProgramNamedParameter4dNV);
SET_ProgramNamedParameter4fvNV(table, save_ProgramNamedParameter4fvNV);
_mesa_GetProgramLocalParameterdvARB);
SET_GetProgramLocalParameterfvARB(table,
_mesa_GetProgramLocalParameterfvARB);
-#endif
/* 262. GL_NV_point_sprite */
SET_PointParameteriNV(table, save_PointParameteriNV);
flag = VERT_BIT_POINT_SIZE;
break;
-#if FEATURE_NV_vertex_program
case GL_VERTEX_ATTRIB_ARRAY0_NV:
case GL_VERTEX_ATTRIB_ARRAY1_NV:
case GL_VERTEX_ATTRIB_ARRAY2_NV:
flag = VERT_BIT_GENERIC(n);
}
break;
-#endif /* FEATURE_NV_vertex_program */
/* GL_NV_primitive_restart */
case GL_PRIMITIVE_RESTART_NV:
ctx->Point.PointSprite = state;
break;
-#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
case GL_VERTEX_PROGRAM_ARB:
if (ctx->API != API_OPENGL)
goto invalid_enum_error;
FLUSH_VERTICES(ctx, _NEW_PROGRAM);
ctx->VertexProgram.TwoSideEnabled = state;
break;
-#endif
-#if FEATURE_NV_vertex_program
+
case GL_MAP1_VERTEX_ATTRIB0_4_NV:
case GL_MAP1_VERTEX_ATTRIB1_4_NV:
case GL_MAP1_VERTEX_ATTRIB2_4_NV:
ctx->Eval.Map2Attrib[map] = state;
}
break;
-#endif /* FEATURE_NV_vertex_program */
-#if FEATURE_NV_fragment_program
case GL_FRAGMENT_PROGRAM_NV:
if (ctx->API != API_OPENGL)
goto invalid_enum_error;
FLUSH_VERTICES(ctx, _NEW_PROGRAM);
ctx->FragmentProgram.Enabled = state;
break;
-#endif /* FEATURE_NV_fragment_program */
/* GL_NV_texture_rectangle */
case GL_TEXTURE_RECTANGLE_NV:
CHECK_EXTENSION2(NV_point_sprite, ARB_point_sprite)
return ctx->Point.PointSprite;
-#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
case GL_VERTEX_PROGRAM_ARB:
if (ctx->API != API_OPENGL)
goto invalid_enum_error;
goto invalid_enum_error;
CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program);
return ctx->VertexProgram.TwoSideEnabled;
-#endif
-#if FEATURE_NV_vertex_program
+
case GL_VERTEX_ATTRIB_ARRAY0_NV:
case GL_VERTEX_ATTRIB_ARRAY1_NV:
case GL_VERTEX_ATTRIB_ARRAY2_NV:
const GLuint map = (GLuint) (cap - GL_MAP2_VERTEX_ATTRIB0_4_NV);
return ctx->Eval.Map2Attrib[map];
}
-#endif /* FEATURE_NV_vertex_program */
-#if FEATURE_NV_fragment_program
case GL_FRAGMENT_PROGRAM_NV:
if (ctx->API != API_OPENGL)
goto invalid_enum_error;
CHECK_EXTENSION(NV_fragment_program);
return ctx->FragmentProgram.Enabled;
-#endif /* FEATURE_NV_fragment_program */
/* GL_NV_texture_rectangle */
case GL_TEXTURE_RECTANGLE_NV:
ctx->Extensions.NV_texture_env_combine4 = GL_TRUE;
ctx->Extensions.NV_texture_rectangle = GL_TRUE;
/*ctx->Extensions.NV_texgen_reflection = GL_TRUE;*/
-#if FEATURE_NV_vertex_program
ctx->Extensions.NV_vertex_program = GL_TRUE;
ctx->Extensions.NV_vertex_program1_1 = GL_TRUE;
-#endif
-#if FEATURE_NV_fragment_program
ctx->Extensions.NV_fragment_program = GL_TRUE;
-#endif
-#if FEATURE_NV_fragment_program && FEATURE_ARB_fragment_program
ctx->Extensions.NV_fragment_program_option = GL_TRUE;
-#endif
#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE;
#endif
if (ctx->API == API_OPENGLES)
break;
return shading_language_version(ctx);
-#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program || \
- FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
case GL_PROGRAM_ERROR_STRING_NV:
if (ctx->API == API_OPENGL &&
(ctx->Extensions.NV_fragment_program ||
return (const GLubyte *) ctx->Program.ErrorString;
}
break;
-#endif
default:
break;
}
#define FEATURE_APPLE_object_purgeable FEATURE_GL
#define FEATURE_ATI_fragment_shader FEATURE_GL
-#define FEATURE_NV_fragment_program FEATURE_GL
-#define FEATURE_NV_vertex_program FEATURE_GL
#endif /* FEATURES_H */
}
-#if FEATURE_NV_vertex_program
/**
* Set a vertex attribute array.
* Note that these arrays DO alias the conventional GL vertex arrays
legalTypes, 1, BGRA_OR_4,
size, type, stride, normalized, GL_FALSE, ptr);
}
-#endif
#if FEATURE_ARB_vertex_program
ctx->Program.ErrorPos = -1;
ctx->Program.ErrorString = _mesa_strdup("");
-#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
ctx->VertexProgram.Enabled = GL_FALSE;
ctx->VertexProgram.PointSizeEnabled =
(ctx->API == API_OPENGLES2) ? GL_TRUE : GL_FALSE;
ctx->VertexProgram.TrackMatrixTransform[i] = GL_IDENTITY_NV;
}
ctx->VertexProgram.Cache = _mesa_new_program_cache();
-#endif
-#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program
ctx->FragmentProgram.Enabled = GL_FALSE;
_mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current,
ctx->Shared->DefaultFragmentProgram);
assert(ctx->FragmentProgram.Current);
ctx->FragmentProgram.Cache = _mesa_new_program_cache();
-#endif
ctx->GeometryProgram.Enabled = GL_FALSE;
/* right now by default we don't have a geometry program */
void
_mesa_free_program_data(struct gl_context *ctx)
{
-#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
_mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current, NULL);
_mesa_delete_program_cache(ctx, ctx->VertexProgram.Cache);
-#endif
-#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program
_mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current, NULL);
_mesa_delete_shader_cache(ctx, ctx->FragmentProgram.Cache);
-#endif
_mesa_reference_geomprog(ctx, &ctx->GeometryProgram.Current, NULL);
_mesa_delete_program_cache(ctx, ctx->GeometryProgram.Cache);
/* XXX probably move this stuff */
void
_mesa_update_default_objects_program(struct gl_context *ctx)
{
-#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
_mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current,
ctx->Shared->DefaultVertexProgram);
assert(ctx->VertexProgram.Current);
-#endif
-#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program
_mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current,
ctx->Shared->DefaultFragmentProgram);
assert(ctx->FragmentProgram.Current);
-#endif
_mesa_reference_geomprog(ctx, &ctx->GeometryProgram.Current,
ctx->Shared->DefaultGeometryProgram);