diff options
Diffstat (limited to 'src/mesa/pipe/tgsi/core/tgsi_util.c')
-rw-r--r-- | src/mesa/pipe/tgsi/core/tgsi_util.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/mesa/pipe/tgsi/core/tgsi_util.c b/src/mesa/pipe/tgsi/core/tgsi_util.c index 2331affdfd..38d6d6e6bc 100644 --- a/src/mesa/pipe/tgsi/core/tgsi_util.c +++ b/src/mesa/pipe/tgsi/core/tgsi_util.c @@ -1,15 +1,22 @@ #include "tgsi_platform.h" #include "tgsi_core.h" +union pointer_hack +{ + void *pointer; + unsigned long long uint64; +}; + void * tgsi_align_128bit( void *unaligned ) { - GLuint *ptr, addr; + union pointer_hack ph; - ptr = (GLuint *) unaligned; - addr = (*(GLuint *) &ptr + 15) & ~15; - return *(void **) &addr; + ph.uint64 = 0; + ph.pointer = unaligned; + ph.uint64 = (ph.uint64 + 15) & ~15; + return ph.pointer; } GLuint |