diff options
author | Jason Sams <jsams@google.com> | 2015-03-09 20:19:49 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-03-09 20:19:49 +0000 |
commit | 906e23b27b260c197e3de6daa35d83afa1f72c1a (patch) | |
tree | b4091938aa120abce2472b25f5b1e0e68f39263b | |
parent | a7b680108baf1dce05aaac155f747ccc79571cf3 (diff) | |
parent | 9a1f726cb7fbdb8ac26e3f43bea88082e8c0c4cb (diff) | |
download | rs-906e23b27b260c197e3de6daa35d83afa1f72c1a.tar.gz |
am 9a1f726c: Merge "Fix AllocationAdapter offseting"
* commit '9a1f726cb7fbdb8ac26e3f43bea88082e8c0c4cb':
Fix AllocationAdapter offseting
-rw-r--r-- | rsAllocation.cpp | 19 | ||||
-rw-r--r-- | rsAllocation.h | 2 |
2 files changed, 21 insertions, 0 deletions
diff --git a/rsAllocation.cpp b/rsAllocation.cpp index 5741bad5..ca65a406 100644 --- a/rsAllocation.cpp +++ b/rsAllocation.cpp @@ -136,6 +136,23 @@ Allocation * Allocation::createAdapter(Context *rsc, const Allocation *alloc, co return a; } +void Allocation::adapterOffset(Context *rsc, const uint32_t *offsets, size_t len) { + if (len >= sizeof(uint32_t) * 9) { + mHal.state.originX = offsets[0]; + mHal.state.originY = offsets[1]; + mHal.state.originZ = offsets[2]; + mHal.state.originLOD = offsets[3]; + mHal.state.originFace = offsets[4]; + mHal.state.originArray[0] = offsets[5]; + mHal.state.originArray[1] = offsets[6]; + mHal.state.originArray[2] = offsets[7]; + mHal.state.originArray[3] = offsets[8]; + } + + rsc->mHal.funcs.allocation.adapterOffset(rsc, this); +} + + void Allocation::updateCache() { const Type *type = mHal.state.type; @@ -891,6 +908,8 @@ RsAllocation rsi_AllocationAdapterCreate(Context *rsc, RsType vwindow, RsAllocat } void rsi_AllocationAdapterOffset(Context *rsc, RsAllocation va, const uint32_t *offsets, size_t len) { + Allocation *a = static_cast<Allocation *>(va); + a->adapterOffset(rsc, offsets, len); } diff --git a/rsAllocation.h b/rsAllocation.h index 30e28390..6ffe05d9 100644 --- a/rsAllocation.h +++ b/rsAllocation.h @@ -180,6 +180,8 @@ public: void ioSend(const Context *rsc); void ioReceive(const Context *rsc); + void adapterOffset(Context *rsc, const uint32_t *offsets, size_t len); + void * getPointer(const Context *rsc, uint32_t lod, RsAllocationCubemapFace face, uint32_t z, uint32_t array, size_t *stride); |