WARN:变量不能绑定(它要么不存在,要么已经被优化掉了)
WARN: Variable cannot be bound (it either doesn't exist or has been optimized away)
我试图传递一个变量timeVar(一个浮点数最初设置为0.0),它在我的display()方法中改变了
行timeVar = time(0);
到我的片段着色器。然后写入
safe_glUniform1f(h_uTime, timeVar);
并将其传递给我的着色器程序,像这样
h_uTime = safe_glGetAttribLocation(h_program, "uTime");
但是我一直得到这个错误。请帮助!
WARN: uTime cannot be bound (it either doesn't exist or has been optimized
away). safe_glAttrib calls will silently ignore it.
由于uTime
是统一的而不是属性,使用glGetAttribLocation
总是会导致错误。必须使用glGetUniformLocation
相关文章:
- 是否允许编译器优化掉局部易失性变量
- 具有必要副作用的静态初始化被优化掉了
- 为什么这个未使用的变量没有优化掉?
- C++对间接运算符的标准描述是否保证内存写入不会被优化掉
- 为什么这个无操作循环没有优化掉?
- (gcc)编译器是否优化掉了空体函数
- 编译器优化合并了相同的函数实现,这意味着在运行时要绕过存根
- 为什么“fork()”调用没有在无限循环中优化掉
- 一个空类会被优化掉吗
- 强制GCC不要优化掉未使用的变量
- 为什么指针增量语句被优化掉了
- sizeof()有可能被优化掉吗?
- WARN:变量不能绑定(它要么不存在,要么已经被优化掉了)
- 被管道弄糊涂了。"cat -A"似乎过滤掉了部分输出
- 静态初始化器在库中会被优化掉
- 优化掉未使用的参数化字段
- 在c++中,如果返回一个指针并立即解引用,这两个操作会被优化掉吗?
- vc++的优化打破了与NaN的比较
- 析构函数单元测试会被优化掉吗?
- c++编译器会通过“引用”优化掉未使用的返回值吗