am 712b05d0: Merge "Add FP16 types to the list of RenderScript types." automerge: 081cda8
* commit '712b05d00b00a6148852e153ef76dfb5960623e9':
Add FP16 types to the list of RenderScript types.
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 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 @@
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 @@
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 @@
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 @@
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;