anv: anv-entrypoints_gen.py: rename hash to cal_hash.
authorDylan Baker <dylan@pnwbakers.com>
Tue, 21 Feb 2017 18:58:32 +0000 (10:58 -0800)
committerDylan Baker <dylan@pnwbakers.com>
Wed, 22 Mar 2017 23:22:00 +0000 (16:22 -0700)
hash is reserved name in python, it's the interface to access an
object's hash protocol.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
src/intel/vulkan/anv_entrypoints_gen.py

index 895ec949986a84c081caf6964e20868d5d3a388e..a63badb4770f7d771606c05b9c93a38c738aa8f4 100644 (file)
@@ -256,7 +256,8 @@ PRIME_FACTOR = 5024183
 PRIME_STEP = 19
 
 
-def hash(name):
+def cal_hash(name):
+    """Calculate the same hash value that Mesa will calculate in C."""
     h = 0
     for c in name:
         h = (h * PRIME_FACTOR + ord(c)) & U32_MASK
@@ -300,7 +301,7 @@ def get_entrypoints(doc, entrypoints_to_defines):
             guard = entrypoints_to_defines[fullname]
         else:
             guard = None
-        entrypoints.append((type, shortname, params, index, hash(fullname), guard))
+        entrypoints.append((type, shortname, params, index, cal_hash(fullname), guard))
         index += 1
 
     return entrypoints
@@ -370,7 +371,7 @@ def main():
                         'const VkAllocationCallbacks* pAllocator,' +
                         'VkDeviceMemory* pMem,' +
                         'VkImage* pImage', len(entrypoints),
-                        hash('vkCreateDmaBufImageINTEL'), None))
+                        cal_hash('vkCreateDmaBufImageINTEL'), None))
 
     # For outputting entrypoints.h we generate a anv_EntryPoint() prototype
     # per entry point.