WebGL 参数 - "must be zero" - 为什么要提供它?

WebGL parameter - "must be zero" - why provide it?

framebufferTexture2D 有几个参数,最后一个是 level

A GLint specifying the mipmap level of the texture image to be attached. Must be 0.

如果它必须为零,为什么我们必须指定它?

它基于OpenGL ES 2 spec,这样做可以实现更好的向前兼容性。 mipmap level 必须 为零(除了规范当前不支持这一事实之外)没有合乎逻辑的原因,因此它启用了规范的未来版本能够在不更改方法签名的情况下扩大该参数的范围并允许其他值。

This has indeed already happened in OpenGL ES 3, which no longer requires the parameter to be zero in all cases.