diff options
author | marha <marha@users.sourceforge.net> | 2012-09-17 16:16:11 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-09-17 16:16:11 +0200 |
commit | c72f683c50e774b21967f0121245a286539fa555 (patch) | |
tree | fa5e86f04a33b8bcebf937d1966052ccf1fefbeb | |
parent | 86fb7e4a298199b30bd16565569a9b3dfe7a1f11 (diff) | |
parent | e3c4aa34268f99562e66b43a7d9efcd16ca072e6 (diff) | |
download | vcxsrv-c72f683c50e774b21967f0121245a286539fa555.tar.gz vcxsrv-c72f683c50e774b21967f0121245a286539fa555.tar.bz2 vcxsrv-c72f683c50e774b21967f0121245a286539fa555.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
mesalib/src/mesa/main/syncobj.h
pixman/pixman/pixman-mmx.c
138 files changed, 289 insertions, 1750 deletions
diff --git a/mesalib/bin/mklib b/mesalib/bin/mklib index 9bac29ea8..086b26898 100644 --- a/mesalib/bin/mklib +++ b/mesalib/bin/mklib @@ -319,6 +319,25 @@ case $ARCH in fi fi + # Check if objects are 32-bit and we're running in 64-bit + # environment. If so, pass -m32 flag to linker. + add_abi_flag_to_opts() { + case $(file $1) in + *32-bit*x86-64*) + # x86_64 x32 ABI. + OPTS="-mx32 ${OPTS}" + ;; + *64-bit*x86-64*) + # x86_64 64-bit ABI. + OPTS="-m64 ${OPTS}" + ;; + *32-bit*Intel*) + # x86 32-bit ABI. + OPTS="-m32 ${OPTS}" + ;; + esac + } + if [ $NOPREFIX = 1 ] ; then # No "lib" or ".so" part echo "mklib: Making" $ARCH "shared library: " ${LIBNAME} @@ -330,15 +349,8 @@ case $ARCH in ;; esac - # Check if objects are 32-bit and we're running in 64-bit - # environment. If so, pass -m32 flag to linker. - set ${OBJECTS} - ABI32=`file $1 | grep 32-bit` - ARM=`file $1 | grep ARM` - # Do not add "-m32" option for arm. - if [ -z "$ARM" -a "${ABI32}" -a `uname -m` = "x86_64" ] ; then - OPTS="-m32 ${OPTS}" - fi + # Check to see if we are building for a different ABI. + add_abi_flag_to_opts ${OBJECTS} if [ "${ALTOPTS}" ] ; then OPTS=${ALTOPTS} @@ -389,15 +401,9 @@ case $ARCH in # exptmp is removed below fi - # Check if objects are 32-bit and we're running in 64-bit - # environment. If so, pass -m32 flag to linker. - set ${OBJECTS} - ABI32=`file $1 | grep 32-bit` - ARM=`file $1 | grep ARM` - # Do not add "-m32" option for arm. - if [ -z "$ARM" -a "${ABI32}" -a `uname -m` = "x86_64" ] ; then - OPTS="-m32 ${OPTS}" - fi + # Check to see if we are building for a different ABI. + add_abi_flag_to_opts ${OBJECTS} + if [ "${ALTOPTS}" ] ; then OPTS=${ALTOPTS} fi diff --git a/mesalib/src/glsl/SConscript b/mesalib/src/glsl/SConscript index 0855c67bb..b034f3b06 100644 --- a/mesalib/src/glsl/SConscript +++ b/mesalib/src/glsl/SConscript @@ -17,7 +17,7 @@ env.Prepend(CPPPATH = [ # Make glcpp-parse.h and glsl_parser.h reachable from the include path. env.Append(CPPPATH = [Dir('.').abspath, Dir('glcpp').abspath]) -env.Append(YACCFLAGS = '-d') +env.Append(YACCFLAGS = '-d -p "glcpp_parser_"') parser_env = env.Clone() parser_env.Append(YACCFLAGS = [ diff --git a/mesalib/src/glsl/glcpp/Makefile.am b/mesalib/src/glsl/glcpp/Makefile.am index 7a95b6848..87affce1c 100644 --- a/mesalib/src/glsl/glcpp/Makefile.am +++ b/mesalib/src/glsl/glcpp/Makefile.am @@ -31,7 +31,7 @@ AM_CFLAGS = \ $(LIBRARY_DEFINES) \ $(API_DEFINES) -AM_YFLAGS = -v -d +AM_YFLAGS = -v -d -p "glcpp_parser_" AM_LFLAGS = --nounistd -o$(LEX_OUTPUT_ROOT).c noinst_LTLIBRARIES = libglcpp.la diff --git a/mesalib/src/glsl/glcpp/glcpp-parse.y b/mesalib/src/glsl/glcpp/glcpp-parse.y index bf6f3ad01..fb9bc588e 100644 --- a/mesalib/src/glsl/glcpp/glcpp-parse.y +++ b/mesalib/src/glsl/glcpp/glcpp-parse.y @@ -133,8 +133,6 @@ _glcpp_parser_skip_stack_change_if (glcpp_parser_t *parser, YYLTYPE *loc, static void _glcpp_parser_skip_stack_pop (glcpp_parser_t *parser, YYLTYPE *loc); -#define yylex glcpp_parser_lex - static int glcpp_parser_lex (YYSTYPE *yylval, YYLTYPE *yylloc, glcpp_parser_t *parser); @@ -1197,12 +1195,6 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api) return parser; } -int -glcpp_parser_parse (glcpp_parser_t *parser) -{ - return yyparse (parser); -} - void glcpp_parser_destroy (glcpp_parser_t *parser) { diff --git a/mesalib/src/glsl/glcpp/glcpp.c b/mesalib/src/glsl/glcpp/glcpp.c index 106c9916b..130f4324d 100644 --- a/mesalib/src/glsl/glcpp/glcpp.c +++ b/mesalib/src/glsl/glcpp/glcpp.c @@ -119,7 +119,7 @@ main (int argc, char *argv[]) if (shader == NULL) return 1; - ret = preprocess(ctx, &shader, &info_log, NULL, API_OPENGL); + ret = glcpp_preprocess(ctx, &shader, &info_log, NULL, API_OPENGL); printf("%s", shader); fprintf(stderr, "%s", info_log); diff --git a/mesalib/src/glsl/glcpp/glcpp.h b/mesalib/src/glsl/glcpp/glcpp.h index a13ade69e..a459289b2 100644 --- a/mesalib/src/glsl/glcpp/glcpp.h +++ b/mesalib/src/glsl/glcpp/glcpp.h @@ -196,7 +196,7 @@ void glcpp_parser_destroy (glcpp_parser_t *parser); int -preprocess(void *ralloc_ctx, const char **shader, char **info_log, +glcpp_preprocess(void *ralloc_ctx, const char **shader, char **info_log, const struct gl_extensions *extensions, int api); /* Functions for writing to the info log */ diff --git a/mesalib/src/glsl/glcpp/pp.c b/mesalib/src/glsl/glcpp/pp.c index 9170d14a3..11b29417b 100644 --- a/mesalib/src/glsl/glcpp/pp.c +++ b/mesalib/src/glsl/glcpp/pp.c @@ -150,7 +150,7 @@ remove_line_continuations(glcpp_parser_t *ctx, const char *shader) } int -preprocess(void *ralloc_ctx, const char **shader, char **info_log, +glcpp_preprocess(void *ralloc_ctx, const char **shader, char **info_log, const struct gl_extensions *extensions, int api) { int errors; diff --git a/mesalib/src/glsl/glsl_parser_extras.h b/mesalib/src/glsl/glsl_parser_extras.h index 43e5fbfba..a5f6845c4 100644 --- a/mesalib/src/glsl/glsl_parser_extras.h +++ b/mesalib/src/glsl/glsl_parser_extras.h @@ -300,7 +300,7 @@ _mesa_glsl_shader_target_name(enum _mesa_glsl_parser_targets target); extern "C" { #endif -extern int preprocess(void *ctx, const char **shader, char **info_log, +extern int glcpp_preprocess(void *ctx, const char **shader, char **info_log, const struct gl_extensions *extensions, int api); extern void _mesa_destroy_shader_compiler(void); diff --git a/mesalib/src/glsl/ir.cpp b/mesalib/src/glsl/ir.cpp index f59cdd29a..1c7aadaca 100644 --- a/mesalib/src/glsl/ir.cpp +++ b/mesalib/src/glsl/ir.cpp @@ -1282,7 +1282,7 @@ ir_dereference::is_lvalue() const } -const char *tex_opcode_strs[] = { "tex", "txb", "txl", "txd", "txf", "txs" }; +static const char *tex_opcode_strs[] = { "tex", "txb", "txl", "txd", "txf", "txs" }; const char *ir_texture::opcode_string() { diff --git a/mesalib/src/glsl/main.cpp b/mesalib/src/glsl/main.cpp index fbcc4aebb..23bd3cde2 100644 --- a/mesalib/src/glsl/main.cpp +++ b/mesalib/src/glsl/main.cpp @@ -155,7 +155,7 @@ compile_shader(struct gl_context *ctx, struct gl_shader *shader) new(shader) _mesa_glsl_parse_state(ctx, shader->Type, shader); const char *source = shader->Source; - state->error = preprocess(state, &source, &state->info_log, + state->error = glcpp_preprocess(state, &source, &state->info_log, state->extensions, ctx->API) != 0; if (!state->error) { diff --git a/mesalib/src/glsl/test_optpass.cpp b/mesalib/src/glsl/test_optpass.cpp index 31f65c3d2..5ed11702c 100644 --- a/mesalib/src/glsl/test_optpass.cpp +++ b/mesalib/src/glsl/test_optpass.cpp @@ -216,7 +216,7 @@ int test_optpass(int argc, char **argv) } else { shader->Source = input.c_str(); const char *source = shader->Source; - state->error = preprocess(state, &source, &state->info_log, + state->error = glcpp_preprocess(state, &source, &state->info_log, state->extensions, ctx->API) != 0; if (!state->error) { diff --git a/mesalib/src/mesa/Makefile.am b/mesalib/src/mesa/Makefile.am index 57325afab..8e4530da3 100644 --- a/mesalib/src/mesa/Makefile.am +++ b/mesalib/src/mesa/Makefile.am @@ -73,7 +73,7 @@ main/api_exec_es1.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py m program/program_parse.tab.c program/program_parse.tab.h: program/program_parse.y $(MKDIR_P) program - $(AM_V_GEN) $(YACC) -v -d --output=program/program_parse.tab.c $< + $(AM_V_GEN) $(YACC) -p "_mesa_program_" -v -d --output=program/program_parse.tab.c $< program/lex.yy.c: program/program_lexer.l $(MKDIR_P) program diff --git a/mesalib/src/mesa/SConscript b/mesalib/src/mesa/SConscript index 920b545a8..dba75a264 100644 --- a/mesalib/src/mesa/SConscript +++ b/mesalib/src/mesa/SConscript @@ -280,7 +280,7 @@ statetracker_sources = [ 'state_tracker/st_texture.c', ] -env.Append(YACCFLAGS = '-d') +env.Append(YACCFLAGS = '-d -p "_mesa_program_"') program_lex = env.CFile('program/lex.yy.c', 'program/program_lexer.l') program_parse = env.CFile('program/program_parse.tab.c', 'program/program_parse.y') diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c index 7e81e5ee1..3b13ad7f1 100644 --- a/mesalib/src/mesa/drivers/common/meta.c +++ b/mesalib/src/mesa/drivers/common/meta.c @@ -76,8 +76,9 @@ #include "drivers/common/meta.h" #include "main/enums.h" #include "main/glformats.h" +#include "../glsl/ralloc.h" - +static void *mem_ctx; /** Return offset in bytes of the field within a vertex struct */ #define OFFSET(FIELD) ((void *) offsetof(struct vertex, FIELD)) @@ -178,12 +179,10 @@ struct save_state struct gl_query_object *CondRenderQuery; GLenum CondRenderMode; -#if FEATURE_feedback /** MESA_META_SELECT_FEEDBACK */ GLenum RenderMode; struct gl_selection Select; struct gl_feedback Feedback; -#endif /** MESA_META_MULTISAMPLE */ GLboolean MultisampleEnabled; @@ -191,9 +190,7 @@ struct save_state /** Miscellaneous (always disabled) */ GLboolean Lighting; GLboolean RasterDiscard; -#if FEATURE_EXT_transform_feedback GLboolean TransformFeedbackNeedsResume; -#endif }; /** @@ -286,6 +283,15 @@ struct gen_mipmap_state GLuint IntegerShaderProg; }; +/** + * State for GLSL texture sampler which is used to generate fragment + * shader in _mesa_meta_generate_mipmap(). + */ +struct glsl_sampler { + const char *type; + const char *func; + const char *texcoords; +}; /** * State for texture decompression @@ -438,35 +444,6 @@ _mesa_meta_free(struct gl_context *ctx) /** - * This is an alternative to _mesa_set_enable() to handle some special cases. - * See comments inside. - */ -static void -meta_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) -{ - switch (cap) { - case GL_MULTISAMPLE: - /* We need to enable/disable multisample when using GLES but this enum - * is not supported there. - */ - if (ctx->Multisample.Enabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); - ctx->Multisample.Enabled = state; - break; - default: - _mesa_problem(ctx, "Unexpected cap in _meta_set_enable()"); - return; - } - - if (ctx->Driver.Enable) { - ctx->Driver.Enable(ctx, cap, state); - } -} - - - -/** * Enter meta state. This is like a light-weight version of glPushAttrib * but it also resets most GL state back to default values. * @@ -485,7 +462,6 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) memset(save, 0, sizeof(*save)); save->SavedState = state; -#if FEATURE_EXT_transform_feedback /* Pausing transform feedback needs to be done early, or else we won't be * able to change other state. */ @@ -494,7 +470,6 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) !ctx->TransformFeedback.CurrentObject->Paused; if (save->TransformFeedbackNeedsResume) _mesa_PauseTransformFeedback(); -#endif if (state & MESA_META_ALPHA_TEST) { save->AlphaEnabled = ctx->Color.AlphaEnabled; @@ -648,19 +623,24 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) if (ctx->Texture.Unit[u].Enabled || ctx->Texture.Unit[u].TexGenEnabled) { _mesa_ActiveTextureARB(GL_TEXTURE0 + u); - _mesa_set_enable(ctx, GL_TEXTURE_1D, GL_FALSE); _mesa_set_enable(ctx, GL_TEXTURE_2D, GL_FALSE); - _mesa_set_enable(ctx, GL_TEXTURE_3D, GL_FALSE); if (ctx->Extensions.ARB_texture_cube_map) _mesa_set_enable(ctx, GL_TEXTURE_CUBE_MAP, GL_FALSE); - if (ctx->Extensions.NV_texture_rectangle) - _mesa_set_enable(ctx, GL_TEXTURE_RECTANGLE, GL_FALSE); if (ctx->Extensions.OES_EGL_image_external) _mesa_set_enable(ctx, GL_TEXTURE_EXTERNAL_OES, GL_FALSE); - _mesa_set_enable(ctx, GL_TEXTURE_GEN_S, GL_FALSE); - _mesa_set_enable(ctx, GL_TEXTURE_GEN_T, GL_FALSE); - _mesa_set_enable(ctx, GL_TEXTURE_GEN_R, GL_FALSE); - _mesa_set_enable(ctx, GL_TEXTURE_GEN_Q, GL_FALSE); + + if (ctx->API == API_OPENGL) { + _mesa_set_enable(ctx, GL_TEXTURE_1D, GL_FALSE); + _mesa_set_enable(ctx, GL_TEXTURE_3D, GL_FALSE); + if (ctx->Extensions.NV_texture_rectangle) + _mesa_set_enable(ctx, GL_TEXTURE_RECTANGLE, GL_FALSE); + _mesa_set_enable(ctx, GL_TEXTURE_GEN_S, GL_FALSE); + _mesa_set_enable(ctx, GL_TEXTURE_GEN_T, GL_FALSE); + _mesa_set_enable(ctx, GL_TEXTURE_GEN_R, GL_FALSE); + _mesa_set_enable(ctx, GL_TEXTURE_GEN_Q, GL_FALSE); + } else { + _mesa_set_enable(ctx, GL_TEXTURE_GEN_STR_OES, GL_FALSE); + } } } } @@ -770,7 +750,6 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) _mesa_EndConditionalRender(); } -#if FEATURE_feedback if (state & MESA_META_SELECT_FEEDBACK) { save->RenderMode = ctx->RenderMode; if (ctx->RenderMode == GL_SELECT) { @@ -781,12 +760,11 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state) _mesa_RenderMode(GL_RENDER); } } -#endif if (state & MESA_META_MULTISAMPLE) { save->MultisampleEnabled = ctx->Multisample.Enabled; if (ctx->Multisample.Enabled) - meta_set_enable(ctx, GL_MULTISAMPLE, GL_FALSE); + _mesa_set_multisample(ctx, GL_FALSE); } /* misc */ @@ -1076,7 +1054,6 @@ _mesa_meta_end(struct gl_context *ctx) save->CondRenderMode); } -#if FEATURE_feedback if (state & MESA_META_SELECT_FEEDBACK) { if (save->RenderMode == GL_SELECT) { _mesa_RenderMode(GL_SELECT); @@ -1086,11 +1063,10 @@ _mesa_meta_end(struct gl_context *ctx) ctx->Feedback = save->Feedback; } } -#endif if (state & MESA_META_MULTISAMPLE) { if (ctx->Multisample.Enabled != save->MultisampleEnabled) - meta_set_enable(ctx, GL_MULTISAMPLE, save->MultisampleEnabled); + _mesa_set_multisample(ctx, save->MultisampleEnabled); } /* misc */ @@ -1100,10 +1076,8 @@ _mesa_meta_end(struct gl_context *ctx) if (save->RasterDiscard) { _mesa_set_enable(ctx, GL_RASTERIZER_DISCARD, GL_TRUE); } -#if FEATURE_EXT_transform_feedback if (save->TransformFeedbackNeedsResume) _mesa_ResumeTransformFeedback(); -#endif ctx->Meta->SaveStackDepth--; } @@ -2974,7 +2948,7 @@ setup_texture_coords(GLenum faceTarget, static void setup_ff_generate_mipmap(struct gl_context *ctx, - struct gen_mipmap_state *mipmap) + struct gen_mipmap_state *mipmap) { struct vertex { GLfloat x, y, tex[3]; @@ -3004,30 +2978,61 @@ setup_ff_generate_mipmap(struct gl_context *ctx, static void +setup_texture_sampler(GLenum target, struct glsl_sampler *sampler) +{ + switch(target) { + case GL_TEXTURE_1D: + sampler->type = "sampler1D"; + sampler->func = "texture1D"; + sampler->texcoords = "texCoords.x"; + break; + case GL_TEXTURE_2D: + sampler->type = "sampler2D"; + sampler->func = "texture2D"; + sampler->texcoords = "texCoords.xy"; + break; + case GL_TEXTURE_3D: + /* Code for mipmap generation with 3D textures is not used yet. + * It's a sw fallback. + */ + sampler->type = "sampler3D"; + sampler->func = "texture3D"; + sampler->texcoords = "texCoords"; + break; + case GL_TEXTURE_CUBE_MAP: + sampler->type = "samplerCube"; + sampler->func = "textureCube"; + sampler->texcoords = "texCoords"; + break; + case GL_TEXTURE_1D_ARRAY: + sampler->type = "sampler1DArray"; + sampler->func = "texture1DArray"; + sampler->texcoords = "texCoords.xy"; + break; + case GL_TEXTURE_2D_ARRAY: + sampler->type = "sampler2DArray"; + sampler->func = "texture2DArray"; + sampler->texcoords = "texCoords"; + break; + default: + _mesa_problem(NULL, "Unexpected texture target 0x%x in" + " setup_texture_sampler()\n", target); + } +} + + +static void setup_glsl_generate_mipmap(struct gl_context *ctx, - struct gen_mipmap_state *mipmap) + struct gen_mipmap_state *mipmap, + GLenum target) { struct vertex { GLfloat x, y, tex[3]; }; + struct glsl_sampler sampler; + const char *vs_source; + const char *fs_template; - static const char *vs_source = - "attribute vec2 position;\n" - "attribute vec3 textureCoords;\n" - "varying vec3 texCoords;\n" - "void main()\n" - "{\n" - " texCoords = textureCoords;\n" - " gl_Position = vec4(position, 0.0, 1.0);\n" - "}\n"; - static const char *fs_source = - "uniform sampler2D tex2d;\n" - "varying vec3 texCoords;\n" - "void main()\n" - "{\n" - " gl_FragColor = texture2D(tex2d, texCoords.xy);\n" - "}\n"; - static const char *vs_int_source = "#version 130\n" "in vec2 position;\n" @@ -3048,8 +3053,51 @@ setup_glsl_generate_mipmap(struct gl_context *ctx, "{\n" " out_color = texture(tex2d, texCoords.xy);\n" "}\n"; + char *fs_source; + const char *extension_mode; GLuint vs, fs; + if (ctx->Const.GLSLVersion < 130) { + vs_source = + "attribute vec2 position;\n" + "attribute vec3 textureCoords;\n" + "varying vec3 texCoords;\n" + "void main()\n" + "{\n" + " texCoords = textureCoords;\n" + " gl_Position = vec4(position, 0.0, 1.0);\n" + "}\n"; + fs_template = + "#extension GL_EXT_texture_array : %s\n" + "uniform %s texSampler;\n" + "varying vec3 texCoords;\n" + "void main()\n" + "{\n" + " gl_FragColor = %s(texSampler, %s);\n" + "}\n"; + } else { + vs_source = + "#version 130\n" + "in vec2 position;\n" + "in vec3 textureCoords;\n" + "out vec3 texCoords;\n" + "void main()\n" + "{\n" + " texCoords = textureCoords;\n" + " gl_Position = vec4(position, 0.0, 1.0);\n" + "}\n"; + fs_template = + "#version 130\n" + "uniform %s texSampler;\n" + "in vec3 texCoords;\n" + "out %s out_color;\n" + "\n" + "void main()\n" + "{\n" + " out_color = texture(texSampler, %s);\n" + "}\n"; + } + /* Check if already initialized */ if (mipmap->ArrayObj != 0) return; @@ -3067,6 +3115,25 @@ setup_glsl_generate_mipmap(struct gl_context *ctx, _mesa_VertexAttribPointerARB(1, 3, GL_FLOAT, GL_FALSE, sizeof(struct vertex), OFFSET(tex)); + /* Generate a fragment shader program appropriate for the texture target */ + setup_texture_sampler(target, &sampler); + mem_ctx = ralloc_context(NULL); + + if (ctx->Const.GLSLVersion < 130) { + extension_mode = ((target == GL_TEXTURE_1D_ARRAY) || + (target == GL_TEXTURE_2D_ARRAY)) ? + "require" : "disable"; + + fs_source = ralloc_asprintf(mem_ctx, fs_template, + extension_mode, sampler.type, + sampler.func, sampler.texcoords); + } + else { + fs_source = ralloc_asprintf(mem_ctx, fs_template, + sampler.type, "vec4", + sampler.texcoords); + } + vs = compile_shader_with_debug(ctx, GL_VERTEX_SHADER, vs_source); fs = compile_shader_with_debug(ctx, GL_FRAGMENT_SHADER, fs_source); @@ -3080,6 +3147,7 @@ setup_glsl_generate_mipmap(struct gl_context *ctx, _mesa_EnableVertexAttribArrayARB(0); _mesa_EnableVertexAttribArrayARB(1); link_program_with_debug(ctx, mipmap->ShaderProg); + ralloc_free(mem_ctx); if ((_mesa_is_desktop_gl(ctx) && ctx->Const.GLSLVersion >= 130) || _mesa_is_gles3(ctx)){ @@ -3172,7 +3240,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target, * GenerateMipmap function. */ if (use_glsl_version) { - setup_glsl_generate_mipmap(ctx, mipmap); + setup_glsl_generate_mipmap(ctx, mipmap, target); if (texObj->_IsIntegerFormat) _mesa_UseProgramObjectARB(mipmap->IntegerShaderProg); @@ -3738,7 +3806,6 @@ void _mesa_meta_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height) { -#if FEATURE_OES_draw_texture struct drawtex_state *drawtex = &ctx->Meta->DrawTex; struct vertex { GLfloat x, y, z, st[MAX_TEXTURE_UNITS][2]; @@ -3854,5 +3921,4 @@ _mesa_meta_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z, _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); _mesa_meta_end(ctx); -#endif /* FEATURE_OES_draw_texture */ } diff --git a/mesalib/src/mesa/main/accum.c b/mesalib/src/mesa/main/accum.c index 16c26168a..8b71640df 100644 --- a/mesalib/src/mesa/main/accum.c +++ b/mesalib/src/mesa/main/accum.c @@ -36,9 +36,6 @@ #include "main/dispatch.h" -#if FEATURE_accum - - void GLAPIENTRY _mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) { @@ -496,9 +493,6 @@ _mesa_accum(struct gl_context *ctx, GLenum op, GLfloat value) } -#endif /* FEATURE_accum */ - - void _mesa_init_accum( struct gl_context *ctx ) { diff --git a/mesalib/src/mesa/main/accum.h b/mesalib/src/mesa/main/accum.h index 5b3f06aa9..594a7687d 100644 --- a/mesalib/src/mesa/main/accum.h +++ b/mesalib/src/mesa/main/accum.h @@ -44,8 +44,6 @@ struct _glapi_table; struct gl_context; struct gl_renderbuffer; -#if FEATURE_accum - extern void GLAPIENTRY _mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); @@ -58,35 +56,6 @@ _mesa_accum(struct gl_context *ctx, GLenum op, GLfloat value); extern void _mesa_clear_accum_buffer(struct gl_context *ctx); -#else /* FEATURE_accum */ - -#include "main/compiler.h" - -static inline void -_mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) -{ - /* this is used in _mesa_PopAttrib */ - ASSERT_NO_FEATURE(); -} - -static inline void -_mesa_init_accum_dispatch(struct _glapi_table *disp) -{ -} - -static inline void -_mesa_accum(struct gl_context *ctx, GLenum op, GLfloat value) -{ -} - -static inline void -_mesa_clear_accum_buffer(struct gl_context *ctx) -{ -} - - -#endif /* FEATURE_accum */ - extern void _mesa_init_accum( struct gl_context *ctx ); diff --git a/mesalib/src/mesa/main/api_arrayelt.c b/mesalib/src/mesa/main/api_arrayelt.c index 152340b5f..d530001bc 100644 --- a/mesalib/src/mesa/main/api_arrayelt.c +++ b/mesalib/src/mesa/main/api_arrayelt.c @@ -83,9 +83,6 @@ typedef struct { #define NUM_TYPES 8 -#if FEATURE_arrayelt - - static const int ColorFuncs[2][NUM_TYPES] = { { _gloffset_Color3bv, @@ -1711,6 +1708,3 @@ void _mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp, { SET_ArrayElement(disp, vfmt->ArrayElement); } - - -#endif /* FEATURE_arrayelt */ diff --git a/mesalib/src/mesa/main/api_arrayelt.h b/mesalib/src/mesa/main/api_arrayelt.h index 03810c69b..988703259 100644 --- a/mesalib/src/mesa/main/api_arrayelt.h +++ b/mesalib/src/mesa/main/api_arrayelt.h @@ -31,8 +31,6 @@ #include "main/mfeatures.h" #include "main/mtypes.h" -#if FEATURE_arrayelt - #define _MESA_INIT_ARRAYELT_VTXFMT(vfmt, impl) \ do { \ (vfmt)->ArrayElement = impl ## ArrayElement; \ @@ -52,33 +50,5 @@ extern void _mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp, const GLvertexformat *vfmt); -#else /* FEATURE_arrayelt */ - -#define _MESA_INIT_ARRAYELT_VTXFMT(vfmt, impl) do { } while (0) - -static inline GLboolean -_ae_create_context( struct gl_context *ctx ) -{ - return GL_TRUE; -} - -static inline void -_ae_destroy_context( struct gl_context *ctx ) -{ -} - -static inline void -_ae_invalidate_state( struct gl_context *ctx, GLuint new_state ) -{ -} - -static inline void -_mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp, - const GLvertexformat *vfmt) -{ -} - -#endif /* FEATURE_arrayelt */ - #endif /* API_ARRAYELT_H */ diff --git a/mesalib/src/mesa/main/api_exec.c b/mesalib/src/mesa/main/api_exec.c index c44818945..1da041545 100644 --- a/mesalib/src/mesa/main/api_exec.c +++ b/mesalib/src/mesa/main/api_exec.c @@ -33,17 +33,13 @@ #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" #include "bufferobj.h" #include "arrayobj.h" -#if FEATURE_draw_read_buffer #include "buffers.h" -#endif #include "clear.h" #include "clip.h" #include "colortab.h" @@ -60,9 +56,7 @@ #include "get.h" #include "feedback.h" #include "fog.h" -#if FEATURE_EXT_framebuffer_object #include "fbobject.h" -#endif #include "framebuffer.h" #include "hint.h" #include "histogram.h" @@ -77,9 +71,7 @@ #include "polygon.h" #include "queryobj.h" #include "readpix.h" -#if FEATURE_ARB_sampler_objects #include "samplerobj.h" -#endif #include "scissor.h" #include "stencil.h" #include "texenv.h" @@ -95,20 +87,13 @@ #include "mtypes.h" #include "varray.h" #include "viewport.h" -#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program #include "nvprogram.h" -#endif -#if FEATURE_ARB_shader_objects #include "shaderapi.h" #include "uniforms.h" -#endif #include "syncobj.h" #include "main/dispatch.h" -#if FEATURE_GL || FEATURE_ES2 - - /** * Initialize a dispatch table with pointers to Mesa's immediate-mode * commands. @@ -144,12 +129,9 @@ _mesa_create_exec_table(struct gl_context *ctx) SET_ColorMask(exec, _mesa_ColorMask); SET_CullFace(exec, _mesa_CullFace); SET_Disable(exec, _mesa_Disable); -#if FEATURE_draw_read_buffer if (ctx->API == API_OPENGL || ctx->API == API_OPENGL_CORE) SET_DrawBuffer(exec, _mesa_DrawBuffer); - SET_ReadBuffer(exec, _mesa_ReadBuffer); -#endif SET_Enable(exec, _mesa_Enable); SET_Finish(exec, _mesa_Finish); SET_Flush(exec, _mesa_Flush); @@ -376,10 +358,8 @@ _mesa_create_exec_table(struct gl_context *ctx) SET_StencilMaskSeparate(exec, _mesa_StencilMaskSeparate); SET_StencilOpSeparate(exec, _mesa_StencilOpSeparate); -#if FEATURE_ARB_shader_objects _mesa_init_shader_dispatch(exec); _mesa_init_shader_uniform_dispatch(exec); -#endif /* 2. GL_EXT_blend_color */ #if 0 @@ -485,7 +465,6 @@ _mesa_create_exec_table(struct gl_context *ctx) #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); @@ -513,7 +492,6 @@ _mesa_create_exec_table(struct gl_context *ctx) 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 */ @@ -526,7 +504,6 @@ _mesa_create_exec_table(struct gl_context *ctx) 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); @@ -541,7 +518,6 @@ _mesa_create_exec_table(struct gl_context *ctx) SET_GetProgramLocalParameterdvARB(exec, _mesa_GetProgramLocalParameterdvARB); SET_GetProgramLocalParameterfvARB(exec, _mesa_GetProgramLocalParameterfvARB); } -#endif /* 262. GL_NV_point_sprite */ #if _HAVE_FULL_GL @@ -624,7 +600,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 */ @@ -692,7 +667,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); @@ -703,9 +677,7 @@ _mesa_create_exec_table(struct gl_context *ctx) } /* ARB 37. GL_ARB_draw_buffers */ -#if FEATURE_draw_read_buffer SET_DrawBuffersARB(exec, _mesa_DrawBuffersARB); -#endif /* ARB 66. GL_ARB_sync */ if (ctx->API != API_OPENGLES2) { @@ -738,7 +710,6 @@ _mesa_create_exec_table(struct gl_context *ctx) SET_TexBumpParameterfvATI(exec, _mesa_TexBumpParameterfvATI); } -#if FEATURE_EXT_framebuffer_object SET_IsRenderbufferEXT(exec, _mesa_IsRenderbufferEXT); SET_BindRenderbufferEXT(exec, _mesa_BindRenderbufferEXT); SET_DeleteRenderbuffersEXT(exec, _mesa_DeleteRenderbuffersEXT); @@ -758,49 +729,38 @@ _mesa_create_exec_table(struct gl_context *ctx) SET_FramebufferRenderbufferEXT(exec, _mesa_FramebufferRenderbufferEXT); SET_GetFramebufferAttachmentParameterivEXT(exec, _mesa_GetFramebufferAttachmentParameterivEXT); SET_GenerateMipmapEXT(exec, _mesa_GenerateMipmapEXT); -#endif -#if FEATURE_EXT_framebuffer_blit if (ctx->API != API_OPENGLES2) { SET_BlitFramebufferEXT(exec, _mesa_BlitFramebufferEXT); } -#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 FEATURE_EXT_framebuffer_object if (ctx->API != API_OPENGLES2) { SET_FramebufferTextureLayerEXT(exec, _mesa_FramebufferTextureLayerEXT); } -#endif /* GL_ATI_separate_stencil */ if (ctx->API == API_OPENGL) { SET_StencilFuncSeparateATI(exec, _mesa_StencilFuncSeparateATI); } -#if FEATURE_ARB_framebuffer_object /* The ARB_fbo functions are the union of * GL_EXT_fbo, GL_EXT_framebuffer_blit, GL_EXT_texture_array */ if (ctx->API != API_OPENGLES2) { SET_RenderbufferStorageMultisample(exec, _mesa_RenderbufferStorageMultisample); } -#endif -#if FEATURE_ARB_map_buffer_range if (ctx->API != API_OPENGLES2) { SET_MapBufferRange(exec, _mesa_MapBufferRange); SET_FlushMappedBufferRange(exec, _mesa_FlushMappedBufferRange); } -#endif /* GL_ARB_copy_buffer */ if (ctx->API != API_OPENGLES2) { @@ -827,25 +787,19 @@ _mesa_create_exec_table(struct gl_context *ctx) SET_EndConditionalRenderNV(exec, _mesa_EndConditionalRender); } -#if FEATURE_OES_EGL_image SET_EGLImageTargetTexture2DOES(exec, _mesa_EGLImageTargetTexture2DOES); SET_EGLImageTargetRenderbufferStorageOES(exec, _mesa_EGLImageTargetRenderbufferStorageOES); -#endif -#if FEATURE_APPLE_object_purgeable if (ctx->API != API_OPENGLES2) { SET_ObjectPurgeableAPPLE(exec, _mesa_ObjectPurgeableAPPLE); SET_ObjectUnpurgeableAPPLE(exec, _mesa_ObjectUnpurgeableAPPLE); SET_GetObjectParameterivAPPLE(exec, _mesa_GetObjectParameterivAPPLE); } -#endif -#if FEATURE_ARB_geometry_shader4 if (ctx->API != API_OPENGLES2) { SET_FramebufferTextureARB(exec, _mesa_FramebufferTextureARB); SET_FramebufferTextureFaceARB(exec, _mesa_FramebufferTextureFaceARB); } -#endif if (ctx->API != API_OPENGLES2) { SET_ClampColorARB(exec, _mesa_ClampColorARB); @@ -913,11 +867,9 @@ _mesa_create_exec_table(struct gl_context *ctx) SET_TextureStorage2DEXT(exec, _mesa_TextureStorage2DEXT); SET_TextureStorage3DEXT(exec, _mesa_TextureStorage3DEXT); -#if FEATURE_ARB_sampler_objects if (ctx->API != API_OPENGLES2) { _mesa_init_sampler_object_dispatch(exec); } -#endif if (_mesa_is_desktop_gl(ctx)) { SET_InvalidateTexSubImage(exec, _mesa_InvalidateTexSubImage); @@ -931,5 +883,3 @@ _mesa_create_exec_table(struct gl_context *ctx) return exec; } - -#endif /* FEATURE_GL || FEATURE_ES2 */ diff --git a/mesalib/src/mesa/main/api_loopback.c b/mesalib/src/mesa/main/api_loopback.c index c438307d8..a5fbe8ebf 100644 --- a/mesalib/src/mesa/main/api_loopback.c +++ b/mesalib/src/mesa/main/api_loopback.c @@ -86,9 +86,6 @@ #define ATTRIBI_4UI(index,x,y,z,w) CALL_VertexAttribI4uiEXT(GET_DISPATCH(), (index,x,y,z,w)) -#if FEATURE_beginend - - static void GLAPIENTRY loopback_Color3b_f( GLbyte red, GLbyte green, GLbyte blue ) { @@ -1720,6 +1717,3 @@ _mesa_loopback_init_api_table( struct _glapi_table *dest ) SET_VertexAttribI4ubvEXT(dest, loopback_VertexAttribI4ubv); SET_VertexAttribI4usvEXT(dest, loopback_VertexAttribI4usv); } - - -#endif /* FEATURE_beginend */ diff --git a/mesalib/src/mesa/main/api_loopback.h b/mesalib/src/mesa/main/api_loopback.h index f53b90280..a99c30962 100644 --- a/mesalib/src/mesa/main/api_loopback.h +++ b/mesalib/src/mesa/main/api_loopback.h @@ -32,17 +32,6 @@ struct _glapi_table; -#if FEATURE_beginend - extern void _mesa_loopback_init_api_table( struct _glapi_table *dest ); -#else /* FEATURE_beginend */ - -static inline void -_mesa_loopback_init_api_table( struct _glapi_table *dest ) -{ -} - -#endif /* FEATURE_beginend */ - #endif /* API_LOOPBACK_H */ diff --git a/mesalib/src/mesa/main/api_validate.c b/mesalib/src/mesa/main/api_validate.c index d0d2ca4d4..db9d14a4c 100644 --- a/mesalib/src/mesa/main/api_validate.c +++ b/mesalib/src/mesa/main/api_validate.c @@ -110,25 +110,20 @@ check_valid_to_render(struct gl_context *ctx, const char *function) } switch (ctx->API) { -#if FEATURE_es2_glsl case API_OPENGLES2: /* For ES2, we can draw if any vertex array is enabled (and we * should always have a vertex program/shader). */ if (ctx->Array.ArrayObj->_Enabled == 0x0 || !ctx->VertexProgram._Current) return GL_FALSE; break; -#endif -#if FEATURE_ES1 case API_OPENGLES: /* For OpenGL ES, only draw if we have vertex positions */ if (!ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POS].Enabled) return GL_FALSE; break; -#endif -#if FEATURE_GL case API_OPENGL: case API_OPENGL_CORE: { @@ -151,7 +146,6 @@ check_valid_to_render(struct gl_context *ctx, const char *function) } } break; -#endif default: ASSERT_NO_FEATURE(); @@ -616,8 +610,6 @@ _mesa_validate_DrawElementsInstanced(struct gl_context *ctx, } -#if FEATURE_EXT_transform_feedback - GLboolean _mesa_validate_DrawTransformFeedback(struct gl_context *ctx, GLenum mode, @@ -662,5 +654,3 @@ _mesa_validate_DrawTransformFeedback(struct gl_context *ctx, return GL_TRUE; } - -#endif diff --git a/mesalib/src/mesa/main/api_validate.h b/mesalib/src/mesa/main/api_validate.h index 8dc8df4b2..0ca9c90d9 100644 --- a/mesalib/src/mesa/main/api_validate.h +++ b/mesalib/src/mesa/main/api_validate.h @@ -78,8 +78,6 @@ _mesa_validate_DrawElementsInstanced(struct gl_context *ctx, const GLvoid *indices, GLsizei primcount, GLint basevertex); -#if FEATURE_EXT_transform_feedback - extern GLboolean _mesa_validate_DrawTransformFeedback(struct gl_context *ctx, GLenum mode, @@ -87,6 +85,5 @@ _mesa_validate_DrawTransformFeedback(struct gl_context *ctx, GLuint stream, GLsizei numInstances); -#endif #endif diff --git a/mesalib/src/mesa/main/arrayobj.c b/mesalib/src/mesa/main/arrayobj.c index 9337fe725..9255559d5 100644 --- a/mesalib/src/mesa/main/arrayobj.c +++ b/mesalib/src/mesa/main/arrayobj.c @@ -236,11 +236,9 @@ _mesa_initialize_array_object( struct gl_context *ctx, case VERT_ATTRIB_EDGEFLAG: init_array(ctx, &obj->VertexAttrib[VERT_ATTRIB_EDGEFLAG], 1, GL_BOOL); break; -#if FEATURE_point_size_array case VERT_ATTRIB_POINT_SIZE: init_array(ctx, &obj->VertexAttrib[VERT_ATTRIB_POINT_SIZE], 1, GL_FLOAT); break; -#endif default: init_array(ctx, &obj->VertexAttrib[i], 4, GL_FLOAT); break; diff --git a/mesalib/src/mesa/main/atifragshader.c b/mesalib/src/mesa/main/atifragshader.c index 63608a33f..32ddfb8bb 100644 --- a/mesalib/src/mesa/main/atifragshader.c +++ b/mesalib/src/mesa/main/atifragshader.c @@ -32,8 +32,6 @@ #include "main/dispatch.h" #include "main/atifragshader.h" -#if FEATURE_ATI_fragment_shader - #define MESA_DEBUG_ATI_FS 0 static struct ati_fragment_shader DummyShader; @@ -786,5 +784,3 @@ _mesa_SetFragmentShaderConstantATI(GLuint dst, const GLfloat * value) COPY_4V(ctx->ATIFragmentShader.GlobalConstants[dstindex], value); } } - -#endif /* FEATURE_ATI_fragment_shader */ diff --git a/mesalib/src/mesa/main/atifragshader.h b/mesalib/src/mesa/main/atifragshader.h index 90ada212a..f5af5f15f 100644 --- a/mesalib/src/mesa/main/atifragshader.h +++ b/mesalib/src/mesa/main/atifragshader.h @@ -25,8 +25,6 @@ struct ati_fs_opcode_st GLint num_src_args; }; -extern struct ati_fs_opcode_st ati_fs_opcodes[]; - struct atifragshader_src_register { GLuint Index; @@ -65,8 +63,6 @@ struct atifs_setupinst }; -#if FEATURE_ATI_fragment_shader - extern void _mesa_init_ati_fragment_shader_dispatch(struct _glapi_table *disp); @@ -130,25 +126,5 @@ _mesa_AlphaFragmentOp3ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, extern void GLAPIENTRY _mesa_SetFragmentShaderConstantATI(GLuint dst, const GLfloat * value); -#else /* FEATURE_ATI_fragment_shader */ - -static inline void -_mesa_init_ati_fragment_shader_dispatch(struct _glapi_table *disp) -{ -} - -static inline struct ati_fragment_shader * -_mesa_new_ati_fragment_shader(struct gl_context *ctx, GLuint id) -{ - return NULL; -} - -static inline void -_mesa_delete_ati_fragment_shader(struct gl_context *ctx, - struct ati_fragment_shader *s) -{ -} - -#endif /* FEATURE_ATI_fragment_shader */ #endif /* ATIFRAGSHADER_H */ diff --git a/mesalib/src/mesa/main/attrib.c b/mesalib/src/mesa/main/attrib.c index 806cf09d8..b92c4652e 100644 --- a/mesalib/src/mesa/main/attrib.c +++ b/mesalib/src/mesa/main/attrib.c @@ -178,9 +178,6 @@ struct texture_state }; -#if FEATURE_attrib_stack - - /** * Allocate new attribute node of given type/kind. Attach payload data. * Insert it into the linked list named by 'head'. @@ -1609,9 +1606,6 @@ _mesa_init_attrib_dispatch(struct _glapi_table *disp) } -#endif /* FEATURE_attrib_stack */ - - /** * Free any attribute state data that might be attached to the context. */ diff --git a/mesalib/src/mesa/main/attrib.h b/mesalib/src/mesa/main/attrib.h index 6809311cf..f75c3c5ce 100644 --- a/mesalib/src/mesa/main/attrib.h +++ b/mesalib/src/mesa/main/attrib.h @@ -33,8 +33,6 @@ struct _glapi_table; struct gl_context; -#if FEATURE_attrib_stack - extern void GLAPIENTRY _mesa_PushAttrib( GLbitfield mask ); @@ -50,27 +48,6 @@ _mesa_PopClientAttrib( void ); extern void _mesa_init_attrib_dispatch(struct _glapi_table *disp); -#else /* FEATURE_attrib_stack */ - -static inline void -_mesa_PushClientAttrib( GLbitfield mask ) -{ - ASSERT_NO_FEATURE(); -} - -static inline void -_mesa_PopClientAttrib( void ) -{ - ASSERT_NO_FEATURE(); -} - -static inline void -_mesa_init_attrib_dispatch(struct _glapi_table *disp) -{ -} - -#endif /* FEATURE_attrib_stack */ - extern void _mesa_init_attrib( struct gl_context *ctx ); diff --git a/mesalib/src/mesa/main/bufferobj.c b/mesalib/src/mesa/main/bufferobj.c index f8fd32922..9c1e0bf52 100644 --- a/mesalib/src/mesa/main/bufferobj.c +++ b/mesalib/src/mesa/main/bufferobj.c @@ -87,13 +87,11 @@ get_buffer_target(struct gl_context *ctx, GLenum target) return &ctx->CopyReadBuffer; case GL_COPY_WRITE_BUFFER: return &ctx->CopyWriteBuffer; -#if FEATURE_EXT_transform_feedback case GL_TRANSFORM_FEEDBACK_BUFFER: if (ctx->Extensions.EXT_transform_feedback) { return &ctx->TransformFeedback.CurrentBuffer; } break; -#endif case GL_TEXTURE_BUFFER: if (_mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_buffer_object) { @@ -1670,7 +1668,6 @@ _mesa_FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length) } -#if FEATURE_APPLE_object_purgeable static GLenum buffer_object_purgeable(struct gl_context *ctx, GLuint name, GLenum option) { @@ -2045,8 +2042,6 @@ _mesa_GetObjectParameterivAPPLE(GLenum objectType, GLuint name, GLenum pname, } } -#endif /* FEATURE_APPLE_object_purgeable */ - static void set_ubo_binding(struct gl_context *ctx, int index, diff --git a/mesalib/src/mesa/main/bufferobj.h b/mesalib/src/mesa/main/bufferobj.h index 15fdb9c30..4f1e61b63 100644 --- a/mesalib/src/mesa/main/bufferobj.h +++ b/mesalib/src/mesa/main/bufferobj.h @@ -148,7 +148,6 @@ _mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, extern void GLAPIENTRY _mesa_FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length); -#if FEATURE_APPLE_object_purgeable extern GLenum GLAPIENTRY _mesa_ObjectPurgeableAPPLE(GLenum objectType, GLuint name, GLenum option); @@ -157,7 +156,6 @@ _mesa_ObjectUnpurgeableAPPLE(GLenum objectType, GLuint name, GLenum option); extern void GLAPIENTRY _mesa_GetObjectParameterivAPPLE(GLenum objectType, GLuint name, GLenum pname, GLint* params); -#endif void GLAPIENTRY _mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer); diff --git a/mesalib/src/mesa/main/colortab.c b/mesalib/src/mesa/main/colortab.c index f20dee677..5799c01f6 100644 --- a/mesalib/src/mesa/main/colortab.c +++ b/mesalib/src/mesa/main/colortab.c @@ -39,8 +39,6 @@ #include "main/dispatch.h" -#if FEATURE_colortable - void GLAPIENTRY _mesa_ColorTable( GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, @@ -164,6 +162,3 @@ _mesa_init_colortable_dispatch(struct _glapi_table *disp) /* GL_ARB_robustness */ SET_GetnColorTableARB(disp, _mesa_GetnColorTableARB); } - - -#endif /* FEATURE_colortable */ diff --git a/mesalib/src/mesa/main/colortab.h b/mesalib/src/mesa/main/colortab.h index 4e225ffc9..7b8df38a1 100644 --- a/mesalib/src/mesa/main/colortab.h +++ b/mesalib/src/mesa/main/colortab.h @@ -33,8 +33,6 @@ struct _glapi_table; -#if FEATURE_colortable - extern void GLAPIENTRY _mesa_ColorTable( GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, @@ -48,29 +46,5 @@ _mesa_ColorSubTable( GLenum target, GLsizei start, extern void _mesa_init_colortable_dispatch(struct _glapi_table *disp); -#else /* FEATURE_colortable */ - -static inline void GLAPIENTRY -_mesa_ColorTable( GLenum target, GLenum internalformat, - GLsizei width, GLenum format, GLenum type, - const GLvoid *table ) -{ - ASSERT_NO_FEATURE(); -} - -static inline void GLAPIENTRY -_mesa_ColorSubTable( GLenum target, GLsizei start, - GLsizei count, GLenum format, GLenum type, - const GLvoid *table ) -{ - ASSERT_NO_FEATURE(); -} - -static inline void -_mesa_init_colortable_dispatch(struct _glapi_table *disp) -{ -} - -#endif /* FEATURE_colortable */ #endif /* COLORTAB_H */ diff --git a/mesalib/src/mesa/main/context.c b/mesalib/src/mesa/main/context.c index 6b28690ec..abce52e58 100644 --- a/mesalib/src/mesa/main/context.c +++ b/mesalib/src/mesa/main/context.c @@ -599,15 +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 -#if FEATURE_ARB_geometry_shader4 init_program_limits(ctx, MESA_GEOMETRY_PROGRAM, &ctx->Const.GeometryProgram); -#endif + ctx->Const.MaxProgramMatrices = MAX_PROGRAM_MATRICES; ctx->Const.MaxProgramMatrixStackDepth = MAX_PROGRAM_MATRIX_STACK_DEPTH; @@ -617,23 +612,17 @@ _mesa_init_constants(struct gl_context *ctx) /* GL_ARB_draw_buffers */ ctx->Const.MaxDrawBuffers = MAX_DRAW_BUFFERS; -#if FEATURE_EXT_framebuffer_object ctx->Const.MaxColorAttachments = MAX_COLOR_ATTACHMENTS; ctx->Const.MaxRenderbufferSize = MAX_RENDERBUFFER_SIZE; -#endif -#if FEATURE_ARB_vertex_shader ctx->Const.MaxVertexTextureImageUnits = MAX_VERTEX_TEXTURE_IMAGE_UNITS; ctx->Const.MaxCombinedTextureImageUnits = MAX_COMBINED_TEXTURE_IMAGE_UNITS; ctx->Const.MaxVarying = MAX_VARYING; -#endif -#if FEATURE_ARB_geometry_shader4 ctx->Const.MaxGeometryTextureImageUnits = MAX_GEOMETRY_TEXTURE_IMAGE_UNITS; ctx->Const.MaxVertexVaryingComponents = MAX_VERTEX_VARYING_COMPONENTS; ctx->Const.MaxGeometryVaryingComponents = MAX_GEOMETRY_VARYING_COMPONENTS; ctx->Const.MaxGeometryOutputVertices = MAX_GEOMETRY_OUTPUT_VERTICES; ctx->Const.MaxGeometryTotalOutputComponents = MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS; -#endif /* Shading language version */ if (_mesa_is_desktop_gl(ctx)) { @@ -961,7 +950,6 @@ _mesa_initialize_context(struct gl_context *ctx, return GL_FALSE; } -#if FEATURE_dispatch /* setup the API dispatch tables */ switch (ctx->API) { #if FEATURE_GL || FEATURE_ES2 @@ -985,7 +973,6 @@ _mesa_initialize_context(struct gl_context *ctx, _mesa_reference_shared_state(ctx, &ctx->Shared, NULL); return GL_FALSE; } -#endif ctx->CurrentDispatch = ctx->Exec; ctx->FragmentProgram._MaintainTexEnvProgram @@ -1008,7 +995,6 @@ _mesa_initialize_context(struct gl_context *ctx, switch (ctx->API) { case API_OPENGL: -#if FEATURE_dlist ctx->Save = _mesa_create_save_table(); if (!ctx->Save) { _mesa_reference_shared_state(ctx, &ctx->Shared, NULL); @@ -1017,7 +1003,6 @@ _mesa_initialize_context(struct gl_context *ctx, } _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt ); -#endif case API_OPENGL_CORE: break; case API_OPENGLES: @@ -1138,12 +1123,9 @@ _mesa_free_context_data( struct gl_context *ctx ) _mesa_free_varray_data(ctx); _mesa_free_transform_feedback(ctx); -#if FEATURE_ARB_pixel_buffer_object _mesa_reference_buffer_object(ctx, &ctx->Pack.BufferObj, NULL); _mesa_reference_buffer_object(ctx, &ctx->Unpack.BufferObj, NULL); _mesa_reference_buffer_object(ctx, &ctx->DefaultPacking.BufferObj, NULL); -#endif - _mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj, NULL); /* free dispatch tables */ diff --git a/mesalib/src/mesa/main/convolve.c b/mesalib/src/mesa/main/convolve.c index 74f28da87..cac8a9979 100644 --- a/mesalib/src/mesa/main/convolve.c +++ b/mesalib/src/mesa/main/convolve.c @@ -41,8 +41,6 @@ #include "main/dispatch.h" -#if FEATURE_convolve - static void GLAPIENTRY _mesa_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *image) { @@ -200,6 +198,3 @@ _mesa_init_convolve_dispatch(struct _glapi_table *disp) SET_GetnConvolutionFilterARB(disp, _mesa_GetnConvolutionFilterARB); SET_GetnSeparableFilterARB(disp, _mesa_GetnSeparableFilterARB); } - - -#endif /* FEATURE_convolve */ diff --git a/mesalib/src/mesa/main/convolve.h b/mesalib/src/mesa/main/convolve.h index 952285643..2fbe3c7f5 100644 --- a/mesalib/src/mesa/main/convolve.h +++ b/mesalib/src/mesa/main/convolve.h @@ -33,19 +33,7 @@ struct _glapi_table; - -#if FEATURE_convolve - extern void _mesa_init_convolve_dispatch(struct _glapi_table *disp); -#else /* FEATURE_convolve */ - -static inline void -_mesa_init_convolve_dispatch(struct _glapi_table *disp) -{ -} - -#endif /* FEATURE_convolve */ - #endif /* CONVOLVE_H */ diff --git a/mesalib/src/mesa/main/dlist.c b/mesalib/src/mesa/main/dlist.c index 40e693364..b663e364c 100644 --- a/mesalib/src/mesa/main/dlist.c +++ b/mesalib/src/mesa/main/dlist.c @@ -35,9 +35,7 @@ #include "api_exec.h" #include "api_loopback.h" #include "api_validate.h" -#if FEATURE_ATI_fragment_shader #include "atifragshader.h" -#endif #include "config.h" #include "mfeatures.h" #include "bufferobj.h" @@ -46,9 +44,7 @@ #include "dlist.h" #include "enums.h" #include "eval.h" -#if FEATURE_EXT_framebuffer_object #include "fbobject.h" -#endif #include "framebuffer.h" #include "glapi/glapi.h" #include "glformats.h" @@ -66,15 +62,9 @@ #include "texstorage.h" #include "mtypes.h" #include "varray.h" -#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 #include "math/m_matrix.h" @@ -553,9 +543,6 @@ union uint64_pair static GLuint InstSize[OPCODE_END_OF_LIST + 1]; -#if FEATURE_dlist - - void mesa_print_display_list(GLuint list); @@ -741,7 +728,6 @@ _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist) 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]; @@ -750,19 +736,14 @@ _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist) 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 */ n += InstSize[n[0].opcode]; break; -#endif case OPCODE_UNIFORM_1FV: case OPCODE_UNIFORM_2FV: case OPCODE_UNIFORM_3FV: @@ -4861,7 +4842,6 @@ save_SampleCoverageARB(GLclampf value, GLboolean invert) /* * 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) { @@ -4961,9 +4941,7 @@ save_ProgramEnvParameter4dvARB(GLenum target, GLuint index, (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) { @@ -5078,13 +5056,11 @@ save_TrackMatrixNV(GLenum target, GLuint address, 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) @@ -5262,9 +5238,6 @@ save_ProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte * name, (GLfloat) v[3]); } -#endif /* FEATURE_NV_fragment_program */ - - /* GL_EXT_stencil_two_side */ static void GLAPIENTRY @@ -5302,8 +5275,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) @@ -5331,10 +5302,6 @@ save_ProgramStringARB(GLenum target, GLenum format, GLsizei len, } } -#endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */ - - -#if FEATURE_queryobj static void GLAPIENTRY save_BeginQueryARB(GLenum target, GLuint id) @@ -5416,8 +5383,6 @@ save_EndQueryIndexed(GLenum target, GLuint index) } } -#endif /* FEATURE_queryobj */ - static void GLAPIENTRY save_DrawBuffersARB(GLsizei count, const GLenum * buffers) @@ -5470,7 +5435,6 @@ save_TexBumpParameterivATI(GLenum pname, const GLint *param) save_TexBumpParameterfvATI(pname, p); } -#if FEATURE_ATI_fragment_shader static void GLAPIENTRY save_BindFragmentShaderATI(GLuint id) { @@ -5504,7 +5468,6 @@ save_SetFragmentShaderConstantATI(GLuint dst, const GLfloat *value) CALL_SetFragmentShaderConstantATI(ctx->Exec, (dst, value)); } } -#endif static void GLAPIENTRY save_Attr1fNV(GLenum attr, GLfloat x) @@ -6354,7 +6317,6 @@ exec_GetUniformLocationARB(GLuint program, const GLchar *name) /* XXX more shader functions needed here */ -#if FEATURE_EXT_framebuffer_blit static void GLAPIENTRY save_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, @@ -6382,7 +6344,6 @@ save_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, mask, filter)); } } -#endif /** GL_EXT_provoking_vertex */ @@ -8412,12 +8373,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_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]; @@ -8439,9 +8397,6 @@ execute_list(struct gl_context *ctx, GLuint list) 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, @@ -8453,28 +8408,21 @@ execute_list(struct gl_context *ctx, GLuint list) 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; 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_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 -#if FEATURE_queryobj case OPCODE_BEGIN_QUERY_ARB: CALL_BeginQueryARB(ctx->Exec, (n[1].e, n[2].ui)); break; @@ -8490,7 +8438,6 @@ execute_list(struct gl_context *ctx, GLuint list) case OPCODE_END_QUERY_INDEXED: CALL_EndQueryIndexed(ctx->Exec, (n[1].e, n[2].ui)); break; -#endif case OPCODE_DRAW_BUFFERS_ARB: { GLenum buffers[MAX_DRAW_BUFFERS]; @@ -8500,14 +8447,11 @@ execute_list(struct gl_context *ctx, GLuint list) CALL_DrawBuffersARB(ctx->Exec, (n[1].i, buffers)); } break; -#if FEATURE_EXT_framebuffer_blit case OPCODE_BLIT_FRAMEBUFFER: CALL_BlitFramebufferEXT(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i, n[5].i, n[6].i, n[7].i, n[8].i, n[9].i, n[10].e)); break; -#endif - case OPCODE_USE_PROGRAM: CALL_UseProgramObjectARB(ctx->Exec, (n[1].ui)); break; @@ -8644,7 +8588,6 @@ execute_list(struct gl_context *ctx, GLuint list) CALL_TexBumpParameterfvATI(ctx->Exec, (pname, values)); } break; -#if FEATURE_ATI_fragment_shader case OPCODE_BIND_FRAGMENT_SHADER_ATI: CALL_BindFragmentShaderATI(ctx->Exec, (n[1].i)); break; @@ -8658,7 +8601,6 @@ execute_list(struct gl_context *ctx, GLuint list) CALL_SetFragmentShaderConstantATI(ctx->Exec, (dst, values)); } break; -#endif case OPCODE_ATTR_1F_NV: CALL_VertexAttrib1fNV(ctx->Exec, (n[1].e, n[2].f)); break; @@ -10289,7 +10231,6 @@ _mesa_create_save_table(void) 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, @@ -10320,20 +10261,16 @@ _mesa_create_save_table(void) 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); SET_TexBumpParameterfvATI(table, save_TexBumpParameterfvATI); /* 245. GL_ATI_fragment_shader */ -#if FEATURE_ATI_fragment_shader SET_BindFragmentShaderATI(table, save_BindFragmentShaderATI); SET_SetFragmentShaderConstantATI(table, save_SetFragmentShaderConstantATI); -#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); @@ -10350,7 +10287,6 @@ _mesa_create_save_table(void) _mesa_GetProgramLocalParameterdvARB); SET_GetProgramLocalParameterfvARB(table, _mesa_GetProgramLocalParameterfvARB); -#endif /* 262. GL_NV_point_sprite */ SET_PointParameteriNV(table, save_PointParameteriNV); @@ -10420,7 +10356,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); @@ -10450,7 +10385,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 */ @@ -10466,18 +10400,14 @@ _mesa_create_save_table(void) SET_MapBufferARB(table, _mesa_MapBufferARB); SET_UnmapBufferARB(table, _mesa_UnmapBufferARB); -#if FEATURE_queryobj _mesa_init_queryobj_dispatch(table); /* glGetQuery, etc */ SET_BeginQueryARB(table, save_BeginQueryARB); SET_EndQueryARB(table, save_EndQueryARB); SET_QueryCounter(table, save_QueryCounter); -#endif SET_DrawBuffersARB(table, save_DrawBuffersARB); -#if FEATURE_EXT_framebuffer_blit SET_BlitFramebufferEXT(table, save_BlitFramebufferEXT); -#endif /* GL_ARB_shader_objects */ _mesa_init_shader_dispatch(table); /* Plug in glCreate/Delete/Get, etc */ @@ -10518,16 +10448,12 @@ _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 SET_MapBufferRange(table, _mesa_MapBufferRange); /* no dlist save */ SET_FlushMappedBufferRange(table, _mesa_FlushMappedBufferRange); /* no dl */ -#endif /* ARB 51. GL_ARB_texture_buffer_object */ SET_TexBufferARB(table, _mesa_TexBuffer); /* no dlist save */ @@ -10539,11 +10465,9 @@ _mesa_create_save_table(void) SET_ProvokingVertexEXT(table, save_ProvokingVertexEXT); /* 371. GL_APPLE_object_purgeable */ -#if FEATURE_APPLE_object_purgeable SET_ObjectPurgeableAPPLE(table, _mesa_ObjectPurgeableAPPLE); SET_ObjectUnpurgeableAPPLE(table, _mesa_ObjectUnpurgeableAPPLE); SET_GetObjectParameterivAPPLE(table, _mesa_GetObjectParameterivAPPLE); -#endif /* GL_EXT_texture_integer */ SET_ClearColorIiEXT(table, save_ClearColorIi); @@ -10586,7 +10510,6 @@ _mesa_create_save_table(void) (void) save_Uniform4uiv; #endif -#if FEATURE_EXT_transform_feedback /* These are not compiled into display lists: */ SET_BindBufferBaseEXT(table, _mesa_BindBufferBase); SET_BindBufferOffsetEXT(table, _mesa_BindBufferOffsetEXT); @@ -10604,11 +10527,8 @@ _mesa_create_save_table(void) save_DrawTransformFeedbackInstanced); SET_DrawTransformFeedbackStreamInstanced(table, save_DrawTransformFeedbackStreamInstanced); -#if FEATURE_queryobj SET_BeginQueryIndexed(table, save_BeginQueryIndexed); SET_EndQueryIndexed(table, save_EndQueryIndexed); -#endif -#endif /* GL_ARB_instanced_arrays */ SET_VertexAttribDivisorARB(table, save_VertexAttribDivisor); @@ -11076,9 +10996,6 @@ void _mesa_init_dlist_dispatch(struct _glapi_table *disp) } -#endif /* FEATURE_dlist */ - - /** * Initialize display list state for given context. */ @@ -11106,9 +11023,7 @@ _mesa_init_display_list(struct gl_context *ctx) /* Display List group */ ctx->List.ListBase = 0; -#if FEATURE_dlist _mesa_save_vtxfmt_init(&ctx->ListState.ListVtxfmt); -#endif } diff --git a/mesalib/src/mesa/main/dlist.h b/mesalib/src/mesa/main/dlist.h index 89008431a..992a089f1 100644 --- a/mesalib/src/mesa/main/dlist.h +++ b/mesalib/src/mesa/main/dlist.h @@ -37,8 +37,6 @@ #include "main/mtypes.h" -#if FEATURE_dlist - #define _MESA_INIT_DLIST_VTXFMT(vfmt, impl) \ do { \ (vfmt)->CallList = impl ## CallList; \ @@ -70,32 +68,6 @@ extern void _mesa_install_dlist_vtxfmt(struct _glapi_table *disp, extern void _mesa_init_dlist_dispatch(struct _glapi_table *disp); -#else /* FEATURE_dlist */ - -#include "main/compiler.h" - -#define _MESA_INIT_DLIST_VTXFMT(vfmt, impl) do { } while (0) - -static inline void -_mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist) -{ - /* there should be no list to delete */ - ASSERT_NO_FEATURE(); -} - -static inline void -_mesa_install_dlist_vtxfmt(struct _glapi_table *disp, - const GLvertexformat *vfmt) -{ -} - -static inline void -_mesa_init_dlist_dispatch(struct _glapi_table *disp) -{ -} - -#endif /* FEATURE_dlist */ - extern void _mesa_init_display_list( struct gl_context * ctx ); extern void _mesa_free_display_list_data(struct gl_context *ctx); diff --git a/mesalib/src/mesa/main/drawpix.c b/mesalib/src/mesa/main/drawpix.c index bd9837fdd..b5ab2cbeb 100644 --- a/mesalib/src/mesa/main/drawpix.c +++ b/mesalib/src/mesa/main/drawpix.c @@ -39,9 +39,6 @@ #include "fbobject.h" -#if FEATURE_drawpix - - /* * Execute glDrawPixels */ @@ -379,6 +376,3 @@ _mesa_init_drawpix_dispatch(struct _glapi_table *disp) SET_CopyPixels(disp, _mesa_CopyPixels); SET_DrawPixels(disp, _mesa_DrawPixels); } - - -#endif /* FEATURE_drawpix */ diff --git a/mesalib/src/mesa/main/drawpix.h b/mesalib/src/mesa/main/drawpix.h index 13efba5f8..971d258f1 100644 --- a/mesalib/src/mesa/main/drawpix.h +++ b/mesalib/src/mesa/main/drawpix.h @@ -32,19 +32,8 @@ struct _glapi_table; -#if FEATURE_drawpix - extern void _mesa_init_drawpix_dispatch(struct _glapi_table *disp); -#else /* FEATURE_drawpix */ - -static inline void -_mesa_init_drawpix_dispatch(struct _glapi_table *disp) -{ -} - -#endif /* FEATURE_drawpix */ - #endif /* DRAWPIX_H */ diff --git a/mesalib/src/mesa/main/drawtex.c b/mesalib/src/mesa/main/drawtex.c index 83485a928..d5cac22bd 100644 --- a/mesalib/src/mesa/main/drawtex.c +++ b/mesalib/src/mesa/main/drawtex.c @@ -28,9 +28,6 @@ #include "main/mtypes.h" -#if FEATURE_OES_draw_texture - - static void draw_texture(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height) @@ -133,5 +130,3 @@ _mesa_DrawTexxv(const GLfixed *coords) (GLfloat) coords[3] / 65536.0f, (GLfloat) coords[4] / 65536.0f); } - -#endif /* FEATURE_OES_draw_texture */ diff --git a/mesalib/src/mesa/main/drawtex.h b/mesalib/src/mesa/main/drawtex.h index 13ff6f97e..938b65fb2 100644 --- a/mesalib/src/mesa/main/drawtex.h +++ b/mesalib/src/mesa/main/drawtex.h @@ -29,8 +29,6 @@ #include "mfeatures.h" -#if FEATURE_OES_draw_texture - extern void GLAPIENTRY _mesa_DrawTexf(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height); @@ -55,7 +53,5 @@ _mesa_DrawTexx(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height); extern void GLAPIENTRY _mesa_DrawTexxv(const GLfixed *coords); -#endif /* FEATURE_OES_draw_texture */ - #endif /* DRAWTEX_H */ diff --git a/mesalib/src/mesa/main/enable.c b/mesalib/src/mesa/main/enable.c index 14eea53fe..3643cfb52 100644 --- a/mesalib/src/mesa/main/enable.c +++ b/mesalib/src/mesa/main/enable.c @@ -92,14 +92,11 @@ client_state(struct gl_context *ctx, GLenum cap, GLboolean state) flag = VERT_BIT_COLOR1; break; -#if FEATURE_point_size_array case GL_POINT_SIZE_ARRAY_OES: var = &arrayObj->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Enabled; flag = VERT_BIT_POINT_SIZE; break; -#endif -#if FEATURE_NV_vertex_program case GL_VERTEX_ATTRIB_ARRAY0_NV: case GL_VERTEX_ATTRIB_ARRAY1_NV: case GL_VERTEX_ATTRIB_ARRAY2_NV: @@ -124,7 +121,6 @@ client_state(struct gl_context *ctx, GLenum cap, GLboolean state) flag = VERT_BIT_GENERIC(n); } break; -#endif /* FEATURE_NV_vertex_program */ /* GL_NV_primitive_restart */ case GL_PRIMITIVE_RESTART_NV: @@ -251,6 +247,23 @@ enable_texture(struct gl_context *ctx, GLboolean state, GLbitfield texBit) /** + * Helper function to enable or disable GL_MULTISAMPLE, skipping the check for + * whether the API supports it (GLES doesn't). + */ +void +_mesa_set_multisample(struct gl_context *ctx, GLboolean state) +{ + if (ctx->Multisample.Enabled == state) + return; + FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); + ctx->Multisample.Enabled = state; + + if (ctx->Driver.Enable) { + ctx->Driver.Enable(ctx, GL_MULTISAMPLE, state); + } +} + +/** * Helper function to enable or disable state. * * \param ctx GL context. @@ -298,7 +311,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) } } break; -#if FEATURE_userclip case GL_CLIP_DISTANCE0: case GL_CLIP_DISTANCE1: case GL_CLIP_DISTANCE2: @@ -328,7 +340,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) } } break; -#endif case GL_COLOR_MATERIAL: if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES) goto invalid_enum_error; @@ -767,11 +778,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) case GL_MULTISAMPLE_ARB: if (!_mesa_is_desktop_gl(ctx) && ctx->API != API_OPENGLES) goto invalid_enum_error; - if (ctx->Multisample.Enabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); - ctx->Multisample.Enabled = state; - break; + _mesa_set_multisample(ctx, state); + return; case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB: if (ctx->Multisample.SampleAlphaToCoverage == state) return; @@ -823,7 +831,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) 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; @@ -854,8 +861,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) 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: @@ -906,9 +912,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) 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; @@ -918,7 +922,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) FLUSH_VERTICES(ctx, _NEW_PROGRAM); ctx->FragmentProgram.Enabled = state; break; -#endif /* FEATURE_NV_fragment_program */ /* GL_NV_texture_rectangle */ case GL_TEXTURE_RECTANGLE_NV: @@ -946,7 +949,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; @@ -956,7 +958,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: @@ -979,7 +980,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Transform.DepthClamp = state; break; -#if FEATURE_ATI_fragment_shader case GL_FRAGMENT_SHADER_ATI: if (ctx->API != API_OPENGL) goto invalid_enum_error; @@ -989,7 +989,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) FLUSH_VERTICES(ctx, _NEW_PROGRAM); ctx->ATIFragmentShader.Enabled = state; break; -#endif /* GL_MESA_texture_array */ case GL_TEXTURE_1D_ARRAY_EXT: @@ -1020,7 +1019,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) } break; -#if FEATURE_EXT_transform_feedback case GL_RASTERIZER_DISCARD: if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx)) goto invalid_enum_error; @@ -1030,7 +1028,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->RasterDiscard = state; } break; -#endif /* GL 3.1 primitive restart. Note: this enum is different from * GL_PRIMITIVE_RESTART_NV (which is client state). @@ -1488,7 +1485,7 @@ _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_point_size_array +#if FEATURE_ES case GL_POINT_SIZE_ARRAY_OES: if (ctx->API != API_OPENGLES) goto invalid_enum_error; @@ -1539,7 +1536,6 @@ _mesa_IsEnabled( GLenum cap ) 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; @@ -1558,8 +1554,7 @@ _mesa_IsEnabled( GLenum cap ) 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: @@ -1630,15 +1625,12 @@ _mesa_IsEnabled( GLenum cap ) 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: @@ -1654,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: @@ -1675,13 +1665,11 @@ _mesa_IsEnabled( GLenum cap ) CHECK_EXTENSION(ARB_depth_clamp); return ctx->Transform.DepthClamp; -#if FEATURE_ATI_fragment_shader case GL_FRAGMENT_SHADER_ATI: if (ctx->API != API_OPENGL) goto invalid_enum_error; CHECK_EXTENSION(ATI_fragment_shader); return ctx->ATIFragmentShader.Enabled; -#endif /* FEATURE_ATI_fragment_shader */ case GL_TEXTURE_CUBE_MAP_SEAMLESS: if (!_mesa_is_desktop_gl(ctx)) @@ -1689,13 +1677,11 @@ _mesa_IsEnabled( GLenum cap ) CHECK_EXTENSION(ARB_seamless_cube_map); return ctx->Texture.CubeMapSeamless; -#if FEATURE_EXT_transform_feedback case GL_RASTERIZER_DISCARD: if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx)) goto invalid_enum_error; CHECK_EXTENSION(EXT_transform_feedback); return ctx->RasterDiscard; -#endif /* GL_NV_primitive_restart */ case GL_PRIMITIVE_RESTART_NV: diff --git a/mesalib/src/mesa/main/enable.h b/mesalib/src/mesa/main/enable.h index 6d90c170c..c49b4948d 100644 --- a/mesalib/src/mesa/main/enable.h +++ b/mesalib/src/mesa/main/enable.h @@ -67,5 +67,9 @@ _mesa_EnableClientState( GLenum cap ); extern void GLAPIENTRY _mesa_DisableClientState( GLenum cap ); +extern void +_mesa_set_multisample(struct gl_context *ctx, GLboolean state); + + #endif diff --git a/mesalib/src/mesa/main/eval.c b/mesalib/src/mesa/main/eval.c index ca1b33bd2..b0458a1e8 100644 --- a/mesalib/src/mesa/main/eval.c +++ b/mesalib/src/mesa/main/eval.c @@ -48,9 +48,6 @@ #include "main/dispatch.h" -#if FEATURE_evaluators - - /* * Return the number of components per control point for any type of * evaluator. Return 0 if bad target. @@ -924,9 +921,6 @@ _mesa_init_eval_dispatch(struct _glapi_table *disp) } -#endif /* FEATURE_evaluators */ - - /**********************************************************************/ /***** Initialization *****/ /**********************************************************************/ diff --git a/mesalib/src/mesa/main/eval.h b/mesalib/src/mesa/main/eval.h index c07d4d532..0649de052 100644 --- a/mesalib/src/mesa/main/eval.h +++ b/mesalib/src/mesa/main/eval.h @@ -41,8 +41,6 @@ #include "main/mtypes.h" -#if FEATURE_evaluators - #define _MESA_INIT_EVAL_VTXFMT(vfmt, impl) \ do { \ (vfmt)->EvalCoord1f = impl ## EvalCoord1f; \ @@ -83,23 +81,6 @@ _mesa_install_eval_vtxfmt(struct _glapi_table *disp, extern void _mesa_init_eval_dispatch(struct _glapi_table *disp); -#else /* FEATURE_evaluators */ - -#define _MESA_INIT_EVAL_VTXFMT(vfmt, impl) do { } while (0) - -static inline void -_mesa_install_eval_vtxfmt(struct _glapi_table *disp, - const GLvertexformat *vfmt) -{ -} - -static inline void -_mesa_init_eval_dispatch(struct _glapi_table *disp) -{ -} - -#endif /* FEATURE_evaluators */ - extern void _mesa_init_eval( struct gl_context *ctx ); extern void _mesa_free_eval_data( struct gl_context *ctx ); diff --git a/mesalib/src/mesa/main/extensions.c b/mesalib/src/mesa/main/extensions.c index e6f4541f0..bd7c7baf9 100644 --- a/mesalib/src/mesa/main/extensions.c +++ b/mesalib/src/mesa/main/extensions.c @@ -235,14 +235,10 @@ static const struct extension extension_table[] = { { "GL_OES_depth24", o(EXT_framebuffer_object), ES1 | ES2, 2005 }, { "GL_OES_depth32", o(dummy_false), DISABLE, 2005 }, { "GL_OES_depth_texture", o(ARB_depth_texture), ES2, 2006 }, -#if FEATURE_OES_draw_texture { "GL_OES_draw_texture", o(OES_draw_texture), ES1, 2004 }, -#endif -#if FEATURE_OES_EGL_image /* FIXME: Mesa expects GL_OES_EGL_image to be available in OpenGL contexts. */ { "GL_OES_EGL_image", o(OES_EGL_image), GL | ES1 | ES2, 2006 }, { "GL_OES_EGL_image_external", o(OES_EGL_image_external), ES1 | ES2, 2010 }, -#endif { "GL_OES_element_index_uint", o(dummy_true), ES1 | ES2, 2005 }, { "GL_OES_fbo_render_mipmap", o(EXT_framebuffer_object), ES1 | ES2, 2005 }, { "GL_OES_fixed_point", o(dummy_true), ES1, 2002 }, @@ -399,35 +395,23 @@ _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 -#if FEATURE_ARB_fragment_shader ctx->Extensions.ARB_fragment_shader = GL_TRUE; -#endif -#if FEATURE_ARB_framebuffer_object ctx->Extensions.ARB_framebuffer_object = GL_TRUE; -#endif -#if FEATURE_ARB_geometry_shader4 && 0 /* XXX re-enable when GLSL compiler again supports geometry shaders */ +#if 0 ctx->Extensions.ARB_geometry_shader4 = GL_TRUE; #endif ctx->Extensions.ARB_half_float_pixel = GL_TRUE; ctx->Extensions.ARB_half_float_vertex = GL_TRUE; ctx->Extensions.ARB_map_buffer_range = GL_TRUE; -#if FEATURE_queryobj ctx->Extensions.ARB_occlusion_query = GL_TRUE; ctx->Extensions.ARB_occlusion_query2 = GL_TRUE; -#endif ctx->Extensions.ARB_point_sprite = GL_TRUE; -#if FEATURE_ARB_shader_objects ctx->Extensions.ARB_shader_objects = GL_TRUE; ctx->Extensions.EXT_separate_shader_objects = GL_TRUE; -#endif -#if FEATURE_ARB_shading_language_100 ctx->Extensions.ARB_shading_language_100 = GL_TRUE; -#endif ctx->Extensions.ARB_shadow = GL_TRUE; ctx->Extensions.ARB_texture_border_clamp = GL_TRUE; ctx->Extensions.ARB_texture_cube_map = GL_TRUE; @@ -439,22 +423,12 @@ _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 -#if FEATURE_ARB_vertex_shader ctx->Extensions.ARB_vertex_shader = GL_TRUE; -#endif -#if FEATURE_ARB_sync ctx->Extensions.ARB_sync = GL_TRUE; -#endif -#if FEATURE_APPLE_object_purgeable ctx->Extensions.APPLE_object_purgeable = GL_TRUE; -#endif ctx->Extensions.ATI_envmap_bumpmap = GL_TRUE; -#if FEATURE_ATI_fragment_shader ctx->Extensions.ATI_fragment_shader = GL_TRUE; -#endif ctx->Extensions.ATI_texture_compression_3dc = GL_TRUE; ctx->Extensions.ATI_texture_env_combine3 = GL_TRUE; ctx->Extensions.ATI_texture_mirror_once = GL_TRUE; @@ -466,19 +440,11 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) ctx->Extensions.EXT_depth_bounds_test = GL_TRUE; ctx->Extensions.EXT_draw_buffers2 = GL_TRUE; ctx->Extensions.EXT_fog_coord = GL_TRUE; -#if FEATURE_EXT_framebuffer_object ctx->Extensions.EXT_framebuffer_object = GL_TRUE; -#endif -#if FEATURE_EXT_framebuffer_blit ctx->Extensions.EXT_framebuffer_blit = GL_TRUE; -#endif -#if FEATURE_ARB_framebuffer_object ctx->Extensions.EXT_framebuffer_multisample = GL_TRUE; -#endif ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE; -#if FEATURE_EXT_pixel_buffer_object ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE; -#endif ctx->Extensions.EXT_point_parameters = GL_TRUE; ctx->Extensions.EXT_provoking_vertex = GL_TRUE; ctx->Extensions.EXT_shadow_funcs = GL_TRUE; @@ -490,14 +456,10 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) ctx->Extensions.EXT_texture_filter_anisotropic = GL_TRUE; ctx->Extensions.EXT_texture_mirror_clamp = GL_TRUE; ctx->Extensions.EXT_texture_shared_exponent = GL_TRUE; -#if FEATURE_EXT_texture_sRGB ctx->Extensions.EXT_texture_sRGB = GL_TRUE; ctx->Extensions.EXT_texture_sRGB_decode = GL_TRUE; -#endif ctx->Extensions.EXT_texture_swizzle = GL_TRUE; -#if FEATURE_EXT_transform_feedback /*ctx->Extensions.EXT_transform_feedback = GL_TRUE;*/ -#endif ctx->Extensions.EXT_vertex_array_bgra = GL_TRUE; /*ctx->Extensions.IBM_multimode_draw_arrays = GL_TRUE;*/ ctx->Extensions.MESA_pack_invert = GL_TRUE; @@ -511,28 +473,16 @@ _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;*/ -#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 FEATURE_texture_fxt1 _mesa_enable_extension(ctx, "GL_3DFX_texture_compression_FXT1"); -#endif -#if FEATURE_texture_s3tc if (ctx->Mesa_DXTn) { _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc"); _mesa_enable_extension(ctx, "GL_S3_s3tc"); } -#endif } @@ -591,22 +541,14 @@ _mesa_enable_1_5_extensions(struct gl_context *ctx) void _mesa_enable_2_0_extensions(struct gl_context *ctx) { -#if FEATURE_ARB_fragment_shader ctx->Extensions.ARB_fragment_shader = GL_TRUE; -#endif ctx->Extensions.ARB_point_sprite = GL_TRUE; ctx->Extensions.EXT_blend_equation_separate = GL_TRUE; ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE; -#if FEATURE_ARB_shader_objects ctx->Extensions.ARB_shader_objects = GL_TRUE; -#endif -#if FEATURE_ARB_shading_language_100 ctx->Extensions.ARB_shading_language_100 = GL_TRUE; -#endif ctx->Extensions.EXT_stencil_two_side = GL_TRUE; -#if FEATURE_ARB_vertex_shader ctx->Extensions.ARB_vertex_shader = GL_TRUE; -#endif } @@ -617,12 +559,8 @@ _mesa_enable_2_0_extensions(struct gl_context *ctx) void _mesa_enable_2_1_extensions(struct gl_context *ctx) { -#if FEATURE_EXT_pixel_buffer_object ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE; -#endif -#if FEATURE_EXT_texture_sRGB ctx->Extensions.EXT_texture_sRGB = GL_TRUE; -#endif } @@ -947,7 +885,7 @@ _mesa_get_enabled_extension(struct gl_context *ctx, GLuint index) base = (GLboolean*) &ctx->Extensions; n = 0; for (i = extension_table; i->name != 0; ++i) { - if (base[i->offset] & (i->api_set & (1 << ctx->API))) { + if (base[i->offset] && (i->api_set & (1 << ctx->API))) { if (n == index) return (const GLubyte*) i->name; else diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c index abc9d83a6..1736899cb 100644 --- a/mesalib/src/mesa/main/fbobject.c +++ b/mesalib/src/mesa/main/fbobject.c @@ -819,7 +819,6 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx, } } -#if FEATURE_GL if (_mesa_is_desktop_gl(ctx) && !ctx->Extensions.ARB_ES2_compatibility) { /* Check that all DrawBuffers are present */ for (j = 0; j < ctx->Const.MaxDrawBuffers; j++) { @@ -847,9 +846,6 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx, } } } -#else - (void) j; -#endif if (numImages == 0) { fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT; @@ -1497,7 +1493,6 @@ renderbuffer_storage(GLenum target, GLenum internalFormat, } -#if FEATURE_OES_EGL_image void GLAPIENTRY _mesa_EGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image) { @@ -1528,7 +1523,6 @@ _mesa_EGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image) ctx->Driver.EGLImageTargetRenderbufferStorage(ctx, rb, image); } -#endif /** @@ -1734,7 +1728,6 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) } switch (target) { -#if FEATURE_EXT_framebuffer_blit case GL_DRAW_FRAMEBUFFER_EXT: if (!ctx->Extensions.EXT_framebuffer_blit) { _mesa_error(ctx, GL_INVALID_ENUM, "glBindFramebufferEXT(target)"); @@ -1751,7 +1744,6 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) bindDrawBuf = GL_FALSE; bindReadBuf = GL_TRUE; break; -#endif case GL_FRAMEBUFFER_EXT: bindDrawBuf = GL_TRUE; bindReadBuf = GL_TRUE; @@ -2659,8 +2651,6 @@ _mesa_GenerateMipmapEXT(GLenum target) } -#if FEATURE_EXT_framebuffer_blit - static const struct gl_renderbuffer_attachment * find_attachment(const struct gl_framebuffer *fb, const struct gl_renderbuffer *rb) @@ -3062,10 +3052,8 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); } -#endif /* FEATURE_EXT_framebuffer_blit */ -#if FEATURE_ARB_geometry_shader4 void GLAPIENTRY _mesa_FramebufferTextureARB(GLenum target, GLenum attachment, GLuint texture, GLint level) @@ -3086,7 +3074,6 @@ _mesa_FramebufferTextureFaceARB(GLenum target, GLenum attachment, "glFramebufferTextureFaceARB " "not implemented!"); } -#endif /* FEATURE_ARB_geometry_shader4 */ static void invalidate_framebuffer_storage(GLenum target, GLsizei numAttachments, diff --git a/mesalib/src/mesa/main/feedback.c b/mesalib/src/mesa/main/feedback.c index f95e3b5d4..8a63acdf1 100644 --- a/mesalib/src/mesa/main/feedback.c +++ b/mesalib/src/mesa/main/feedback.c @@ -40,9 +40,6 @@ #include "main/dispatch.h" -#if FEATURE_feedback - - #define FB_3D 0x01 #define FB_4D 0x02 #define FB_COLOR 0x04 @@ -515,9 +512,6 @@ _mesa_init_feedback_dispatch(struct _glapi_table *disp) } -#endif /* FEATURE_feedback */ - - /**********************************************************************/ /** \name Initialization */ /*@{*/ diff --git a/mesalib/src/mesa/main/feedback.h b/mesalib/src/mesa/main/feedback.h index c64db3134..cc4cf15a8 100644 --- a/mesalib/src/mesa/main/feedback.h +++ b/mesalib/src/mesa/main/feedback.h @@ -31,8 +31,6 @@ #include "main/mtypes.h" -#if FEATURE_feedback - extern GLint GLAPIENTRY _mesa_RenderMode( GLenum mode ); @@ -60,41 +58,6 @@ _mesa_update_hitflag( struct gl_context *ctx, GLfloat z ); extern void _mesa_init_feedback_dispatch(struct _glapi_table *disp); -#else /* FEATURE_feedback */ - -#include "main/compiler.h" - -static inline void -_mesa_feedback_vertex( struct gl_context *ctx, - const GLfloat win[4], - const GLfloat color[4], - const GLfloat texcoord[4] ) -{ - /* render mode is always GL_RENDER */ - ASSERT_NO_FEATURE(); -} - - -static inline void -_mesa_feedback_token( struct gl_context *ctx, GLfloat token ) -{ - /* render mode is always GL_RENDER */ - ASSERT_NO_FEATURE(); -} - -static inline void -_mesa_update_hitflag( struct gl_context *ctx, GLfloat z ) -{ - /* render mode is always GL_RENDER */ - ASSERT_NO_FEATURE(); -} - -static inline void -_mesa_init_feedback_dispatch(struct _glapi_table *disp) -{ -} - -#endif /* FEATURE_feedback */ extern void _mesa_init_feedback( struct gl_context *ctx ); diff --git a/mesalib/src/mesa/main/ffvertex_prog.c b/mesalib/src/mesa/main/ffvertex_prog.c index e5ab20145..0a98c4acf 100644 --- a/mesalib/src/mesa/main/ffvertex_prog.c +++ b/mesalib/src/mesa/main/ffvertex_prog.c @@ -229,10 +229,8 @@ static void make_state_key( struct gl_context *ctx, struct state_key *key ) if (ctx->Point._Attenuated) key->point_attenuated = 1; -#if FEATURE_point_size_array if (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Enabled) key->point_array = 1; -#endif if (ctx->Texture._TexGenEnabled || ctx->Texture._TexMatEnabled || diff --git a/mesalib/src/mesa/main/formats.c b/mesalib/src/mesa/main/formats.c index 1fa641c92..df23af1dd 100644 --- a/mesalib/src/mesa/main/formats.c +++ b/mesalib/src/mesa/main/formats.c @@ -2245,7 +2245,6 @@ _mesa_format_to_type_and_comps(gl_format format, *comps = 4; return; -#if FEATURE_EXT_texture_sRGB case MESA_FORMAT_SRGB8: *datatype = GL_UNSIGNED_BYTE; *comps = 3; @@ -2263,24 +2262,17 @@ _mesa_format_to_type_and_comps(gl_format format, *datatype = GL_UNSIGNED_BYTE; *comps = 2; return; -#endif -#if FEATURE_texture_fxt1 case MESA_FORMAT_RGB_FXT1: case MESA_FORMAT_RGBA_FXT1: -#endif -#if FEATURE_texture_s3tc case MESA_FORMAT_RGB_DXT1: case MESA_FORMAT_RGBA_DXT1: case MESA_FORMAT_RGBA_DXT3: case MESA_FORMAT_RGBA_DXT5: -#if FEATURE_EXT_texture_sRGB case MESA_FORMAT_SRGB_DXT1: case MESA_FORMAT_SRGBA_DXT1: case MESA_FORMAT_SRGBA_DXT3: case MESA_FORMAT_SRGBA_DXT5: -#endif -#endif case MESA_FORMAT_RED_RGTC1: case MESA_FORMAT_SIGNED_RED_RGTC1: case MESA_FORMAT_RG_RGTC2: diff --git a/mesalib/src/mesa/main/get.c b/mesalib/src/mesa/main/get.c index 6800cc353..14208504b 100644 --- a/mesalib/src/mesa/main/get.c +++ b/mesalib/src/mesa/main/get.c @@ -536,6 +536,11 @@ static const struct value_desc values[] = { /* GL_{APPLE,ARB,OES}_vertex_array_object */ { GL_VERTEX_ARRAY_BINDING_APPLE, ARRAY_INT(Name), NO_EXTRA }, + /* GL_EXT_texture_filter_anisotropic */ + { GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, + CONTEXT_FLOAT(Const.MaxTextureMaxAnisotropy), + extra_EXT_texture_filter_anisotropic }, + #if FEATURE_GL || FEATURE_ES1 /* Enums in OpenGL and GLES1 */ { 0, 0, TYPE_API_MASK, API_OPENGL_BIT | API_OPENGLES_BIT | API_OPENGL_CORE_BIT, NO_EXTRA }, @@ -685,11 +690,6 @@ static const struct value_desc values[] = { /* GL_EXT_texture_lod_bias */ { GL_MAX_TEXTURE_LOD_BIAS_EXT, CONTEXT_FLOAT(Const.MaxTextureLodBias), NO_EXTRA }, - - /* GL_EXT_texture_filter_anisotropic */ - { GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, - CONTEXT_FLOAT(Const.MaxTextureMaxAnisotropy), - extra_EXT_texture_filter_anisotropic }, #endif /* FEATURE_GL || FEATURE_ES1 */ #if FEATURE_ES1 @@ -2316,7 +2316,6 @@ _mesa_GetIntegerv(GLenum pname, GLint *params) } } -#if FEATURE_ARB_sync void GLAPIENTRY _mesa_GetInteger64v(GLenum pname, GLint64 *params) { @@ -2411,7 +2410,6 @@ _mesa_GetInteger64v(GLenum pname, GLint64 *params) break; } } -#endif /* FEATURE_ARB_sync */ void GLAPIENTRY _mesa_GetDoublev(GLenum pname, GLdouble *params) @@ -2684,7 +2682,6 @@ _mesa_GetIntegerIndexedv( GLenum pname, GLuint index, GLint *params ) } } -#if FEATURE_ARB_sync void GLAPIENTRY _mesa_GetInteger64Indexedv( GLenum pname, GLuint index, GLint64 *params ) { @@ -2709,7 +2706,6 @@ _mesa_GetInteger64Indexedv( GLenum pname, GLuint index, GLint64 *params ) ; /* nothing - GL error was recorded */ } } -#endif /* FEATURE_ARB_sync */ #if FEATURE_ES1 void GLAPIENTRY diff --git a/mesalib/src/mesa/main/getstring.c b/mesalib/src/mesa/main/getstring.c index 9c9ade359..54e518d2b 100644 --- a/mesalib/src/mesa/main/getstring.c +++ b/mesalib/src/mesa/main/getstring.c @@ -131,14 +131,10 @@ _mesa_GetString( GLenum name ) return (const GLubyte *) 0; } return (const GLubyte *) ctx->Extensions.String; -#if FEATURE_ARB_shading_language_100 || FEATURE_ES2 case GL_SHADING_LANGUAGE_VERSION: if (ctx->API == API_OPENGLES) break; return shading_language_version(ctx); -#endif -#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 || @@ -148,7 +144,6 @@ _mesa_GetString( GLenum name ) return (const GLubyte *) ctx->Program.ErrorString; } break; -#endif default: break; } @@ -261,13 +256,11 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params ) goto invalid_pname; *params = ctx->Select.Buffer; break; -#if FEATURE_point_size_array case GL_POINT_SIZE_ARRAY_POINTER_OES: if (ctx->API != API_OPENGLES) goto invalid_pname; *params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Ptr; break; -#endif case GL_DEBUG_CALLBACK_FUNCTION_ARB: if (!_mesa_is_desktop_gl(ctx)) goto invalid_pname; diff --git a/mesalib/src/mesa/main/glformats.c b/mesalib/src/mesa/main/glformats.c index 2d06cb715..047a613a1 100644 --- a/mesalib/src/mesa/main/glformats.c +++ b/mesalib/src/mesa/main/glformats.c @@ -544,7 +544,6 @@ _mesa_is_color_format(GLenum format) case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: case GL_COMPRESSED_RGB_FXT1_3DFX: case GL_COMPRESSED_RGBA_FXT1_3DFX: -#if FEATURE_EXT_texture_sRGB case GL_SRGB_EXT: case GL_SRGB8_EXT: case GL_SRGB_ALPHA_EXT: @@ -561,7 +560,6 @@ _mesa_is_color_format(GLenum format) case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: case GL_COMPRESSED_SLUMINANCE_EXT: case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT: -#endif /* FEATURE_EXT_texture_sRGB */ case GL_COMPRESSED_RED_RGTC1: case GL_COMPRESSED_SIGNED_RED_RGTC1: case GL_COMPRESSED_RG_RGTC2: diff --git a/mesalib/src/mesa/main/histogram.c b/mesalib/src/mesa/main/histogram.c index 44fc1325c..d3dc7ddc4 100644 --- a/mesalib/src/mesa/main/histogram.c +++ b/mesalib/src/mesa/main/histogram.c @@ -32,8 +32,6 @@ #include "main/dispatch.h" -#if FEATURE_histogram - /********************************************************************** * API functions */ @@ -169,5 +167,3 @@ _mesa_init_histogram_dispatch(struct _glapi_table *disp) SET_GetnHistogramARB(disp, _mesa_GetnHistogramARB); SET_GetnMinmaxARB(disp, _mesa_GetnMinmaxARB); } - -#endif /* FEATURE_histogram */ diff --git a/mesalib/src/mesa/main/histogram.h b/mesalib/src/mesa/main/histogram.h index d97e74abb..a9c312152 100644 --- a/mesalib/src/mesa/main/histogram.h +++ b/mesalib/src/mesa/main/histogram.h @@ -41,18 +41,7 @@ struct _glapi_table; -#if FEATURE_histogram - extern void _mesa_init_histogram_dispatch(struct _glapi_table *disp); -#else /* FEATURE_histogram */ - -static inline void -_mesa_init_histogram_dispatch(struct _glapi_table *disp) -{ -} - -#endif /* FEATURE_histogram */ - #endif /* HISTOGRAM_H */ diff --git a/mesalib/src/mesa/main/matrix.c b/mesalib/src/mesa/main/matrix.c index 5c3569c16..76f5ea7cd 100644 --- a/mesalib/src/mesa/main/matrix.c +++ b/mesalib/src/mesa/main/matrix.c @@ -572,7 +572,6 @@ update_projection( struct gl_context *ctx ) { _math_matrix_analyse( ctx->ProjectionMatrixStack.Top ); -#if FEATURE_userclip /* Recompute clip plane positions in clipspace. This is also done * in _mesa_ClipPlane(). */ @@ -586,7 +585,6 @@ update_projection( struct gl_context *ctx ) } } } -#endif } diff --git a/mesalib/src/mesa/main/mfeatures.h b/mesalib/src/mesa/main/mfeatures.h index b67f046ca..3162a0bbf 100644 --- a/mesalib/src/mesa/main/mfeatures.h +++ b/mesalib/src/mesa/main/mfeatures.h @@ -31,7 +31,6 @@ #ifndef FEATURES_H #define FEATURES_H - #ifndef _HAVE_FULL_GL #define _HAVE_FULL_GL 1 #endif @@ -39,32 +38,6 @@ /* assert that a feature is disabled and should never be used */ #define ASSERT_NO_FEATURE() ASSERT(0) -/** - * A feature can be anything. But most of them share certain characteristics. - * - * When a feature defines vtxfmt entries, they can be initialized and - * installed by - * _MESA_INIT_<FEATURE>_VTXFMT - * _mesa_install_<feature>_vtxfmt - * - * When a feature defines dispatch entries, they are initialized by - * _mesa_init_<feature>_dispatch - * - * When a feature has states, they are initialized and freed by - * _mesa_init_<feature> - * _mesa_free_<feature>_data - * - * Except for states, the others compile to no-op when a feature is disabled. - * - * The GLAPIENTRYs and helper functions defined by a feature should also - * compile to no-op when it is disabled. But to save typings and to catch - * bugs, some of them may be unavailable, or compile to ASSERT_NO_FEATURE() - * when the feature is disabled. - * - * A feature following the conventions may be used without knowing if it is - * enabled or not. - */ - #ifndef FEATURE_ES1 #define FEATURE_ES1 0 #endif @@ -84,62 +57,4 @@ #define FEATURE_remap_table 0 #endif -#define FEATURE_dispatch 1 -#define FEATURE_texgen 1 -#define FEATURE_userclip 1 - -#define FEATURE_accum FEATURE_GL -#define FEATURE_arrayelt FEATURE_GL -#define FEATURE_attrib_stack FEATURE_GL -/* this disables vtxfmt, api_loopback, and api_noop completely */ -#define FEATURE_beginend FEATURE_GL -#define FEATURE_colortable FEATURE_GL -#define FEATURE_convolve FEATURE_GL -#define FEATURE_dlist (FEATURE_GL && FEATURE_arrayelt && FEATURE_beginend) -#define FEATURE_draw_read_buffer FEATURE_GL -#define FEATURE_drawpix FEATURE_GL -#define FEATURE_evaluators FEATURE_GL -#define FEATURE_feedback FEATURE_GL -#define FEATURE_pixel_transfer FEATURE_GL -#define FEATURE_queryobj FEATURE_GL -#define FEATURE_rastpos FEATURE_GL -#define FEATURE_texture_fxt1 FEATURE_GL -#define FEATURE_texture_s3tc FEATURE_GL - -#define FEATURE_extra_context_init FEATURE_ES -#define FEATURE_point_size_array FEATURE_ES - -#define FEATURE_es2_glsl FEATURE_ES2 - -#define FEATURE_ARB_fragment_program 1 -#define FEATURE_ARB_vertex_program 1 -#define FEATURE_ARB_vertex_shader 1 -#define FEATURE_ARB_fragment_shader 1 -#define FEATURE_ARB_shader_objects (FEATURE_ARB_vertex_shader || FEATURE_ARB_fragment_shader) -#define FEATURE_ARB_shading_language_100 FEATURE_ARB_shader_objects -#define FEATURE_ARB_geometry_shader4 FEATURE_ARB_shader_objects - -#define FEATURE_ARB_framebuffer_object (FEATURE_GL && FEATURE_EXT_framebuffer_object) -#define FEATURE_ARB_map_buffer_range FEATURE_GL -#define FEATURE_ARB_pixel_buffer_object (FEATURE_GL && FEATURE_EXT_pixel_buffer_object) -#define FEATURE_ARB_sampler_objects FEATURE_GL -#define FEATURE_ARB_sync FEATURE_GL - -#define FEATURE_EXT_framebuffer_blit FEATURE_GL -#define FEATURE_EXT_framebuffer_object 1 -#define FEATURE_EXT_pixel_buffer_object 1 -#define FEATURE_EXT_texture_sRGB FEATURE_GL -#define FEATURE_EXT_transform_feedback FEATURE_GL - -#define FEATURE_APPLE_object_purgeable FEATURE_GL -#define FEATURE_ATI_fragment_shader FEATURE_GL -#define FEATURE_NV_fence FEATURE_GL -#define FEATURE_NV_fragment_program FEATURE_GL -#define FEATURE_NV_vertex_program FEATURE_GL - -#define FEATURE_OES_EGL_image 1 -#define FEATURE_OES_draw_texture FEATURE_ES1 -#define FEATURE_OES_framebuffer_object FEATURE_ES -#define FEATURE_OES_mapbuffer FEATURE_ES - #endif /* FEATURES_H */ diff --git a/mesalib/src/mesa/main/pixel.c b/mesalib/src/mesa/main/pixel.c index 450c936b7..f926c56a4 100644 --- a/mesalib/src/mesa/main/pixel.c +++ b/mesalib/src/mesa/main/pixel.c @@ -40,9 +40,6 @@ #include "main/dispatch.h" -#if FEATURE_pixel_transfer - - /**********************************************************************/ /***** glPixelZoom *****/ /**********************************************************************/ @@ -670,9 +667,6 @@ _mesa_init_pixel_dispatch(struct _glapi_table *disp) } -#endif /* FEATURE_pixel_transfer */ - - /**********************************************************************/ /***** Initialization *****/ /**********************************************************************/ diff --git a/mesalib/src/mesa/main/pixel.h b/mesalib/src/mesa/main/pixel.h index 797b0d9d6..bfd76d934 100644 --- a/mesalib/src/mesa/main/pixel.h +++ b/mesalib/src/mesa/main/pixel.h @@ -41,8 +41,6 @@ struct _glapi_table; struct gl_context; -#if FEATURE_pixel_transfer - extern void GLAPIENTRY _mesa_PixelTransferf(GLenum pname, GLfloat param); @@ -52,27 +50,6 @@ _mesa_update_pixel( struct gl_context *ctx, GLuint newstate ); extern void _mesa_init_pixel_dispatch( struct _glapi_table * disp ); -#else /* FEATURE_pixel_transfer */ - -static inline void GLAPIENTRY -_mesa_PixelTransferf(GLenum pname, GLfloat param) -{ -} - - -static inline void -_mesa_update_pixel(struct gl_context *ctx, GLuint newstate) -{ -} - -static inline void -_mesa_init_pixel_dispatch(struct _glapi_table *disp) -{ -} - -#endif /* FEATURE_pixel_transfer */ - - extern void _mesa_init_pixel( struct gl_context * ctx ); diff --git a/mesalib/src/mesa/main/pixelstore.c b/mesalib/src/mesa/main/pixelstore.c index d1e96aa8f..e56d5049f 100644 --- a/mesalib/src/mesa/main/pixelstore.c +++ b/mesalib/src/mesa/main/pixelstore.c @@ -270,10 +270,8 @@ _mesa_init_pixelstore( struct gl_context *ctx ) ctx->Pack.SwapBytes = GL_FALSE; ctx->Pack.LsbFirst = GL_FALSE; ctx->Pack.Invert = GL_FALSE; -#if FEATURE_EXT_pixel_buffer_object _mesa_reference_buffer_object(ctx, &ctx->Pack.BufferObj, ctx->Shared->NullBufferObj); -#endif ctx->Unpack.Alignment = 4; ctx->Unpack.RowLength = 0; ctx->Unpack.ImageHeight = 0; @@ -283,10 +281,8 @@ _mesa_init_pixelstore( struct gl_context *ctx ) ctx->Unpack.SwapBytes = GL_FALSE; ctx->Unpack.LsbFirst = GL_FALSE; ctx->Unpack.Invert = GL_FALSE; -#if FEATURE_EXT_pixel_buffer_object _mesa_reference_buffer_object(ctx, &ctx->Unpack.BufferObj, ctx->Shared->NullBufferObj); -#endif /* * _mesa_unpack_image() returns image data in this format. When we @@ -303,8 +299,6 @@ _mesa_init_pixelstore( struct gl_context *ctx ) ctx->DefaultPacking.SwapBytes = GL_FALSE; ctx->DefaultPacking.LsbFirst = GL_FALSE; ctx->DefaultPacking.Invert = GL_FALSE; -#if FEATURE_EXT_pixel_buffer_object _mesa_reference_buffer_object(ctx, &ctx->DefaultPacking.BufferObj, ctx->Shared->NullBufferObj); -#endif } diff --git a/mesalib/src/mesa/main/queryobj.c b/mesalib/src/mesa/main/queryobj.c index d5e2453e6..42c77bdb8 100644 --- a/mesalib/src/mesa/main/queryobj.c +++ b/mesalib/src/mesa/main/queryobj.c @@ -34,9 +34,6 @@ #include "main/dispatch.h" -#if FEATURE_queryobj - - /** * Allocate a new query object. This is a fallback routine called via * ctx->Driver.NewQueryObject(). @@ -155,7 +152,6 @@ get_query_binding_point(struct gl_context *ctx, GLenum target) return &ctx->Query.CurrentTimerObject; else return NULL; -#if FEATURE_EXT_transform_feedback case GL_PRIMITIVES_GENERATED: if (ctx->Extensions.EXT_transform_feedback) return &ctx->Query.PrimitivesGenerated; @@ -166,7 +162,6 @@ get_query_binding_point(struct gl_context *ctx, GLenum target) return &ctx->Query.PrimitivesWritten; else return NULL; -#endif default: return NULL; } @@ -734,9 +729,6 @@ _mesa_init_queryobj_dispatch(struct _glapi_table *disp) } -#endif /* FEATURE_queryobj */ - - /** * Allocate/init the context state related to query objects. */ diff --git a/mesalib/src/mesa/main/queryobj.h b/mesalib/src/mesa/main/queryobj.h index e7a133b59..0f662fb57 100644 --- a/mesalib/src/mesa/main/queryobj.h +++ b/mesalib/src/mesa/main/queryobj.h @@ -32,8 +32,6 @@ #include "main/hash.h" -#if FEATURE_queryobj - static inline struct gl_query_object * _mesa_lookup_query_object(struct gl_context *ctx, GLuint id) { @@ -48,26 +46,6 @@ _mesa_init_query_object_functions(struct dd_function_table *driver); extern void _mesa_init_queryobj_dispatch(struct _glapi_table *disp); -#else /* FEATURE_queryobj */ - -static inline struct gl_query_object * -_mesa_lookup_query_object(struct gl_context *ctx, GLuint id) -{ - return NULL; -} - -static inline void -_mesa_init_query_object_functions(struct dd_function_table *driver) -{ -} - -static inline void -_mesa_init_queryobj_dispatch(struct _glapi_table *disp) -{ -} - -#endif /* FEATURE_queryobj */ - extern void _mesa_init_queryobj(struct gl_context *ctx); diff --git a/mesalib/src/mesa/main/rastpos.c b/mesalib/src/mesa/main/rastpos.c index a1f6f4234..ab8e2c1a3 100644 --- a/mesalib/src/mesa/main/rastpos.c +++ b/mesalib/src/mesa/main/rastpos.c @@ -39,9 +39,6 @@ #include "main/dispatch.h" -#if FEATURE_rastpos - - /** * Helper function for all the RasterPos functions. */ @@ -533,9 +530,6 @@ _mesa_init_rastpos_dispatch(struct _glapi_table *disp) } -#endif /* FEATURE_rastpos */ - - /**********************************************************************/ /** \name Initialization */ /**********************************************************************/ diff --git a/mesalib/src/mesa/main/rastpos.h b/mesalib/src/mesa/main/rastpos.h index cdd94a66c..9bb04cc9c 100644 --- a/mesalib/src/mesa/main/rastpos.h +++ b/mesalib/src/mesa/main/rastpos.h @@ -38,20 +38,9 @@ struct _glapi_table; struct gl_context; -#if FEATURE_rastpos - extern void _mesa_init_rastpos_dispatch(struct _glapi_table *disp); -#else /* FEATURE_rastpos */ - -static inline void -_mesa_init_rastpos_dispatch(struct _glapi_table *disp) -{ -} - -#endif /* FEATURE_rastpos */ - extern void _mesa_init_rastpos(struct gl_context *ctx); diff --git a/mesalib/src/mesa/main/shaderapi.c b/mesalib/src/mesa/main/shaderapi.c index 643ef516f..c2ec1fa42 100644 --- a/mesalib/src/mesa/main/shaderapi.c +++ b/mesalib/src/mesa/main/shaderapi.c @@ -167,18 +167,12 @@ static bool validate_shader_target(const struct gl_context *ctx, GLenum type) { switch (type) { -#if FEATURE_ARB_fragment_shader case GL_FRAGMENT_SHADER: return ctx->Extensions.ARB_fragment_shader; -#endif -#if FEATURE_ARB_vertex_shader case GL_VERTEX_SHADER: return ctx->Extensions.ARB_vertex_shader; -#endif -#if FEATURE_ARB_geometry_shader4 case GL_GEOMETRY_SHADER_ARB: return _mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_geometry_shader4; -#endif default: return false; } @@ -473,21 +467,17 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *param struct gl_shader_program *shProg = _mesa_lookup_shader_program(ctx, program); -#if FEATURE_EXT_transform_feedback /* Is transform feedback available in this context? */ const bool has_xfb = (ctx->API == API_OPENGL && ctx->Extensions.EXT_transform_feedback) || ctx->API == API_OPENGL_CORE || _mesa_is_gles3(ctx); -#endif -#if FEATURE_ARB_geometry_shader4 /* Are geometry shaders available in this context? */ const bool has_gs = _mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_geometry_shader4; -#endif /* Are uniform buffer objects available in this context? */ @@ -542,7 +532,6 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *param *params = max_len; return; } -#if FEATURE_EXT_transform_feedback case GL_TRANSFORM_FEEDBACK_VARYINGS: if (!has_xfb) break; @@ -558,8 +547,6 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *param break; *params = shProg->TransformFeedback.BufferMode; return; -#endif -#if FEATURE_ARB_geometry_shader4 case GL_GEOMETRY_VERTICES_OUT_ARB: if (!has_gs) break; @@ -575,7 +562,6 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *param break; *params = shProg->Geom.OutputType; return; -#endif case GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH: { unsigned i; GLint max_len = 0; @@ -860,7 +846,6 @@ use_shader_program(struct gl_context *ctx, GLenum type, struct gl_shader_program **target; switch (type) { -#if FEATURE_ARB_vertex_shader case GL_VERTEX_SHADER: target = &ctx->Shader.CurrentVertexProgram; if ((shProg == NULL) @@ -868,8 +853,6 @@ use_shader_program(struct gl_context *ctx, GLenum type, shProg = NULL; } break; -#endif -#if FEATURE_ARB_geometry_shader4 case GL_GEOMETRY_SHADER_ARB: target = &ctx->Shader.CurrentGeometryProgram; if ((shProg == NULL) @@ -877,8 +860,6 @@ use_shader_program(struct gl_context *ctx, GLenum type, shProg = NULL; } break; -#endif -#if FEATURE_ARB_fragment_shader case GL_FRAGMENT_SHADER: target = &ctx->Shader.CurrentFragmentProgram; if ((shProg == NULL) @@ -886,7 +867,6 @@ use_shader_program(struct gl_context *ctx, GLenum type, shProg = NULL; } break; -#endif default: return false; } @@ -899,17 +879,12 @@ use_shader_program(struct gl_context *ctx, GLenum type, * semantics of glDeleteProgram are maintained. */ switch (type) { -#if FEATURE_ARB_vertex_shader case GL_VERTEX_SHADER: /* Empty for now. */ break; -#endif -#if FEATURE_ARB_geometry_shader4 case GL_GEOMETRY_SHADER_ARB: /* Empty for now. */ break; -#endif -#if FEATURE_ARB_fragment_shader case GL_FRAGMENT_SHADER: if (*target == ctx->Shader._CurrentFragmentProgram) { _mesa_reference_shader_program(ctx, @@ -917,7 +892,6 @@ use_shader_program(struct gl_context *ctx, GLenum type, NULL); } break; -#endif } _mesa_reference_shader_program(ctx, target, shProg); @@ -1533,8 +1507,6 @@ _mesa_ShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, #endif /* FEATURE_ES2 */ -#if FEATURE_ARB_geometry_shader4 - void GLAPIENTRY _mesa_ProgramParameteriARB(GLuint program, GLenum pname, GLint value) { @@ -1596,8 +1568,6 @@ _mesa_ProgramParameteriARB(GLuint program, GLenum pname, GLint value) } } -#endif - void _mesa_use_shader_program(struct gl_context *ctx, GLenum type, struct gl_shader_program *shProg) @@ -1752,15 +1722,12 @@ _mesa_init_shader_dispatch(struct _glapi_table *exec) SET_IsProgram(exec, _mesa_IsProgram); SET_IsShader(exec, _mesa_IsShader); -#if FEATURE_ARB_vertex_shader + /* GL_ARB_vertex_shader */ SET_BindAttribLocationARB(exec, _mesa_BindAttribLocationARB); SET_GetActiveAttribARB(exec, _mesa_GetActiveAttribARB); SET_GetAttribLocationARB(exec, _mesa_GetAttribLocationARB); -#endif -#if FEATURE_ARB_geometry_shader4 SET_ProgramParameteriARB(exec, _mesa_ProgramParameteriARB); -#endif SET_UseShaderProgramEXT(exec, _mesa_UseShaderProgramEXT); SET_ActiveProgramEXT(exec, _mesa_ActiveProgramEXT); diff --git a/mesalib/src/mesa/main/shaderobj.c b/mesalib/src/mesa/main/shaderobj.c index c7f45c88e..1706cac55 100644 --- a/mesalib/src/mesa/main/shaderobj.c +++ b/mesalib/src/mesa/main/shaderobj.c @@ -243,11 +243,9 @@ _mesa_init_shader_program(struct gl_context *ctx, struct gl_shader_program *prog prog->FragDataBindings = string_to_uint_map_ctor(); prog->FragDataIndexBindings = string_to_uint_map_ctor(); -#if FEATURE_ARB_geometry_shader4 prog->Geom.VerticesOut = 0; prog->Geom.InputType = GL_TRIANGLES; prog->Geom.OutputType = GL_TRIANGLE_STRIP; -#endif prog->InfoLog = ralloc_strdup(prog, ""); } diff --git a/mesalib/src/mesa/main/shared.c b/mesalib/src/mesa/main/shared.c index 58cbc5250..fab2995a4 100644 --- a/mesalib/src/mesa/main/shared.c +++ b/mesalib/src/mesa/main/shared.c @@ -31,16 +31,12 @@ #include "mfeatures.h" #include "mtypes.h" #include "hash.h" -#if FEATURE_ATI_fragment_shader #include "atifragshader.h" -#endif #include "bufferobj.h" #include "shared.h" #include "program/program.h" #include "dlist.h" -#if FEATURE_ARB_sampler_objects #include "samplerobj.h" -#endif #include "shaderobj.h" #include "syncobj.h" @@ -70,33 +66,22 @@ _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(); shared->DefaultFragmentShader = _mesa_new_ati_fragment_shader(ctx, 0); -#endif -#if FEATURE_ARB_shader_objects shared->ShaderObjects = _mesa_NewHashTable(); -#endif shared->BufferObjects = _mesa_NewHashTable(); -#if FEATURE_ARB_sampler_objects /* GL_ARB_sampler_objects */ shared->SamplerObjects = _mesa_NewHashTable(); -#endif /* Allocate the default buffer object */ shared->NullBufferObj = ctx->Driver.NewBufferObject(ctx, 0, 0); @@ -126,10 +111,8 @@ _mesa_alloc_shared_state(struct gl_context *ctx) _glthread_INIT_MUTEX(shared->TexMutex); shared->TextureStateStamp = 0; -#if FEATURE_EXT_framebuffer_object shared->FrameBuffers = _mesa_NewHashTable(); shared->RenderBuffers = _mesa_NewHashTable(); -#endif make_empty_list(& shared->SyncObjects); @@ -177,7 +160,6 @@ delete_program_cb(GLuint id, void *data, void *userData) } -#if FEATURE_ATI_fragment_shader /** * Callback for deleting an ATI fragment shader object. * Called by _mesa_HashDeleteAll(). @@ -189,7 +171,6 @@ delete_fragshader_cb(GLuint id, void *data, void *userData) struct gl_context *ctx = (struct gl_context *) userData; _mesa_delete_ati_fragment_shader(ctx, shader); } -#endif /** @@ -278,7 +259,6 @@ delete_renderbuffer_cb(GLuint id, void *data, void *userData) } -#if FEATURE_ARB_sampler_objects /** * Callback for deleting a sampler object. Called by _mesa_HashDeleteAll() */ @@ -289,7 +269,6 @@ delete_sampler_object_cb(GLuint id, void *data, void *userData) struct gl_sampler_object *sampObj = (struct gl_sampler_object *) data; _mesa_reference_sampler_object(ctx, &sampObj, NULL); } -#endif /** @@ -321,38 +300,27 @@ free_shared_state(struct gl_context *ctx, struct gl_shared_state *shared) _mesa_HashDeleteAll(shared->DisplayList, delete_displaylist_cb, ctx); _mesa_DeleteHashTable(shared->DisplayList); -#if FEATURE_ARB_shader_objects _mesa_HashWalk(shared->ShaderObjects, free_shader_program_data_cb, ctx); _mesa_HashDeleteAll(shared->ShaderObjects, delete_shader_cb, ctx); _mesa_DeleteHashTable(shared->ShaderObjects); -#endif _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); _mesa_DeleteHashTable(shared->ATIShaders); _mesa_delete_ati_fragment_shader(ctx, shared->DefaultFragmentShader); -#endif _mesa_HashDeleteAll(shared->BufferObjects, delete_bufferobj_cb, ctx); _mesa_DeleteHashTable(shared->BufferObjects); -#if FEATURE_EXT_framebuffer_object _mesa_HashDeleteAll(shared->FrameBuffers, delete_framebuffer_cb, ctx); _mesa_DeleteHashTable(shared->FrameBuffers); _mesa_HashDeleteAll(shared->RenderBuffers, delete_renderbuffer_cb, ctx); _mesa_DeleteHashTable(shared->RenderBuffers); -#endif _mesa_reference_buffer_object(ctx, &shared->NullBufferObj, NULL); @@ -365,10 +333,8 @@ free_shared_state(struct gl_context *ctx, struct gl_shared_state *shared) } } -#if FEATURE_ARB_sampler_objects _mesa_HashDeleteAll(shared->SamplerObjects, delete_sampler_object_cb, ctx); _mesa_DeleteHashTable(shared->SamplerObjects); -#endif /* * Free texture objects (after FBOs since some textures might have diff --git a/mesalib/src/mesa/main/syncobj.c b/mesalib/src/mesa/main/syncobj.c index 1c09e421c..8927f46b0 100644 --- a/mesalib/src/mesa/main/syncobj.c +++ b/mesalib/src/mesa/main/syncobj.c @@ -64,7 +64,6 @@ #include "dispatch.h" #include "mtypes.h" -#if FEATURE_ARB_sync #include "syncobj.h" static struct gl_sync_object * @@ -426,5 +425,3 @@ _mesa_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, *length = size; } } - -#endif /* FEATURE_ARB_sync */ diff --git a/mesalib/src/mesa/main/syncobj.h b/mesalib/src/mesa/main/syncobj.h index e2e92b0ac..b0e09a605 100644 --- a/mesalib/src/mesa/main/syncobj.h +++ b/mesalib/src/mesa/main/syncobj.h @@ -39,8 +39,6 @@ struct dd_function_table; struct gl_context; struct gl_sync_object; -#if FEATURE_ARB_sync - extern void GLAPIENTRY _mesa_init_sync_object_functions(struct dd_function_table *driver); @@ -78,42 +76,4 @@ extern void GLAPIENTRY _mesa_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); -#else /* FEATURE_ARB_sync */ - -#include "main/compiler.h" - -static inline void -_mesa_init_sync_object_functions(struct dd_function_table *driver) -{ -} - -static inline void -_mesa_init_sync_dispatch(struct _glapi_table *disp) -{ -} - -static inline void -_mesa_init_sync(struct gl_context *ctx) -{ -} - -static inline void -_mesa_free_sync_data(struct gl_context *ctx) -{ -} - -static inline void -_mesa_ref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj) -{ - ASSERT_NO_FEATURE(); -} - -static inline void -_mesa_unref_sync_object(struct gl_context *ctx, struct gl_sync_object *syncObj) -{ - ASSERT_NO_FEATURE(); -} - -#endif /* FEATURE_ARB_sync */ - #endif /* SYNCOBJ_H */ diff --git a/mesalib/src/mesa/main/texcompress.c b/mesalib/src/mesa/main/texcompress.c index 846d4bb63..bb61e6eda 100644 --- a/mesalib/src/mesa/main/texcompress.c +++ b/mesalib/src/mesa/main/texcompress.c @@ -375,13 +375,10 @@ GLenum _mesa_compressed_format_to_glenum(struct gl_context *ctx, gl_format mesaFormat) { switch (mesaFormat) { -#if FEATURE_texture_fxt1 case MESA_FORMAT_RGB_FXT1: return GL_COMPRESSED_RGB_FXT1_3DFX; case MESA_FORMAT_RGBA_FXT1: return GL_COMPRESSED_RGBA_FXT1_3DFX; -#endif -#if FEATURE_texture_s3tc case MESA_FORMAT_RGB_DXT1: return GL_COMPRESSED_RGB_S3TC_DXT1_EXT; case MESA_FORMAT_RGBA_DXT1: @@ -390,7 +387,6 @@ _mesa_compressed_format_to_glenum(struct gl_context *ctx, gl_format mesaFormat) return GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; case MESA_FORMAT_RGBA_DXT5: return GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; -#if FEATURE_EXT_texture_sRGB case MESA_FORMAT_SRGB_DXT1: return GL_COMPRESSED_SRGB_S3TC_DXT1_EXT; case MESA_FORMAT_SRGBA_DXT1: @@ -399,9 +395,6 @@ _mesa_compressed_format_to_glenum(struct gl_context *ctx, gl_format mesaFormat) return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT; case MESA_FORMAT_SRGBA_DXT5: return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT; -#endif -#endif - case MESA_FORMAT_RED_RGTC1: return GL_COMPRESSED_RED_RGTC1; case MESA_FORMAT_SIGNED_RED_RGTC1: diff --git a/mesalib/src/mesa/main/texcompress_cpal.c b/mesalib/src/mesa/main/texcompress_cpal.c index ceeec9403..4aa1f610e 100644 --- a/mesalib/src/mesa/main/texcompress_cpal.c +++ b/mesalib/src/mesa/main/texcompress_cpal.c @@ -40,8 +40,6 @@ #include "texcompress_cpal.h" #include "teximage.h" -#if FEATURE_ES - static const struct cpal_format_info { GLenum cpal_format; @@ -226,5 +224,3 @@ _mesa_cpal_compressed_teximage2d(GLenum target, GLint level, if (saved_align != align) _mesa_PixelStorei(GL_UNPACK_ALIGNMENT, saved_align); } - -#endif diff --git a/mesalib/src/mesa/main/texcompress_fxt1.c b/mesalib/src/mesa/main/texcompress_fxt1.c index 92af29ad4..eeed78891 100644 --- a/mesalib/src/mesa/main/texcompress_fxt1.c +++ b/mesalib/src/mesa/main/texcompress_fxt1.c @@ -42,15 +42,12 @@ #include "swrast/s_context.h" -#if FEATURE_texture_fxt1 - - static void fxt1_encode (GLuint width, GLuint height, GLint comps, const void *source, GLint srcRowStride, void *dest, GLint destRowStride); -void +static void fxt1_decode_1 (const void *texture, GLint stride, GLint i, GLint j, GLubyte *rgba); @@ -1619,7 +1616,7 @@ fxt1_decode_1ALPHA (const GLubyte *code, GLint t, GLubyte *rgba) } -void +static void fxt1_decode_1 (const void *texture, GLint stride, /* in pixels */ GLint i, GLint j, GLubyte *rgba) { @@ -1646,6 +1643,3 @@ fxt1_decode_1 (const void *texture, GLint stride, /* in pixels */ decode_1[mode](code, t, rgba); } - - -#endif /* FEATURE_texture_fxt1 */ diff --git a/mesalib/src/mesa/main/texcompress_fxt1.h b/mesalib/src/mesa/main/texcompress_fxt1.h index bd84082e9..2a8b8d653 100644 --- a/mesalib/src/mesa/main/texcompress_fxt1.h +++ b/mesalib/src/mesa/main/texcompress_fxt1.h @@ -31,8 +31,6 @@ struct swrast_texture_image; -#if FEATURE_texture_fxt1 - extern GLboolean _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS); @@ -47,16 +45,4 @@ extern void _mesa_fetch_texel_2d_f_rgb_fxt1(const struct swrast_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel); -#else /* FEATURE_texture_fxt1 */ - -/* these are used only in texstore_funcs[] */ -#define _mesa_texstore_rgb_fxt1 NULL -#define _mesa_texstore_rgba_fxt1 NULL - -/* these are used only in texfetch_funcs[] */ -#define _mesa_fetch_texel_2d_f_rgba_fxt1 NULL -#define _mesa_fetch_texel_2d_f_rgb_fxt1 NULL - -#endif /* FEATURE_texture_fxt1 */ - #endif /* TEXCOMPRESS_FXT1_H */ diff --git a/mesalib/src/mesa/main/texcompress_s3tc.c b/mesalib/src/mesa/main/texcompress_s3tc.c index 215d7a385..d4288a6f8 100644 --- a/mesalib/src/mesa/main/texcompress_s3tc.c +++ b/mesalib/src/mesa/main/texcompress_s3tc.c @@ -47,9 +47,6 @@ #include "swrast/s_context.h" -#if FEATURE_texture_s3tc - - #if defined(_WIN32) || defined(WIN32) #ifdef _DEBUG #define DXTN_LIBNAME "dxtn_dbg.dll" @@ -64,7 +61,6 @@ #define DXTN_LIBNAME "libtxc_dxtn.so" #endif -#if FEATURE_EXT_texture_sRGB /** * Convert an 8-bit sRGB value from non-linear space to a * linear RGB value in [0, 1]. @@ -91,14 +87,13 @@ nonlinear_to_linear(GLubyte cs8) } return table[cs8]; } -#endif /* FEATURE_EXT_texture_sRGB */ typedef void (*dxtFetchTexelFuncExt)( GLint srcRowstride, GLubyte *pixdata, GLint col, GLint row, GLvoid *texelOut ); -dxtFetchTexelFuncExt fetch_ext_rgb_dxt1 = NULL; -dxtFetchTexelFuncExt fetch_ext_rgba_dxt1 = NULL; -dxtFetchTexelFuncExt fetch_ext_rgba_dxt3 = NULL; -dxtFetchTexelFuncExt fetch_ext_rgba_dxt5 = NULL; +static dxtFetchTexelFuncExt fetch_ext_rgb_dxt1 = NULL; +static dxtFetchTexelFuncExt fetch_ext_rgba_dxt1 = NULL; +static dxtFetchTexelFuncExt fetch_ext_rgba_dxt3 = NULL; +static dxtFetchTexelFuncExt fetch_ext_rgba_dxt5 = NULL; typedef void (*dxtCompressTexFuncExt)(GLint srccomps, GLint width, GLint height, const GLubyte *srcPixData, @@ -482,7 +477,6 @@ _mesa_fetch_texel_rgba_dxt5(const struct swrast_texture_image *texImage, texel[ACOMP] = UBYTE_TO_FLOAT(rgba[ACOMP]); } -#if FEATURE_EXT_texture_sRGB void _mesa_fetch_texel_srgb_dxt1(const struct swrast_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel) @@ -534,7 +528,3 @@ _mesa_fetch_texel_srgba_dxt5(const struct swrast_texture_image *texImage, texel[BCOMP] = nonlinear_to_linear(rgba[BCOMP]); texel[ACOMP] = UBYTE_TO_FLOAT(rgba[ACOMP]); } -#endif /* FEATURE_EXT_texture_sRGB */ - - -#endif /* FEATURE_texture_s3tc */ diff --git a/mesalib/src/mesa/main/texcompress_s3tc.h b/mesalib/src/mesa/main/texcompress_s3tc.h index 2c06e50ce..524ac0c13 100644 --- a/mesalib/src/mesa/main/texcompress_s3tc.h +++ b/mesalib/src/mesa/main/texcompress_s3tc.h @@ -33,8 +33,6 @@ struct gl_context; struct swrast_texture_image; -#if FEATURE_texture_s3tc - extern GLboolean _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS); @@ -82,29 +80,4 @@ _mesa_fetch_texel_srgba_dxt5(const struct swrast_texture_image *texImage, extern void _mesa_init_texture_s3tc(struct gl_context *ctx); -#else /* FEATURE_texture_s3tc */ - -/* these are used only in texstore_funcs[] */ -#define _mesa_texstore_rgb_dxt1 NULL -#define _mesa_texstore_rgba_dxt1 NULL -#define _mesa_texstore_rgba_dxt3 NULL -#define _mesa_texstore_rgba_dxt5 NULL - -/* these are used only in texfetch_funcs[] */ -#define _mesa_fetch_texel_2d_f_rgb_dxt1 NULL -#define _mesa_fetch_texel_2d_f_rgba_dxt1 NULL -#define _mesa_fetch_texel_2d_f_rgba_dxt3 NULL -#define _mesa_fetch_texel_2d_f_rgba_dxt5 NULL -#define _mesa_fetch_texel_2d_f_srgb_dxt1 NULL -#define _mesa_fetch_texel_2d_f_srgba_dxt1 NULL -#define _mesa_fetch_texel_2d_f_srgba_dxt3 NULL -#define _mesa_fetch_texel_2d_f_srgba_dxt5 NULL - -static inline void -_mesa_init_texture_s3tc(struct gl_context *ctx) -{ -} - -#endif /* FEATURE_texture_s3tc */ - #endif /* TEXCOMPRESS_S3TC_H */ diff --git a/mesalib/src/mesa/main/texformat.c b/mesalib/src/mesa/main/texformat.c index 1a318abe4..17270ba92 100644 --- a/mesalib/src/mesa/main/texformat.c +++ b/mesalib/src/mesa/main/texformat.c @@ -289,7 +289,6 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, } } -#if FEATURE_texture_fxt1 if (ctx->Extensions.TDFX_texture_compression_FXT1) { switch (internalFormat) { case GL_COMPRESSED_RGB_FXT1_3DFX: @@ -302,9 +301,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, ; /* fallthrough */ } } -#endif -#if FEATURE_texture_s3tc if (ctx->Extensions.EXT_texture_compression_s3tc) { switch (internalFormat) { case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: @@ -338,7 +335,6 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, ; /* fallthrough */ } } -#endif if (ctx->Extensions.ARB_texture_float) { switch (internalFormat) { @@ -555,7 +551,6 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, } } -#if FEATURE_EXT_texture_sRGB if (ctx->Extensions.EXT_texture_sRGB) { switch (internalFormat) { case GL_SRGB_EXT: @@ -587,22 +582,17 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); break; case GL_COMPRESSED_SRGB_EXT: -#if FEATURE_texture_s3tc if (ctx->Extensions.EXT_texture_compression_s3tc) RETURN_IF_SUPPORTED(MESA_FORMAT_SRGB_DXT1); -#endif RETURN_IF_SUPPORTED(MESA_FORMAT_SRGB8); RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); break; case GL_COMPRESSED_SRGB_ALPHA_EXT: -#if FEATURE_texture_s3tc if (ctx->Extensions.EXT_texture_compression_s3tc) RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA_DXT3); /* Not srgba_dxt1, see spec */ -#endif RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA8); RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); break; -#if FEATURE_texture_s3tc case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: if (ctx->Extensions.EXT_texture_compression_s3tc) RETURN_IF_SUPPORTED(MESA_FORMAT_SRGB_DXT1); @@ -623,12 +613,10 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA_DXT5); RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); break; -#endif default: ; /* fallthrough */ } } -#endif /* FEATURE_EXT_texture_sRGB */ if (ctx->Extensions.EXT_texture_integer) { switch (internalFormat) { diff --git a/mesalib/src/mesa/main/texgen.c b/mesalib/src/mesa/main/texgen.c index 3788669d4..0b0f67335 100644 --- a/mesalib/src/mesa/main/texgen.c +++ b/mesalib/src/mesa/main/texgen.c @@ -41,9 +41,6 @@ #include "main/dispatch.h" -#if FEATURE_texgen - - /** * Return texgen state for given coordinate */ @@ -441,6 +438,3 @@ _mesa_init_texgen_dispatch(struct _glapi_table *disp) SET_TexGeni(disp, _mesa_TexGeni); SET_TexGeniv(disp, _mesa_TexGeniv); } - - -#endif /* FEATURE_texgen */ diff --git a/mesalib/src/mesa/main/texgen.h b/mesalib/src/mesa/main/texgen.h index 1d13422b2..35a799587 100644 --- a/mesalib/src/mesa/main/texgen.h +++ b/mesalib/src/mesa/main/texgen.h @@ -34,8 +34,6 @@ struct _glapi_table; -#if FEATURE_texgen - extern void GLAPIENTRY _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); @@ -65,24 +63,4 @@ extern void GLAPIENTRY _es_TexGenfv(GLenum coord, GLenum pname, const GLfloat *params); -#else /* FEATURE_texgen */ - -static void -_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) -{ -} - -static void inline -_mesa_TexGeni( GLenum coord, GLenum pname, GLint param ) -{ -} - -static inline void -_mesa_init_texgen_dispatch(struct _glapi_table *disp) -{ -} - -#endif /* FEATURE_texgen */ - - #endif /* TEXGEN_H */ diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c index 02bd87ac6..da8fbcd32 100644 --- a/mesalib/src/mesa/main/teximage.c +++ b/mesalib/src/mesa/main/teximage.c @@ -311,7 +311,6 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat ) } } -#if FEATURE_EXT_texture_sRGB if (ctx->Extensions.EXT_texture_sRGB) { switch (internalFormat) { case GL_SRGB_EXT: @@ -338,7 +337,6 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat ) ; /* fallthrough */ } } -#endif /* FEATURE_EXT_texture_sRGB */ if (ctx->Version >= 30 || ctx->Extensions.EXT_texture_integer) { @@ -3134,7 +3132,6 @@ _mesa_TexImage3DEXT( GLenum target, GLint level, GLenum internalFormat, } -#if FEATURE_OES_EGL_image void GLAPIENTRY _mesa_EGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image) { @@ -3189,7 +3186,6 @@ _mesa_EGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image) _mesa_unlock_texture(ctx, texObj); } -#endif diff --git a/mesalib/src/mesa/main/texparam.c b/mesalib/src/mesa/main/texparam.c index e6140eb65..63a63b732 100644 --- a/mesalib/src/mesa/main/texparam.c +++ b/mesalib/src/mesa/main/texparam.c @@ -428,7 +428,6 @@ set_tex_parameteri(struct gl_context *ctx, } goto invalid_pname; -#if FEATURE_OES_draw_texture case GL_TEXTURE_CROP_RECT_OES: if (ctx->API != API_OPENGLES || !ctx->Extensions.OES_draw_texture) goto invalid_pname; @@ -438,7 +437,6 @@ set_tex_parameteri(struct gl_context *ctx, texObj->CropRect[2] = params[2]; texObj->CropRect[3] = params[3]; return GL_TRUE; -#endif case GL_TEXTURE_SWIZZLE_R_EXT: case GL_TEXTURE_SWIZZLE_G_EXT: @@ -728,8 +726,6 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) need_update = set_tex_parameteri(ctx, texObj, pname, p); } break; - -#if FEATURE_OES_draw_texture case GL_TEXTURE_CROP_RECT_OES: { /* convert float params to int */ @@ -741,8 +737,6 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) need_update = set_tex_parameteri(ctx, texObj, pname, iparams); } break; -#endif - case GL_TEXTURE_SWIZZLE_R_EXT: case GL_TEXTURE_SWIZZLE_G_EXT: case GL_TEXTURE_SWIZZLE_B_EXT: @@ -1398,7 +1392,6 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) *params = obj->Sampler.LodBias; break; -#if FEATURE_OES_draw_texture case GL_TEXTURE_CROP_RECT_OES: if (ctx->API != API_OPENGLES || !ctx->Extensions.OES_draw_texture) goto invalid_pname; @@ -1408,7 +1401,6 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) params[2] = obj->CropRect[2]; params[3] = obj->CropRect[3]; break; -#endif case GL_TEXTURE_SWIZZLE_R_EXT: case GL_TEXTURE_SWIZZLE_G_EXT: @@ -1573,7 +1565,6 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) *params = (GLint) obj->Sampler.LodBias; break; -#if FEATURE_OES_draw_texture case GL_TEXTURE_CROP_RECT_OES: if (ctx->API != API_OPENGLES || !ctx->Extensions.OES_draw_texture) goto invalid_pname; @@ -1583,7 +1574,6 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) params[2] = obj->CropRect[2]; params[3] = obj->CropRect[3]; break; -#endif case GL_TEXTURE_SWIZZLE_R_EXT: case GL_TEXTURE_SWIZZLE_G_EXT: case GL_TEXTURE_SWIZZLE_B_EXT: diff --git a/mesalib/src/mesa/main/texstate.c b/mesalib/src/mesa/main/texstate.c index fa1fef27e..1fd09e985 100644 --- a/mesalib/src/mesa/main/texstate.c +++ b/mesalib/src/mesa/main/texstate.c @@ -841,11 +841,9 @@ _mesa_free_texture_data(struct gl_context *ctx) /* GL_ARB_texture_buffer_object */ _mesa_reference_buffer_object(ctx, &ctx->Texture.BufferObject, NULL); -#if FEATURE_sampler_objects for (u = 0; u < Elements(ctx->Texture.Unit); u++) { _mesa_reference_sampler_object(ctx, &ctx->Texture.Unit[u].Sampler, NULL); } -#endif } diff --git a/mesalib/src/mesa/main/texstore.c b/mesalib/src/mesa/main/texstore.c index 2d055808e..e2598a1dc 100644 --- a/mesalib/src/mesa/main/texstore.c +++ b/mesalib/src/mesa/main/texstore.c @@ -3604,9 +3604,6 @@ _mesa_texstore_rgba_uint32(TEXSTORE_PARAMS) } - - -#if FEATURE_EXT_texture_sRGB static GLboolean _mesa_texstore_srgb8(TEXSTORE_PARAMS) { @@ -3710,17 +3707,6 @@ _mesa_texstore_sla8(TEXSTORE_PARAMS) return k; } -#else - -/* these are used only in texstore_funcs[] below */ -#define _mesa_texstore_srgb8 NULL -#define _mesa_texstore_srgba8 NULL -#define _mesa_texstore_sargb8 NULL -#define _mesa_texstore_sl8 NULL -#define _mesa_texstore_sla8 NULL - -#endif /* FEATURE_EXT_texture_sRGB */ - static GLboolean _mesa_texstore_rgb9_e5(TEXSTORE_PARAMS) { diff --git a/mesalib/src/mesa/main/transformfeedback.c b/mesalib/src/mesa/main/transformfeedback.c index 26345b100..ea6cfdf8c 100644 --- a/mesalib/src/mesa/main/transformfeedback.c +++ b/mesalib/src/mesa/main/transformfeedback.c @@ -44,9 +44,6 @@ #include "program/prog_parameter.h" -#if FEATURE_EXT_transform_feedback - - /** * Do reference counting of transform feedback buffers. */ @@ -171,40 +168,6 @@ _mesa_free_transform_feedback(struct gl_context *ctx) } -#else /* FEATURE_EXT_transform_feedback */ - -/* forward declarations */ -static struct gl_transform_feedback_object * -new_transform_feedback(struct gl_context *ctx, GLuint name); - -static void -delete_transform_feedback(struct gl_context *ctx, - struct gl_transform_feedback_object *obj); - -/* dummy per-context init/clean-up for transform feedback */ -void -_mesa_init_transform_feedback(struct gl_context *ctx) -{ - ctx->TransformFeedback.DefaultObject = new_transform_feedback(ctx, 0); - ctx->TransformFeedback.CurrentObject = ctx->TransformFeedback.DefaultObject; - _mesa_reference_buffer_object(ctx, - &ctx->TransformFeedback.CurrentBuffer, - ctx->Shared->NullBufferObj); -} - -void -_mesa_free_transform_feedback(struct gl_context *ctx) -{ - _mesa_reference_buffer_object(ctx, - &ctx->TransformFeedback.CurrentBuffer, - NULL); - ctx->TransformFeedback.CurrentObject = NULL; - delete_transform_feedback(ctx, ctx->TransformFeedback.DefaultObject); -} - -#endif /* FEATURE_EXT_transform_feedback */ - - /** Default fallback for ctx->Driver.NewTransformFeedback() */ static struct gl_transform_feedback_object * new_transform_feedback(struct gl_context *ctx, GLuint name) @@ -233,9 +196,6 @@ delete_transform_feedback(struct gl_context *ctx, } -#if FEATURE_EXT_transform_feedback - - /** Default fallback for ctx->Driver.BeginTransformFeedback() */ static void begin_transform_feedback(struct gl_context *ctx, GLenum mode, @@ -901,5 +861,3 @@ _mesa_ResumeTransformFeedback(void) assert(ctx->Driver.ResumeTransformFeedback); ctx->Driver.ResumeTransformFeedback(ctx, obj); } - -#endif /* FEATURE_EXT_transform_feedback */ diff --git a/mesalib/src/mesa/main/transformfeedback.h b/mesalib/src/mesa/main/transformfeedback.h index 85f4cbc77..7d4a945c5 100644 --- a/mesalib/src/mesa/main/transformfeedback.h +++ b/mesalib/src/mesa/main/transformfeedback.h @@ -39,8 +39,6 @@ _mesa_init_transform_feedback(struct gl_context *ctx); extern void _mesa_free_transform_feedback(struct gl_context *ctx); -#if FEATURE_EXT_transform_feedback - extern GLboolean _mesa_validate_transform_feedback_buffers(struct gl_context *ctx); @@ -110,30 +108,4 @@ _mesa_PauseTransformFeedback(void); extern void GLAPIENTRY _mesa_ResumeTransformFeedback(void); -#else /* FEATURE_EXT_transform_feedback */ - -static inline GLboolean -_mesa_validate_primitive_mode(struct gl_context *ctx, GLenum mode) -{ - return GL_TRUE; -} - -static inline GLboolean -_mesa_validate_transform_feedback_buffers(struct gl_context *ctx) -{ - return GL_TRUE; -} - -static inline void -_mesa_init_transform_feedback_functions(struct dd_function_table *driver) -{ -} - -static inline void -_mesa_init_transform_feedback_dispatch(struct _glapi_table *disp) -{ -} - -#endif /* FEATURE_EXT_transform_feedback */ - #endif /* TRANSFORM_FEEDBACK_H */ diff --git a/mesalib/src/mesa/main/varray.c b/mesalib/src/mesa/main/varray.c index 91452b75f..9a2dec61b 100644 --- a/mesalib/src/mesa/main/varray.c +++ b/mesalib/src/mesa/main/varray.c @@ -431,7 +431,6 @@ _mesa_PointSizePointer(GLenum type, GLsizei stride, const GLvoid *ptr) } -#if FEATURE_NV_vertex_program /** * Set a vertex attribute array. * Note that these arrays DO alias the conventional GL vertex arrays @@ -462,10 +461,8 @@ _mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type, legalTypes, 1, BGRA_OR_4, size, type, stride, normalized, GL_FALSE, ptr); } -#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 +492,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/mesalib/src/mesa/main/varray.h b/mesalib/src/mesa/main/varray.h index b6041bd78..d48361256 100644 --- a/mesalib/src/mesa/main/varray.h +++ b/mesalib/src/mesa/main/varray.h @@ -245,13 +245,9 @@ _mesa_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end, const GLvoid *indices, GLint basevertex); -#if FEATURE_EXT_transform_feedback - extern void GLAPIENTRY _mesa_DrawTransformFeedback(GLenum mode, GLuint name); -#endif - extern void GLAPIENTRY _mesa_PrimitiveRestartIndex(GLuint index); diff --git a/mesalib/src/mesa/main/vtxfmt.c b/mesalib/src/mesa/main/vtxfmt.c index 2b6e25ecd..725ac2047 100644 --- a/mesalib/src/mesa/main/vtxfmt.c +++ b/mesalib/src/mesa/main/vtxfmt.c @@ -38,8 +38,6 @@ #include "main/dispatch.h" -#if FEATURE_beginend - /** * Use the per-vertex functions found in <vfmt> to initialize the given * API dispatch table. @@ -136,7 +134,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 +142,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); @@ -235,6 +231,3 @@ _mesa_install_save_vtxfmt(struct gl_context *ctx, const GLvertexformat *vfmt) if (_mesa_is_desktop_gl(ctx)) install_vtxfmt( ctx, ctx->Save, vfmt ); } - - -#endif /* FEATURE_beginend */ diff --git a/mesalib/src/mesa/main/vtxfmt.h b/mesalib/src/mesa/main/vtxfmt.h index aac656879..65a0e6c8e 100644 --- a/mesalib/src/mesa/main/vtxfmt.h +++ b/mesalib/src/mesa/main/vtxfmt.h @@ -37,23 +37,7 @@ #include "mfeatures.h" #include "mtypes.h" -#if FEATURE_beginend - extern void _mesa_install_exec_vtxfmt( struct gl_context *ctx, const GLvertexformat *vfmt ); extern void _mesa_install_save_vtxfmt( struct gl_context *ctx, const GLvertexformat *vfmt ); -#else /* FEATURE_beginend */ - -static inline void -_mesa_install_exec_vtxfmt( struct gl_context *ctx, const GLvertexformat *vfmt ) -{ -} - -static inline void -_mesa_install_save_vtxfmt( struct gl_context *ctx, const GLvertexformat *vfmt ) -{ -} - -#endif /* FEATURE_beginend */ - #endif /* _VTXFMT_H_ */ diff --git a/mesalib/src/mesa/program/ir_to_mesa.cpp b/mesalib/src/mesa/program/ir_to_mesa.cpp index d675da269..4991a551c 100644 --- a/mesalib/src/mesa/program/ir_to_mesa.cpp +++ b/mesalib/src/mesa/program/ir_to_mesa.cpp @@ -325,11 +325,11 @@ public: void *mem_ctx; }; -src_reg undef_src = src_reg(PROGRAM_UNDEFINED, 0, NULL); +static src_reg undef_src = src_reg(PROGRAM_UNDEFINED, 0, NULL); -dst_reg undef_dst = dst_reg(PROGRAM_UNDEFINED, SWIZZLE_NOOP); +static dst_reg undef_dst = dst_reg(PROGRAM_UNDEFINED, SWIZZLE_NOOP); -dst_reg address_reg = dst_reg(PROGRAM_ADDRESS, WRITEMASK_X); +static dst_reg address_reg = dst_reg(PROGRAM_ADDRESS, WRITEMASK_X); static int swizzle_for_size(int size) @@ -3060,7 +3060,7 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader) return; } - state->error = preprocess(state, &source, &state->info_log, + state->error = glcpp_preprocess(state, &source, &state->info_log, &ctx->Extensions, ctx->API); if (ctx->Shader.Flags & GLSL_DUMP) { diff --git a/mesalib/src/mesa/program/prog_noise.c b/mesalib/src/mesa/program/prog_noise.c index 1713ddb5f..75cd8c659 100644 --- a/mesalib/src/mesa/program/prog_noise.c +++ b/mesalib/src/mesa/program/prog_noise.c @@ -76,7 +76,7 @@ * A vector-valued noise over 3D accesses it 96 times, and a * float-valued 4D noise 64 times. We want this to fit in the cache! */ -unsigned char perm[512] = { 151, 160, 137, 91, 90, 15, +static const unsigned char perm[512] = { 151, 160, 137, 91, 90, 15, 131, 13, 201, 95, 96, 53, 194, 233, 7, 225, 140, 36, 103, 30, 69, 142, 8, 99, 37, 240, 21, 10, 23, 190, 6, 148, 247, 120, 234, 75, 0, 26, 197, 62, 94, 252, 219, 203, 117, 35, diff --git a/mesalib/src/mesa/program/program.c b/mesalib/src/mesa/program/program.c index becb77c1d..30f83772f 100644 --- a/mesalib/src/mesa/program/program.c +++ b/mesalib/src/mesa/program/program.c @@ -83,14 +83,9 @@ _mesa_init_program(struct gl_context *ctx) ctx->Program.ErrorPos = -1; ctx->Program.ErrorString = _mesa_strdup(""); -#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program ctx->VertexProgram.Enabled = GL_FALSE; -#if FEATURE_es2_glsl ctx->VertexProgram.PointSizeEnabled = (ctx->API == API_OPENGLES2) ? GL_TRUE : GL_FALSE; -#else - ctx->VertexProgram.PointSizeEnabled = GL_FALSE; -#endif ctx->VertexProgram.TwoSideEnabled = GL_FALSE; _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current, ctx->Shared->DefaultVertexProgram); @@ -100,31 +95,24 @@ _mesa_init_program(struct gl_context *ctx) 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 -#if FEATURE_ARB_geometry_shader4 ctx->GeometryProgram.Enabled = GL_FALSE; /* right now by default we don't have a geometry program */ _mesa_reference_geomprog(ctx, &ctx->GeometryProgram.Current, NULL); ctx->GeometryProgram.Cache = _mesa_new_program_cache(); -#endif /* XXX probably move this stuff */ -#if FEATURE_ATI_fragment_shader ctx->ATIFragmentShader.Enabled = GL_FALSE; ctx->ATIFragmentShader.Current = ctx->Shared->DefaultFragmentShader; assert(ctx->ATIFragmentShader.Current); ctx->ATIFragmentShader.Current->RefCount++; -#endif } @@ -134,27 +122,21 @@ _mesa_init_program(struct gl_context *ctx) 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 -#if FEATURE_ARB_geometry_shader4 _mesa_reference_geomprog(ctx, &ctx->GeometryProgram.Current, NULL); _mesa_delete_program_cache(ctx, ctx->GeometryProgram.Cache); -#endif + /* XXX probably move this stuff */ -#if FEATURE_ATI_fragment_shader if (ctx->ATIFragmentShader.Current) { ctx->ATIFragmentShader.Current->RefCount--; if (ctx->ATIFragmentShader.Current->RefCount <= 0) { free(ctx->ATIFragmentShader.Current); } } -#endif + free((void *) ctx->Program.ErrorString); } @@ -167,25 +149,18 @@ _mesa_free_program_data(struct gl_context *ctx) 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 -#if FEATURE_ARB_geometry_shader4 _mesa_reference_geomprog(ctx, &ctx->GeometryProgram.Current, ctx->Shared->DefaultGeometryProgram); -#endif /* XXX probably move this stuff */ -#if FEATURE_ATI_fragment_shader if (ctx->ATIFragmentShader.Current) { ctx->ATIFragmentShader.Current->RefCount--; if (ctx->ATIFragmentShader.Current->RefCount <= 0) { @@ -195,7 +170,6 @@ _mesa_update_default_objects_program(struct gl_context *ctx) ctx->ATIFragmentShader.Current = (struct ati_fragment_shader *) ctx->Shared->DefaultFragmentShader; assert(ctx->ATIFragmentShader.Current); ctx->ATIFragmentShader.Current->RefCount++; -#endif } diff --git a/mesalib/src/mesa/program/program_lexer.l b/mesalib/src/mesa/program/program_lexer.l index 0a50dab97..0947bb046 100644 --- a/mesalib/src/mesa/program/program_lexer.l +++ b/mesalib/src/mesa/program/program_lexer.l @@ -165,6 +165,7 @@ szf [HR]? cc C? sat (_SAT)? +%option prefix="_mesa_program_" %option bison-bridge bison-locations reentrant noyywrap %% diff --git a/mesalib/src/mesa/state_tracker/st_cb_bitmap.c b/mesalib/src/mesa/state_tracker/st_cb_bitmap.c index dbd778b4f..62e571235 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_bitmap.c +++ b/mesalib/src/mesa/state_tracker/st_cb_bitmap.c @@ -57,8 +57,6 @@ #include "cso_cache/cso_context.h" -#if FEATURE_drawpix - /** * glBitmaps are drawn as textured quads. The user's bitmap pattern * is stored in a texture image. An alpha8 texture format is used. @@ -884,5 +882,3 @@ st_destroy_bitmap(struct st_context *st) st->bitmap.cache = NULL; } } - -#endif /* FEATURE_drawpix */ diff --git a/mesalib/src/mesa/state_tracker/st_cb_bitmap.h b/mesalib/src/mesa/state_tracker/st_cb_bitmap.h index 25410e503..d1c18058b 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_bitmap.h +++ b/mesalib/src/mesa/state_tracker/st_cb_bitmap.h @@ -38,8 +38,6 @@ struct st_context; struct gl_fragment_program; struct st_fragment_program; -#if FEATURE_drawpix - extern void st_init_bitmap_functions(struct dd_function_table *functions); @@ -58,33 +56,5 @@ st_make_bitmap_fragment_program(struct st_context *st, extern void st_flush_bitmap_cache(struct st_context *st); -#else - -static INLINE void -st_init_bitmap_functions(struct dd_function_table *functions) -{ -} - -static INLINE void -st_init_bitmap(struct st_context *st) -{ -} - -static INLINE void -st_destroy_bitmap(struct st_context *st) -{ -} - -static INLINE void -st_flush_bitmap_cache(struct st_context *st) -{ -} - -static INLINE void -st_flush_bitmap(struct st_context *st) -{ -} - -#endif /* FEATURE_drawpix */ #endif /* ST_CB_BITMAP_H */ diff --git a/mesalib/src/mesa/state_tracker/st_cb_blit.c b/mesalib/src/mesa/state_tracker/st_cb_blit.c index 1486779fd..c2d756813 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_blit.c +++ b/mesalib/src/mesa/state_tracker/st_cb_blit.c @@ -59,8 +59,6 @@ st_destroy_blit(struct st_context *st) } -#if FEATURE_EXT_framebuffer_blit - static void st_BlitFramebuffer_resolve(struct gl_context *ctx, GLbitfield mask, @@ -354,5 +352,3 @@ st_init_blit_functions(struct dd_function_table *functions) { functions->BlitFramebuffer = st_BlitFramebuffer; } - -#endif /* FEATURE_EXT_framebuffer_blit */ diff --git a/mesalib/src/mesa/state_tracker/st_cb_blit.h b/mesalib/src/mesa/state_tracker/st_cb_blit.h index c6d9a3679..eb6089e47 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_blit.h +++ b/mesalib/src/mesa/state_tracker/st_cb_blit.h @@ -42,18 +42,8 @@ st_init_blit(struct st_context *st); extern void st_destroy_blit(struct st_context *st); -#if FEATURE_EXT_framebuffer_blit - extern void st_init_blit_functions(struct dd_function_table *functions); -#else - -static INLINE void -st_init_blit_functions(struct dd_function_table *functions) -{ -} - -#endif /* FEATURE_EXT_framebuffer_blit */ #endif /* ST_CB_BLIT_H */ diff --git a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c index b2c6327a0..a8a01db96 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c @@ -71,8 +71,6 @@ #include "cso_cache/cso_context.h" -#if FEATURE_drawpix - /** * Check if the given program is: * 0: MOVE result.color, fragment.color; @@ -1661,5 +1659,3 @@ st_destroy_drawpix(struct st_context *st) if (st->drawpix.vert_shaders[1]) cso_delete_vertex_shader(st->cso_context, st->drawpix.vert_shaders[1]); } - -#endif /* FEATURE_drawpix */ diff --git a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.h b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.h index 44d7f5ed1..6209dcade 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.h +++ b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.h @@ -36,8 +36,6 @@ struct dd_function_table; struct st_context; -#if FEATURE_drawpix - extern void st_init_drawpixels_functions(struct dd_function_table *functions); extern void @@ -53,18 +51,5 @@ st_make_drawpix_z_stencil_program(struct st_context *st, GLboolean write_depth, GLboolean write_stencil); -#else - -static INLINE void -st_init_drawpixels_functions(struct dd_function_table *functions) -{ -} - -static INLINE void -st_destroy_drawpix(struct st_context *st) -{ -} - -#endif /* FEATURE_drawpix */ #endif /* ST_CB_DRAWPIXELS_H */ diff --git a/mesalib/src/mesa/state_tracker/st_cb_drawtex.c b/mesalib/src/mesa/state_tracker/st_cb_drawtex.c index d57e629f1..e87de4406 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_drawtex.c +++ b/mesalib/src/mesa/state_tracker/st_cb_drawtex.c @@ -34,9 +34,6 @@ #include "cso_cache/cso_context.h" -#if FEATURE_OES_draw_texture - - struct cached_shader { void *handle; @@ -306,6 +303,3 @@ st_destroy_drawtex(struct st_context *st) } NumCachedShaders = 0; } - - -#endif /* FEATURE_OES_draw_texture */ diff --git a/mesalib/src/mesa/state_tracker/st_cb_drawtex.h b/mesalib/src/mesa/state_tracker/st_cb_drawtex.h index 455da04e6..ccb615e98 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_drawtex.h +++ b/mesalib/src/mesa/state_tracker/st_cb_drawtex.h @@ -16,26 +16,10 @@ struct dd_function_table; struct st_context; -#if FEATURE_OES_draw_texture - extern void st_init_drawtex_functions(struct dd_function_table *functions); extern void st_destroy_drawtex(struct st_context *st); -#else - -static INLINE void -st_init_drawtex_functions(struct dd_function_table *functions) -{ -} - -static INLINE void -st_destroy_drawtex(struct st_context *st) -{ -} - -#endif /* FEATURE_OES_draw_texture */ - #endif /* ST_CB_DRAWTEX_H */ diff --git a/mesalib/src/mesa/state_tracker/st_cb_eglimage.c b/mesalib/src/mesa/state_tracker/st_cb_eglimage.c index e91e9142d..0679e7d44 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_eglimage.c +++ b/mesalib/src/mesa/state_tracker/st_cb_eglimage.c @@ -38,8 +38,6 @@ #include "st_format.h" #include "st_manager.h" -#if FEATURE_OES_EGL_image - /** * Return the base format just like _mesa_base_fbo_format does. */ @@ -164,5 +162,3 @@ st_init_eglimage_functions(struct dd_function_table *functions) functions->EGLImageTargetTexture2D = st_egl_image_target_texture_2d; functions->EGLImageTargetRenderbufferStorage = st_egl_image_target_renderbuffer_storage; } - -#endif /* FEATURE_OES_EGL_image */ diff --git a/mesalib/src/mesa/state_tracker/st_cb_eglimage.h b/mesalib/src/mesa/state_tracker/st_cb_eglimage.h index 48567ed9d..1750b9147 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_eglimage.h +++ b/mesalib/src/mesa/state_tracker/st_cb_eglimage.h @@ -34,18 +34,7 @@ struct dd_function_table; -#if FEATURE_OES_EGL_image - extern void st_init_eglimage_functions(struct dd_function_table *functions); -#else - -static INLINE void -st_init_eglimage_functions(struct dd_function_table *functions) -{ -} - -#endif - #endif /* ST_CB_EGLIMAGE_H */ diff --git a/mesalib/src/mesa/state_tracker/st_cb_fbo.c b/mesalib/src/mesa/state_tracker/st_cb_fbo.c index 01aba8eaf..c523795b9 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_fbo.c +++ b/mesalib/src/mesa/state_tracker/st_cb_fbo.c @@ -790,7 +790,6 @@ st_UnmapRenderbuffer(struct gl_context *ctx, void st_init_fbo_functions(struct dd_function_table *functions) { -#if FEATURE_EXT_framebuffer_object functions->NewFramebuffer = st_new_framebuffer; functions->NewRenderbuffer = st_new_renderbuffer; functions->BindFramebuffer = st_bind_framebuffer; @@ -798,7 +797,6 @@ void st_init_fbo_functions(struct dd_function_table *functions) functions->RenderTexture = st_render_texture; functions->FinishRenderTexture = st_finish_render_texture; functions->ValidateFramebuffer = st_validate_framebuffer; -#endif functions->DrawBuffers = st_DrawBuffers; functions->ReadBuffer = st_ReadBuffer; diff --git a/mesalib/src/mesa/state_tracker/st_cb_feedback.c b/mesalib/src/mesa/state_tracker/st_cb_feedback.c index 9b85a39be..9092e3a71 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_feedback.c +++ b/mesalib/src/mesa/state_tracker/st_cb_feedback.c @@ -55,8 +55,6 @@ #include "draw/draw_pipe.h" -#if FEATURE_feedback - /** * This is actually used for both feedback and selection. */ @@ -305,5 +303,3 @@ void st_init_feedback_functions(struct dd_function_table *functions) { functions->RenderMode = st_RenderMode; } - -#endif /* FEATURE_feedback */ diff --git a/mesalib/src/mesa/state_tracker/st_cb_feedback.h b/mesalib/src/mesa/state_tracker/st_cb_feedback.h index 02e34e402..0163631e3 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_feedback.h +++ b/mesalib/src/mesa/state_tracker/st_cb_feedback.h @@ -35,18 +35,8 @@ struct dd_function_table; -#if FEATURE_feedback - extern void st_init_feedback_functions(struct dd_function_table *functions); -#else - -static INLINE void -st_init_feedback_functions(struct dd_function_table *functions) -{ -} - -#endif /* FEATURE_feedback */ #endif /* ST_CB_FEEDBACK_H */ diff --git a/mesalib/src/mesa/state_tracker/st_cb_queryobj.c b/mesalib/src/mesa/state_tracker/st_cb_queryobj.c index e5e4a81dc..b10fd9335 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_queryobj.c +++ b/mesalib/src/mesa/state_tracker/st_cb_queryobj.c @@ -45,8 +45,6 @@ #include "st_cb_bitmap.h" -#if FEATURE_queryobj - static struct gl_query_object * st_NewQueryObject(struct gl_context *ctx, GLuint id) { @@ -194,5 +192,3 @@ void st_init_query_functions(struct dd_function_table *functions) functions->CheckQuery = st_CheckQuery; functions->GetTimestamp = st_GetTimestamp; } - -#endif /* FEATURE_queryobj */ diff --git a/mesalib/src/mesa/state_tracker/st_cb_queryobj.h b/mesalib/src/mesa/state_tracker/st_cb_queryobj.h index 03f0be837..03487b153 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_queryobj.h +++ b/mesalib/src/mesa/state_tracker/st_cb_queryobj.h @@ -53,18 +53,8 @@ st_query_object(struct gl_query_object *q) } -#if FEATURE_queryobj - extern void st_init_query_functions(struct dd_function_table *functions); -#else - -static INLINE void -st_init_query_functions(struct dd_function_table *functions) -{ -} - -#endif /* FEATURE_queryobj */ #endif diff --git a/mesalib/src/mesa/state_tracker/st_cb_rasterpos.c b/mesalib/src/mesa/state_tracker/st_cb_rasterpos.c index 8337f4624..fb4a62ee3 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_rasterpos.c +++ b/mesalib/src/mesa/state_tracker/st_cb_rasterpos.c @@ -50,8 +50,6 @@ #include "vbo/vbo.h" -#if FEATURE_rastpos - /** * Our special drawing pipeline stage (replaces rasterization). */ @@ -275,5 +273,3 @@ void st_init_rasterpos_functions(struct dd_function_table *functions) { functions->RasterPos = st_RasterPos; } - -#endif /* FEATURE_rastpos */ diff --git a/mesalib/src/mesa/state_tracker/st_cb_rasterpos.h b/mesalib/src/mesa/state_tracker/st_cb_rasterpos.h index b61411bd2..bfd3e4138 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_rasterpos.h +++ b/mesalib/src/mesa/state_tracker/st_cb_rasterpos.h @@ -34,17 +34,7 @@ struct dd_function_table; -#if FEATURE_rastpos - extern void st_init_rasterpos_functions(struct dd_function_table *functions); -#else - -static INLINE void -st_init_rasterpos_functions(struct dd_function_table *functions) -{ -} - -#endif /* FEATURE_rastpos */ #endif /* ST_CB_RASTERPOS_H */ diff --git a/mesalib/src/mesa/state_tracker/st_cb_xformfb.c b/mesalib/src/mesa/state_tracker/st_cb_xformfb.c index b8534855b..3e52c9988 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_xformfb.c +++ b/mesalib/src/mesa/state_tracker/st_cb_xformfb.c @@ -48,8 +48,6 @@ #include "util/u_inlines.h" #include "cso_cache/cso_context.h" -#if FEATURE_EXT_transform_feedback - struct st_transform_feedback_object { struct gl_transform_feedback_object base; @@ -229,5 +227,3 @@ st_init_xformfb_functions(struct dd_function_table *functions) functions->PauseTransformFeedback = st_pause_transform_feedback; functions->ResumeTransformFeedback = st_resume_transform_feedback; } - -#endif /* FEATURE_EXT_transform_feedback */ diff --git a/mesalib/src/mesa/state_tracker/st_cb_xformfb.h b/mesalib/src/mesa/state_tracker/st_cb_xformfb.h index c5261b39b..5c82fed18 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_xformfb.h +++ b/mesalib/src/mesa/state_tracker/st_cb_xformfb.h @@ -36,8 +36,6 @@ struct dd_function_table; struct gl_transform_feedback_object; struct pipe_draw_info; -#if FEATURE_EXT_transform_feedback - extern void st_init_xformfb_functions(struct dd_function_table *functions); @@ -45,19 +43,5 @@ extern void st_transform_feedback_draw_init(struct gl_transform_feedback_object *obj, struct pipe_draw_info *out); -#else - -static INLINE void -st_init_xformfb_functions(struct dd_function_table *functions) -{ -} - -static INLINE void -st_transform_feedback_draw_init(struct gl_transform_feedback_object *obj, - struct pipe_draw_info *out) -{ -} - -#endif /* FEATURE_EXT_transform_feedback */ #endif /* ST_CB_XFORMFB_H */ diff --git a/mesalib/src/mesa/state_tracker/st_draw.c b/mesalib/src/mesa/state_tracker/st_draw.c index 9dc4822cc..4800e1c87 100644 --- a/mesalib/src/mesa/state_tracker/st_draw.c +++ b/mesalib/src/mesa/state_tracker/st_draw.c @@ -278,7 +278,6 @@ st_init_draw(struct st_context *st) vbo_set_draw_func(ctx, st_draw_vbo); -#if FEATURE_feedback || FEATURE_rastpos st->draw = draw_create(st->pipe); /* for selection/feedback */ /* Disable draw options that might convert points/lines to tris, etc. @@ -288,14 +287,11 @@ st_init_draw(struct st_context *st) draw_wide_point_threshold(st->draw, 1000.0f); draw_enable_line_stipple(st->draw, FALSE); draw_enable_point_sprites(st->draw, FALSE); -#endif } void st_destroy_draw(struct st_context *st) { -#if FEATURE_feedback || FEATURE_rastpos draw_destroy(st->draw); -#endif } diff --git a/mesalib/src/mesa/state_tracker/st_draw_feedback.c b/mesalib/src/mesa/state_tracker/st_draw_feedback.c index 820918e51..a6c7d0eec 100644 --- a/mesalib/src/mesa/state_tracker/st_draw_feedback.c +++ b/mesalib/src/mesa/state_tracker/st_draw_feedback.c @@ -46,8 +46,6 @@ #include "draw/draw_context.h" -#if FEATURE_feedback || FEATURE_rastpos - /** * Set the (private) draw module's post-transformed vertex format when in * GL_SELECT or GL_FEEDBACK mode or for glRasterPos. @@ -268,6 +266,3 @@ st_feedback_draw_vbo(struct gl_context *ctx, } draw_set_vertex_buffers(draw, 0, NULL); } - -#endif /* FEATURE_feedback || FEATURE_rastpos */ - diff --git a/mesalib/src/mesa/state_tracker/st_extensions.c b/mesalib/src/mesa/state_tracker/st_extensions.c index ac11f127c..d6cb915e9 100644 --- a/mesalib/src/mesa/state_tracker/st_extensions.c +++ b/mesalib/src/mesa/state_tracker/st_extensions.c @@ -530,14 +530,10 @@ void st_init_extensions(struct st_context *st) ctx->Extensions.NV_vertex_program1_1 = GL_TRUE; #endif -#if FEATURE_OES_EGL_image ctx->Extensions.OES_EGL_image = GL_TRUE; if (ctx->API != API_OPENGL) ctx->Extensions.OES_EGL_image_external = GL_TRUE; -#endif -#if FEATURE_OES_draw_texture ctx->Extensions.OES_draw_texture = GL_TRUE; -#endif /* Expose the extensions which directly correspond to gallium caps. */ for (i = 0; i < Elements(cap_mapping); i++) { diff --git a/mesalib/src/mesa/state_tracker/st_format.c b/mesalib/src/mesa/state_tracker/st_format.c index 302b58c7b..a9ff2cd0d 100644 --- a/mesalib/src/mesa/state_tracker/st_format.c +++ b/mesalib/src/mesa/state_tracker/st_format.c @@ -119,7 +119,6 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat) return PIPE_FORMAT_Z32_FLOAT_S8X24_UINT; case MESA_FORMAT_YCBCR: return PIPE_FORMAT_UYVY; -#if FEATURE_texture_s3tc case MESA_FORMAT_RGB_DXT1: return PIPE_FORMAT_DXT1_RGB; case MESA_FORMAT_RGBA_DXT1: @@ -128,7 +127,6 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat) return PIPE_FORMAT_DXT3_RGBA; case MESA_FORMAT_RGBA_DXT5: return PIPE_FORMAT_DXT5_RGBA; -#if FEATURE_EXT_texture_sRGB case MESA_FORMAT_SRGB_DXT1: return PIPE_FORMAT_DXT1_SRGB; case MESA_FORMAT_SRGBA_DXT1: @@ -137,9 +135,6 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat) return PIPE_FORMAT_DXT3_SRGBA; case MESA_FORMAT_SRGBA_DXT5: return PIPE_FORMAT_DXT5_SRGBA; -#endif -#endif -#if FEATURE_EXT_texture_sRGB case MESA_FORMAT_SLA8: return PIPE_FORMAT_L8A8_SRGB; case MESA_FORMAT_SL8: @@ -150,7 +145,6 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat) return PIPE_FORMAT_A8B8G8R8_SRGB; case MESA_FORMAT_SARGB8: return PIPE_FORMAT_B8G8R8A8_SRGB; -#endif case MESA_FORMAT_RGBA_FLOAT32: return PIPE_FORMAT_R32G32B32A32_FLOAT; case MESA_FORMAT_RGBA_FLOAT16: @@ -449,7 +443,6 @@ st_pipe_format_to_mesa_format(enum pipe_format format) case PIPE_FORMAT_YUYV: return MESA_FORMAT_YCBCR_REV; -#if FEATURE_texture_s3tc case PIPE_FORMAT_DXT1_RGB: return MESA_FORMAT_RGB_DXT1; case PIPE_FORMAT_DXT1_RGBA: @@ -458,7 +451,6 @@ st_pipe_format_to_mesa_format(enum pipe_format format) return MESA_FORMAT_RGBA_DXT3; case PIPE_FORMAT_DXT5_RGBA: return MESA_FORMAT_RGBA_DXT5; -#if FEATURE_EXT_texture_sRGB case PIPE_FORMAT_DXT1_SRGB: return MESA_FORMAT_SRGB_DXT1; case PIPE_FORMAT_DXT1_SRGBA: @@ -467,10 +459,6 @@ st_pipe_format_to_mesa_format(enum pipe_format format) return MESA_FORMAT_SRGBA_DXT3; case PIPE_FORMAT_DXT5_SRGBA: return MESA_FORMAT_SRGBA_DXT5; -#endif -#endif - -#if FEATURE_EXT_texture_sRGB case PIPE_FORMAT_L8A8_SRGB: return MESA_FORMAT_SLA8; case PIPE_FORMAT_L8_SRGB: @@ -481,7 +469,6 @@ st_pipe_format_to_mesa_format(enum pipe_format format) return MESA_FORMAT_SRGBA8; case PIPE_FORMAT_B8G8R8A8_SRGB: return MESA_FORMAT_SARGB8; -#endif case PIPE_FORMAT_R32G32B32A32_FLOAT: return MESA_FORMAT_RGBA_FLOAT32; case PIPE_FORMAT_R16G16B16A16_FLOAT: diff --git a/mesalib/src/mesa/state_tracker/st_program.c b/mesalib/src/mesa/state_tracker/st_program.c index 9816e22ac..ac066a766 100644 --- a/mesalib/src/mesa/state_tracker/st_program.c +++ b/mesalib/src/mesa/state_tracker/st_program.c @@ -66,10 +66,8 @@ delete_vp_variant(struct st_context *st, struct st_vp_variant *vpv) if (vpv->driver_shader) cso_delete_vertex_shader(st->cso_context, vpv->driver_shader); -#if FEATURE_feedback || FEATURE_rastpos if (vpv->draw_shader) draw_delete_vertex_shader( st->draw, vpv->draw_shader ); -#endif if (vpv->tgsi.tokens) st_free_tokens(vpv->tgsi.tokens); @@ -497,7 +495,6 @@ st_translate_fragment_program(struct st_context *st, assert(!(key->bitmap && key->drawpixels)); -#if FEATURE_drawpix if (key->bitmap) { /* glBitmap drawing */ struct gl_fragment_program *fp; /* we free this temp program below */ @@ -525,7 +522,6 @@ st_translate_fragment_program(struct st_context *st, } stfp = st_fragment_program(fp); } -#endif if (!stfp->glsl_to_tgsi) _mesa_remove_output_reads(&stfp->Base.Base, PROGRAM_OUTPUT); diff --git a/mesalib/src/mesa/swrast/s_atifragshader.c b/mesalib/src/mesa/swrast/s_atifragshader.c index 394fac50b..c5abaa0d4 100644 --- a/mesalib/src/mesa/swrast/s_atifragshader.c +++ b/mesalib/src/mesa/swrast/s_atifragshader.c @@ -237,21 +237,6 @@ finish_pass(struct atifs_machine *machine) } } -struct ati_fs_opcode_st ati_fs_opcodes[] = { - {GL_ADD_ATI, 2}, - {GL_SUB_ATI, 2}, - {GL_MUL_ATI, 2}, - {GL_MAD_ATI, 3}, - {GL_LERP_ATI, 3}, - {GL_MOV_ATI, 1}, - {GL_CND_ATI, 3}, - {GL_CND0_ATI, 3}, - {GL_DOT2_ADD_ATI, 3}, - {GL_DOT3_ATI, 2}, - {GL_DOT4_ATI, 2} -}; - - static void handle_pass_op(struct atifs_machine *machine, struct atifs_setupinst *texinst, diff --git a/mesalib/src/mesa/vbo/vbo.h b/mesalib/src/mesa/vbo/vbo.h index eb06bf9b5..e0584973f 100644 --- a/mesalib/src/mesa/vbo/vbo.h +++ b/mesalib/src/mesa/vbo/vbo.h @@ -156,7 +156,7 @@ void vbo_check_buffers_are_unmapped(struct gl_context *ctx); void vbo_bind_arrays(struct gl_context *ctx); size_t -count_tessellated_primitives(const struct _mesa_prim *prim); +vbo_count_tessellated_primitives(const struct _mesa_prim *prim); void vbo_sw_primitive_restart(struct gl_context *ctx, diff --git a/mesalib/src/mesa/vbo/vbo_context.h b/mesalib/src/mesa/vbo/vbo_context.h index 1c49de0ca..e3e37e7f2 100644 --- a/mesalib/src/mesa/vbo/vbo_context.h +++ b/mesalib/src/mesa/vbo/vbo_context.h @@ -78,9 +78,7 @@ struct vbo_context { GLuint map_vp_arb[VERT_ATTRIB_MAX]; struct vbo_exec_context exec; -#if FEATURE_dlist struct vbo_save_context save; -#endif /* Callback into the driver. This must always succeed, the driver * is responsible for initiating any fallback actions required: diff --git a/mesalib/src/mesa/vbo/vbo_exec.c b/mesalib/src/mesa/vbo/vbo_exec.c index fd5e0f891..0763f0d4d 100644 --- a/mesalib/src/mesa/vbo/vbo_exec.c +++ b/mesalib/src/mesa/vbo/vbo_exec.c @@ -105,7 +105,7 @@ void vbo_exec_invalidate_state( struct gl_context *ctx, GLuint new_state ) * PRIMITIVES_GENERATED and TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN queries. */ size_t -count_tessellated_primitives(const struct _mesa_prim *prim) +vbo_count_tessellated_primitives(const struct _mesa_prim *prim) { size_t num_primitives; switch (prim->mode) { diff --git a/mesalib/src/mesa/vbo/vbo_exec.h b/mesalib/src/mesa/vbo/vbo_exec.h index 4ac7d168d..635e743ae 100644 --- a/mesalib/src/mesa/vbo/vbo_exec.h +++ b/mesalib/src/mesa/vbo/vbo_exec.h @@ -160,24 +160,9 @@ void vbo_exec_vtx_init( struct vbo_exec_context *exec ); void vbo_exec_vtx_destroy( struct vbo_exec_context *exec ); -#if FEATURE_beginend - void vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap ); void vbo_exec_vtx_map( struct vbo_exec_context *exec ); -#else /* FEATURE_beginend */ - -static inline void -vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap ) -{ -} - -static inline void -vbo_exec_vtx_map( struct vbo_exec_context *exec ) -{ -} - -#endif /* FEATURE_beginend */ void vbo_exec_vtx_wrap( struct vbo_exec_context *exec ); diff --git a/mesalib/src/mesa/vbo/vbo_exec_api.c b/mesalib/src/mesa/vbo/vbo_exec_api.c index ded711b9f..6bcb61cc8 100644 --- a/mesalib/src/mesa/vbo/vbo_exec_api.c +++ b/mesalib/src/mesa/vbo/vbo_exec_api.c @@ -550,11 +550,6 @@ vbo_exec_FlushVertices_internal(struct vbo_exec_context *exec, GLboolean unmap) } -#if FEATURE_beginend - - -#if FEATURE_evaluators - static void GLAPIENTRY vbo_exec_EvalCoord1f( GLfloat u ) { GET_CURRENT_CONTEXT( ctx ); @@ -757,8 +752,6 @@ vbo_exec_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) } } -#endif /* FEATURE_evaluators */ - /** * Execute a glRectf() function. This is not suitable for GL_COMPILE @@ -1048,74 +1041,6 @@ static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec ) } -#else /* FEATURE_beginend */ - - -static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec ) -{ - /* silence warnings */ - (void) vbo_Color3f; - (void) vbo_Color3fv; - (void) vbo_Color4f; - (void) vbo_Color4fv; - (void) vbo_FogCoordfEXT; - (void) vbo_FogCoordfvEXT; - (void) vbo_MultiTexCoord1f; - (void) vbo_MultiTexCoord1fv; - (void) vbo_MultiTexCoord2f; - (void) vbo_MultiTexCoord2fv; - (void) vbo_MultiTexCoord3f; - (void) vbo_MultiTexCoord3fv; - (void) vbo_MultiTexCoord4f; - (void) vbo_MultiTexCoord4fv; - (void) vbo_Normal3f; - (void) vbo_Normal3fv; - (void) vbo_SecondaryColor3fEXT; - (void) vbo_SecondaryColor3fvEXT; - (void) vbo_TexCoord1f; - (void) vbo_TexCoord1fv; - (void) vbo_TexCoord2f; - (void) vbo_TexCoord2fv; - (void) vbo_TexCoord3f; - (void) vbo_TexCoord3fv; - (void) vbo_TexCoord4f; - (void) vbo_TexCoord4fv; - (void) vbo_Vertex2f; - (void) vbo_Vertex2fv; - (void) vbo_Vertex3f; - (void) vbo_Vertex3fv; - (void) vbo_Vertex4f; - (void) vbo_Vertex4fv; - - (void) vbo_VertexAttrib1fARB; - (void) vbo_VertexAttrib1fvARB; - (void) vbo_VertexAttrib2fARB; - (void) vbo_VertexAttrib2fvARB; - (void) vbo_VertexAttrib3fARB; - (void) vbo_VertexAttrib3fvARB; - (void) vbo_VertexAttrib4fARB; - (void) vbo_VertexAttrib4fvARB; - - (void) vbo_VertexAttrib1fNV; - (void) vbo_VertexAttrib1fvNV; - (void) vbo_VertexAttrib2fNV; - (void) vbo_VertexAttrib2fvNV; - (void) vbo_VertexAttrib3fNV; - (void) vbo_VertexAttrib3fvNV; - (void) vbo_VertexAttrib4fNV; - (void) vbo_VertexAttrib4fvNV; - - (void) vbo_Materialfv; - - (void) vbo_EdgeFlag; - (void) vbo_Indexf; - (void) vbo_Indexfv; -} - - -#endif /* FEATURE_beginend */ - - /** * Tell the VBO module to use a real OpenGL vertex buffer object to * store accumulated immediate-mode vertex data. diff --git a/mesalib/src/mesa/vbo/vbo_exec_array.c b/mesalib/src/mesa/vbo/vbo_exec_array.c index a923aa1fa..f0ef2058e 100644 --- a/mesalib/src/mesa/vbo/vbo_exec_array.c +++ b/mesalib/src/mesa/vbo/vbo_exec_array.c @@ -1281,8 +1281,6 @@ vbo_exec_MultiDrawElementsBaseVertex(GLenum mode, basevertex); } -#if FEATURE_EXT_transform_feedback - static void vbo_draw_transform_feedback(struct gl_context *ctx, GLenum mode, struct gl_transform_feedback_object *obj, @@ -1387,8 +1385,6 @@ vbo_exec_DrawTransformFeedbackStreamInstanced(GLenum mode, GLuint name, vbo_draw_transform_feedback(ctx, mode, obj, stream, primcount); } -#endif - /** * Plug in the immediate-mode vertex array drawing commands into the * givven vbo_exec_context object. @@ -1409,7 +1405,6 @@ vbo_exec_array_init( struct vbo_exec_context *exec ) exec->vtxfmt.DrawElementsInstancedBaseInstance = vbo_exec_DrawElementsInstancedBaseInstance; exec->vtxfmt.DrawElementsInstancedBaseVertex = vbo_exec_DrawElementsInstancedBaseVertex; exec->vtxfmt.DrawElementsInstancedBaseVertexBaseInstance = vbo_exec_DrawElementsInstancedBaseVertexBaseInstance; -#if FEATURE_EXT_transform_feedback exec->vtxfmt.DrawTransformFeedback = vbo_exec_DrawTransformFeedback; exec->vtxfmt.DrawTransformFeedbackStream = vbo_exec_DrawTransformFeedbackStream; @@ -1417,7 +1412,6 @@ vbo_exec_array_init( struct vbo_exec_context *exec ) vbo_exec_DrawTransformFeedbackInstanced; exec->vtxfmt.DrawTransformFeedbackStreamInstanced = vbo_exec_DrawTransformFeedbackStreamInstanced; -#endif } @@ -1494,12 +1488,8 @@ _mesa_MultiDrawElementsBaseVertex(GLenum mode, primcount, basevertex); } -#if FEATURE_EXT_transform_feedback - void GLAPIENTRY _mesa_DrawTransformFeedback(GLenum mode, GLuint name) { vbo_exec_DrawTransformFeedback(mode, name); } - -#endif diff --git a/mesalib/src/mesa/vbo/vbo_exec_draw.c b/mesalib/src/mesa/vbo/vbo_exec_draw.c index 77db8ec7f..15ecfc031 100644 --- a/mesalib/src/mesa/vbo/vbo_exec_draw.c +++ b/mesalib/src/mesa/vbo/vbo_exec_draw.c @@ -38,9 +38,6 @@ #include "vbo_noop.h" -#if FEATURE_beginend - - static void vbo_exec_debug_verts( struct vbo_exec_context *exec ) { @@ -441,6 +438,3 @@ vbo_exec_vtx_flush(struct vbo_exec_context *exec, GLboolean keepUnmapped) exec->vtx.prim_count = 0; exec->vtx.vert_count = 0; } - - -#endif /* FEATURE_beginend */ diff --git a/mesalib/src/mesa/vbo/vbo_noop.c b/mesalib/src/mesa/vbo/vbo_noop.c index 2f472c21c..2f2200219 100644 --- a/mesalib/src/mesa/vbo/vbo_noop.c +++ b/mesalib/src/mesa/vbo/vbo_noop.c @@ -37,9 +37,6 @@ #include "main/mfeatures.h" #include "vbo/vbo_noop.h" -#if FEATURE_beginend - - static void GLAPIENTRY _mesa_noop_EdgeFlag(GLboolean b) { @@ -304,8 +301,6 @@ _mesa_noop_Vertex4f(GLfloat a, GLfloat b, GLfloat c, GLfloat d) { } - -#if FEATURE_evaluators static void GLAPIENTRY _mesa_noop_EvalCoord1f(GLfloat a) { @@ -335,8 +330,6 @@ static void GLAPIENTRY _mesa_noop_EvalPoint2(GLint a, GLint b) { } -#endif /* FEATURE_evaluators */ - static void GLAPIENTRY _mesa_noop_Begin(GLenum mode) @@ -514,6 +507,3 @@ _mesa_using_noop_vtxfmt(const struct _glapi_table *dispatch) { return GET_Begin((struct _glapi_table *) dispatch) == _mesa_noop_Begin; } - - -#endif /* FEATURE_beginend */ diff --git a/mesalib/src/mesa/vbo/vbo_noop.h b/mesalib/src/mesa/vbo/vbo_noop.h index 92f61d356..044d373e8 100644 --- a/mesalib/src/mesa/vbo/vbo_noop.h +++ b/mesalib/src/mesa/vbo/vbo_noop.h @@ -30,22 +30,11 @@ #include "main/mtypes.h" -#if FEATURE_beginend - extern void _mesa_noop_vtxfmt_init(GLvertexformat *vfmt); extern GLboolean _mesa_using_noop_vtxfmt(const struct _glapi_table *dispatch); -#else - -static inline void -_mesa_noop_vtxfmt_init(GLvertexformat *vfmt) -{ -} - -#endif /* FEATURE_beginend */ - #endif /* _API_NOOP_H */ diff --git a/mesalib/src/mesa/vbo/vbo_save.c b/mesalib/src/mesa/vbo/vbo_save.c index a40039927..ad11b5ddc 100644 --- a/mesalib/src/mesa/vbo/vbo_save.c +++ b/mesalib/src/mesa/vbo/vbo_save.c @@ -34,9 +34,6 @@ #include "vbo_context.h" -#if FEATURE_dlist - - static void vbo_save_callback_init( struct gl_context *ctx ) { ctx->Driver.NewList = vbo_save_NewList; @@ -131,6 +128,3 @@ void vbo_save_fallback( struct gl_context *ctx, GLboolean fallback ) else save->replay_flags &= ~VBO_SAVE_FALLBACK; } - - -#endif /* FEATURE_dlist */ diff --git a/mesalib/src/mesa/vbo/vbo_save.h b/mesalib/src/mesa/vbo/vbo_save.h index 0b4d563a7..f33669670 100644 --- a/mesalib/src/mesa/vbo/vbo_save.h +++ b/mesalib/src/mesa/vbo/vbo_save.h @@ -158,8 +158,6 @@ struct vbo_save_context { GLubyte *currentsz[VBO_ATTRIB_MAX]; }; -#if FEATURE_dlist - void vbo_save_init( struct gl_context *ctx ); void vbo_save_destroy( struct gl_context *ctx ); void vbo_save_fallback( struct gl_context *ctx, GLboolean fallback ); @@ -195,18 +193,4 @@ void vbo_save_unmap_vertex_store(struct gl_context *ctx, struct vbo_save_vertex_store *vertex_store); -#else /* FEATURE_dlist */ - -static inline void -vbo_save_init( struct gl_context *ctx ) -{ -} - -static inline void -vbo_save_destroy( struct gl_context *ctx ) -{ -} - -#endif /* FEATURE_dlist */ - #endif /* VBO_SAVE_H */ diff --git a/mesalib/src/mesa/vbo/vbo_save_api.c b/mesalib/src/mesa/vbo/vbo_save_api.c index f7936610c..89f09a8d8 100644 --- a/mesalib/src/mesa/vbo/vbo_save_api.c +++ b/mesalib/src/mesa/vbo/vbo_save_api.c @@ -84,9 +84,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "vbo_noop.h" -#if FEATURE_dlist - - #ifdef ERROR #undef ERROR #endif @@ -1668,6 +1665,3 @@ vbo_save_api_init(struct vbo_save_context *save) ctx->ListState.ListVtxfmt.MultiDrawElementsBaseVertex = _save_OBE_MultiDrawElementsBaseVertex; _mesa_install_save_vtxfmt(ctx, &ctx->ListState.ListVtxfmt); } - - -#endif /* FEATURE_dlist */ diff --git a/mesalib/src/mesa/vbo/vbo_save_draw.c b/mesalib/src/mesa/vbo/vbo_save_draw.c index c6425ab1b..8ffc96aec 100644 --- a/mesalib/src/mesa/vbo/vbo_save_draw.c +++ b/mesalib/src/mesa/vbo/vbo_save_draw.c @@ -39,9 +39,6 @@ #include "vbo_context.h" -#if FEATURE_dlist - - /** * After playback, copy everything but the position from the * last vertex to the saved state @@ -331,6 +328,3 @@ end: save->buffer_ptr = vbo_save_map_vertex_store(ctx, save->vertex_store); } } - - -#endif /* FEATURE_dlist */ diff --git a/mesalib/src/mesa/vbo/vbo_save_loopback.c b/mesalib/src/mesa/vbo/vbo_save_loopback.c index 51e598e7e..98772be76 100644 --- a/mesalib/src/mesa/vbo/vbo_save_loopback.c +++ b/mesalib/src/mesa/vbo/vbo_save_loopback.c @@ -37,9 +37,6 @@ #include "vbo_context.h" -#if FEATURE_dlist - - typedef void (*attr_func)( struct gl_context *ctx, GLint target, const GLfloat * ); @@ -191,6 +188,3 @@ void vbo_loopback_vertex_list( struct gl_context *ctx, } } } - - -#endif /* FEATURE_dlist */ diff --git a/pixman/Makefile.win32 b/pixman/Makefile.win32 index 91cd12a52..c3ca3bc59 100644 --- a/pixman/Makefile.win32 +++ b/pixman/Makefile.win32 @@ -3,23 +3,23 @@ default: all top_srcdir = . include $(top_srcdir)/Makefile.win32.common -# Recursive targets -pixman_r: +all: pixman test + +pixman: @$(MAKE) -C pixman -f Makefile.win32 -test_r: +test: @$(MAKE) -C test -f Makefile.win32 clean_r: @$(MAKE) -C pixman -f Makefile.win32 clean @$(MAKE) -C test -f Makefile.win32 clean -check_r: +check: @$(MAKE) -C test -f Makefile.win32 check -# Base targets -all: test_r clean: clean_r -check: check_r + +.PHONY: all pixman test clean check diff --git a/pixman/Makefile.win32.common b/pixman/Makefile.win32.common index 56c3593d2..777f94ce2 100644 --- a/pixman/Makefile.win32.common +++ b/pixman/Makefile.win32.common @@ -46,9 +46,11 @@ endif endif -$(CFG_VAR)/%.obj: %.c $(BUILT_SOURCES) +$(CFG_VAR)/%.obj: %.c $(libpixman_headers) @mkdir -p $(CFG_VAR) @$(CC) -c $(PIXMAN_CFLAGS) -Fo"$@" $< clean: inform @$(RM) $(CFG_VAR)/*.{exe,ilk,lib,obj,pdb} $(BUILT_SOURCES) || exit 0 + +.PHONY: inform clean diff --git a/pixman/pixman/Makefile.win32 b/pixman/pixman/Makefile.win32 index 381f2cd9d..57ed7a5dc 100644 --- a/pixman/pixman/Makefile.win32 +++ b/pixman/pixman/Makefile.win32 @@ -64,3 +64,5 @@ endif # pixman linking $(CFG_VAR)/$(LIBRARY).lib: $(OBJECTS) @$(AR) $(PIXMAN_ARFLAGS) -OUT:$@ $^ + +.PHONY: all informMMX informSSE2 diff --git a/pixman/pixman/pixman-mmx.c b/pixman/pixman/pixman-mmx.c index dfca50954..cde5026a3 100644 --- a/pixman/pixman/pixman-mmx.c +++ b/pixman/pixman/pixman-mmx.c @@ -3575,7 +3575,6 @@ do { \ /* fetch 2x2 pixel block into 2 mmx registers */ \ __m64 t = ldq_u ((__m64 *)&src_top [pixman_fixed_to_int (vx)]); \ __m64 b = ldq_u ((__m64 *)&src_bottom [pixman_fixed_to_int (vx)]); \ - vx += unit_x; \ /* vertical interpolation */ \ t_hi = _mm_mullo_pi16 (_mm_unpackhi_pi8 (t, mm_zero), mm_wt); \ t_lo = _mm_mullo_pi16 (_mm_unpacklo_pi8 (t, mm_zero), mm_wt); \ @@ -3583,6 +3582,7 @@ do { \ b_lo = _mm_mullo_pi16 (_mm_unpacklo_pi8 (b, mm_zero), mm_wb); \ hi = _mm_add_pi16 (t_hi, b_hi); \ lo = _mm_add_pi16 (t_lo, b_lo); \ + vx += unit_x; \ if (BILINEAR_INTERPOLATION_BITS < 8) \ { \ __m64 p, q; \ @@ -3590,7 +3590,6 @@ do { \ __m64 mm_wh = _mm_add_pi16 (mm_addc7, _mm_xor_si64 (mm_xorc7, \ _mm_srli_pi16 (mm_x, \ 16 - BILINEAR_INTERPOLATION_BITS))); \ - mm_x = _mm_add_pi16 (mm_x, mm_ux); \ /* horizontal interpolation */ \ p = _mm_unpacklo_pi16 (lo, hi); \ q = _mm_unpackhi_pi16 (lo, hi); \ @@ -3605,7 +3604,6 @@ do { \ 16 - BILINEAR_INTERPOLATION_BITS)); \ __m64 mm_wh_hi = _mm_srli_pi16 (mm_x, \ 16 - BILINEAR_INTERPOLATION_BITS); \ - mm_x = _mm_add_pi16 (mm_x, mm_ux); \ /* horizontal interpolation */ \ mm_lo_lo = _mm_mullo_pi16 (lo, mm_wh_lo); \ mm_lo_hi = _mm_mullo_pi16 (hi, mm_wh_hi); \ @@ -3616,6 +3614,7 @@ do { \ hi = _mm_add_pi32 (_mm_unpackhi_pi16 (mm_lo_lo, mm_hi_lo), \ _mm_unpackhi_pi16 (mm_lo_hi, mm_hi_hi)); \ } \ + mm_x = _mm_add_pi16 (mm_x, mm_ux); \ /* shift and pack the result */ \ hi = _mm_srli_pi32 (hi, BILINEAR_INTERPOLATION_BITS * 2); \ lo = _mm_srli_pi32 (lo, BILINEAR_INTERPOLATION_BITS * 2); \ diff --git a/pixman/test/Makefile.win32 b/pixman/test/Makefile.win32 index c88d0872a..b6254a3cf 100644 --- a/pixman/test/Makefile.win32 +++ b/pixman/test/Makefile.win32 @@ -16,9 +16,9 @@ OBJECTS = $(patsubst %.c, $(CFG_VAR)/%.obj, $(SOURCES)) TESTS = $(patsubst %, $(CFG_VAR)/%.exe, $(TESTPROGRAMS)) BENCHS = $(patsubst %, $(CFG_VAR)/%.exe, $(BENCHMARKS)) -all: inform $(TESTS) $(BENCHS) +all: pixman inform $(TESTS) $(BENCHS) -check: inform $(TESTS) +check: pixman inform $(TESTS) @failures=0 ; \ total=0 ; \ for test in $(TESTS) ; \ @@ -46,5 +46,9 @@ $(CFG_VAR)/libutils.lib: $(libutils_OBJECTS) $(CFG_VAR)/%.exe: $(CFG_VAR)/%.obj $(TEST_LDADD) @$(LD) $(PIXMAN_LDFLAGS) -OUT:$@ $^ -$(top_builddir)/pixman/$(CFG_VAR)/$(LIBRARY).lib: +$(top_builddir)/pixman/$(CFG_VAR)/$(LIBRARY).lib: pixman + +pixman: @$(MAKE) -C $(top_builddir)/pixman -f Makefile.win32 + +.PHONY: all check pixman diff --git a/xorg-server/hw/xfree86/dri2/dri2.c b/xorg-server/hw/xfree86/dri2/dri2.c index 23f589cdc..40963c3b0 100644 --- a/xorg-server/hw/xfree86/dri2/dri2.c +++ b/xorg-server/hw/xfree86/dri2/dri2.c @@ -766,6 +766,44 @@ static inline PixmapPtr GetDrawablePixmap(DrawablePtr drawable) } } +/* + * A TraverseTree callback to invalidate all windows using the same + * pixmap + */ +static int +DRI2InvalidateWalk(WindowPtr pWin, pointer data) +{ + if (pWin->drawable.pScreen->GetWindowPixmap(pWin) != data) + return WT_DONTWALKCHILDREN; + DRI2InvalidateDrawable(&pWin->drawable); + return WT_WALKCHILDREN; +} + +static void +DRI2InvalidateDrawableAll(DrawablePtr pDraw) +{ + if (pDraw->type == DRAWABLE_WINDOW) { + WindowPtr pWin = (WindowPtr) pDraw; + PixmapPtr pPixmap = pDraw->pScreen->GetWindowPixmap(pWin); + + /* + * Find the top-most window using this pixmap + */ + while (pWin->parent && + pDraw->pScreen->GetWindowPixmap(pWin->parent) == pPixmap) + pWin = pWin->parent; + + /* + * Walk the sub-tree to invalidate all of the + * windows using the same pixmap + */ + TraverseTree(pWin, DRI2InvalidateWalk, pPixmap); + DRI2InvalidateDrawable(&pPixmap->drawable); + } + else + DRI2InvalidateDrawable(pDraw); +} + DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest) { DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw); @@ -831,6 +869,8 @@ DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest) spix->screen_x = mpix->screen_x; spix->screen_y = mpix->screen_y; #endif + + DRI2InvalidateDrawableAll(pDraw); return &spix->drawable; } @@ -1048,18 +1088,7 @@ DRI2WaitSwap(ClientPtr client, DrawablePtr pDrawable) return FALSE; } -/* - * A TraverseTree callback to invalidate all windows using the same - * pixmap - */ -static int -DRI2InvalidateWalk(WindowPtr pWin, pointer data) -{ - if (pWin->drawable.pScreen->GetWindowPixmap(pWin) != data) - return WT_DONTWALKCHILDREN; - DRI2InvalidateDrawable(&pWin->drawable); - return WT_WALKCHILDREN; -} + int DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc, @@ -1162,26 +1191,7 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc, */ *swap_target = pPriv->swap_count + pPriv->swapsPending; - if (pDraw->type == DRAWABLE_WINDOW) { - WindowPtr pWin = (WindowPtr) pDraw; - PixmapPtr pPixmap = pScreen->GetWindowPixmap(pWin); - - /* - * Find the top-most window using this pixmap - */ - while (pWin->parent && - pScreen->GetWindowPixmap(pWin->parent) == pPixmap) - pWin = pWin->parent; - - /* - * Walk the sub-tree to invalidate all of the - * windows using the same pixmap - */ - TraverseTree(pWin, DRI2InvalidateWalk, pPixmap); - DRI2InvalidateDrawable(&pPixmap->drawable); - } - else - DRI2InvalidateDrawable(pDraw); + DRI2InvalidateDrawableAll(pDraw); return Success; } |