diff options
author | José Fonseca <jfonseca@vmware.com> | 2010-07-02 11:40:22 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2010-07-02 11:50:01 +0100 |
commit | 3cc4301c146e2a6e680939456ea3df4ec2d12e3e (patch) | |
tree | 8017d2aab10858445bd0bccbce83393b516eebd6 /src/gallium/auxiliary/gallivm/lp_bld_format_aos.c | |
parent | 37f4c2f906c8e2a6df609a190e4ca9ff028b265b (diff) | |
download | external_mesa3d-3cc4301c146e2a6e680939456ea3df4ec2d12e3e.zip external_mesa3d-3cc4301c146e2a6e680939456ea3df4ec2d12e3e.tar.gz external_mesa3d-3cc4301c146e2a6e680939456ea3df4ec2d12e3e.tar.bz2 |
gallivm: Code generate YUV format unpacking.
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_format_aos.c')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_format_aos.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_format_aos.c b/src/gallium/auxiliary/gallivm/lp_bld_format_aos.c index bec2a80..cc72a31 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_format_aos.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_format_aos.c @@ -366,6 +366,8 @@ lp_build_pack_rgba_aos(LLVMBuilderRef builder, } + + /** * Fetch a pixel into a 4 float AoS. * @@ -429,6 +431,26 @@ lp_build_fetch_rgba_aos(LLVMBuilderRef builder, return lp_build_unpack_rgba_aos(format_desc, &bld, packed); } } + else if (format_desc->layout == UTIL_FORMAT_LAYOUT_SUBSAMPLED) { + LLVMValueRef packed; + LLVMValueRef rgba; + + ptr = LLVMBuildBitCast(builder, ptr, + LLVMPointerType(LLVMInt32Type(), 0), + "packed_ptr"); + + packed = LLVMBuildLoad(builder, ptr, "packed"); + + rgba = lp_build_unpack_subsampled_to_rgba_aos(builder, format_desc, + 1, packed, i, j); + + lp_build_conv(builder, + lp_unorm8_vec4_type(), + type, + &rgba, 1, &rgba, 1); + + return rgba; + } else if (format_desc->fetch_rgba_float) { /* * Fallback to calling util_format_description::fetch_rgba_float. |