to top
Android APIs
public class

Program

extends BaseObj
java.lang.Object
   ↳ android.renderscript.BaseObj
     ↳ android.renderscript.Program
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Program is a base class for all the objects that modify various stages of the graphics pipeline

Summary

Nested Classes
class Program.BaseProgramBuilder  
enum Program.TextureType TextureType specifies what textures are attached to Program objects  
Public Methods
void bindConstants(Allocation a, int slot)
Binds a constant buffer to be used as uniform inputs to the program
void bindSampler(Sampler vs, int slot)
Binds an object that describes how a texture at the corresponding location is sampled
void bindTexture(Allocation va, int slot)
Binds a texture to be used in the program
Type getConstant(int slot)
Returns the type of the constant buffer used in the program object.
int getConstantCount()
Program object can have zero or more constant allocations associated with it.
int getTextureCount()
Returns the number of textures used in this program object
String getTextureName(int slot)
Returns the name of the texture input at a given slot.
Program.TextureType getTextureType(int slot)
Returns the type of texture at a given slot.
[Expand]
Inherited Methods
From class android.renderscript.BaseObj
From class java.lang.Object

Public Methods

public void bindConstants (Allocation a, int slot)

Added in API level 11

Binds a constant buffer to be used as uniform inputs to the program

Parameters
a allocation containing uniform data
slot index within the program's list of constant buffer allocations

public void bindSampler (Sampler vs, int slot)

Added in API level 11

Binds an object that describes how a texture at the corresponding location is sampled

Parameters
vs sampler for a corresponding texture
slot index within the program's list of textures to use the sampler on

public void bindTexture (Allocation va, int slot)

Added in API level 11

Binds a texture to be used in the program

Parameters
va allocation containing texture data
slot index within the program's list of textures

public Type getConstant (int slot)

Added in API level 16

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.

Parameters
slot index of the constant input type to return
Returns
  • constant input type

public int getConstantCount ()

Added in API level 16

Program object can have zero or more constant allocations associated with it. This method returns the total count.

Returns
  • number of constant input types

public int getTextureCount ()

Added in API level 16

Returns the number of textures used in this program object

Returns
  • number of texture inputs

public String getTextureName (int slot)

Added in API level 16

Returns the name of the texture input at a given slot. e.g. tex0, diffuse, spec

Parameters
slot index of the texture input
Returns
  • texture input name

public Program.TextureType getTextureType (int slot)

Added in API level 16

Returns the type of texture at a given slot. e.g. 2D or Cube

Parameters
slot index of the texture input
Returns
  • texture input type