Revision: 250 http://trac.macosforge.org/projects/xquartz/changeset/250 Author: gstaplin@apple.com Date: 2009-02-23 20:33:09 -0800 (Mon, 23 Feb 2009) Log Message: ----------- Add support for detecting the OpenGL framework support for features with nm -j -g. gen_funcs.tcl now lists the missing functions on both sides. There is one non-extension function (glSamplePass) that seems to have been removed from the OpenGL 3.0 spec (in PDF form). The gl.spec also doesn't list it. Modified Paths: -------------- AppleSGLX/trunk/GL_aliases AppleSGLX/trunk/GL_extensions AppleSGLX/trunk/gen_funcs.tcl Modified: AppleSGLX/trunk/GL_aliases =================================================================== --- AppleSGLX/trunk/GL_aliases 2009-02-24 02:07:37 UTC (rev 249) +++ AppleSGLX/trunk/GL_aliases 2009-02-24 04:33:09 UTC (rev 250) @@ -5,4 +5,3 @@ alias PrioritizeTexturesEXT PrioritizeTextures alias AreTexturesResidentEXT AreTexturesResident alias IsTextureEXT IsTexture - Modified: AppleSGLX/trunk/GL_extensions =================================================================== --- AppleSGLX/trunk/GL_extensions 2009-02-24 02:07:37 UTC (rev 249) +++ AppleSGLX/trunk/GL_extensions 2009-02-24 04:33:09 UTC (rev 250) @@ -92,3 +92,15 @@ #The OpenGL framework has moved this to the core OpenGL, and eliminated EXT_convolution listing. #extension EXT_convolution + +#Leopard supports these according to nm. +#Applications should use the GL_EXTENSIONS list to determine capabilities. +extension EXT_paletted_texture +extension APPLE_fence +extension NV_vertex_program4 +extension EXT_draw_buffers2 +extension EXT_gpu_shader4 +extension ATI_pn_triangles +extension NV_register_combiners +extension EXT_depth_bounds_test + Modified: AppleSGLX/trunk/gen_funcs.tcl =================================================================== --- AppleSGLX/trunk/gen_funcs.tcl 2009-02-24 02:07:37 UTC (rev 249) +++ AppleSGLX/trunk/gen_funcs.tcl 2009-02-24 04:33:09 UTC (rev 250) @@ -71,6 +71,7 @@ return [info exists extensions($name)] } +#This is going to need to be updated for OpenGL >= 2.1 in SnowLeopard. array set typemap { void void List GLuint @@ -224,7 +225,7 @@ VertexAttribPointerTypeARB GLenum ClampColorTargetARB unknown3.0 ClampColorModeARB unknown3.0 - VertexAttribEnum unknown3.0 + VertexAttribEnum GLenum DrawBufferName unknown3.0 WeightPointerTypeARB GLenum ProgramTargetARB GLenum @@ -520,7 +521,60 @@ set newapi($from) $d } + #Iterate the nm output and set each symbol in an associative array. + array set validapi {} + foreach line [split [exec nm -j -g /System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib] \n] { + set fn [string trim $line] + + #Only match the _gl functions. + if {[string match _gl* $fn]} { + set finalfn [string range $fn 3 end] + puts FINALFN:$finalfn + set validapi($finalfn) $finalfn + } + } + + puts "Correcting the API functions to match the OpenGL framework." + #parray validapi + + #Iterate the newapi and unset any members that the + #libGL.dylib doesn't support, assuming they aren't no-ops. + foreach fn [array names newapi] { + if {![info exists validapi($fn)]} { + puts "WARNING: libGL.dylib lacks support for: $fn" + + if {[dict exists $newapi($fn) noop] + && [dict get $newapi($fn) noop]} { + #This is no-op, so we should skip it. + continue + } + + #Is the function an alias for another in libGL? + if {[dict exists $newapi($fn) alias_for]} { + set alias [dict get $newapi($fn) alias_for] + + if {![info exists validapi($alias)]} { + puts "WARNING: alias function doesn't exist for $fn." + puts "The alias is $alias." + puts "unsetting $fn" + unset newapi($fn) + } + } else { + puts "unsetting $fn" + unset newapi($fn) + } + } + } + + + #Now print a warning about any symbols that libGL supports that we don't. + foreach fn [array names validapi] { + if {![info exists newapi($fn)]} { + puts "AppleSGLX is missing $fn" + } + } + puts "NOW GENERATING:[lindex $::argv 1]" set fd [open [lindex $::argv 1] w]