Mesa (lp-setup-llvm): llvmpipe: minor changes in llvm coefficient calcs

Keith Whitwell keithw at kemper.freedesktop.org
Mon Sep 27 19:47:52 UTC 2010


Module: Mesa
Branch: lp-setup-llvm
Commit: 75d22e71a812bbe78414d3f9519f4c7a7157c748
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=75d22e71a812bbe78414d3f9519f4c7a7157c748

Author: Hui Qi Tay <tayhuiqithq at gmail.com>
Date:   Sun Sep 26 16:01:59 2010 +0800

llvmpipe: minor changes in llvm coefficient calcs

---

 src/gallium/drivers/llvmpipe/lp_setup_debug.c |    1 +
 src/gallium/drivers/llvmpipe/lp_state_setup.c |    5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_setup_debug.c b/src/gallium/drivers/llvmpipe/lp_setup_debug.c
new file mode 100644
index 0000000..a71a471
--- /dev/null
+++ b/src/gallium/drivers/llvmpipe/lp_setup_debug.c
@@ -0,0 +1 @@
+/* Some debugging stuff */
diff --git a/src/gallium/drivers/llvmpipe/lp_state_setup.c b/src/gallium/drivers/llvmpipe/lp_state_setup.c
index aa9147a..3261c53 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_setup.c
@@ -173,8 +173,9 @@ emit_facing_coef( LLVMBuilderRef builder,
 		  unsigned slot )
 {
    LLVMValueRef a0_0 = args->facing;
+   LLVMValueRef a0_0f = LLVMBuildSIToFP(builder, a0_0, LLVMFloatType(), "");
    LLVMValueRef zero = LLVMConstReal(LLVMFloatType(), 0.0);
-   LLVMValueRef a0      = vec4f(builder, a0_0, zero, zero, zero, "facing");
+   LLVMValueRef a0      = vec4f(builder, a0_0f, zero, zero, zero, "facing");
    LLVMValueRef zerovec = vec4f_from_scalar(builder, zero, "zero");
 
    store_coef(builder, args, slot, a0, zerovec, zerovec);
@@ -520,7 +521,7 @@ generate_setup_variant(struct llvmpipe_screen *screen,
    arg_types[4] = LLVMPointerType(vec4f_type, 0);	/* a0, aligned */
    arg_types[5] = LLVMPointerType(vec4f_type, 0);	/* dadx, aligned */
    arg_types[6] = LLVMPointerType(vec4f_type, 0);	/* dady, aligned */
-   arg_types[7] = LLVMPointerType(LLVMVoidType(), 0);      /* key, unused */
+   arg_types[7] = LLVMPointerType(vec4f_type, 0);       /* key, unused */
 
    func_type = LLVMFunctionType(LLVMVoidType(), arg_types, Elements(arg_types), 0);
 




More information about the mesa-commit mailing list