diff options
4 files changed, 26 insertions, 2 deletions
diff --git a/graphics/java/android/renderscript/Element.java b/graphics/java/android/renderscript/Element.java index 91824e6..dc421d8 100644 --- a/graphics/java/android/renderscript/Element.java +++ b/graphics/java/android/renderscript/Element.java @@ -47,7 +47,7 @@ public class Element extends BaseObj { UNSIGNED_8 (8, 1), UNSIGNED_16 (9, 2), UNSIGNED_32 (10, 4), - //UNSIGNED_64 (11, 8), + UNSIGNED_64 (11, 8), BOOLEAN(12, 1), @@ -142,6 +142,13 @@ public class Element extends BaseObj { return rs.mElement_I32; } + public static Element U64(RenderScript rs) { + if(rs.mElement_U64 == null) { + rs.mElement_U64 = createUser(rs, DataType.UNSIGNED_64); + } + return rs.mElement_U64; + } + public static Element I64(RenderScript rs) { if(rs.mElement_I64 == null) { rs.mElement_I64 = createUser(rs, DataType.SIGNED_64); diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java index 2774fea..0f9ed87 100644 --- a/graphics/java/android/renderscript/RenderScript.java +++ b/graphics/java/android/renderscript/RenderScript.java @@ -514,6 +514,7 @@ public class RenderScript { Element mElement_I16; Element mElement_U32; Element mElement_I32; + Element mElement_U64; Element mElement_I64; Element mElement_F32; Element mElement_F64; diff --git a/libs/rs/java/tests/src/com/android/rs/test/UT_primitives.java b/libs/rs/java/tests/src/com/android/rs/test/UT_primitives.java index 01eb26d..da995da 100644 --- a/libs/rs/java/tests/src/com/android/rs/test/UT_primitives.java +++ b/libs/rs/java/tests/src/com/android/rs/test/UT_primitives.java @@ -64,12 +64,24 @@ public class UT_primitives extends UnitTest { } s.set_longTest(17179869185l); + long puL = s.get_ulongTest(); + if (puL != 4611686018427387904L) { + return false; + } + s.set_ulongTest(4611686018427387903L); + + long pLL = s.get_longlongTest(); if (pLL != 68719476736L) { return false; } s.set_longlongTest(68719476735L); - //s.set_longlongTest(0); + + long pu64 = s.get_uint64_tTest(); + if (pu64 != 117179869184l) { + return false; + } + s.set_uint64_tTest(117179869185l); return true; } diff --git a/libs/rs/java/tests/src/com/android/rs/test/primitives.rs b/libs/rs/java/tests/src/com/android/rs/test/primitives.rs index 0363fd0..351a8a5 100644 --- a/libs/rs/java/tests/src/com/android/rs/test/primitives.rs +++ b/libs/rs/java/tests/src/com/android/rs/test/primitives.rs @@ -14,7 +14,9 @@ long long longlongTest = 68719476736l; // 1 << 36 uchar ucharTest = 8; ushort ushortTest = 16; uint uintTest = 32; +ulong ulongTest = 4611686018427387904L; int64_t int64_tTest = -17179869184l; // - 1 << 34 +uint64_t uint64_tTest = 117179869184l; static bool test_primitive_types(uint32_t index) { bool failed = false; @@ -31,7 +33,9 @@ static bool test_primitive_types(uint32_t index) { _RS_ASSERT(ucharTest == 8); _RS_ASSERT(ushortTest == 16); _RS_ASSERT(uintTest == 32); + _RS_ASSERT(ulongTest == 4611686018427387903L); _RS_ASSERT(int64_tTest == -17179869184l); + _RS_ASSERT(uint64_tTest == 117179869185l); float time = end(index); |