Methods Summary |
---|
public void | bindConstants(Allocation a, int slot)Binds a constant buffer to be used as uniform inputs to the
program
if (slot < 0 || slot >= mConstants.length) {
throw new IllegalArgumentException("Slot ID out of range.");
}
if (a != null &&
a.getType().getID(mRS) != mConstants[slot].getID(mRS)) {
throw new IllegalArgumentException("Allocation type does not match slot type.");
}
long id = a != null ? a.getID(mRS) : 0;
mRS.nProgramBindConstants(getID(mRS), slot, id);
|
public void | bindSampler(Sampler vs, int slot)Binds an object that describes how a texture at the
corresponding location is sampled
mRS.validate();
if ((slot < 0) || (slot >= mTextureCount)) {
throw new IllegalArgumentException("Slot ID out of range.");
}
long id = vs != null ? vs.getID(mRS) : 0;
mRS.nProgramBindSampler(getID(mRS), slot, id);
|
public void | bindTexture(Allocation va, int slot)Binds a texture to be used in the program
mRS.validate();
if ((slot < 0) || (slot >= mTextureCount)) {
throw new IllegalArgumentException("Slot ID out of range.");
}
if (va != null && va.getType().hasFaces() &&
mTextures[slot] != TextureType.TEXTURE_CUBE) {
throw new IllegalArgumentException("Cannot bind cubemap to 2d texture slot");
}
long id = va != null ? va.getID(mRS) : 0;
mRS.nProgramBindTexture(getID(mRS), slot, id);
|
public Type | getConstant(int slot)Returns the type of the constant buffer used in the program
object. It could be used to query internal elements or create
an allocation to store constant data.
if (slot < 0 || slot >= mConstants.length) {
throw new IllegalArgumentException("Slot ID out of range.");
}
return mConstants[slot];
|
public int | getConstantCount()Program object can have zero or more constant allocations
associated with it. This method returns the total count.
return mConstants != null ? mConstants.length : 0;
|
public int | getTextureCount()Returns the number of textures used in this program object
return mTextureCount;
|
public java.lang.String | getTextureName(int slot)Returns the name of the texture input at a given slot. e.g.
tex0, diffuse, spec
if ((slot < 0) || (slot >= mTextureCount)) {
throw new IllegalArgumentException("Slot ID out of range.");
}
return mTextureNames[slot];
|
public android.renderscript.Program$TextureType | getTextureType(int slot)Returns the type of texture at a given slot. e.g. 2D or Cube
if ((slot < 0) || (slot >= mTextureCount)) {
throw new IllegalArgumentException("Slot ID out of range.");
}
return mTextures[slot];
|