summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2011-10-23 10:02:53 -0600
committerBrian Paul <brianp@vmware.com>2011-10-23 10:09:33 -0600
commit903a14ed9146f3a38895ca7e39f69f2ad77bf5df (patch)
treecb26742e805ffd0cf74fb05c1061ac82d374f92d /src
parent08b2cc018ddcfce4b4f4204b89ff5c1d62bfe85d (diff)
downloadexternal_mesa3d-903a14ed9146f3a38895ca7e39f69f2ad77bf5df.zip
external_mesa3d-903a14ed9146f3a38895ca7e39f69f2ad77bf5df.tar.gz
external_mesa3d-903a14ed9146f3a38895ca7e39f69f2ad77bf5df.tar.bz2
gallivm: added lp_build_print_ivec4() function
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_printf.c21
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_printf.h3
2 files changed, 24 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_printf.c b/src/gallium/auxiliary/gallivm/lp_bld_printf.c
index 60cc609..56ff426 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_printf.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_printf.c
@@ -149,3 +149,24 @@ lp_build_print_vec4(struct gallivm_state *gallivm,
util_snprintf(format, sizeof(format), "%s %%f %%f %%f %%f\n", msg);
return lp_build_printf(gallivm, format, x, y, z, w);
}
+
+
+/**
+ * Print a intt[4] vector.
+ */
+LLVMValueRef
+lp_build_print_ivec4(struct gallivm_state *gallivm,
+ const char *msg, LLVMValueRef vec)
+{
+ LLVMBuilderRef builder = gallivm->builder;
+ char format[1000];
+ LLVMValueRef x, y, z, w;
+
+ x = LLVMBuildExtractElement(builder, vec, lp_build_const_int32(gallivm, 0), "");
+ y = LLVMBuildExtractElement(builder, vec, lp_build_const_int32(gallivm, 1), "");
+ z = LLVMBuildExtractElement(builder, vec, lp_build_const_int32(gallivm, 2), "");
+ w = LLVMBuildExtractElement(builder, vec, lp_build_const_int32(gallivm, 3), "");
+
+ util_snprintf(format, sizeof(format), "%s %%i %%i %%i %%i\n", msg);
+ return lp_build_printf(gallivm, format, x, y, z, w);
+}
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_printf.h b/src/gallium/auxiliary/gallivm/lp_bld_printf.h
index f6bb834..79db74d 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_printf.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_printf.h
@@ -45,6 +45,9 @@ LLVMValueRef
lp_build_print_vec4(struct gallivm_state *gallivm,
const char *msg, LLVMValueRef vec);
+LLVMValueRef
+lp_build_print_ivec4(struct gallivm_state *gallivm,
+ const char *msg, LLVMValueRef vec);
#endif