GraphicAlgorithm
GraphicAlgorithm copied to clipboard
Release下运行,Shader报错:Attached vertex shader is not compiled.
问题: 在Frame->Shader.cpp文件中
···cpp GLint CShader::__loadShader(const std::string& vShaderFileName, GLint vShaderType) const ···
出了问题,没有编译Shader文件
原因是在Release模式下,不会运行_ASSERT函数,因此忽略了_ASSERT(__compileShader(Shader)); 所以在Debug下可以正常运行,但是在Release下运行报错。
建议修改为 GLboolean isCompileShader = __compileShader(Shader); _ASSERT(isCompileShader);