summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/gallivm/lp_bld_format_soa.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-05-12 12:41:53 -0600
committerBrian Paul <brianp@vmware.com>2010-05-12 12:43:09 -0600
commit92b1908db89f23ee05f8d0da5307529440bc7560 (patch)
treebf9d10cfcf521fee0fd1b2e79807b02d2dce9ac4 /src/gallium/auxiliary/gallivm/lp_bld_format_soa.c
parentc722029f3a54c2e619b95e3b02005a7d844bca43 (diff)
gallivm: additional comments
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_format_soa.c')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_format_soa.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_format_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_format_soa.c
index 63a751ec3d..a2b0298a1c 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_format_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_format_soa.c
@@ -250,7 +250,15 @@ lp_build_unpack_rgba_soa(LLVMBuilderRef builder,
* Fetch a pixel into a SoA.
*
* \param type the desired return type for 'rgba'
- * \param i, j the sub-block pixel coordinates.
+ *
+ * \param base_ptr points to start of the texture image block. For non-
+ * compressed formats, this simply points to the texel.
+ * For compressed formats, it points to the start of the
+ * compressed data block.
+ *
+ * \param i, j the sub-block pixel coordinates. For non-compressed formats
+ * these will always be (0,0). For compressed formats, i will
+ * be in [0, block_width-1] and j will be in [0, block_height-1].
*/
void
lp_build_fetch_rgba_soa(LLVMBuilderRef builder,
@@ -315,6 +323,7 @@ lp_build_fetch_rgba_soa(LLVMBuilderRef builder,
rgba_out[chan] = lp_build_undef(type);
}
+ /* loop over number of pixels */
for(k = 0; k < type.length; ++k) {
LLVMValueRef index = LLVMConstInt(LLVMInt32Type(), k, 0);
LLVMValueRef offset_elem;
@@ -328,11 +337,13 @@ lp_build_fetch_rgba_soa(LLVMBuilderRef builder,
i_elem = LLVMBuildExtractElement(builder, i, index, "");
j_elem = LLVMBuildExtractElement(builder, j, index, "");
+ /* Get a single float[4]={R,G,B,A} pixel */
tmp = lp_build_fetch_rgba_aos(builder, format_desc, ptr,
i_elem, j_elem);
/*
- * AoS to SoA
+ * Insert the AoS tmp value channels into the SoA result vectors at
+ * position = 'index'.
*/
for (chan = 0; chan < 4; ++chan) {
LLVMValueRef chan_val = LLVMConstInt(LLVMInt32Type(), chan, 0),