Lines Matching defs:slot

152 void Program::bindAllocation(Context *rsc, Allocation *alloc, uint32_t slot) {
154 if (slot >= mHal.state.constantsCount) {
155 ALOGE("Attempt to bind alloc at slot %u, on shader id %" PRIuPTR ", but const count is %u",
156 slot, (uintptr_t)this, mHal.state.constantsCount);
160 if (alloc->getType() != mConstantTypes[slot].get()) {
161 ALOGE("Attempt to bind alloc at slot %u, on shader id %" PRIuPTR ", but types mismatch",
162 slot, (uintptr_t)this);
167 if (mConstants[slot].get() == alloc) {
170 if (mConstants[slot].get()) {
171 mConstants[slot]->removeProgramToDirty(this);
173 mConstants[slot].set(alloc);
174 mHal.state.constants[slot] = alloc;
181 void Program::bindTexture(Context *rsc, uint32_t slot, Allocation *a) {
182 if (slot >= mHal.state.texturesCount) {
183 ALOGE("Attempt to bind texture to slot %u but tex count is %u", slot, mHal.state.texturesCount);
188 if (a && a->getType()->getDimFaces() && mHal.state.textureTargets[slot] != RS_TEXTURE_CUBE) {
189 ALOGE("Attempt to bind cubemap to slot %u but 2d texture needed", slot);
190 rsc->setError(RS_ERROR_BAD_SHADER, "Cannot bind cubemap to 2d texture slot");
194 mTextures[slot].set(a);
195 mHal.state.textures[slot] = a;
200 void Program::bindSampler(Context *rsc, uint32_t slot, Sampler *s) {
201 if (slot >= mHal.state.texturesCount) {
202 ALOGE("Attempt to bind sampler to slot %u but tex count is %u", slot, mHal.state.texturesCount);
207 mSamplers[slot].set(s);
208 mHal.state.samplers[slot] = s;
215 void rsi_ProgramBindConstants(Context *rsc, RsProgram vp, uint32_t slot, RsAllocation constants) {
217 p->bindAllocation(rsc, static_cast<Allocation *>(constants), slot);
220 void rsi_ProgramBindTexture(Context *rsc, RsProgram vpf, uint32_t slot, RsAllocation a) {
222 p->bindTexture(rsc, slot, static_cast<Allocation *>(a));
225 void rsi_ProgramBindSampler(Context *rsc, RsProgram vpf, uint32_t slot, RsSampler s) {
227 p->bindSampler(rsc, slot, static_cast<Sampler *>(s));