v2: Rebase on top of get.c changes.
Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
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);
*/
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);
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);
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
*/
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_FRAGMENT_PROGRAM_NV:
{ "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 },
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(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);
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),
[ "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" ],
-
# 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" ],
# 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" ],
struct gl_vertex_program
{
struct gl_program Base; /**< base class */
- GLboolean IsNVProgram; /**< is this a GL_NV_vertex_program program? */
GLboolean IsPositionInvariant;
GLboolean UsesClipDistance;
};
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;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- if (!ctx->Extensions.NV_vertex_program
- && !ctx->Extensions.NV_fragment_program) {
+ if (!ctx->Extensions.NV_fragment_program) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glLoadProgramNV()");
return;
}
const struct gl_vertex_program *vp = gl_vertex_program_const(prog);
struct gl_vertex_program *vpc = gl_vertex_program(clone);
vpc->IsPositionInvariant = vp->IsPositionInvariant;
- vpc->IsNVProgram = vp->IsNVProgram;
}
break;
case GL_FRAGMENT_PROGRAM_ARB:
memcpy(machine->VertAttribs, ctx->Current.Attrib,
MAX_VERTEX_GENERIC_ATTRIBS * 4 * sizeof(GLfloat));
- if (ctx->VertexProgram._Current->IsNVProgram) {
- GLuint i;
- /* Output/result regs are initialized to [0,0,0,1] */
- for (i = 0; i < MAX_NV_VERTEX_PROGRAM_OUTPUTS; i++) {
- ASSIGN_4V(machine->Outputs[i], 0.0F, 0.0F, 0.0F, 1.0F);
- }
- /* Temp regs are initialized to [0,0,0,0] */
- for (i = 0; i < MAX_NV_VERTEX_PROGRAM_TEMPS; i++) {
- ASSIGN_4V(machine->Temporaries[i], 0.0F, 0.0F, 0.0F, 0.0F);
- }
- for (i = 0; i < MAX_VERTEX_PROGRAM_ADDRESS_REGS; i++) {
- ASSIGN_4V(machine->AddressReg[i], 0, 0, 0, 0);
- }
- }
-
machine->NumDeriv = 0;
/* init condition codes */
unmap_textures(ctx, program);
- /* Fixup fog and point size results if needed */
- if (program->IsNVProgram) {
- if (ctx->Fog.Enabled &&
- (program->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_FOGC)) == 0) {
- for (i = 0; i < VB->Count; i++) {
- store->results[VERT_RESULT_FOGC].data[i][0] = 1.0;
- }
- }
-
- if (ctx->VertexProgram.PointSizeEnabled &&
- (program->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_PSIZ)) == 0) {
- for (i = 0; i < VB->Count; i++) {
- store->results[VERT_RESULT_PSIZ].data[i][0] = ctx->Point.Size;
- }
- }
- }
-
if (program->IsPositionInvariant) {
/* We need the exact same transform as in the fixed function path here
* to guarantee invariance, depending on compiler optimization flags