Mesa (master): llvmpipe: Convenience function to obtain the integer type with same bitdepth of an arbitrary type .

Jose Fonseca jrfonseca at kemper.freedesktop.org
Mon Sep 7 14:09:42 UTC 2009


Module: Mesa
Branch: master
Commit: 0c2ea2433833d5eda8a4fefe1412bf0ea40b14bf
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0c2ea2433833d5eda8a4fefe1412bf0ea40b14bf

Author: José Fonseca <jfonseca at vmware.com>
Date:   Mon Sep  7 14:42:57 2009 +0100

llvmpipe: Convenience function to obtain the integer type with same bitdepth of an arbitrary type.

---

 src/gallium/drivers/llvmpipe/lp_bld_type.c |   11 +++++++++++
 src/gallium/drivers/llvmpipe/lp_bld_type.h |    4 ++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_bld_type.c b/src/gallium/drivers/llvmpipe/lp_bld_type.c
index 8e0026f..577644b 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_type.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_type.c
@@ -157,6 +157,17 @@ lp_build_int_vec_type(union lp_type type)
 }
 
 
+union lp_type
+lp_int_type(union lp_type type)
+{
+   union lp_type int_type;
+   int_type.value = 0;
+   int_type.width = type.width;
+   int_type.length = type.length;
+   return int_type;
+}
+
+
 void
 lp_build_context_init(struct lp_build_context *bld,
                       LLVMBuilderRef builder,
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_type.h b/src/gallium/drivers/llvmpipe/lp_bld_type.h
index 3ce566b..9933e0b 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_type.h
+++ b/src/gallium/drivers/llvmpipe/lp_bld_type.h
@@ -165,6 +165,10 @@ LLVMTypeRef
 lp_build_int_vec_type(union lp_type type);
 
 
+union lp_type
+lp_int_type(union lp_type type);
+
+
 void
 lp_build_context_init(struct lp_build_context *bld,
                       LLVMBuilderRef builder,




More information about the mesa-commit mailing list