mesa: remove FEATURE_ARB_shader_objects and related defines.
authorOliver McFadden <oliver.mcfadden@linux.intel.com>
Tue, 11 Sep 2012 07:09:18 +0000 (10:09 +0300)
committerOliver McFadden <oliver.mcfadden@linux.intel.com>
Sat, 15 Sep 2012 09:57:16 +0000 (12:57 +0300)
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/api_exec.c
src/mesa/main/context.c
src/mesa/main/extensions.c
src/mesa/main/fbobject.c
src/mesa/main/getstring.c
src/mesa/main/mfeatures.h
src/mesa/main/shaderapi.c
src/mesa/main/shaderobj.c
src/mesa/main/shared.c
src/mesa/program/program.c

index e589701b32a5bc9fac5fa5437457102ed9056fe5..546273b989ed5768b380e586d63743ec525f057d 100644 (file)
 #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"
 
@@ -371,10 +369,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
@@ -833,12 +829,10 @@ _mesa_create_exec_table(struct gl_context *ctx)
    }
 #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);
index 3caaf5f4101b9693823d391066398d6cf67627e8..1ec6c8e877320ddecd4d86ac09dbeefbc8223885 100644 (file)
@@ -605,9 +605,7 @@ _mesa_init_constants(struct gl_context *ctx)
 #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;
 
@@ -625,13 +623,11 @@ _mesa_init_constants(struct gl_context *ctx)
    ctx->Const.MaxVertexTextureImageUnits = MAX_VERTEX_TEXTURE_IMAGE_UNITS;
    ctx->Const.MaxCombinedTextureImageUnits = MAX_COMBINED_TEXTURE_IMAGE_UNITS;
    ctx->Const.MaxVarying = MAX_VARYING;
-#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)) {
index 39f6630e4df2050d5793465b9e83c625546ab694..7d50167093c75c45522e4fadaeef63c0e657ef8b 100644 (file)
@@ -405,8 +405,8 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
 #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;
@@ -415,13 +415,9 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
    ctx->Extensions.ARB_occlusion_query = GL_TRUE;
    ctx->Extensions.ARB_occlusion_query2 = GL_TRUE;
    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;
@@ -583,12 +579,8 @@ _mesa_enable_2_0_extensions(struct gl_context *ctx)
    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;
    ctx->Extensions.ARB_vertex_shader = GL_TRUE;
 }
index abc9d83a6489e8fdcb03caaf773ebdeb2e4a3e78..be65e6bc6b7a1c52cf191a9c97d097c1142ead0c 100644 (file)
@@ -3065,7 +3065,6 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
 #endif /* FEATURE_EXT_framebuffer_blit */
 
 
-#if FEATURE_ARB_geometry_shader4
 void GLAPIENTRY
 _mesa_FramebufferTextureARB(GLenum target, GLenum attachment,
                             GLuint texture, GLint level)
@@ -3086,7 +3085,6 @@ _mesa_FramebufferTextureFaceARB(GLenum target, GLenum attachment,
                "glFramebufferTextureFaceARB "
                "not implemented!");
 }
-#endif /* FEATURE_ARB_geometry_shader4 */
 
 static void
 invalidate_framebuffer_storage(GLenum target, GLsizei numAttachments,
index e8a5930dd6c67d988422f3fbe5905a8c5955cdd7..24210c34bd80b2ff5592fcc9454948769eeaf3a2 100644 (file)
@@ -131,12 +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:
index d9ec213101e225acfe11d65b135c7cc94e6b9d94..e0a40a629fdeb6616184bba5f310b6a2d9851cd9 100644 (file)
@@ -86,9 +86,6 @@
 
 #define FEATURE_ARB_fragment_program      1
 #define FEATURE_ARB_vertex_program        1
-#define FEATURE_ARB_shader_objects        1
-#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
index 393f5efc2c14de985b3bc0952cbaaed31cdced07..4ce02e6bf556e0229d3c375244e64a39aa71fbf2 100644 (file)
@@ -171,10 +171,8 @@ validate_shader_target(const struct gl_context *ctx, GLenum type)
       return ctx->Extensions.ARB_fragment_shader;
    case GL_VERTEX_SHADER:
       return ctx->Extensions.ARB_vertex_shader;
-#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;
    }
