Lines Matching refs:state
54 StateBasedKey *state = mStateBasedShaders.at(i); in ~RsdShader() local
55 if (state->mShaderID) { in ~RsdShader()
56 glDeleteShader(state->mShaderID); in ~RsdShader()
58 delete state; in ~RsdShader()
85 for (uint32_t ct = 0; ct < mRSProgram->mHal.state.texturesCount; ct ++) { in getExistingState()
87 if (mRSProgram->mHal.state.textureTargets[ct] == RS_TEXTURE_2D) { in getExistingState()
88 Allocation *a = mRSProgram->mHal.state.textures[ct]; in getExistingState()
89 if (a && a->mHal.state.surfaceTextureID) { in getExistingState()
107 StateBasedKey *state = getExistingState(); in getStateBasedShaderID() local
108 if (state != nullptr) { in getStateBasedShaderID()
109 mCurrentState = state; in getStateBasedShaderID()
113 state = new StateBasedKey(mTextureCount); in getStateBasedShaderID()
114 mCurrentState = state; in getStateBasedShaderID()
115 mStateBasedShaders.push_back(state); in getStateBasedShaderID()
125 for (uint32_t ct=0; ct < mRSProgram->mHal.state.inputElementsCount; ct++) { in init()
126 initAddUserElement(mRSProgram->mHal.state.inputElements[ct], mAttribNames, in init()
129 for (uint32_t ct=0; ct < mRSProgram->mHal.state.constantsCount; ct++) { in init()
130 initAddUserElement(mRSProgram->mHal.state.constantTypes[ct]->getElement(), in init()
135 for (uint32_t ct=0; ct < mRSProgram->mHal.state.texturesCount; ct++) { in init()
145 for (uint32_t ct=0; ct < mRSProgram->mHal.state.inputElementsCount; ct++) { in getGLSLInputString()
146 const Element *e = mRSProgram->mHal.state.inputElements[ct]; in getGLSLInputString()
147 for (uint32_t field=0; field < e->mHal.state.fieldsCount; field++) { in getGLSLInputString()
148 const Element *f = e->mHal.state.fields[field]; in getGLSLInputString()
151 rsAssert(!f->mHal.state.fieldsCount); in getGLSLInputString()
152 switch (f->mHal.state.vectorSize) { in getGLSLInputString()
161 s.append(e->mHal.state.fieldNames[field]); in getGLSLInputString()
169 for (uint32_t ct=0; ct < mRSProgram->mHal.state.inputElementsCount; ct++) { in appendAttributes()
170 const Element *e = mRSProgram->mHal.state.inputElements[ct]; in appendAttributes()
171 for (uint32_t field=0; field < e->mHal.state.fieldsCount; field++) { in appendAttributes()
172 const Element *f = e->mHal.state.fields[field]; in appendAttributes()
173 const char *fn = e->mHal.state.fieldNames[field]; in appendAttributes()
176 rsAssert(!f->mHal.state.fieldsCount); in appendAttributes()
177 switch (f->mHal.state.vectorSize) { in appendAttributes()
197 for (uint32_t ct = 0; ct < mRSProgram->mHal.state.texturesCount; ct ++) { in appendTextures()
198 if (mRSProgram->mHal.state.textureTargets[ct] == RS_TEXTURE_2D) { in appendTextures()
199 Allocation *a = mRSProgram->mHal.state.textures[ct]; in appendTextures()
200 if (a && a->mHal.state.surfaceTextureID) { in appendTextures()
279 for (uint32_t ct=0; ct < mRSProgram->mHal.state.constantsCount; ct++) { in appendUserConstants()
280 const Element *e = mRSProgram->mHal.state.constantTypes[ct]->getElement(); in appendUserConstants()
281 for (uint32_t field=0; field < e->mHal.state.fieldsCount; field++) { in appendUserConstants()
282 const Element *f = e->mHal.state.fields[field]; in appendUserConstants()
283 const char *fn = e->mHal.state.fieldNames[field]; in appendUserConstants()
286 rsAssert(!f->mHal.state.fieldsCount); in appendUserConstants()
287 if (f->mHal.state.dataType == RS_TYPE_MATRIX_4X4) { in appendUserConstants()
289 } else if (f->mHal.state.dataType == RS_TYPE_MATRIX_3X3) { in appendUserConstants()
291 } else if (f->mHal.state.dataType == RS_TYPE_MATRIX_2X2) { in appendUserConstants()
294 switch (f->mHal.state.vectorSize) { in appendUserConstants()
305 if (e->mHal.state.fieldArraySizes[field] > 1) { in appendUserConstants()
307 mShader += std::to_string(e->mHal.state.fieldArraySizes[field]); in appendUserConstants()
316 RsDataType dataType = field->mHal.state.dataType; in logUniform()
317 uint32_t elementSize = field->mHal.state.elementSizeBytes / sizeof(float); in logUniform()
338 switch (field->mHal.state.vectorSize) { in logUniform()
363 RsDataType dataType = field->mHal.state.dataType; in setUniform()
371 switch (field->mHal.state.vectorSize) { in setUniform()
425 trans[s->mHal.state.minFilter]); in setupSampler()
427 switch (trans[s->mHal.state.minFilter]) { in setupSampler()
434 trans[s->mHal.state.minFilter]); in setupSampler()
440 transNP[s->mHal.state.minFilter]); in setupSampler()
443 transNP[s->mHal.state.magFilter]); in setupSampler()
444 RSD_CALL_GL(glTexParameteri, target, GL_TEXTURE_WRAP_S, transNP[s->mHal.state.wrapS]); in setupSampler()
445 RSD_CALL_GL(glTexParameteri, target, GL_TEXTURE_WRAP_T, transNP[s->mHal.state.wrapT]); in setupSampler()
449 trans[s->mHal.state.minFilter]); in setupSampler()
452 transNP[s->mHal.state.minFilter]); in setupSampler()
454 RSD_CALL_GL(glTexParameteri, target, GL_TEXTURE_MAG_FILTER, trans[s->mHal.state.magFilter]); in setupSampler()
455 RSD_CALL_GL(glTexParameteri, target, GL_TEXTURE_WRAP_S, trans[s->mHal.state.wrapS]); in setupSampler()
456 RSD_CALL_GL(glTexParameteri, target, GL_TEXTURE_WRAP_T, trans[s->mHal.state.wrapT]); in setupSampler()
459 float anisoValue = rsMin(dc->gl.gl.EXT_texture_max_aniso, s->mHal.state.aniso); in setupSampler()
468 if (mRSProgram->mHal.state.texturesCount == 0) { in setupTextures()
474 uint32_t numTexturesToBind = mRSProgram->mHal.state.texturesCount; in setupTextures()
478 mRSProgram->mHal.state.texturesCount, this, numTexturesAvailable); in setupTextures()
487 if (!mRSProgram->mHal.state.textures[ct]) { in setupTextures()
493 DrvAllocation *drvTex = (DrvAllocation *)mRSProgram->mHal.state.textures[ct]->mHal.drv; in setupTextures()
504 if (mRSProgram->mHal.state.samplers[ct]) { in setupTextures()
505 setupSampler(rsc, mRSProgram->mHal.state.samplers[ct], in setupTextures()
506 mRSProgram->mHal.state.textures[ct]); in setupTextures()
528 for (uint32_t ct=0; ct < mRSProgram->mHal.state.constantsCount; ct++) { in setupUserConstants()
529 Allocation *alloc = mRSProgram->mHal.state.constants[ct]; in setupUserConstants()
539 const Element *e = mRSProgram->mHal.state.constantTypes[ct]->getElement(); in setupUserConstants()
540 for (uint32_t field=0; field < e->mHal.state.fieldsCount; field++) { in setupUserConstants()
541 const Element *f = e->mHal.state.fields[field]; in setupUserConstants()
542 const char *fieldName = e->mHal.state.fieldNames[field]; in setupUserConstants()
544 uint32_t offset = e->mHal.state.fieldOffsetBytes[field]; in setupUserConstants()
581 for (uint32_t ct=0; ct < mRSProgram->mHal.state.inputElementsCount; ct++) { in initAttribAndUniformArray()
582 const Element *elem = mRSProgram->mHal.state.inputElements[ct]; in initAttribAndUniformArray()
583 mAttribCount += elem->mHal.state.fieldsCount; in initAttribAndUniformArray()
587 for (uint32_t ct=0; ct < mRSProgram->mHal.state.constantsCount; ct++) { in initAttribAndUniformArray()
588 const Element *elem = mRSProgram->mHal.state.constantTypes[ct]->getElement(); in initAttribAndUniformArray()
589 mUniformCount += elem->mHal.state.fieldsCount; in initAttribAndUniformArray()
591 mUniformCount += mRSProgram->mHal.state.texturesCount; in initAttribAndUniformArray()
601 mTextureCount = mRSProgram->mHal.state.texturesCount; in initAttribAndUniformArray()
607 rsAssert(e->mHal.state.fieldsCount); in initAddUserElement()
608 for (uint32_t ct=0; ct < e->mHal.state.fieldsCount; ct++) { in initAddUserElement()
609 const Element *ce = e->mHal.state.fields[ct]; in initAddUserElement()
610 if (ce->mHal.state.fieldsCount) { in initAddUserElement()
614 tmp.append(e->mHal.state.fieldNames[ct]); in initAddUserElement()
617 arrayLengths[*count] = e->mHal.state.fieldArraySizes[ct]; in initAddUserElement()