diff options
author | Brian Paul <brianp@vmware.com> | 2010-05-12 12:41:53 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2010-05-12 12:43:09 -0600 |
commit | 92b1908db89f23ee05f8d0da5307529440bc7560 (patch) | |
tree | bf9d10cfcf521fee0fd1b2e79807b02d2dce9ac4 /src/gallium/auxiliary/gallivm/lp_bld_format_soa.c | |
parent | c722029f3a54c2e619b95e3b02005a7d844bca43 (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.c | 15 |
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), |