From: Roland Scheidegger Date: Fri, 3 Mar 2006 15:03:04 +0000 (+0000) Subject: Use standard ARB names instead of vendor-specific NV names for the ARB/NV_vertex_prog... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e1e03b32ab651e992f7b979eba046fdc84fedf2e;p=mesa.git Use standard ARB names instead of vendor-specific NV names for the ARB/NV_vertex_program enums in common state handling code, and update comments accordingly. Change some slightly confusing code which gave the impression GL_VERTEX_PROGRAM_ARB and GL_VERTEX_PROGRAM_NV enums were different. --- diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 41119f7937d..2eef7294691 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -533,16 +533,16 @@ pop_enable_group(GLcontext *ctx, const struct gl_enable_attrib *enable) TEST_AND_UPDATE(ctx->Multisample.SampleCoverageInvert, enable->SampleCoverageInvert, GL_SAMPLE_COVERAGE_INVERT_ARB); - /* GL_NV_vertex_program */ + /* GL_ARB_vertex_program, GL_NV_vertex_program */ TEST_AND_UPDATE(ctx->VertexProgram.Enabled, enable->VertexProgram, - GL_VERTEX_PROGRAM_NV); + GL_VERTEX_PROGRAM_ARB); TEST_AND_UPDATE(ctx->VertexProgram.PointSizeEnabled, enable->VertexProgramPointSize, - GL_VERTEX_PROGRAM_POINT_SIZE_NV); + GL_VERTEX_PROGRAM_POINT_SIZE_ARB); TEST_AND_UPDATE(ctx->VertexProgram.TwoSideEnabled, enable->VertexProgramTwoSide, - GL_VERTEX_PROGRAM_TWO_SIDE_NV); + GL_VERTEX_PROGRAM_TWO_SIDE_ARB); #undef TEST_AND_UPDATE diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 26cf9ec654f..af54fea30bb 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -822,22 +822,22 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) break; #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program - case GL_VERTEX_PROGRAM_NV: - CHECK_EXTENSION2(NV_vertex_program, ARB_vertex_program, cap); + case GL_VERTEX_PROGRAM_ARB: + CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap); if (ctx->VertexProgram.Enabled == state) return; FLUSH_VERTICES(ctx, _NEW_PROGRAM); ctx->VertexProgram.Enabled = state; break; - case GL_VERTEX_PROGRAM_POINT_SIZE_NV: - CHECK_EXTENSION2(NV_vertex_program, ARB_vertex_program, cap); + case GL_VERTEX_PROGRAM_POINT_SIZE_ARB: + CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap); if (ctx->VertexProgram.PointSizeEnabled == state) return; FLUSH_VERTICES(ctx, _NEW_PROGRAM); ctx->VertexProgram.PointSizeEnabled = state; break; - case GL_VERTEX_PROGRAM_TWO_SIDE_NV: - CHECK_EXTENSION2(NV_vertex_program, ARB_vertex_program, cap); + case GL_VERTEX_PROGRAM_TWO_SIDE_ARB: + CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap); if (ctx->VertexProgram.TwoSideEnabled == state) return; FLUSH_VERTICES(ctx, _NEW_PROGRAM); diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index e86310f189d..89eccf36b44 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -1404,60 +1404,10 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) CHECK_EXT1(SGIS_generate_mipmap, "GetBooleanv"); params[0] = ENUM_TO_BOOLEAN(ctx->Hint.GenerateMipmap); break; - case GL_VERTEX_PROGRAM_NV: - CHECK_EXT2(NV_vertex_program, ARB_vertex_program, "GetBooleanv"); - params[0] = ctx->VertexProgram.Enabled; - break; - case GL_VERTEX_PROGRAM_POINT_SIZE_NV: - CHECK_EXT2(NV_vertex_program, ARB_vertex_program, "GetBooleanv"); - params[0] = ctx->VertexProgram.PointSizeEnabled; - break; - case GL_VERTEX_PROGRAM_TWO_SIDE_NV: - CHECK_EXT2(NV_vertex_program, ARB_vertex_program, "GetBooleanv"); - params[0] = ctx->VertexProgram.TwoSideEnabled; - break; - case GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV: - CHECK_EXT3(NV_vertex_program, ARB_vertex_program, ARB_fragment_program, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.MaxProgramMatrixStackDepth); - break; - case GL_MAX_TRACK_MATRICES_NV: - CHECK_EXT3(NV_vertex_program, ARB_vertex_program, ARB_fragment_program, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.MaxProgramMatrices); - break; - case GL_CURRENT_MATRIX_STACK_DEPTH_NV: - CHECK_EXT3(NV_vertex_program, ARB_vertex_program, ARB_fragment_program, "GetBooleanv"); - params[0] = ctx->CurrentStack->Depth + 1; - break; - case GL_CURRENT_MATRIX_NV: - CHECK_EXT3(NV_vertex_program, ARB_vertex_program, ARB_fragment_program, "GetBooleanv"); - { - const GLfloat *matrix = ctx->CurrentStack->Top->m; - params[0] = FLOAT_TO_BOOLEAN(matrix[0]); - params[1] = FLOAT_TO_BOOLEAN(matrix[1]); - params[2] = FLOAT_TO_BOOLEAN(matrix[2]); - params[3] = FLOAT_TO_BOOLEAN(matrix[3]); - params[4] = FLOAT_TO_BOOLEAN(matrix[4]); - params[5] = FLOAT_TO_BOOLEAN(matrix[5]); - params[6] = FLOAT_TO_BOOLEAN(matrix[6]); - params[7] = FLOAT_TO_BOOLEAN(matrix[7]); - params[8] = FLOAT_TO_BOOLEAN(matrix[8]); - params[9] = FLOAT_TO_BOOLEAN(matrix[9]); - params[10] = FLOAT_TO_BOOLEAN(matrix[10]); - params[11] = FLOAT_TO_BOOLEAN(matrix[11]); - params[12] = FLOAT_TO_BOOLEAN(matrix[12]); - params[13] = FLOAT_TO_BOOLEAN(matrix[13]); - params[14] = FLOAT_TO_BOOLEAN(matrix[14]); - params[15] = FLOAT_TO_BOOLEAN(matrix[15]); - } - break; case GL_VERTEX_PROGRAM_BINDING_NV: CHECK_EXT1(NV_vertex_program, "GetBooleanv"); params[0] = INT_TO_BOOLEAN((ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0)); break; - case GL_PROGRAM_ERROR_POSITION_NV: - CHECK_EXT4(NV_vertex_program, ARB_vertex_program, NV_fragment_program, ARB_fragment_program, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Program.ErrorPos); - break; case GL_VERTEX_ATTRIB_ARRAY0_NV: CHECK_EXT1(NV_vertex_program, "GetBooleanv"); params[0] = ctx->Array.VertexAttrib[0].Enabled; @@ -1590,14 +1540,6 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) CHECK_EXT1(NV_fragment_program, "GetBooleanv"); params[0] = ctx->FragmentProgram.Enabled; break; - case GL_MAX_TEXTURE_COORDS_NV: - CHECK_EXT2(NV_fragment_program, ARB_fragment_program, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.MaxTextureCoordUnits); - break; - case GL_MAX_TEXTURE_IMAGE_UNITS_NV: - CHECK_EXT2(NV_fragment_program, ARB_fragment_program, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.MaxTextureImageUnits); - break; case GL_FRAGMENT_PROGRAM_BINDING_NV: CHECK_EXT1(NV_fragment_program, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0); @@ -1682,9 +1624,51 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) CHECK_EXT1(EXT_pixel_buffer_object, "GetBooleanv"); params[0] = INT_TO_BOOLEAN(ctx->Unpack.BufferObj->Name); break; - case GL_MAX_VERTEX_ATTRIBS_ARB: - CHECK_EXT1(ARB_vertex_program, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.VertexProgram.MaxAttribs); + case GL_VERTEX_PROGRAM_ARB: + CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetBooleanv"); + params[0] = ctx->VertexProgram.Enabled; + break; + case GL_VERTEX_PROGRAM_POINT_SIZE_ARB: + CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetBooleanv"); + params[0] = ctx->VertexProgram.PointSizeEnabled; + break; + case GL_VERTEX_PROGRAM_TWO_SIDE_ARB: + CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetBooleanv"); + params[0] = ctx->VertexProgram.TwoSideEnabled; + break; + case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB: + CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Const.MaxProgramMatrixStackDepth); + break; + case GL_MAX_PROGRAM_MATRICES_ARB: + CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Const.MaxProgramMatrices); + break; + case GL_CURRENT_MATRIX_STACK_DEPTH_ARB: + CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetBooleanv"); + params[0] = ctx->CurrentStack->Depth + 1; + break; + case GL_CURRENT_MATRIX_ARB: + CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_fragment_program, "GetBooleanv"); + { + const GLfloat *matrix = ctx->CurrentStack->Top->m; + params[0] = FLOAT_TO_BOOLEAN(matrix[0]); + params[1] = FLOAT_TO_BOOLEAN(matrix[1]); + params[2] = FLOAT_TO_BOOLEAN(matrix[2]); + params[3] = FLOAT_TO_BOOLEAN(matrix[3]); + params[4] = FLOAT_TO_BOOLEAN(matrix[4]); + params[5] = FLOAT_TO_BOOLEAN(matrix[5]); + params[6] = FLOAT_TO_BOOLEAN(matrix[6]); + params[7] = FLOAT_TO_BOOLEAN(matrix[7]); + params[8] = FLOAT_TO_BOOLEAN(matrix[8]); + params[9] = FLOAT_TO_BOOLEAN(matrix[9]); + params[10] = FLOAT_TO_BOOLEAN(matrix[10]); + params[11] = FLOAT_TO_BOOLEAN(matrix[11]); + params[12] = FLOAT_TO_BOOLEAN(matrix[12]); + params[13] = FLOAT_TO_BOOLEAN(matrix[13]); + params[14] = FLOAT_TO_BOOLEAN(matrix[14]); + params[15] = FLOAT_TO_BOOLEAN(matrix[15]); + } break; case GL_TRANSPOSE_CURRENT_MATRIX_ARB: CHECK_EXT2(ARB_vertex_program, ARB_fragment_program, "GetBooleanv"); @@ -1708,10 +1692,26 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[15] = FLOAT_TO_BOOLEAN(matrix[15]); } break; + case GL_MAX_VERTEX_ATTRIBS_ARB: + CHECK_EXT1(ARB_vertex_program, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Const.VertexProgram.MaxAttribs); + break; + case GL_PROGRAM_ERROR_POSITION_ARB: + CHECK_EXT4(NV_vertex_program, ARB_vertex_program, NV_fragment_program, ARB_fragment_program, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Program.ErrorPos); + break; case GL_FRAGMENT_PROGRAM_ARB: CHECK_EXT1(ARB_fragment_program, "GetBooleanv"); params[0] = ctx->FragmentProgram.Enabled; break; + case GL_MAX_TEXTURE_COORDS_ARB: + CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Const.MaxTextureCoordUnits); + break; + case GL_MAX_TEXTURE_IMAGE_UNITS_ARB: + CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetBooleanv"); + params[0] = INT_TO_BOOLEAN(ctx->Const.MaxTextureImageUnits); + break; case GL_DEPTH_BOUNDS_TEST_EXT: CHECK_EXT1(EXT_depth_bounds_test, "GetBooleanv"); params[0] = ctx->Depth.BoundsTest; @@ -3222,60 +3222,10 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) CHECK_EXT1(SGIS_generate_mipmap, "GetFloatv"); params[0] = ENUM_TO_FLOAT(ctx->Hint.GenerateMipmap); break; - case GL_VERTEX_PROGRAM_NV: - CHECK_EXT2(NV_vertex_program, ARB_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->VertexProgram.Enabled); - break; - case GL_VERTEX_PROGRAM_POINT_SIZE_NV: - CHECK_EXT2(NV_vertex_program, ARB_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->VertexProgram.PointSizeEnabled); - break; - case GL_VERTEX_PROGRAM_TWO_SIDE_NV: - CHECK_EXT2(NV_vertex_program, ARB_vertex_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->VertexProgram.TwoSideEnabled); - break; - case GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV: - CHECK_EXT3(NV_vertex_program, ARB_vertex_program, ARB_fragment_program, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.MaxProgramMatrixStackDepth); - break; - case GL_MAX_TRACK_MATRICES_NV: - CHECK_EXT3(NV_vertex_program, ARB_vertex_program, ARB_fragment_program, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.MaxProgramMatrices); - break; - case GL_CURRENT_MATRIX_STACK_DEPTH_NV: - CHECK_EXT3(NV_vertex_program, ARB_vertex_program, ARB_fragment_program, "GetFloatv"); - params[0] = BOOLEAN_TO_FLOAT(ctx->CurrentStack->Depth + 1); - break; - case GL_CURRENT_MATRIX_NV: - CHECK_EXT3(NV_vertex_program, ARB_vertex_program, ARB_fragment_program, "GetFloatv"); - { - const GLfloat *matrix = ctx->CurrentStack->Top->m; - params[0] = matrix[0]; - params[1] = matrix[1]; - params[2] = matrix[2]; - params[3] = matrix[3]; - params[4] = matrix[4]; - params[5] = matrix[5]; - params[6] = matrix[6]; - params[7] = matrix[7]; - params[8] = matrix[8]; - params[9] = matrix[9]; - params[10] = matrix[10]; - params[11] = matrix[11]; - params[12] = matrix[12]; - params[13] = matrix[13]; - params[14] = matrix[14]; - params[15] = matrix[15]; - } - break; case GL_VERTEX_PROGRAM_BINDING_NV: CHECK_EXT1(NV_vertex_program, "GetFloatv"); params[0] = (GLfloat)((ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0)); break; - case GL_PROGRAM_ERROR_POSITION_NV: - CHECK_EXT4(NV_vertex_program, ARB_vertex_program, NV_fragment_program, ARB_fragment_program, "GetFloatv"); - params[0] = (GLfloat)(ctx->Program.ErrorPos); - break; case GL_VERTEX_ATTRIB_ARRAY0_NV: CHECK_EXT1(NV_vertex_program, "GetFloatv"); params[0] = BOOLEAN_TO_FLOAT(ctx->Array.VertexAttrib[0].Enabled); @@ -3408,14 +3358,6 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) CHECK_EXT1(NV_fragment_program, "GetFloatv"); params[0] = BOOLEAN_TO_FLOAT(ctx->FragmentProgram.Enabled); break; - case GL_MAX_TEXTURE_COORDS_NV: - CHECK_EXT2(NV_fragment_program, ARB_fragment_program, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.MaxTextureCoordUnits); - break; - case GL_MAX_TEXTURE_IMAGE_UNITS_NV: - CHECK_EXT2(NV_fragment_program, ARB_fragment_program, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.MaxTextureImageUnits); - break; case GL_FRAGMENT_PROGRAM_BINDING_NV: CHECK_EXT1(NV_fragment_program, "GetFloatv"); params[0] = (GLfloat)(ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0); @@ -3500,9 +3442,51 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) CHECK_EXT1(EXT_pixel_buffer_object, "GetFloatv"); params[0] = (GLfloat)(ctx->Unpack.BufferObj->Name); break; - case GL_MAX_VERTEX_ATTRIBS_ARB: - CHECK_EXT1(ARB_vertex_program, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.VertexProgram.MaxAttribs); + case GL_VERTEX_PROGRAM_ARB: + CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->VertexProgram.Enabled); + break; + case GL_VERTEX_PROGRAM_POINT_SIZE_ARB: + CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->VertexProgram.PointSizeEnabled); + break; + case GL_VERTEX_PROGRAM_TWO_SIDE_ARB: + CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->VertexProgram.TwoSideEnabled); + break; + case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB: + CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetFloatv"); + params[0] = (GLfloat)(ctx->Const.MaxProgramMatrixStackDepth); + break; + case GL_MAX_PROGRAM_MATRICES_ARB: + CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetFloatv"); + params[0] = (GLfloat)(ctx->Const.MaxProgramMatrices); + break; + case GL_CURRENT_MATRIX_STACK_DEPTH_ARB: + CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetFloatv"); + params[0] = BOOLEAN_TO_FLOAT(ctx->CurrentStack->Depth + 1); + break; + case GL_CURRENT_MATRIX_ARB: + CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_fragment_program, "GetFloatv"); + { + const GLfloat *matrix = ctx->CurrentStack->Top->m; + params[0] = matrix[0]; + params[1] = matrix[1]; + params[2] = matrix[2]; + params[3] = matrix[3]; + params[4] = matrix[4]; + params[5] = matrix[5]; + params[6] = matrix[6]; + params[7] = matrix[7]; + params[8] = matrix[8]; + params[9] = matrix[9]; + params[10] = matrix[10]; + params[11] = matrix[11]; + params[12] = matrix[12]; + params[13] = matrix[13]; + params[14] = matrix[14]; + params[15] = matrix[15]; + } break; case GL_TRANSPOSE_CURRENT_MATRIX_ARB: CHECK_EXT2(ARB_vertex_program, ARB_fragment_program, "GetFloatv"); @@ -3526,10 +3510,26 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[15] = matrix[15]; } break; + case GL_MAX_VERTEX_ATTRIBS_ARB: + CHECK_EXT1(ARB_vertex_program, "GetFloatv"); + params[0] = (GLfloat)(ctx->Const.VertexProgram.MaxAttribs); + break; + case GL_PROGRAM_ERROR_POSITION_ARB: + CHECK_EXT4(NV_vertex_program, ARB_vertex_program, NV_fragment_program, ARB_fragment_program, "GetFloatv"); + params[0] = (GLfloat)(ctx->Program.ErrorPos); + break; case GL_FRAGMENT_PROGRAM_ARB: CHECK_EXT1(ARB_fragment_program, "GetFloatv"); params[0] = BOOLEAN_TO_FLOAT(ctx->FragmentProgram.Enabled); break; + case GL_MAX_TEXTURE_COORDS_ARB: + CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetFloatv"); + params[0] = (GLfloat)(ctx->Const.MaxTextureCoordUnits); + break; + case GL_MAX_TEXTURE_IMAGE_UNITS_ARB: + CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetFloatv"); + params[0] = (GLfloat)(ctx->Const.MaxTextureImageUnits); + break; case GL_DEPTH_BOUNDS_TEST_EXT: CHECK_EXT1(EXT_depth_bounds_test, "GetFloatv"); params[0] = BOOLEAN_TO_FLOAT(ctx->Depth.BoundsTest); @@ -5040,60 +5040,10 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) CHECK_EXT1(SGIS_generate_mipmap, "GetIntegerv"); params[0] = ENUM_TO_INT(ctx->Hint.GenerateMipmap); break; - case GL_VERTEX_PROGRAM_NV: - CHECK_EXT2(NV_vertex_program, ARB_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->VertexProgram.Enabled); - break; - case GL_VERTEX_PROGRAM_POINT_SIZE_NV: - CHECK_EXT2(NV_vertex_program, ARB_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->VertexProgram.PointSizeEnabled); - break; - case GL_VERTEX_PROGRAM_TWO_SIDE_NV: - CHECK_EXT2(NV_vertex_program, ARB_vertex_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->VertexProgram.TwoSideEnabled); - break; - case GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV: - CHECK_EXT3(NV_vertex_program, ARB_vertex_program, ARB_fragment_program, "GetIntegerv"); - params[0] = ctx->Const.MaxProgramMatrixStackDepth; - break; - case GL_MAX_TRACK_MATRICES_NV: - CHECK_EXT3(NV_vertex_program, ARB_vertex_program, ARB_fragment_program, "GetIntegerv"); - params[0] = ctx->Const.MaxProgramMatrices; - break; - case GL_CURRENT_MATRIX_STACK_DEPTH_NV: - CHECK_EXT3(NV_vertex_program, ARB_vertex_program, ARB_fragment_program, "GetIntegerv"); - params[0] = BOOLEAN_TO_INT(ctx->CurrentStack->Depth + 1); - break; - case GL_CURRENT_MATRIX_NV: - CHECK_EXT3(NV_vertex_program, ARB_vertex_program, ARB_fragment_program, "GetIntegerv"); - { - const GLfloat *matrix = ctx->CurrentStack->Top->m; - params[0] = IROUND(matrix[0]); - params[1] = IROUND(matrix[1]); - params[2] = IROUND(matrix[2]); - params[3] = IROUND(matrix[3]); - params[4] = IROUND(matrix[4]); - params[5] = IROUND(matrix[5]); - params[6] = IROUND(matrix[6]); - params[7] = IROUND(matrix[7]); - params[8] = IROUND(matrix[8]); - params[9] = IROUND(matrix[9]); - params[10] = IROUND(matrix[10]); - params[11] = IROUND(matrix[11]); - params[12] = IROUND(matrix[12]); - params[13] = IROUND(matrix[13]); - params[14] = IROUND(matrix[14]); - params[15] = IROUND(matrix[15]); - } - break; case GL_VERTEX_PROGRAM_BINDING_NV: CHECK_EXT1(NV_vertex_program, "GetIntegerv"); params[0] = (ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0); break; - case GL_PROGRAM_ERROR_POSITION_NV: - CHECK_EXT4(NV_vertex_program, ARB_vertex_program, NV_fragment_program, ARB_fragment_program, "GetIntegerv"); - params[0] = ctx->Program.ErrorPos; - break; case GL_VERTEX_ATTRIB_ARRAY0_NV: CHECK_EXT1(NV_vertex_program, "GetIntegerv"); params[0] = BOOLEAN_TO_INT(ctx->Array.VertexAttrib[0].Enabled); @@ -5226,14 +5176,6 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) CHECK_EXT1(NV_fragment_program, "GetIntegerv"); params[0] = BOOLEAN_TO_INT(ctx->FragmentProgram.Enabled); break; - case GL_MAX_TEXTURE_COORDS_NV: - CHECK_EXT2(NV_fragment_program, ARB_fragment_program, "GetIntegerv"); - params[0] = ctx->Const.MaxTextureCoordUnits; - break; - case GL_MAX_TEXTURE_IMAGE_UNITS_NV: - CHECK_EXT2(NV_fragment_program, ARB_fragment_program, "GetIntegerv"); - params[0] = ctx->Const.MaxTextureImageUnits; - break; case GL_FRAGMENT_PROGRAM_BINDING_NV: CHECK_EXT1(NV_fragment_program, "GetIntegerv"); params[0] = ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0; @@ -5318,9 +5260,51 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) CHECK_EXT1(EXT_pixel_buffer_object, "GetIntegerv"); params[0] = ctx->Unpack.BufferObj->Name; break; - case GL_MAX_VERTEX_ATTRIBS_ARB: - CHECK_EXT1(ARB_vertex_program, "GetIntegerv"); - params[0] = ctx->Const.VertexProgram.MaxAttribs; + case GL_VERTEX_PROGRAM_ARB: + CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->VertexProgram.Enabled); + break; + case GL_VERTEX_PROGRAM_POINT_SIZE_ARB: + CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->VertexProgram.PointSizeEnabled); + break; + case GL_VERTEX_PROGRAM_TWO_SIDE_ARB: + CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->VertexProgram.TwoSideEnabled); + break; + case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB: + CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetIntegerv"); + params[0] = ctx->Const.MaxProgramMatrixStackDepth; + break; + case GL_MAX_PROGRAM_MATRICES_ARB: + CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetIntegerv"); + params[0] = ctx->Const.MaxProgramMatrices; + break; + case GL_CURRENT_MATRIX_STACK_DEPTH_ARB: + CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetIntegerv"); + params[0] = BOOLEAN_TO_INT(ctx->CurrentStack->Depth + 1); + break; + case GL_CURRENT_MATRIX_ARB: + CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_fragment_program, "GetIntegerv"); + { + const GLfloat *matrix = ctx->CurrentStack->Top->m; + params[0] = IROUND(matrix[0]); + params[1] = IROUND(matrix[1]); + params[2] = IROUND(matrix[2]); + params[3] = IROUND(matrix[3]); + params[4] = IROUND(matrix[4]); + params[5] = IROUND(matrix[5]); + params[6] = IROUND(matrix[6]); + params[7] = IROUND(matrix[7]); + params[8] = IROUND(matrix[8]); + params[9] = IROUND(matrix[9]); + params[10] = IROUND(matrix[10]); + params[11] = IROUND(matrix[11]); + params[12] = IROUND(matrix[12]); + params[13] = IROUND(matrix[13]); + params[14] = IROUND(matrix[14]); + params[15] = IROUND(matrix[15]); + } break; case GL_TRANSPOSE_CURRENT_MATRIX_ARB: CHECK_EXT2(ARB_vertex_program, ARB_fragment_program, "GetIntegerv"); @@ -5344,10 +5328,26 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[15] = IROUND(matrix[15]); } break; + case GL_MAX_VERTEX_ATTRIBS_ARB: + CHECK_EXT1(ARB_vertex_program, "GetIntegerv"); + params[0] = ctx->Const.VertexProgram.MaxAttribs; + break; + case GL_PROGRAM_ERROR_POSITION_ARB: + CHECK_EXT4(NV_vertex_program, ARB_vertex_program, NV_fragment_program, ARB_fragment_program, "GetIntegerv"); + params[0] = ctx->Program.ErrorPos; + break; case GL_FRAGMENT_PROGRAM_ARB: CHECK_EXT1(ARB_fragment_program, "GetIntegerv"); params[0] = BOOLEAN_TO_INT(ctx->FragmentProgram.Enabled); break; + case GL_MAX_TEXTURE_COORDS_ARB: + CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetIntegerv"); + params[0] = ctx->Const.MaxTextureCoordUnits; + break; + case GL_MAX_TEXTURE_IMAGE_UNITS_ARB: + CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetIntegerv"); + params[0] = ctx->Const.MaxTextureImageUnits; + break; case GL_DEPTH_BOUNDS_TEST_EXT: CHECK_EXT1(EXT_depth_bounds_test, "GetIntegerv"); params[0] = BOOLEAN_TO_INT(ctx->Depth.BoundsTest); diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index 7bdb20a8abf..9676a35872c 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -704,37 +704,9 @@ StateVars = [ "", ["SGIS_generate_mipmap"] ), # GL_NV_vertex_program - ( "GL_VERTEX_PROGRAM_NV", GLboolean, - ["ctx->VertexProgram.Enabled"], "", - ["NV_vertex_program", "ARB_vertex_program"] ), - ( "GL_VERTEX_PROGRAM_POINT_SIZE_NV", GLboolean, - ["ctx->VertexProgram.PointSizeEnabled"], "", - ["NV_vertex_program", "ARB_vertex_program"] ), - ( "GL_VERTEX_PROGRAM_TWO_SIDE_NV", GLboolean, - ["ctx->VertexProgram.TwoSideEnabled"], "", - ["NV_vertex_program", "ARB_vertex_program"] ), - ( "GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV", GLint, - ["ctx->Const.MaxProgramMatrixStackDepth"], "", - ["NV_vertex_program", "ARB_vertex_program", "ARB_fragment_program"] ), - ( "GL_MAX_TRACK_MATRICES_NV", GLint, - ["ctx->Const.MaxProgramMatrices"], "", - ["NV_vertex_program", "ARB_vertex_program", "ARB_fragment_program"] ), - ( "GL_CURRENT_MATRIX_STACK_DEPTH_NV", GLboolean, - ["ctx->CurrentStack->Depth + 1"], "", - ["NV_vertex_program", "ARB_vertex_program", "ARB_fragment_program"] ), - ( "GL_CURRENT_MATRIX_NV", GLfloat, - ["matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]", - "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]", - "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]", - "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ], - "const GLfloat *matrix = ctx->CurrentStack->Top->m;", - ["NV_vertex_program", "ARB_vertex_program", "ARB_fragment_program"] ), ( "GL_VERTEX_PROGRAM_BINDING_NV", GLint, ["(ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0)"], "", ["NV_vertex_program"] ), - ( "GL_PROGRAM_ERROR_POSITION_NV", GLint, - ["ctx->Program.ErrorPos"], "", ["NV_vertex_program", - "ARB_vertex_program", "NV_fragment_program", "ARB_fragment_program"] ), ( "GL_VERTEX_ATTRIB_ARRAY0_NV", GLboolean, ["ctx->Array.VertexAttrib[0].Enabled"], "", ["NV_vertex_program"] ), ( "GL_VERTEX_ATTRIB_ARRAY1_NV", GLboolean, @@ -803,12 +775,6 @@ StateVars = [ # GL_NV_fragment_program ( "GL_FRAGMENT_PROGRAM_NV", GLboolean, ["ctx->FragmentProgram.Enabled"], "", ["NV_fragment_program"] ), - ( "GL_MAX_TEXTURE_COORDS_NV", GLint, - ["ctx->Const.MaxTextureCoordUnits"], "", - ["NV_fragment_program", "ARB_fragment_program"] ), - ( "GL_MAX_TEXTURE_IMAGE_UNITS_NV", GLint, - ["ctx->Const.MaxTextureImageUnits"], "", - ["NV_fragment_program", "ARB_fragment_program"] ), ( "GL_FRAGMENT_PROGRAM_BINDING_NV", GLint, ["ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0"], "", ["NV_fragment_program"] ), @@ -871,8 +837,31 @@ StateVars = [ ["ctx->Unpack.BufferObj->Name"], "", ["EXT_pixel_buffer_object"] ), # GL_ARB_vertex_program - ( "GL_MAX_VERTEX_ATTRIBS_ARB", GLint, - ["ctx->Const.VertexProgram.MaxAttribs"], "", ["ARB_vertex_program"] ), + ( "GL_VERTEX_PROGRAM_ARB", GLboolean, # == GL_VERTEX_PROGRAM_NV + ["ctx->VertexProgram.Enabled"], "", + ["ARB_vertex_program", "NV_vertex_program"] ), + ( "GL_VERTEX_PROGRAM_POINT_SIZE_ARB", GLboolean, # == GL_VERTEX_PROGRAM_POINT_SIZE_NV + ["ctx->VertexProgram.PointSizeEnabled"], "", + ["ARB_vertex_program", "NV_vertex_program"] ), + ( "GL_VERTEX_PROGRAM_TWO_SIDE_ARB", GLboolean, # == GL_VERTEX_PROGRAM_TWO_SIDE_NV + ["ctx->VertexProgram.TwoSideEnabled"], "", + ["ARB_vertex_program", "NV_vertex_program"] ), + ( "GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB", GLint, # == GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV + ["ctx->Const.MaxProgramMatrixStackDepth"], "", + ["ARB_vertex_program", "ARB_fragment_program", "NV_vertex_program"] ), + ( "GL_MAX_PROGRAM_MATRICES_ARB", GLint, # == GL_MAX_TRACK_MATRICES_NV + ["ctx->Const.MaxProgramMatrices"], "", + ["ARB_vertex_program", "ARB_fragment_program", "NV_vertex_program"] ), + ( "GL_CURRENT_MATRIX_STACK_DEPTH_ARB", GLboolean, # == GL_CURRENT_MATRIX_STACK_DEPTH_NV + ["ctx->CurrentStack->Depth + 1"], "", + ["ARB_vertex_program", "ARB_fragment_program", "NV_vertex_program"] ), + ( "GL_CURRENT_MATRIX_ARB", GLfloat, # == GL_CURRENT_MATRIX_NV + ["matrix[0]", "matrix[1]", "matrix[2]", "matrix[3]", + "matrix[4]", "matrix[5]", "matrix[6]", "matrix[7]", + "matrix[8]", "matrix[9]", "matrix[10]", "matrix[11]", + "matrix[12]", "matrix[13]", "matrix[14]", "matrix[15]" ], + "const GLfloat *matrix = ctx->CurrentStack->Top->m;", + ["ARB_vertex_program", "ARB_fragment_program", "NV_fragment_program"] ), ( "GL_TRANSPOSE_CURRENT_MATRIX_ARB", GLfloat, ["matrix[0]", "matrix[4]", "matrix[8]", "matrix[12]", "matrix[1]", "matrix[5]", "matrix[9]", "matrix[13]", @@ -880,10 +869,21 @@ StateVars = [ "matrix[3]", "matrix[7]", "matrix[11]", "matrix[15]"], "const GLfloat *matrix = ctx->CurrentStack->Top->m;", ["ARB_vertex_program", "ARB_fragment_program"] ), + ( "GL_MAX_VERTEX_ATTRIBS_ARB", GLint, + ["ctx->Const.VertexProgram.MaxAttribs"], "", ["ARB_vertex_program"] ), + ( "GL_PROGRAM_ERROR_POSITION_ARB", GLint, # == GL_PROGRAM_ERROR_POSITION_NV + ["ctx->Program.ErrorPos"], "", ["NV_vertex_program", + "ARB_vertex_program", "NV_fragment_program", "ARB_fragment_program"] ), # GL_ARB_fragment_program ( "GL_FRAGMENT_PROGRAM_ARB", GLboolean, ["ctx->FragmentProgram.Enabled"], "", ["ARB_fragment_program"] ), + ( "GL_MAX_TEXTURE_COORDS_ARB", GLint, # == GL_MAX_TEXTURE_COORDS_NV + ["ctx->Const.MaxTextureCoordUnits"], "", + ["ARB_fragment_program", "NV_fragment_program"] ), + ( "GL_MAX_TEXTURE_IMAGE_UNITS_ARB", GLint, # == GL_MAX_TEXTURE_IMAGE_UNITS_NV + ["ctx->Const.MaxTextureImageUnits"], "", + ["ARB_fragment_program", "NV_fragment_program"] ), # GL_EXT_depth_bounds_test ( "GL_DEPTH_BOUNDS_TEST_EXT", GLboolean, diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 0712fd413ef..82d45f35920 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -659,7 +659,7 @@ struct gl_enable_attrib GLuint TexGen[MAX_TEXTURE_COORD_UNITS]; /* SGI_texture_color_table */ GLboolean TextureColorTable[MAX_TEXTURE_IMAGE_UNITS]; - /* GL_NV_vertex_program */ + /* GL_ARB_vertex_program / GL_NV_vertex_program */ GLboolean VertexProgram; GLboolean VertexProgramPointSize; GLboolean VertexProgramTwoSide; @@ -1778,7 +1778,7 @@ struct vertex_program { struct program Base; /* base class */ GLboolean IsNVProgram; /* GL_NV_vertex_program ? */ - GLboolean IsPositionInvariant; /* GL_NV_vertex_program1_1 */ + GLboolean IsPositionInvariant; /* GL_ARB_vertex_program / GL_NV_vertex_program1_1 */ void *TnlData; /* should probably use Base.DriverData */ }; @@ -1804,8 +1804,8 @@ struct fragment_program */ struct gl_program_state { - GLint ErrorPos; /* GL_PROGRAM_ERROR_POSITION_NV */ - const char *ErrorString; /* GL_PROGRAM_ERROR_STRING_NV */ + GLint ErrorPos; /* GL_PROGRAM_ERROR_POSITION_ARB/NV */ + const char *ErrorString; /* GL_PROGRAM_ERROR_STRING_ARB/NV */ }; @@ -1814,10 +1814,10 @@ struct gl_program_state */ struct gl_vertex_program_state { - GLboolean Enabled; /**< GL_VERTEX_PROGRAM_NV */ + GLboolean Enabled; /**< GL_VERTEX_PROGRAM_ARB/NV */ GLboolean _Enabled; /**< Enabled and valid program? */ - GLboolean PointSizeEnabled; /**< GL_VERTEX_PROGRAM_POINT_SIZE_NV */ - GLboolean TwoSideEnabled; /**< GL_VERTEX_PROGRAM_TWO_SIDE_NV */ + GLboolean PointSizeEnabled; /**< GL_VERTEX_PROGRAM_POINT_SIZE_ARB/NV */ + GLboolean TwoSideEnabled; /**< GL_VERTEX_PROGRAM_TWO_SIDE_ARB/NV */ struct vertex_program *Current; /**< ptr to currently bound program */ struct vertex_program *_Current; /**< ptr to currently bound program, including internal @@ -2790,8 +2790,8 @@ struct __GLcontextRec struct gl_color_table ProxyPostColorMatrixColorTable; struct gl_program_state Program; /**< for vertex or fragment progs */ - struct gl_vertex_program_state VertexProgram; /**< GL_NV_vertex_program */ - struct gl_fragment_program_state FragmentProgram; /**< GL_NV_fragment_program */ + struct gl_vertex_program_state VertexProgram; /**< GL_ARB/NV_vertex_program */ + struct gl_fragment_program_state FragmentProgram; /**< GL_ARB/NV_vertex_program */ struct gl_ati_fragment_shader_state ATIFragmentShader; /**< GL_ATI_fragment_shader */ struct fragment_program *_TexEnvProgram; /**< Texture state as fragment program */ diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index a899618d148..d9c24c345c4 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -1699,10 +1699,9 @@ _mesa_BindProgram(GLenum target, GLuint id) FLUSH_VERTICES(ctx, _NEW_PROGRAM); - if ((target == GL_VERTEX_PROGRAM_NV - && ctx->Extensions.NV_vertex_program) || - (target == GL_VERTEX_PROGRAM_ARB - && ctx->Extensions.ARB_vertex_program)) { + if ((target == GL_VERTEX_PROGRAM_ARB) && /* == GL_VERTEX_PROGRAM_NV */ + (ctx->Extensions.NV_vertex_program || + ctx->Extensions.ARB_vertex_program)) { /*** Vertex program binding ***/ struct vertex_program *curProg = ctx->VertexProgram.Current; if (curProg->Base.Id == id) { @@ -1750,7 +1749,7 @@ _mesa_BindProgram(GLenum target, GLuint id) if (id == 0) { /* Bind default program */ prog = NULL; - if (target == GL_VERTEX_PROGRAM_NV || target == GL_VERTEX_PROGRAM_ARB) + if (target == GL_VERTEX_PROGRAM_ARB) /* == GL_VERTEX_PROGRAM_NV */ prog = ctx->Shared->DefaultVertexProgram; else prog = ctx->Shared->DefaultFragmentProgram; @@ -1775,7 +1774,7 @@ _mesa_BindProgram(GLenum target, GLuint id) } /* bind now */ - if (target == GL_VERTEX_PROGRAM_NV || target == GL_VERTEX_PROGRAM_ARB) { + if (target == GL_VERTEX_PROGRAM_ARB) { /* == GL_VERTEX_PROGRAM_NV */ ctx->VertexProgram.Current = (struct vertex_program *) prog; } else if (target == GL_FRAGMENT_PROGRAM_NV || target == GL_FRAGMENT_PROGRAM_ARB) { @@ -1820,7 +1819,7 @@ _mesa_DeletePrograms(GLsizei n, const GLuint *ids) } else if (prog) { /* Unbind program if necessary */ - if (prog->Target == GL_VERTEX_PROGRAM_NV || + if (prog->Target == GL_VERTEX_PROGRAM_ARB || /* == GL_VERTEX_PROGRAM_NV */ prog->Target == GL_VERTEX_STATE_PROGRAM_NV) { if (ctx->VertexProgram.Current && ctx->VertexProgram.Current->Base.Id == ids[i]) { @@ -1996,7 +1995,7 @@ _mesa_GetProgramRegisterfvMESA(GLenum target, reg[len] = 0; switch (target) { - case GL_VERTEX_PROGRAM_NV: + case GL_VERTEX_PROGRAM_ARB: /* == GL_VERTEX_PROGRAM_NV */ if (!ctx->Extensions.ARB_vertex_program && !ctx->Extensions.NV_vertex_program) { _mesa_error(ctx, GL_INVALID_ENUM,