This will be used to store all pointers in the cache as 64bit ints
allowing us to avoid issues when a 32bit program reads a cached
shader that was created by a 64bit application.
---
 src/compiler/glsl/shader_cache.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/compiler/glsl/shader_cache.h b/src/compiler/glsl/shader_cache.h
index ffcf4f8..ae055ac 100644
--- a/src/compiler/glsl/shader_cache.h
+++ b/src/compiler/glsl/shader_cache.h
@@ -27,6 +27,16 @@
 
 #include "cache.h"
 
+static uint64_t inline
+ptr_to_uint64_t(void *ptr)
+{
+   uint64_t ptr_int = (uint64_t) ptr;
+#if __i386__
+   ptr_int &= 0xFFFFFFFF;
+#endif
+   return ptr_int;
+}
+
 void
 shader_cache_write_program_metadata(struct gl_context *ctx,
                                     struct gl_shader_program *prog);
-- 
2.7.4

_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to