summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-08-21 07:42:29 +0100
committerJosé Fonseca <jfonseca@vmware.com>2009-08-29 09:21:37 +0100
commitc0472f9c34da78bccecb2c790b54b9dd9712a0b9 (patch)
treebe554214b9b558b85bf42e163747317e1f9dd076 /src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c
parent3dbf00f9ab0d2e771c72a74d9db32c048ce7df4e (diff)
llvmpipe: Centralize mask update logic.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c b/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c
index 01328c1c48..e392a50005 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c
@@ -88,7 +88,7 @@ struct lp_build_tgsi_soa_context
LLVMValueRef immediates[LP_MAX_IMMEDIATES][NUM_CHANNELS];
LLVMValueRef temps[LP_MAX_TEMPS][NUM_CHANNELS];
- LLVMValueRef mask;
+ LLVMValueRef *mask;
/** Coords/texels store */
LLVMValueRef store_ptr;
@@ -395,10 +395,7 @@ emit_kil(
mask = lp_build_cmp(&bld->base, PIPE_FUNC_GEQUAL, terms[chan_index], bld->base.zero);
- if(bld->mask)
- bld->mask = LLVMBuildAnd(bld->base.builder, bld->mask, mask, "");
- else
- bld->mask = mask;
+ lp_build_mask_and(bld->base.builder, bld->mask, mask);
}
}
}
@@ -1409,19 +1406,12 @@ emit_declaration(
}
}
-/**
- * Translate a TGSI vertex/fragment shader to SSE2 code.
- * Slightly different things are done for vertex vs. fragment shaders.
- *
- * \param tokens the TGSI input shader
- * \param bld the output SSE code/function
- * \param immediates buffer to place immediates, later passed to SSE bld
- * \param return 1 for success, 0 if translation failed
- */
-LLVMValueRef
+
+void
lp_build_tgsi_soa(LLVMBuilderRef builder,
const struct tgsi_token *tokens,
union lp_type type,
+ LLVMValueRef *mask,
LLVMValueRef *pos,
LLVMValueRef a0_ptr,
LLVMValueRef dadx_ptr,
@@ -1438,6 +1428,7 @@ lp_build_tgsi_soa(LLVMBuilderRef builder,
/* Setup build context */
memset(&bld, 0, sizeof bld);
lp_build_context_init(&bld.base, builder, type);
+ bld.mask = mask;
bld.x = pos[0];
bld.y = pos[1];
bld.w = pos[3];
@@ -1490,7 +1481,5 @@ lp_build_tgsi_soa(LLVMBuilderRef builder,
}
tgsi_parse_free( &parse );
-
- return bld.mask;
}