void GraphicsPipeline::bind() const
{
	// bind shader programs
	assert(glIsProgram(mProgId));
	assert(glIsProgramPipeline(mPipeId));
	glBindProgramPipeline(mPipeId);
}
bool GraphicsPipeline::isValid() const
{
	return glIsProgram(mProgId) && glIsProgramPipeline(mPipeId);
}
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL41_nglIsProgramPipeline(JNIEnv *env, jclass clazz, jint pipeline, jlong function_pointer) {
	glIsProgramPipelinePROC glIsProgramPipeline = (glIsProgramPipelinePROC)((intptr_t)function_pointer);
	GLboolean __result = glIsProgramPipeline(pipeline);
	return __result;
}
Exemple #4
0
    String logObjectInfo(const String& msg, const GLuint obj)
    {
        String logMessage = msg;

        // Invalid object.
        if (obj <= 0)
        {
            return logMessage;
        }

        GLint infologLength = 0;

        GLboolean isShader = glIsShader(obj);
        GLboolean isProgramPipeline = glIsProgramPipeline(obj);
        GLboolean isProgram = glIsProgram(obj);

        if (isShader)
        {
            OGRE_CHECK_GL_ERROR(glGetShaderiv(obj, GL_INFO_LOG_LENGTH, &infologLength));
        }
        else if (isProgramPipeline &&
                 Root::getSingleton().getRenderSystem()->getCapabilities()->hasCapability(RSC_SEPARATE_SHADER_OBJECTS))
        {
            //FIXME Crashes on NVIDIA? See GL3+ GSoC forum
            // posts around 2013-11-25.
            OGRE_CHECK_GL_ERROR(glGetProgramPipelineiv(obj, GL_INFO_LOG_LENGTH, &infologLength));
        }
        else if (isProgram)
        {
            OGRE_CHECK_GL_ERROR(glGetProgramiv(obj, GL_INFO_LOG_LENGTH, &infologLength));
        }

        // No info log available.
        // if (infologLength <= 1)
        if (infologLength < 1)
        {
            return logMessage;
        }

        GLint charsWritten  = 0;

        char * infoLog = new char [infologLength];
        infoLog[0] = 0;

        if (isShader)
        {
            OGRE_CHECK_GL_ERROR(glGetShaderInfoLog(obj, infologLength, &charsWritten, infoLog));
        }
        else if (isProgramPipeline &&
                 Root::getSingleton().getRenderSystem()->getCapabilities()->hasCapability(RSC_SEPARATE_SHADER_OBJECTS))
        {
            OGRE_CHECK_GL_ERROR(glGetProgramPipelineInfoLog(obj, infologLength, &charsWritten, infoLog));
        }
        else if (isProgram)
        {
            OGRE_CHECK_GL_ERROR(glGetProgramInfoLog(obj, infologLength, &charsWritten, infoLog));
        }

        if (strlen(infoLog) > 0)
        {
            logMessage += "\n" + String(infoLog);
        }

        delete [] infoLog;

        if (logMessage.size() > 0)
        {
            // Remove empty lines from the end of the log.
            while (logMessage[logMessage.size() - 1] == '\n')
            {
                logMessage.erase(logMessage.size() - 1, 1);
            }
            LogManager::getSingleton().logMessage(logMessage);
        }

        return logMessage;
    }