Update libbcc for cpu separation.
Change-Id: I14cdf14cc8a8df42efe960a4aafd9e2b282f509d
diff --git a/lib/Renderscript/runtime/rs_allocation.c b/lib/Renderscript/runtime/rs_allocation.c
index d914c3f..f165f01 100644
--- a/lib/Renderscript/runtime/rs_allocation.c
+++ b/lib/Renderscript/runtime/rs_allocation.c
@@ -36,7 +36,7 @@
extern const void * __attribute__((overloadable))
rsGetElementAt(rs_allocation a, uint32_t x) {
Allocation_t *alloc = (Allocation_t *)a.p;
- const uint8_t *p = (const uint8_t *)alloc->mHal.drvState.mallocPtr;
+ const uint8_t *p = (const uint8_t *)alloc->mHal.drvState.lod[0].mallocPtr;
const uint32_t eSize = alloc->mHal.state.elementSizeBytes;
return &p[eSize * x];
}
@@ -44,18 +44,18 @@
extern const void * __attribute__((overloadable))
rsGetElementAt(rs_allocation a, uint32_t x, uint32_t y) {
Allocation_t *alloc = (Allocation_t *)a.p;
- const uint8_t *p = (const uint8_t *)alloc->mHal.drvState.mallocPtr;
+ const uint8_t *p = (const uint8_t *)alloc->mHal.drvState.lod[0].mallocPtr;
const uint32_t eSize = alloc->mHal.state.elementSizeBytes;
- const uint32_t stride = alloc->mHal.drvState.stride;
+ const uint32_t stride = alloc->mHal.drvState.lod[0].stride;
return &p[(eSize * x) + (y * stride)];
}
extern const void * __attribute__((overloadable))
rsGetElementAt(rs_allocation a, uint32_t x, uint32_t y, uint32_t z) {
Allocation_t *alloc = (Allocation_t *)a.p;
- const uint8_t *p = (const uint8_t *)alloc->mHal.drvState.mallocPtr;
+ const uint8_t *p = (const uint8_t *)alloc->mHal.drvState.lod[0].mallocPtr;
const uint32_t eSize = alloc->mHal.state.elementSizeBytes;
- const uint32_t stride = alloc->mHal.drvState.stride;
+ const uint32_t stride = alloc->mHal.drvState.lod[0].stride;
const uint32_t dimY = alloc->mHal.state.dimensionY;
return &p[(eSize * x) + (y * stride) + (z * stride * dimY)];
}
@@ -83,7 +83,7 @@
extern void __attribute__((overloadable))
rsSetElementAt(rs_allocation a, void* ptr, uint32_t x) {
Allocation_t *alloc = (Allocation_t *)a.p;
- const uint8_t *p = (const uint8_t *)alloc->mHal.drvState.mallocPtr;
+ const uint8_t *p = (const uint8_t *)alloc->mHal.drvState.lod[0].mallocPtr;
const uint32_t eSize = alloc->mHal.state.elementSizeBytes;
memcpy((void*)&p[eSize * x], ptr, eSize);
}
@@ -91,9 +91,9 @@
extern void __attribute__((overloadable))
rsSetElementAt(rs_allocation a, void* ptr, uint32_t x, uint32_t y) {
Allocation_t *alloc = (Allocation_t *)a.p;
- const uint8_t *p = (const uint8_t *)alloc->mHal.drvState.mallocPtr;
+ const uint8_t *p = (const uint8_t *)alloc->mHal.drvState.lod[0].mallocPtr;
const uint32_t eSize = alloc->mHal.state.elementSizeBytes;
- const uint32_t stride = alloc->mHal.drvState.stride;
+ const uint32_t stride = alloc->mHal.drvState.lod[0].stride;
memcpy((void*)&p[(eSize * x) + (y * stride)], ptr, eSize);
}
diff --git a/lib/Renderscript/runtime/rs_sample.c b/lib/Renderscript/runtime/rs_sample.c
index b41e7f1..6c34368 100644
--- a/lib/Renderscript/runtime/rs_sample.c
+++ b/lib/Renderscript/runtime/rs_sample.c
@@ -9,7 +9,7 @@
getElementAt(rs_allocation a, uint32_t x, uint32_t lod) {
Allocation_t *alloc = (Allocation_t *)a.p;
const Type_t *type = (const Type_t*)alloc->mHal.state.type;
- const uint8_t *p = (const uint8_t *)alloc->mHal.drvState.mallocPtr;
+ const uint8_t *p = (const uint8_t *)alloc->mHal.drvState.lod[0].mallocPtr;
const uint32_t offset = type->mHal.state.lodOffset[lod];
const uint32_t eSize = alloc->mHal.state.elementSizeBytes;
@@ -21,13 +21,13 @@
getElementAt(rs_allocation a, uint32_t x, uint32_t y, uint32_t lod) {
Allocation_t *alloc = (Allocation_t *)a.p;
const Type_t *type = (const Type_t*)alloc->mHal.state.type;
- const uint8_t *p = (const uint8_t *)alloc->mHal.drvState.mallocPtr;
+ const uint8_t *p = (const uint8_t *)alloc->mHal.drvState.lod[0].mallocPtr;
const uint32_t eSize = alloc->mHal.state.elementSizeBytes;
const uint32_t offset = type->mHal.state.lodOffset[lod];
uint32_t stride;
if(lod == 0) {
- stride = alloc->mHal.drvState.stride;
+ stride = alloc->mHal.drvState.lod[0].stride;
} else {
stride = type->mHal.state.lodDimX[lod] * eSize;
}
diff --git a/lib/Renderscript/runtime/rs_structs.h b/lib/Renderscript/runtime/rs_structs.h
index 710dd31..3d90463 100644
--- a/lib/Renderscript/runtime/rs_structs.h
+++ b/lib/Renderscript/runtime/rs_structs.h
@@ -47,8 +47,16 @@
} state;
struct DrvState {
- void * mallocPtr;
- uint32_t stride;
+ struct LodState {
+ void * mallocPtr;
+ size_t stride;
+ uint32_t dimX;
+ uint32_t dimY;
+ uint32_t dimZ;
+ } lod[16/*android::renderscript::Allocation::MAX_LOD*/];
+ size_t faceOffset;
+ uint32_t lodCount;
+ uint32_t faceCount;
} drvState;
} mHal;
} Allocation_t;