summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2014-06-24 18:35:40 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-06-23 21:50:22 +0000
commitba61895349d3c54e71d8851fd8fd1609ea91c716 (patch)
treeb81838b0b2054470c84524abed43bd85637b2938
parentc559d902ae9e815f97b90f14a4aeb52e48ee2d83 (diff)
parent99bfdec2b1676239ae66d308dd6624983aae2d56 (diff)
downloadrs-ba61895349d3c54e71d8851fd8fd1609ea91c716.tar.gz
Merge "Only 1D Allocations can be bound in API 20+, so fix the test."
-rw-r--r--java/tests/RsTest/src/com/android/rs/test/UT_alloc.java2
-rw-r--r--java/tests/RsTest/src/com/android/rs/test/alloc.rs31
2 files changed, 7 insertions, 26 deletions
diff --git a/java/tests/RsTest/src/com/android/rs/test/UT_alloc.java b/java/tests/RsTest/src/com/android/rs/test/UT_alloc.java
index 3ea942cc..e810787e 100644
--- a/java/tests/RsTest/src/com/android/rs/test/UT_alloc.java
+++ b/java/tests/RsTest/src/com/android/rs/test/UT_alloc.java
@@ -36,7 +36,7 @@ public class UT_alloc extends UnitTest {
s.set_dimX(X);
s.set_dimY(Y);
s.set_dimZ(Z);
- typeBuilder.setX(X).setY(Y);
+ typeBuilder.setX(X); // Only build a 1-D version of this
Allocation A = Allocation.createTyped(RS, typeBuilder.create());
s.bind_a(A);
s.set_aRaw(A);
diff --git a/java/tests/RsTest/src/com/android/rs/test/alloc.rs b/java/tests/RsTest/src/com/android/rs/test/alloc.rs
index 1b5e2ac5..5c333a95 100644
--- a/java/tests/RsTest/src/com/android/rs/test/alloc.rs
+++ b/java/tests/RsTest/src/com/android/rs/test/alloc.rs
@@ -10,27 +10,18 @@ rs_allocation aFaces;
rs_allocation aLOD;
rs_allocation aFacesLOD;
-void root(int *o, uint32_t x, uint32_t y) {
- *o = x + y * dimX;
+void root(int *o, uint32_t x) {
+ *o = x;
}
static bool test_alloc_dims() {
bool failed = false;
- int i, j;
+ int i;
_RS_ASSERT(rsAllocationGetDimX(aRaw) == dimX);
- _RS_ASSERT(rsAllocationGetDimY(aRaw) == dimY);
- _RS_ASSERT(rsAllocationGetDimZ(aRaw) == dimZ);
-
- // Test 2D addressing
- for (j = 0; j < dimY; j++) {
- for (i = 0; i < dimX; i++) {
- rsDebug("Verifying ", i + j * dimX);
- const void *p = rsGetElementAt(aRaw, i, j);
- int val = *(const int *)p;
- _RS_ASSERT(val == (i + j * dimX));
- }
- }
+ // Since we are binding with our A allocation, it has 0 Y/Z dimensions.
+ _RS_ASSERT(rsAllocationGetDimY(aRaw) == 0);
+ _RS_ASSERT(rsAllocationGetDimZ(aRaw) == 0);
// Test 1D addressing
for (i = 0; i < dimX; i++) {
@@ -40,16 +31,6 @@ static bool test_alloc_dims() {
_RS_ASSERT(val == i);
}
- // Test 3D addressing
- for (j = 0; j < dimY; j++) {
- for (i = 0; i < dimX; i++) {
- rsDebug("Verifying ", i + j * dimX);
- const void *p = rsGetElementAt(aRaw, i, j, 0);
- int val = *(const int *)p;
- _RS_ASSERT(val == (i + j * dimX));
- }
- }
-
_RS_ASSERT(rsAllocationGetDimX(aFaces) == dimX);
_RS_ASSERT(rsAllocationGetDimY(aFaces) == dimY);
_RS_ASSERT(rsAllocationGetDimZ(aFaces) == dimZ);