diff options
Diffstat (limited to 'src/mesa/pipe/tgsi/core')
-rw-r--r-- | src/mesa/pipe/tgsi/core/tgsi_dump.c | 4 | ||||
-rw-r--r-- | src/mesa/pipe/tgsi/core/tgsi_util.c | 15 |
2 files changed, 15 insertions, 4 deletions
diff --git a/src/mesa/pipe/tgsi/core/tgsi_dump.c b/src/mesa/pipe/tgsi/core/tgsi_dump.c index fecb246ab1..0345fd93f7 100644 --- a/src/mesa/pipe/tgsi/core/tgsi_dump.c +++ b/src/mesa/pipe/tgsi/core/tgsi_dump.c @@ -400,12 +400,16 @@ tgsi_dump( GLuint deflt = !(flags & TGSI_DUMP_NO_DEFAULT); { +#if 0 static GLuint counter = 0; char buffer[64]; sprintf( buffer, "sbir-dump-%.4u.txt", counter++ ); dump.file = fopen( buffer, "wt" ); +#else + dump.file = stderr; dump.tabs = 0; +#endif } tgsi_parse_init( &parse, tokens ); 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 |