diff options
author | Ian Romanick <[email protected]> | 2006-10-11 22:37:14 +0000 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2006-10-11 22:37:14 +0000 |
commit | f3f51bc844c8749250724d164722402cb9a07dc7 (patch) | |
tree | 68ccc40931c2d10f7a521d531609aeeb5b1637f9 /src/mesa/glapi/glX_XML.py | |
parent | 8a5871a98c23ce1a1d893b681f59dc8c42228dd1 (diff) |
Fix bug #4681.
glDeleteTextures and glDeleteTexturesEXT were erroneously listed as
aliases of each other. For anything /except/ GLX protocol they are
aliases. This set of changes allows functions that are functionally
identical but have different GLX protocol to be listed as aliases.
When building with GLX_INDIRECT_RENDERING set, different static
functions are used. These functions determine whether the current
context is direct rendering or not. If the context is direct
rendering, the aliased function (e.g., glDeleteTextures in the case of
glDeleteTexturesEXT) is called. If the context is not direct
rendering, the correct GLX protocol is sent.
For a deeper explanation of what is changed, please see:
http://dri.freedesktop.org/wiki/PartiallyAliasedFunctions
Diffstat (limited to 'src/mesa/glapi/glX_XML.py')
-rw-r--r-- | src/mesa/glapi/glX_XML.py | 41 |
1 files changed, 34 insertions, 7 deletions
diff --git a/src/mesa/glapi/glX_XML.py b/src/mesa/glapi/glX_XML.py index e3d4c666cfc..3759e8da02e 100644 --- a/src/mesa/glapi/glX_XML.py +++ b/src/mesa/glapi/glX_XML.py @@ -81,6 +81,8 @@ class glx_function(gl_XML.gl_function): self.glx_sop = 0 self.glx_vendorpriv = 0 + self.glx_vendorpriv_names = [] + # If this is set to true, it means that GLdouble parameters should be # written to the GLX protocol packet in the order they appear in the # prototype. This is different from the "classic" ordering. In the @@ -116,7 +118,8 @@ class glx_function(gl_XML.gl_function): self.vectorequiv = element.nsProp( "vectorequiv", None ) - if element.nsProp( "name", None ) == self.name: + name = element.nsProp("name", None) + if name == self.name: for param in self.parameters: self.parameters_by_name[ param.name ] = param @@ -137,18 +140,13 @@ class glx_function(gl_XML.gl_function): if rop: self.glx_rop = int(rop) - else: - self.glx_rop = 0 if sop: self.glx_sop = int(sop) - else: - self.glx_sop = 0 if vop: self.glx_vendorpriv = int(vop) - else: - self.glx_vendorpriv = 0 + self.glx_vendorpriv_names.append(name) self.img_reset = child.nsProp( 'img_reset', None ) @@ -447,6 +445,13 @@ class glx_function(gl_XML.gl_function): raise RuntimeError('Function "%s" has no opcode.' % (self.name)) + def opcode_vendor_name(self, name): + if name in self.glx_vendorpriv_names: + return "X_GLvop_%s" % (name) + else: + raise RuntimeError('Function "%s" has no VendorPrivate opcode.' % (name)) + + def opcode_real_name(self): """Get the true protocol enum name for the GLX opcode @@ -505,6 +510,28 @@ class glx_function(gl_XML.gl_function): return None + def has_different_protocol(self, name): + """Returns true if the named version of the function uses different protocol from the other versions. + + Some functions, such as glDeleteTextures and + glDeleteTexturesEXT are functionally identical, but have + different protocol. This function returns true if the + named function is an alias name and that named version uses + different protocol from the function that is aliased. + """ + + return (name in self.glx_vendorpriv_names) and self.glx_sop + + + def static_glx_name(self, name): + if self.has_different_protocol(name): + for n in self.glx_vendorpriv_names: + if n in self.static_entry_points: + return n + + return self.static_name(name) + + def client_supported_for_indirect(self): """Returns true if the function is supported on the client side for indirect rendering.""" |