diff options
Diffstat (limited to 'graphics/java/android')
-rw-r--r-- | graphics/java/android/renderscript/Program.java | 34 | ||||
-rw-r--r-- | graphics/java/android/renderscript/ProgramVertex.java | 17 |
2 files changed, 51 insertions, 0 deletions
diff --git a/graphics/java/android/renderscript/Program.java b/graphics/java/android/renderscript/Program.java index a1b1ba3..3f769ee 100644 --- a/graphics/java/android/renderscript/Program.java +++ b/graphics/java/android/renderscript/Program.java @@ -77,6 +77,40 @@ public class Program extends BaseObj { } /** + * @hide + */ + public int getConstantCount() { + return mConstants != null ? mConstants.length : 0; + } + + /** + * @hide + */ + public Type getConstant(int slot) { + if (slot < 0 || slot >= mConstants.length) { + throw new IllegalArgumentException("Slot ID out of range."); + } + return mConstants[slot]; + } + + /** + * @hide + */ + public int getTextureCount() { + return mTextureCount; + } + + /** + * @hide + */ + public TextureType getTextureType(int slot) { + if ((slot < 0) || (slot >= mTextureCount)) { + throw new IllegalArgumentException("Slot ID out of range."); + } + return mTextures[slot]; + } + + /** * Binds a constant buffer to be used as uniform inputs to the * program * diff --git a/graphics/java/android/renderscript/ProgramVertex.java b/graphics/java/android/renderscript/ProgramVertex.java index 56bb836..b3c1bd9 100644 --- a/graphics/java/android/renderscript/ProgramVertex.java +++ b/graphics/java/android/renderscript/ProgramVertex.java @@ -55,6 +55,23 @@ public class ProgramVertex extends Program { } /** + * @hide + */ + public int getInputCount() { + return mInputs != null ? mInputs.length : 0; + } + + /** + * @hide + */ + public Element getInput(int slot) { + if (slot < 0 || slot >= mInputs.length) { + throw new IllegalArgumentException("Slot ID out of range."); + } + return mInputs[slot]; + } + + /** * Builder class for creating ProgramVertex objects. * The builder starts empty and the user must minimally provide * the GLSL shader code, and the varying inputs. Constant, or |