本文整理汇总了C++中GLSLShader::setLinked方法的典型用法代码示例。如果您正苦于以下问题:C++ GLSLShader::setLinked方法的具体用法?C++ GLSLShader::setLinked怎么用?C++ GLSLShader::setLinked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GLSLShader
的用法示例。
在下文中一共展示了GLSLShader::setLinked方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setTransformFeedbackVaryings
void GLSLProgram::setTransformFeedbackVaryings(const std::vector<String>& nameStrings)
{
// Get program object ID.
GLuint programId;
if (Root::getSingleton().getRenderSystem()->getCapabilities()->hasCapability(RSC_SEPARATE_SHADER_OBJECTS))
{
//TODO include tessellation stages
GLSLShader* glslGpuProgram = getGeometryShader();
if (!glslGpuProgram)
glslGpuProgram = getVertexShader();
programId = glslGpuProgram->getGLProgramHandle();
// force re-link
GpuProgramManager::getSingleton().removeMicrocodeFromCache(glslGpuProgram->_getHash());
glslGpuProgram->setLinked(false);
}
else
{
programId = getGLProgramHandle();
// force re-link
GpuProgramManager::getSingleton().removeMicrocodeFromCache(getCombinedHash());
}
mLinked = false;
// Convert to const char * for GL
std::vector<const char*> names;
for (uint e = 0; e < nameStrings.size(); e++)
{
names.push_back(nameStrings[e].c_str());
}
// TODO replace glTransformFeedbackVaryings with in-shader specification (GL 4.4)
OGRE_CHECK_GL_ERROR(glTransformFeedbackVaryings(programId, nameStrings.size(), &names[0],
GL_INTERLEAVED_ATTRIBS));
#if OGRE_DEBUG_MODE
activate();
// Check if varyings were successfully set.
GLchar Name[64];
GLsizei Length(0);
GLsizei Size(0);
GLenum Type(0);
// bool Validated = false;
for (size_t i = 0; i < nameStrings.size(); i++)
{
OGRE_CHECK_GL_ERROR(
glGetTransformFeedbackVarying(programId, i, 64, &Length, &Size, &Type, Name));
LogManager::getSingleton().stream() << "Varying " << i << ": " << Name << " " << Length
<< " " << Size << " " << Type;
// Validated = (Size == 1) && (Type == GL_FLOAT_VEC3);
// std::cout << Validated << " " << GL_FLOAT_VEC3 << std::endl;
}
#endif
}