if (mField != null) {
return mField;
}
RenderScriptGL rs = SceneManager.getRS();
Resources res = SceneManager.getRes();
if (rs == null || res == null) {
return null;
}
ScriptField_VertexShader_s.Item item = new ScriptField_VertexShader_s.Item();
item.program = mProgram;
linkConstants(rs);
if (mPerShaderConstants != null) {
item.shaderConst = mConstantBuffer;
item.shaderConstParams = mConstantBufferParams.getAllocation();
mProgram.bindConstants(item.shaderConst, 0);
}
item.objectConstIndex = -1;
if (mPerObjConstants != null) {
item.objectConstIndex = mPerShaderConstants != null ? 1 : 0;
}
mField = new ScriptField_VertexShader_s(rs, 1);
mField.set(item, 0, true);
return mField;