#!/bin/bash ## ## Copyright (C) 2002-2008, Marcelo E. Magallon ## Copyright (C) 2002-2008, Milan Ikits ## ## This program is distributed under the terms and conditions of the GNU ## General Public License Version 2 as published by the Free Software ## Foundation or, at your option, any later version. ## ## Parameters: ## ## $1: Extensions directory set -e # fix GL_NV_texture_compression_vtc grep -v EXT $1/GL_NV_texture_compression_vtc > tmp mv tmp $1/GL_NV_texture_compression_vtc # remove duplicates from GL_ARB_vertex_program and GL_ARB_fragment_program grep -v -F -f $1/GL_ARB_vertex_program $1/GL_ARB_fragment_program > tmp mv tmp $1/GL_ARB_fragment_program # remove duplicates from GLX_EXT_visual_rating and GLX_EXT_visual_info grep -v -F -f $1/GLX_EXT_visual_info $1/GLX_EXT_visual_rating > tmp mv tmp $1/GLX_EXT_visual_rating # GL_EXT_draw_buffers2 and GL_EXT_transform_feedback both define glGetBooleanIndexedvEXT but with different parameter names grep -v glGetBooleanIndexedvEXT $1/GL_EXT_transform_feedback > tmp mv tmp $1/GL_EXT_transform_feedback # GL_EXT_draw_buffers2 and GL_EXT_transform_feedback both define glGetIntegerIndexedvEXT but with different parameter names grep -v glGetIntegerIndexedvEXT $1/GL_EXT_transform_feedback > tmp mv tmp $1/GL_EXT_transform_feedback # remove duplicates from GL_NV_video_capture and GLX_NV_video_capture grep -v glX $1/GL_NV_video_capture > tmp mv tmp $1/GL_NV_video_capture # add missing functions to GL_NV_video_capture cat >> $1/GL_NV_video_capture <> $1/WGL_NV_video_capture <> $1/GLX_NV_video_capture < tmp mv tmp $1/GL_NV_present_video # fix WGL_NV_present_video cat >> $1/WGL_NV_present_video <> $1/WGL_NV_video_output < tmp mv tmp $1/GL_NV_occlusion_query perl -e's/OCCLUSION_TEST_HP.*/OCCLUSION_TEST_HP 0x8165/' -pi \ $1/GL_HP_occlusion_test perl -e's/OCCLUSION_TEST_RESULT_HP.*/OCCLUSION_TEST_RESULT_HP 0x8166/' -pi \ $1/GL_HP_occlusion_test # fix GLvoid in GL_ARB_vertex_buffer_objects perl -e 's/ void\*/ GLvoid\*/g' -pi \ $1/GL_ARB_vertex_buffer_object # add deprecated constants to GL_ATI_fragment_shader cat >> $1/GL_ATI_fragment_shader <> $1/GL_NV_texture_shader <> $1/WGL_ATI_pixel_format_float <> $1/WGL_ARB_make_current_read <> $1/WGL_EXT_make_current_read <> $1/GL_ARB_vertex_buffer_object <> $1/GLX_EXT_import_context <> $1/GLX_OML_swap_method <> $1/GLX_SGIX_fbconfig <> $1/GLX_SGIX_pbuffer <> $1/GL_NV_half_float <> $1/WGL_ARB_pbuffer <> $1/WGL_EXT_pbuffer < tmp mv tmp $1/GL_ARB_fragment_shader grep -v -F -f $1/GL_ARB_shader_objects $1/GL_ARB_vertex_shader > tmp mv tmp $1/GL_ARB_vertex_shader # remove duplicates in GL_ARB_vertex_program and GL_ARB_vertex_shader grep -v -F -f $1/GL_ARB_vertex_program $1/GL_ARB_vertex_shader > tmp mv tmp $1/GL_ARB_vertex_shader # remove triplicates in GL_ARB_fragment_program, GL_ARB_fragment_shader, # and GL_ARB_vertex_shader grep -v -F -f $1/GL_ARB_fragment_program $1/GL_ARB_fragment_shader > tmp mv tmp $1/GL_ARB_fragment_shader grep -v -F -f $1/GL_ARB_fragment_program $1/GL_ARB_vertex_shader > tmp mv tmp $1/GL_ARB_vertex_shader # remove duplicates in GL_EXT_direct_state_access grep -v "glGetBooleanIndexedvEXT" $1/GL_EXT_direct_state_access > tmp mv tmp $1/GL_EXT_direct_state_access grep -v "glGetIntegerIndexedvEXT" $1/GL_EXT_direct_state_access > tmp mv tmp $1/GL_EXT_direct_state_access grep -v "glDisableIndexedEXT" $1/GL_EXT_direct_state_access > tmp mv tmp $1/GL_EXT_direct_state_access grep -v "glEnableIndexedEXT" $1/GL_EXT_direct_state_access > tmp mv tmp $1/GL_EXT_direct_state_access grep -v "glIsEnabledIndexedEXT" $1/GL_EXT_direct_state_access > tmp mv tmp $1/GL_EXT_direct_state_access # remove duplicates in GL_NV_explicit_multisample grep -v "glGetBooleanIndexedvEXT" $1/GL_NV_explicit_multisample > tmp mv tmp $1/GL_NV_explicit_multisample grep -v "glGetIntegerIndexedvEXT" $1/GL_NV_explicit_multisample > tmp mv tmp $1/GL_NV_explicit_multisample # fix bugs in GL_ARB_vertex_shader grep -v "GL_FLOAT" $1/GL_ARB_vertex_shader > tmp mv tmp $1/GL_ARB_vertex_shader perl -e 's/handle /GLhandleARB /g' -pi $1/GL_ARB_vertex_shader # fix bugs in GL_ARB_shader_objects grep -v "GL_FLOAT " $1/GL_ARB_shader_objects > tmp mv tmp $1/GL_ARB_shader_objects grep -v "GL_INT " $1/GL_ARB_shader_objects > tmp mv tmp $1/GL_ARB_shader_objects # add typedefs to GL_ARB_shader_objects cat >> $1/GL_ARB_shader_objects <> $1/GL_ARB_transpose_matrix <> $1/GL_EXT_framebuffer_multisample < tmp mv tmp $1/GL_NV_gpu_program_fp64 # Filter glGetUniformui64vNV from GL_NV_shader_buffer_load grep -v "glGetUniformui64vNV" $1/GL_NV_shader_buffer_load > tmp mv tmp $1/GL_NV_shader_buffer_load # Filter out profile enumerations from GLX_ARB_create_context grep -v "_PROFILE_" $1/GLX_ARB_create_context > tmp mv tmp $1/GLX_ARB_create_context # Filter only profile related enumerations for GLX_ARB_create_context_profile head -n3 $1/GLX_ARB_create_context_profile > tmp grep "_PROFILE_" $1/GLX_ARB_create_context_profile >> tmp mv tmp $1/GLX_ARB_create_context_profile # Filter out profile enumerations from WGL_ARB_create_context grep -v "_PROFILE_" $1/WGL_ARB_create_context > tmp mv tmp $1/WGL_ARB_create_context # Filter only profile related enumerations for WGL_ARB_create_context_profile head -n3 $1/WGL_ARB_create_context_profile > tmp grep "_PROFILE_" $1/WGL_ARB_create_context_profile >> tmp mv tmp $1/WGL_ARB_create_context_profile # add missing function to GLX_NV_copy_image cat >> $1/GLX_NV_copy_image <> $1/WGL_NV_copy_image < tmp # mv tmp $1/GL_ARB_separate_shader_objects # Filter out EXT functions from GL_ARB_viewport_array grep -v "EXT" $1/GL_ARB_viewport_array > tmp mv tmp $1/GL_ARB_viewport_array # Additional enumerations for GL_NV_vertex_buffer_unified_memory # These are mentioned in GL_ARB_draw_indirect.txt cat >> $1/GL_NV_vertex_buffer_unified_memory < tmp mv tmp $1/GL_ARB_debug_output # Filter glGetPointerv from GL_EXT_vertex_array # It's part of OpenGL 1.1, after all grep -v "glGetPointerv" $1/GL_EXT_vertex_array > tmp mv tmp $1/GL_EXT_vertex_array # add typedef to GL_AMD_debug_output # parse_spec.pl can't parse typedefs from New Types section, but ought to cat >> $1/GL_AMD_debug_output <> $1/GL_ARB_debug_output <> $1/GL_KHR_debug < tmp mv tmp $1/GL_KHR_debug # Remove GL_ARB_debug_group, GL_ARB_debug_label and GL_ARB_debug_output2, for now rm -f $1/GL_ARB_debug_group rm -f $1/GL_ARB_debug_label rm -f $1/GL_ARB_debug_output2 # add typedefs to GL_ARB_cl_event # parse_spec.pl can't parse typedefs from New Types section, but ought to cat >> $1/GL_ARB_cl_event < tmp mv tmp $1/GL_ARB_gpu_shader_fp64 # add missing functions to GL_EXT_direct_state_access (GL_ARB_gpu_shader_fp64 related) cat >> $1/GL_EXT_direct_state_access < tmp mv tmp $1/GL_AMD_performance_monitor grep -v 'GL_FLOAT ' $1/GL_AMD_performance_monitor > tmp mv tmp $1/GL_AMD_performance_monitor # Filter out GL_STORAGE_CACHED_APPLE and GL_STORAGE_SHARED_APPLE from GL_APPLE_texture_range grep -v 'GL_STORAGE_CACHED_APPLE ' $1/GL_APPLE_texture_range > tmp mv tmp $1/GL_APPLE_texture_range grep -v 'GL_STORAGE_SHARED_APPLE ' $1/GL_APPLE_texture_range > tmp mv tmp $1/GL_APPLE_texture_range # Filter out GL_RED from GL_ARB_texture_rg grep -v 'GL_RED ' $1/GL_ARB_texture_rg > tmp mv tmp $1/GL_ARB_texture_rg # Filter out _EXT enums from GL_ARB_texture_storage grep -v '_EXT ' $1/GL_ARB_texture_storage > tmp mv tmp $1/GL_ARB_texture_storage # Filter out TEXTURE_3D enums from GL_EXT_paletted_texture grep -v 'TEXTURE_3D' $1/GL_EXT_paletted_texture > tmp mv tmp $1/GL_EXT_paletted_texture # Filter out GL_VERSION_1_1 enums from GL_AMD_stencil_operation_extended grep -v '0x150' $1/GL_AMD_stencil_operation_extended > tmp mv tmp $1/GL_AMD_stencil_operation_extended # Filter out from GL_APPLE_ycbcr_422 grep -v 'GL_UNSIGNED_SHORT_8_8_APPLE' $1/GL_APPLE_ycbcr_422 > tmp mv tmp $1/GL_APPLE_ycbcr_422 grep -v 'GL_UNSIGNED_SHORT_8_8_REV_APPLE' $1/GL_APPLE_ycbcr_422 > tmp mv tmp $1/GL_APPLE_ycbcr_422 # Filter out GL_FRAGMENT_DEPTH_EXT from GL_EXT_light_texture grep -v 'GL_FRAGMENT_DEPTH_EXT' $1/GL_EXT_light_texture > tmp mv tmp $1/GL_EXT_light_texture # Filter out GL_MULTISAMPLE_BIT_EXT from GL_SGIS_multisample grep -v 'GL_MULTISAMPLE_BIT_EXT' $1/GL_SGIS_multisample > tmp mv tmp $1/GL_SGIS_multisample # Filter out GL_COMPRESSED_RGB_S3TC_DXT1_EXT from GL_EXT_texture_compression_dxt1 grep -v 'GL_COMPRESSED_RGB_S3TC_DXT1_EXT' $1/GL_EXT_texture_compression_dxt1 > tmp mv tmp $1/GL_EXT_texture_compression_dxt1 # Filter out GL_COMPRESSED_RGBA_S3TC_DXT1_EXT from GL_EXT_texture_compression_dxt1 grep -v 'GL_COMPRESSED_RGBA_S3TC_DXT1_EXT' $1/GL_EXT_texture_compression_dxt1 > tmp mv tmp $1/GL_EXT_texture_compression_dxt1 # Append GLfixed to GL_ARB_ES2_compatibility # Probably ought to be explicitly mentioned in the spec language cat >> $1/GL_ARB_ES2_compatibility <> $1/GL_REGAL_ES1_0_compatibility <> $1/GL_REGAL_log < GLLOGPROCREGAL perl -e 's/LOGPROCREGAL/GLLOGPROCREGAL/g' -pi $1/GL_REGAL_log # Filter out GL_BYTE from GL_OES_byte_coordinates grep -v 'GL_BYTE' $1/GL_OES_byte_coordinates > tmp mv tmp $1/GL_OES_byte_coordinates # Filter out fp64 (not widely supported) from GL_EXT_direct_state_access egrep -v 'glProgramUniform.*[1234]d[v]?EXT' $1/GL_EXT_direct_state_access > tmp mv tmp $1/GL_EXT_direct_state_access # Filter out all enums from GL_ANGLE_depth_texture grep -v '0x' $1/GL_ANGLE_depth_texture > tmp mv tmp $1/GL_ANGLE_depth_texture # Filter out GL_NONE enum from GL_ANGLE_depth_texture grep -v 'GL_NONE' $1/GL_ANGLE_texture_usage > tmp mv tmp $1/GL_ANGLE_texture_usage # Fixup REGAL and ANGLE urls for i in $1/GL_REGAL_*; do perl -e 's#http://www.opengl.org/registry/specs/gl/REGAL/.*#https://github.com/p3/regal/tree/master/doc/extensions#g' -pi $i; done for i in $1/GL_ANGLE_*; do perl -e 's#http://www.opengl.org/registry/specs/gl/ANGLE/.*#https://code.google.com/p/angleproject/source/browse/\#git%2Fextensions#g' -pi $i; done # Filter out GL_NV_blend_equation_advanced_coherent enums and functions head -n3 $1/GL_NV_blend_equation_advanced_coherent > tmp mv tmp $1/GL_NV_blend_equation_advanced_coherent # clean up rm -f $1/*.bak