本文整理汇总了C++中GpuProgramParametersSharedPtr::getPassIterationNumberIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ GpuProgramParametersSharedPtr::getPassIterationNumberIndex方法的具体用法?C++ GpuProgramParametersSharedPtr::getPassIterationNumberIndex怎么用?C++ GpuProgramParametersSharedPtr::getPassIterationNumberIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GpuProgramParametersSharedPtr
的用法示例。
在下文中一共展示了GpuProgramParametersSharedPtr::getPassIterationNumberIndex方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updatePassIterationUniforms
//-----------------------------------------------------------------------
void GLSLESProgramPipeline::updatePassIterationUniforms(GpuProgramParametersSharedPtr params)
{
if (params->hasPassIterationNumber())
{
size_t index = params->getPassIterationNumberIndex();
GLUniformReferenceIterator currentUniform = mGLUniformReferences.begin();
GLUniformReferenceIterator endUniform = mGLUniformReferences.end();
// Need to find the uniform that matches the multi pass entry
for (;currentUniform != endUniform; ++currentUniform)
{
// Get the index in the parameter real list
if (index == currentUniform->mConstantDef->physicalIndex)
{
#if OGRE_PLATFORM != OGRE_PLATFORM_NACL
GLuint progID = 0;
if (getVertexProgram() && currentUniform->mSourceProgType == GPT_VERTEX_PROGRAM)
{
progID = getVertexProgram()->getGLProgramHandle();
OGRE_CHECK_GL_ERROR(glProgramUniform1fvEXT(progID, currentUniform->mLocation, 1, params->getFloatPointer(index)));
}
if (mFragmentProgram && currentUniform->mSourceProgType == GPT_FRAGMENT_PROGRAM)
{
progID = mFragmentProgram->getGLProgramHandle();
OGRE_CHECK_GL_ERROR(glProgramUniform1fvEXT(progID, currentUniform->mLocation, 1, params->getFloatPointer(index)));
}
#endif
// There will only be one multipass entry
return;
}
}
}
}
示例2: bindProgramPassIterationParameters
void ATI_FS_GLGpuProgram::bindProgramPassIterationParameters(GpuProgramParametersSharedPtr params)
{
if (params->hasPassIterationNumber())
{
size_t physicalIndex = params->getPassIterationNumberIndex();
size_t logicalIndex = params->getFloatLogicalIndexForPhysicalIndex(physicalIndex);
const float* pFloat = params->getFloatPointer(physicalIndex);
glSetFragmentShaderConstantATI( GL_CON_0_ATI + (GLuint)logicalIndex, pFloat);
}
}
示例3: updatePassIterationUniforms
void GLSLSeparableProgram::updatePassIterationUniforms(GpuProgramParametersSharedPtr params)
{
if (params->hasPassIterationNumber())
{
size_t index = params->getPassIterationNumberIndex();
GLUniformReferenceIterator currentUniform = mGLUniformReferences.begin();
GLUniformReferenceIterator endUniform = mGLUniformReferences.end();
// Need to find the uniform that matches the multi pass entry
for (;currentUniform != endUniform; ++currentUniform)
{
// Get the index in the parameter real list
if (index == currentUniform->mConstantDef->physicalIndex)
{
GLuint progID = 0;
if (mVertexShader && currentUniform->mSourceProgType == GPT_VERTEX_PROGRAM)
{
progID = mVertexShader->getGLProgramHandle();
}
if (mFragmentShader && currentUniform->mSourceProgType == GPT_FRAGMENT_PROGRAM)
{
progID = mFragmentShader->getGLProgramHandle();
}
if (mGeometryShader && currentUniform->mSourceProgType == GPT_GEOMETRY_PROGRAM)
{
progID = mGeometryShader->getGLProgramHandle();
}
if (mDomainShader && currentUniform->mSourceProgType == GPT_DOMAIN_PROGRAM)
{
progID = mDomainShader->getGLProgramHandle();
}
if (mHullShader && currentUniform->mSourceProgType == GPT_HULL_PROGRAM)
{
progID = mHullShader->getGLProgramHandle();
}
if (mComputeShader && currentUniform->mSourceProgType == GPT_COMPUTE_PROGRAM)
{
progID = mComputeShader->getGLProgramHandle();
}
OGRE_CHECK_GL_ERROR(glProgramUniform1fv(progID, currentUniform->mLocation, 1, params->getFloatPointer(index)));
// There will only be one multipass entry
return;
}
}
}
}
示例4: bindProgramPassIterationParameters
void GLArbGpuProgram::bindProgramPassIterationParameters(GpuProgramParametersSharedPtr params)
{
if (params->hasPassIterationNumber())
{
GLenum type = getGLShaderType(mType);
size_t physicalIndex = params->getPassIterationNumberIndex();
size_t logicalIndex = params->getFloatLogicalIndexForPhysicalIndex(physicalIndex);
const float* pFloat = params->getFloatPointer(physicalIndex);
glProgramLocalParameter4fvARB(type, (GLuint)logicalIndex, pFloat);
}
}
示例5: updatePassIterationUniforms
//-----------------------------------------------------------------------
void GLSLLinkProgram::updatePassIterationUniforms(GpuProgramParametersSharedPtr params)
{
if (params->hasPassIterationNumber())
{
size_t index = params->getPassIterationNumberIndex();
GLUniformReferenceIterator currentUniform = mGLUniformReferences.begin();
GLUniformReferenceIterator endUniform = mGLUniformReferences.end();
// Need to find the uniform that matches the multi pass entry
for (;currentUniform != endUniform; ++currentUniform)
{
// Get the index in the parameter real list
if (index == currentUniform->mConstantDef->physicalIndex)
{
OGRE_CHECK_GL_ERROR(glUniform1fv(currentUniform->mLocation, 1, params->getFloatPointer(index)));
// There will only be one multipass entry
return;
}
}
}
}