@@ -478,12 +476,10 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *param
       || _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?
     */
@@ -555,7 +551,6 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *param
       *params = shProg->TransformFeedback.BufferMode;
       return;
 #endif
-#if FEATURE_ARB_geometry_shader4
    case GL_GEOMETRY_VERTICES_OUT_ARB:
       if (!has_gs)
          break;
@@ -571,7 +566,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;
@@ -863,7 +857,6 @@ use_shader_program(struct gl_context *ctx, GLenum type,
         shProg = NULL;
       }
       break;
-#if FEATURE_ARB_geometry_shader4
    case GL_GEOMETRY_SHADER_ARB:
       target = &ctx->Shader.CurrentGeometryProgram;
       if ((shProg == NULL)
@@ -871,7 +864,6 @@ use_shader_program(struct gl_context *ctx, GLenum type,
         shProg = NULL;
       }
       break;
-#endif
    case GL_FRAGMENT_SHADER:
       target = &ctx->Shader.CurrentFragmentProgram;
       if ((shProg == NULL)
@@ -894,11 +886,9 @@ use_shader_program(struct gl_context *ctx, GLenum type,
       case GL_VERTEX_SHADER:
         /* Empty for now. */
         break;
-#if FEATURE_ARB_geometry_shader4
       case GL_GEOMETRY_SHADER_ARB:
         /* Empty for now. */
         break;
-#endif
       case GL_FRAGMENT_SHADER:
         if (*target == ctx->Shader._CurrentFragmentProgram) {
            _mesa_reference_shader_program(ctx,
@@ -1521,8 +1511,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)
 {
@@ -1584,8 +1572,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)
@@ -1745,9 +1731,7 @@ _mesa_init_shader_dispatch(struct _glapi_table *exec)
    SET_GetActiveAttribARB(exec, _mesa_GetActiveAttribARB);
    SET_GetAttribLocationARB(exec, _mesa_GetAttribLocationARB);
 
-#if FEATURE_ARB_geometry_shader4
    SET_ProgramParameteriARB(exec, _mesa_ProgramParameteriARB);
-#endif
 
    SET_UseShaderProgramEXT(exec, _mesa_UseShaderProgramEXT);
    SET_ActiveProgramEXT(exec, _mesa_ActiveProgramEXT);
index c7f45c88e72e347f53c253284ece5ba42a6cfecd..1706cac55ffce9e046090f8c9f25ef534b2953dc 100644 (file)
@@ -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, "");
 }
index 58cbc525065636f082026b637af0825906117955..f8d66455a4e97124723bd046d5c528fac12d893a 100644 (file)
@@ -87,9 +87,7 @@ _mesa_alloc_shared_state(struct gl_context *ctx)
    shared->DefaultFragmentShader = _mesa_new_ati_fragment_shader(ctx, 0);
 #endif
 
-#if FEATURE_ARB_shader_objects
    shared->ShaderObjects = _mesa_NewHashTable();
-#endif
 
    shared->BufferObjects = _mesa_NewHashTable();
 
@@ -321,11 +319,9 @@ 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);
index 7d827b78b5b0b46e9af7ea0e6bddfbed60932a29..939f3f89aafc59e25359fcf4b8c96274ee6bf758 100644 (file)
@@ -106,13 +106,11 @@ _mesa_init_program(struct gl_context *ctx)
    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
@@ -138,10 +136,8 @@ _mesa_free_program_data(struct gl_context *ctx)
    _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) {
@@ -175,10 +171,8 @@ _mesa_update_default_objects_program(struct gl_context *ctx)
    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