Move texture bindings to base program object. Change ProgramFragment creation to require a texture format in 1.0 mode.

This commit is contained in:
Jason Sams
2009-12-17 16:55:08 -08:00
parent 8bb41dd614
commit 68afd01ec9
12 changed files with 203 additions and 339 deletions

View File

@ -46,6 +46,27 @@ public class Program extends BaseObj {
mRS.nProgramBindConstants(mID, slot, a.mID);
}
public void bindTexture(Allocation va, int slot)
throws IllegalArgumentException {
mRS.validate();
if((slot < 0) || (slot >= mTextureCount)) {
throw new IllegalArgumentException("Slot ID out of range.");
}
mRS.nProgramBindTexture(mID, slot, va.mID);
}
public void bindSampler(Sampler vs, int slot)
throws IllegalArgumentException {
mRS.validate();
if((slot < 0) || (slot >= mTextureCount)) {
throw new IllegalArgumentException("Slot ID out of range.");
}
mRS.nProgramBindSampler(mID, slot, vs.mID);
}
public static class BaseProgramBuilder {
RenderScript mRS;
Element mInputs[];