diff options
Diffstat (limited to 'rs')
-rw-r--r-- | rs/java/android/renderscript/Element.java | 45 | ||||
-rw-r--r-- | rs/java/android/renderscript/RenderScript.java | 5 |
2 files changed, 49 insertions, 1 deletions
diff --git a/rs/java/android/renderscript/Element.java b/rs/java/android/renderscript/Element.java index c6b5b0d..287b3f1 100644 --- a/rs/java/android/renderscript/Element.java +++ b/rs/java/android/renderscript/Element.java @@ -118,7 +118,10 @@ public class Element extends BaseObj { */ public enum DataType { NONE (0, 0), - //FLOAT_16 (1, 2), + /** + * @hide + */ + FLOAT_16 (1, 2), FLOAT_32 (2, 4), FLOAT_64 (3, 8), SIGNED_8 (4, 1), @@ -386,6 +389,16 @@ public class Element extends BaseObj { return rs.mElement_I64; } + /** + * @hide + */ + public static Element F16(RenderScript rs) { + if(rs.mElement_F16 == null) { + rs.mElement_F16 = createUser(rs, DataType.FLOAT_16); + } + return rs.mElement_F16; + } + public static Element F32(RenderScript rs) { if(rs.mElement_F32 == null) { rs.mElement_F32 = createUser(rs, DataType.FLOAT_32); @@ -520,6 +533,36 @@ public class Element extends BaseObj { return rs.mElement_RGBA_8888; } + /** + * @hide + */ + public static Element F16_2(RenderScript rs) { + if(rs.mElement_HALF_2 == null) { + rs.mElement_HALF_2 = createVector(rs, DataType.FLOAT_16, 2); + } + return rs.mElement_HALF_2; + } + + /** + * @hide + */ + public static Element F16_3(RenderScript rs) { + if(rs.mElement_FLOAT_3 == null) { + rs.mElement_FLOAT_3 = createVector(rs, DataType.FLOAT_16, 3); + } + return rs.mElement_HALF_3; + } + + /** + * @hide + */ + public static Element F16_4(RenderScript rs) { + if(rs.mElement_HALF_4 == null) { + rs.mElement_HALF_4 = createVector(rs, DataType.FLOAT_16, 4); + } + return rs.mElement_HALF_4; + } + public static Element F32_2(RenderScript rs) { if(rs.mElement_FLOAT_2 == null) { rs.mElement_FLOAT_2 = createVector(rs, DataType.FLOAT_32, 2); diff --git a/rs/java/android/renderscript/RenderScript.java b/rs/java/android/renderscript/RenderScript.java index fb8ae5d..e12495a 100644 --- a/rs/java/android/renderscript/RenderScript.java +++ b/rs/java/android/renderscript/RenderScript.java @@ -871,6 +871,7 @@ public class RenderScript { Element mElement_I32; Element mElement_U64; Element mElement_I64; + Element mElement_F16; Element mElement_F32; Element mElement_F64; Element mElement_BOOLEAN; @@ -894,6 +895,10 @@ public class RenderScript { Element mElement_RGBA_4444; Element mElement_RGBA_8888; + Element mElement_HALF_2; + Element mElement_HALF_3; + Element mElement_HALF_4; + Element mElement_FLOAT_2; Element mElement_FLOAT_3; Element mElement_FLOAT_4; |