[Mesa-dev] [PATCH 44/47] mesa: remove FEATURE_ATI_fragment_shader define.

Oliver McFadden oliver.mcfadden at linux.intel.com
Thu Sep 13 01:19:13 PDT 2012


Signed-off-by: Oliver McFadden <oliver.mcfadden at linux.intel.com>
---
 src/mesa/main/atifragshader.c |    4 ----
 src/mesa/main/atifragshader.h |   22 ----------------------
 src/mesa/main/dlist.c         |    8 --------
 src/mesa/main/enable.c        |    4 ----
 src/mesa/main/extensions.c    |    2 --
 src/mesa/main/mfeatures.h     |    2 --
 src/mesa/main/shared.c        |    8 --------
 src/mesa/program/program.c    |    8 ++------
 8 files changed, 2 insertions(+), 56 deletions(-)

diff --git a/src/mesa/main/atifragshader.c b/src/mesa/main/atifragshader.c
index 63608a3..32ddfb8 100644
--- a/src/mesa/main/atifragshader.c
+++ b/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/src/mesa/main/atifragshader.h b/src/mesa/main/atifragshader.h
index 90ada21..51dc00c 100644
--- a/src/mesa/main/atifragshader.h
+++ b/src/mesa/main/atifragshader.h
@@ -65,8 +65,6 @@ struct atifs_setupinst
 };
 
 
-#if FEATURE_ATI_fragment_shader
-
 extern void
 _mesa_init_ati_fragment_shader_dispatch(struct _glapi_table *disp);
 
@@ -130,25 +128,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/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 7ed9665..b663e36 100644
--- a/src/mesa/main/dlist.c
+++ b/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"
@@ -5437,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)
 {
@@ -5471,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)
@@ -8592,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;
@@ -8606,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;
@@ -10273,10 +10267,8 @@ _mesa_create_save_table(void)
    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 */
    SET_ProgramNamedParameter4fNV(table, save_ProgramNamedParameter4fNV);
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 5702539..6a7f8a0 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -966,7 +966,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;
@@ -976,7 +975,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:
@@ -1653,13 +1651,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))
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index c7ab086..6fe7ad1 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -428,9 +428,7 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
    ctx->Extensions.ARB_sync = GL_TRUE;
    ctx->Extensions.APPLE_object_purgeable = GL_TRUE;
    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;
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index a315d9b..36724bd 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -84,6 +84,4 @@
 #define FEATURE_remap_table               0
 #endif
 
-#define FEATURE_ATI_fragment_shader       FEATURE_GL
-
 #endif /* FEATURES_H */
diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c
index 6b23a13..fab2995 100644
--- a/src/mesa/main/shared.c
+++ b/src/mesa/main/shared.c
@@ -31,9 +31,7 @@
 #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"
@@ -75,10 +73,8 @@ _mesa_alloc_shared_state(struct gl_context *ctx)
       gl_fragment_program(ctx->Driver.NewProgram(ctx,
                                                  GL_FRAGMENT_PROGRAM_ARB, 0));
 
-#if FEATURE_ATI_fragment_shader
    shared->ATIShaders = _mesa_NewHashTable();
    shared->DefaultFragmentShader = _mesa_new_ati_fragment_shader(ctx, 0);
-#endif
 
    shared->ShaderObjects = _mesa_NewHashTable();
 
@@ -164,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().
@@ -176,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
 
 
 /**
@@ -316,11 +310,9 @@ free_shared_state(struct gl_context *ctx, struct gl_shared_state *shared)
    _mesa_reference_vertprog(ctx, &shared->DefaultVertexProgram, NULL);
    _mesa_reference_fragprog(ctx, &shared->DefaultFragmentProgram, NULL);
 
-#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);
diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c
index 531a932..30f8377 100644
--- a/src/mesa/program/program.c
+++ b/src/mesa/program/program.c
@@ -109,12 +109,10 @@ _mesa_init_program(struct gl_context *ctx)
    ctx->GeometryProgram.Cache = _mesa_new_program_cache();
 
    /* 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
 }
 
 
@@ -130,15 +128,15 @@ _mesa_free_program_data(struct gl_context *ctx)
    _mesa_delete_shader_cache(ctx, ctx->FragmentProgram.Cache);
    _mesa_reference_geomprog(ctx, &ctx->GeometryProgram.Current, NULL);
    _mesa_delete_program_cache(ctx, ctx->GeometryProgram.Cache);
+
    /* 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);
 }
 
@@ -163,7 +161,6 @@ _mesa_update_default_objects_program(struct gl_context *ctx)
                       ctx->Shared->DefaultGeometryProgram);
 
    /* XXX probably move this stuff */
-#if FEATURE_ATI_fragment_shader
    if (ctx->ATIFragmentShader.Current) {
       ctx->ATIFragmentShader.Current->RefCount--;
       if (ctx->ATIFragmentShader.Current->RefCount <= 0) {
@@ -173,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
 }
 
 
-- 
1.7.8.6



More information about the mesa-dev mailing list