summaryrefslogtreecommitdiff
path: root/libs/rs/rsComponent.cpp
diff options
context:
space:
mode:
author Alex Sakhartchouk <alexst@google.com> 2011-11-15 15:15:21 -0800
committer Alex Sakhartchouk <alexst@google.com> 2011-11-15 15:15:21 -0800
commite60149d2277da53c4a681b7f3971cf13cd4b012b (patch)
tree1bb4f453808bf3ebd87d6f724c7b1b73d5d54934 /libs/rs/rsComponent.cpp
parent7b95eba9f47a3992128d59a9ec593b887e4dac0e (diff)
Expand RS vector3 types to vector4.
BUG=5609007 The underlying LLVM implementation for vector3 types does this implicitly. If RS does not adjust its implementation, we will always be misaligned for any subsequent data after a vector3 type. We previously inserted padding into the reflected layers from llvm-rs-cc (hence the skip padding part of this change). We can safely ignore the padding now that the Java/native code is updated to use the expanded size. The compiler will also need modification to ensure that we don't mistakenly skip over any end-of-struct padding. Fixing the 3 component vector padding problem. Change-Id: If68af42287deb8f4b28addcd19a9fa314656be44
Diffstat (limited to 'libs/rs/rsComponent.cpp')
-rw-r--r--libs/rs/rsComponent.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/rs/rsComponent.cpp b/libs/rs/rsComponent.cpp
index 7d9cf0ba954c..21b98f6193a2 100644
--- a/libs/rs/rsComponent.cpp
+++ b/libs/rs/rsComponent.cpp
@@ -169,7 +169,8 @@ void Component::set(RsDataType dt, RsDataKind dk, bool norm, uint32_t vecSize) {
break;
}
- mBits = mTypeBits * mVectorSize;
+ mBitsUnpadded = mTypeBits * mVectorSize;
+ mBits = mTypeBits * rsHigherPow2(mVectorSize);
}
bool Component::isReference() const {