llvmpipe: Better structure dereference naming.
authorJosé Fonseca <jfonseca@vmware.com>
Tue, 25 Aug 2009 05:40:22 +0000 (06:40 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Sat, 29 Aug 2009 08:21:42 +0000 (09:21 +0100)
src/gallium/drivers/llvmpipe/lp_bld_struct.c
src/gallium/drivers/llvmpipe/lp_jit.h

index 4877c4d3f72b19eccc394caf688fa53ca69d74ca..14d2b10df9c7a7e9e005f4bf3677d8bb71c0df77 100644 (file)
@@ -37,6 +37,7 @@
 #include "util/u_debug.h"
 #include "util/u_memory.h"
 
+#include "lp_bld_debug.h"
 #include "lp_bld_struct.h"
 
 
@@ -47,8 +48,12 @@ lp_build_struct_get(LLVMBuilderRef builder,
                     const char *name)
 {
    LLVMValueRef indices[2];
+   LLVMValueRef member_ptr;
+   LLVMValueRef res;
    indices[0] = LLVMConstInt(LLVMInt32Type(), 0, 0);
    indices[1] = LLVMConstInt(LLVMInt32Type(), member, 0);
-   ptr = LLVMBuildGEP(builder, ptr, indices, Elements(indices), "");
-   return LLVMBuildLoad(builder, ptr, name);
+   member_ptr = LLVMBuildGEP(builder, ptr, indices, Elements(indices), "");
+   res = LLVMBuildLoad(builder, member_ptr, "");
+   lp_build_name(res, "%s.%s", LLVMGetValueName(ptr), name);
+   return res;
 }
index e7e887fb64f76bc63c6415f071daa88b6ae0296c..33010ad5fb8d93ab3886095236f8796d06a89201 100644 (file)
@@ -69,16 +69,16 @@ struct lp_jit_context
 
 
 #define lp_jit_context_constants(_builder, _ptr) \
-   lp_build_struct_get(_builder, _ptr, 0, "context.constants")
+   lp_build_struct_get(_builder, _ptr, 0, "constants")
 
 #define lp_jit_context_samplers(_builder, _ptr) \
-   lp_build_struct_get(_builder, _ptr, 1, "context.samplers")
+   lp_build_struct_get(_builder, _ptr, 1, "samplers")
 
 #define lp_jit_context_alpha_ref_value(_builder, _ptr) \
-   lp_build_struct_get(_builder, _ptr, 2, "context.alpha")
+   lp_build_struct_get(_builder, _ptr, 2, "alpha_ref_value")
 
 #define lp_jit_context_blend_color(_builder, _ptr) \
-   lp_build_struct_get(_builder, _ptr, 3, "context.blend")
+   lp_build_struct_get(_builder, _ptr, 3, "blend_color")
 
 
 typedef void