I've noticed some sharp inconsistencies in how rendering to 3D textures works across platforms and browsers. I've tested Chrome 62/Firefox 57 on Ubuntu 16.04/Quadro M1000 and Windows 10/GT 750m using the following scenes:
- "This is WebGL" texture used for offscreen draw
- Gray bar is the clear color for the offscreen draw
- Black bar is the clear color for the main draw
The second works in both browsers on Ubuntu, but fails in both on Windows. Chrome reports FRAMEBUFFER_UNSUPPORTED as the framebuffer status. Firefox reports no errors, and seems to do the clear (gray), but doesn't draw.
The third works in both browsers on Ubuntu and fixes things in Chrome on Windows. Firefox behaves the same as for the previous example.
I was tipped off to trying the third setup by the following language from the OpenGL 4.6 spec (section 9.4.2): "If any framebuffer attachment is layered, all populated attachments must be layered. Additionally, all populated color attachments must be from textures of the same target (three-dimensional, one- or two-dimensional array, cube map, or cube map array textures)."
However, neither the ES 3.0, nor the WebGL 2 spec mention any such restriction. Shannon Woods brought it to my attention that it does appear in section 9.4.2 of the ES 3.2 spec.
So the first question would be: should this restriction be formally added to the WebGL 2 spec?