diff --git a/src/osg/Shader.cpp b/src/osg/Shader.cpp index 53bdb853b..7f4fd8eeb 100644 --- a/src/osg/Shader.cpp +++ b/src/osg/Shader.cpp @@ -625,13 +625,6 @@ void Shader::PerContextShader::compileShader(osg::State& state) } - if (osg::getNotifyLevel()>=osg::INFO) - { - std::string sourceWithLineNumbers = insertLineNumbers(source); - OSG_INFO << "\nCompiling " << _shader->getTypename() - << " source:\n" << sourceWithLineNumbers << std::endl; - } - GLint compiled = GL_FALSE; // OSG_NOTICE<<"Compiling PerContextShader "<getTypename() + << " source:\n" << sourceWithLineNumbers << std::endl; + } + + + _extensions->glShaderSource( _glShaderHandle, 1, &sourceText, NULL ); } else @@ -676,6 +683,13 @@ void Shader::PerContextShader::compileShader(osg::State& state) if (!versionLine.empty()) { + if (osg::getNotifyLevel()>=osg::INFO) + { + std::string sourceWithLineNumbers = insertLineNumbers(versionLine + _defineStr + source); + OSG_INFO << "\nCompiling " << _shader->getTypename() + << " source:\n" << sourceWithLineNumbers << std::endl; + } + // OSG_NOTICE<<"Shader::PerContextShader::compileShader() : Found #version, lineNum = "<=osg::INFO) + { + std::string sourceWithLineNumbers = insertLineNumbers(_defineStr + source); + OSG_INFO << "\nCompiling " << _shader->getTypename() + << " source:\n" << sourceWithLineNumbers << std::endl; + } + const GLchar* sourceText[2]; //OSG_NOTICE<<"glShaderSource() ["<<_defineStr<<"], ["<(_defineStr.c_str());