[Mesa-dev] [PATCH 34/45] mesa: remove FEATURE_ARB_(fragment|vertex)_program defines.
Oliver McFadden
oliver.mcfadden at linux.intel.com
Tue Sep 11 02:56:47 PDT 2012
Signed-off-by: Oliver McFadden <oliver.mcfadden at linux.intel.com>
---
src/mesa/main/api_exec.c | 6 ------
src/mesa/main/context.c | 5 +----
src/mesa/main/dlist.c | 20 --------------------
src/mesa/main/enable.c | 8 --------
src/mesa/main/extensions.c | 12 ------------
src/mesa/main/getstring.c | 3 ---
src/mesa/main/mfeatures.h | 3 ---
src/mesa/main/shared.c | 10 ----------
src/mesa/main/varray.c | 2 --
src/mesa/main/vtxfmt.c | 2 --
src/mesa/program/program.c | 12 ------------
11 files changed, 1 insertions(+), 82 deletions(-)
diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c
index c6bf6dc..560052b 100644
--- a/src/mesa/main/api_exec.c
+++ b/src/mesa/main/api_exec.c
@@ -33,9 +33,7 @@
#include "accum.h"
#include "api_loopback.h"
#include "api_exec.h"
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
#include "arbprogram.h"
-#endif
#include "atifragshader.h"
#include "attrib.h"
#include "blend.h"
@@ -618,7 +616,6 @@ _mesa_create_exec_table(struct gl_context *ctx)
/* ARB 26. GL_ARB_vertex_program */
/* ARB 27. GL_ARB_fragment_program */
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
/* glVertexAttrib1sARB aliases glVertexAttrib1sNV */
/* glVertexAttrib1fARB aliases glVertexAttrib1fNV */
/* glVertexAttrib1dARB aliases glVertexAttrib1dNV */
@@ -686,7 +683,6 @@ _mesa_create_exec_table(struct gl_context *ctx)
SET_GetProgramStringARB(exec, _mesa_GetProgramStringARB);
}
SET_GetProgramivARB(exec, _mesa_GetProgramivARB);
-#endif
/* ARB 28. GL_ARB_vertex_buffer_object */
_mesa_init_bufferobj_dispatch(ctx, exec);
@@ -759,12 +755,10 @@ _mesa_create_exec_table(struct gl_context *ctx)
#endif
/* GL_EXT_gpu_program_parameters */
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
if (ctx->API == API_OPENGL) {
SET_ProgramEnvParameters4fvEXT(exec, _mesa_ProgramEnvParameters4fvEXT);
SET_ProgramLocalParameters4fvEXT(exec, _mesa_ProgramLocalParameters4fvEXT);
}
-#endif
/* GL_MESA_texture_array / GL_EXT_texture_array */
if (ctx->API != API_OPENGLES2) {
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 6a37099..57bd1a7 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -599,13 +599,10 @@ _mesa_init_constants(struct gl_context *ctx)
ctx->Const.MaxUniformBlockSize = 16384;
ctx->Const.UniformBufferOffsetAlignment = 1;
-#if FEATURE_ARB_vertex_program
init_program_limits(ctx, GL_VERTEX_PROGRAM_ARB, &ctx->Const.VertexProgram);
-#endif
-#if FEATURE_ARB_fragment_program
init_program_limits(ctx, GL_FRAGMENT_PROGRAM_ARB, &ctx->Const.FragmentProgram);
-#endif
init_program_limits(ctx, MESA_GEOMETRY_PROGRAM, &ctx->Const.GeometryProgram);
+
ctx->Const.MaxProgramMatrices = MAX_PROGRAM_MATRICES;
ctx->Const.MaxProgramMatrixStackDepth = MAX_PROGRAM_MATRIX_STACK_DEPTH;
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 33ff08c..7796344 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -64,9 +64,7 @@
#include "texstorage.h"
#include "mtypes.h"
#include "varray.h"
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
#include "arbprogram.h"
-#endif
#if FEATURE_GL
#include "nvprogram.h"
#endif
@@ -755,12 +753,10 @@ _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist)
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 */
n += InstSize[n[0].opcode];
break;
-#endif
case OPCODE_UNIFORM_1FV:
case OPCODE_UNIFORM_2FV:
case OPCODE_UNIFORM_3FV:
@@ -4859,7 +4855,6 @@ save_SampleCoverageARB(GLclampf value, GLboolean invert)
/*
* GL_NV_vertex_program
*/
-#if FEATURE_GL || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
static void GLAPIENTRY
save_BindProgramNV(GLenum target, GLuint id)
{
@@ -4959,7 +4954,6 @@ save_ProgramEnvParameter4dvARB(GLenum target, GLuint index,
(GLfloat) params[2], (GLfloat) params[3]);
}
-#endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_GL */
#if FEATURE_GL
static void GLAPIENTRY
@@ -5300,8 +5294,6 @@ save_DepthBoundsEXT(GLclampd zmin, GLclampd zmax)
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
-
static void GLAPIENTRY
save_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
const GLvoid * string)
@@ -5329,8 +5321,6 @@ save_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
}
}
-#endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
-
#if FEATURE_GL
@@ -8410,11 +8400,9 @@ 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;
-#if FEATURE_GL || 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_GL
case OPCODE_EXECUTE_PROGRAM_NV:
{
@@ -8459,19 +8447,15 @@ execute_list(struct gl_context *ctx, GLuint list)
case OPCODE_DEPTH_BOUNDS_EXT:
CALL_DepthBoundsEXT(ctx->Exec, (n[1].f, n[2].f));
break;
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
case OPCODE_PROGRAM_STRING_ARB:
CALL_ProgramStringARB(ctx->Exec,
(n[1].e, n[2].e, n[3].i, n[4].data));
break;
-#endif
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_GL
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
#if FEATURE_GL
case OPCODE_BEGIN_QUERY_ARB:
CALL_BeginQueryARB(ctx->Exec, (n[1].e, n[2].ui));
@@ -10418,7 +10402,6 @@ _mesa_create_save_table(void)
/* ARB 26. GL_ARB_vertex_program */
/* ARB 27. GL_ARB_fragment_program */
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
/* glVertexAttrib* functions alias the NV ones, handled elsewhere */
SET_VertexAttribPointerARB(table, _mesa_VertexAttribPointerARB);
SET_EnableVertexAttribArrayARB(table, _mesa_EnableVertexAttribArrayARB);
@@ -10448,7 +10431,6 @@ _mesa_create_save_table(void)
_mesa_GetProgramLocalParameterfvARB);
SET_GetProgramivARB(table, _mesa_GetProgramivARB);
SET_GetProgramStringARB(table, _mesa_GetProgramStringARB);
-#endif
/* ARB 28. GL_ARB_vertex_buffer_object */
/* None of the extension's functions get compiled */
@@ -10516,10 +10498,8 @@ _mesa_create_save_table(void)
SET_BlendEquationSeparateEXT(table, save_BlendEquationSeparateEXT);
/* GL_EXT_gpu_program_parameters */
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
SET_ProgramEnvParameters4fvEXT(table, save_ProgramEnvParameters4fvEXT);
SET_ProgramLocalParameters4fvEXT(table, save_ProgramLocalParameters4fvEXT);
-#endif
/* ARB 50. GL_ARB_map_buffer_range */
#if FEATURE_ARB_map_buffer_range
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 3e7e728..3742776 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -821,7 +821,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
ctx->Point.PointSprite = state;
break;
-#if FEATURE_GL || FEATURE_ARB_vertex_program
case GL_VERTEX_PROGRAM_ARB:
if (ctx->API != API_OPENGL)
goto invalid_enum_error;
@@ -852,7 +851,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
FLUSH_VERTICES(ctx, _NEW_PROGRAM);
ctx->VertexProgram.TwoSideEnabled = state;
break;
-#endif
#if FEATURE_GL
case GL_MAP1_VERTEX_ATTRIB0_4_NV:
case GL_MAP1_VERTEX_ATTRIB1_4_NV:
@@ -944,7 +942,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
}
break;
-#if FEATURE_ARB_fragment_program
case GL_FRAGMENT_PROGRAM_ARB:
if (ctx->API != API_OPENGL)
goto invalid_enum_error;
@@ -954,7 +951,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
FLUSH_VERTICES(ctx, _NEW_PROGRAM);
ctx->FragmentProgram.Enabled = state;
break;
-#endif /* FEATURE_ARB_fragment_program */
/* GL_EXT_depth_bounds_test */
case GL_DEPTH_BOUNDS_TEST_EXT:
@@ -1537,7 +1533,6 @@ _mesa_IsEnabled( GLenum cap )
CHECK_EXTENSION2(NV_point_sprite, ARB_point_sprite)
return ctx->Point.PointSprite;
-#if FEATURE_GL || FEATURE_ARB_vertex_program
case GL_VERTEX_PROGRAM_ARB:
if (ctx->API != API_OPENGL)
goto invalid_enum_error;
@@ -1556,7 +1551,6 @@ _mesa_IsEnabled( GLenum cap )
goto invalid_enum_error;
CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program);
return ctx->VertexProgram.TwoSideEnabled;
-#endif
#if FEATURE_GL
case GL_VERTEX_ATTRIB_ARRAY0_NV:
case GL_VERTEX_ATTRIB_ARRAY1_NV:
@@ -1652,12 +1646,10 @@ _mesa_IsEnabled( GLenum cap )
CHECK_EXTENSION(EXT_stencil_two_side);
return ctx->Stencil.TestTwoSide;
-#if FEATURE_ARB_fragment_program
case GL_FRAGMENT_PROGRAM_ARB:
if (ctx->API != API_OPENGL)
goto invalid_enum_error;
return ctx->FragmentProgram.Enabled;
-#endif /* FEATURE_ARB_fragment_program */
/* GL_EXT_depth_bounds_test */
case GL_DEPTH_BOUNDS_TEST_EXT:
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index e62deee..f520a96 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -397,10 +397,8 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
ctx->Extensions.ARB_draw_instanced = GL_TRUE;
ctx->Extensions.ARB_explicit_attrib_location = GL_TRUE;
ctx->Extensions.ARB_fragment_coord_conventions = GL_TRUE;
-#if FEATURE_ARB_fragment_program
ctx->Extensions.ARB_fragment_program = GL_TRUE;
ctx->Extensions.ARB_fragment_program_shadow = GL_TRUE;
-#endif
ctx->Extensions.ARB_fragment_shader = GL_TRUE;
#if FEATURE_ARB_framebuffer_object
ctx->Extensions.ARB_framebuffer_object = GL_TRUE;
@@ -431,9 +429,7 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
ctx->Extensions.ARB_texture_rg = GL_TRUE;
ctx->Extensions.ARB_texture_compression_rgtc = GL_TRUE;
ctx->Extensions.ARB_texture_storage = GL_TRUE;
-#if FEATURE_ARB_vertex_program
ctx->Extensions.ARB_vertex_program = GL_TRUE;
-#endif
ctx->Extensions.ARB_vertex_shader = GL_TRUE;
#if FEATURE_ARB_sync
ctx->Extensions.ARB_sync = GL_TRUE;
@@ -500,20 +496,12 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
#if FEATURE_GL
ctx->Extensions.NV_vertex_program = GL_TRUE;
ctx->Extensions.NV_vertex_program1_1 = GL_TRUE;
-#endif
-#if FEATURE_GL
ctx->Extensions.NV_fragment_program = GL_TRUE;
-#endif
-#if FEATURE_GL && 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 FEATURE_GL
_mesa_enable_extension(ctx, "GL_3DFX_texture_compression_FXT1");
-#endif
-#if FEATURE_GL
if (ctx->Mesa_DXTn) {
_mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc");
_mesa_enable_extension(ctx, "GL_S3_s3tc");
diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c
index 33ca2e5..4f83419 100644
--- a/src/mesa/main/getstring.c
+++ b/src/mesa/main/getstring.c
@@ -135,8 +135,6 @@ _mesa_GetString( GLenum name )
if (ctx->API == API_OPENGLES)
break;
return shading_language_version(ctx);
-#if FEATURE_GL || FEATURE_ARB_fragment_program || \
- FEATURE_GL || FEATURE_ARB_vertex_program
case GL_PROGRAM_ERROR_STRING_NV:
if (ctx->API == API_OPENGL &&
(ctx->Extensions.NV_fragment_program ||
@@ -146,7 +144,6 @@ _mesa_GetString( GLenum name )
return (const GLubyte *) ctx->Program.ErrorString;
}
break;
-#endif
default:
break;
}
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index 3f6e292..1b1be52 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,9 +84,6 @@
#define FEATURE_remap_table 0
#endif
-#define FEATURE_ARB_fragment_program 1
-#define FEATURE_ARB_vertex_program 1
-
#define FEATURE_ARB_framebuffer_object FEATURE_GL
#define FEATURE_ARB_map_buffer_range FEATURE_GL
#define FEATURE_ARB_pixel_buffer_object FEATURE_GL
diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c
index d1443e9..e4bb830 100644
--- a/src/mesa/main/shared.c
+++ b/src/mesa/main/shared.c
@@ -70,17 +70,12 @@ _mesa_alloc_shared_state(struct gl_context *ctx)
shared->TexObjects = _mesa_NewHashTable();
shared->Programs = _mesa_NewHashTable();
-#if FEATURE_ARB_vertex_program
shared->DefaultVertexProgram =
gl_vertex_program(ctx->Driver.NewProgram(ctx,
GL_VERTEX_PROGRAM_ARB, 0));
-#endif
-
-#if FEATURE_ARB_fragment_program
shared->DefaultFragmentProgram =
gl_fragment_program(ctx->Driver.NewProgram(ctx,
GL_FRAGMENT_PROGRAM_ARB, 0));
-#endif
#if FEATURE_ATI_fragment_shader
shared->ATIShaders = _mesa_NewHashTable();
@@ -324,13 +319,8 @@ free_shared_state(struct gl_context *ctx, struct gl_shared_state *shared)
_mesa_HashDeleteAll(shared->Programs, delete_program_cb, ctx);
_mesa_DeleteHashTable(shared->Programs);
-#if FEATURE_ARB_vertex_program
_mesa_reference_vertprog(ctx, &shared->DefaultVertexProgram, NULL);
-#endif
-
-#if FEATURE_ARB_fragment_program
_mesa_reference_fragprog(ctx, &shared->DefaultFragmentProgram, NULL);
-#endif
#if FEATURE_ATI_fragment_shader
_mesa_HashDeleteAll(shared->ATIShaders, delete_fragshader_cb, ctx);
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 99e3b2c..fe015d2 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -465,7 +465,6 @@ _mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type,
#endif
-#if FEATURE_ARB_vertex_program
/**
* Set a generic vertex attribute array.
* Note that these arrays DO NOT alias the conventional GL vertex arrays
@@ -495,7 +494,6 @@ _mesa_VertexAttribPointerARB(GLuint index, GLint size, GLenum type,
legalTypes, 1, BGRA_OR_4,
size, type, stride, normalized, GL_FALSE, ptr);
}
-#endif
/**
diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c
index a14f403..a120268 100644
--- a/src/mesa/main/vtxfmt.c
+++ b/src/mesa/main/vtxfmt.c
@@ -136,7 +136,6 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab,
SET_VertexAttrib3fvNV(tab, vfmt->VertexAttrib3fvNV);
SET_VertexAttrib4fNV(tab, vfmt->VertexAttrib4fNV);
SET_VertexAttrib4fvNV(tab, vfmt->VertexAttrib4fvNV);
-#if FEATURE_ARB_vertex_program
SET_VertexAttrib1fARB(tab, vfmt->VertexAttrib1fARB);
SET_VertexAttrib1fvARB(tab, vfmt->VertexAttrib1fvARB);
SET_VertexAttrib2fARB(tab, vfmt->VertexAttrib2fARB);
@@ -145,7 +144,6 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab,
SET_VertexAttrib3fvARB(tab, vfmt->VertexAttrib3fvARB);
SET_VertexAttrib4fARB(tab, vfmt->VertexAttrib4fARB);
SET_VertexAttrib4fvARB(tab, vfmt->VertexAttrib4fvARB);
-#endif
/* GL_EXT_gpu_shader4 / OpenGL 3.0 */
SET_VertexAttribI1iEXT(tab, vfmt->VertexAttribI1i);
diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c
index 438a68c..13e0ce1 100644
--- a/src/mesa/program/program.c
+++ b/src/mesa/program/program.c
@@ -83,7 +83,6 @@ _mesa_init_program(struct gl_context *ctx)
ctx->Program.ErrorPos = -1;
ctx->Program.ErrorString = _mesa_strdup("");
-#if FEATURE_GL || FEATURE_ARB_vertex_program
ctx->VertexProgram.Enabled = GL_FALSE;
#if FEATURE_ES2
ctx->VertexProgram.PointSizeEnabled =
@@ -100,15 +99,12 @@ _mesa_init_program(struct gl_context *ctx)
ctx->VertexProgram.TrackMatrixTransform[i] = GL_IDENTITY_NV;
}
ctx->VertexProgram.Cache = _mesa_new_program_cache();
-#endif
-#if FEATURE_GL || 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 */
@@ -132,14 +128,10 @@ _mesa_init_program(struct gl_context *ctx)
void
_mesa_free_program_data(struct gl_context *ctx)
{
-#if FEATURE_GL || FEATURE_ARB_vertex_program
_mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current, NULL);
_mesa_delete_program_cache(ctx, ctx->VertexProgram.Cache);
-#endif
-#if FEATURE_GL || 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 */
@@ -163,17 +155,13 @@ _mesa_free_program_data(struct gl_context *ctx)
void
_mesa_update_default_objects_program(struct gl_context *ctx)
{
-#if FEATURE_GL || FEATURE_ARB_vertex_program
_mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current,
ctx->Shared->DefaultVertexProgram);
assert(ctx->VertexProgram.Current);
-#endif
-#if FEATURE_GL || 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);
--
1.7.8.6
More information about the mesa-dev
mailing list