copyTexImage2D does not fail on float textures on OSX |
|||||
Issue description
Version: 49
OS: OSX
What steps will reproduce the problem?
(1) run the attached code
What is the expected output?
Seems like it should fail with an error
What do you see instead?
It runs
As far as I can tell this is an error. If I read the spec correctly, texImage2D doesn't take `GL_FLOAT` as an argument. `OES_texture_float` enables that. BUT, it doesn't enable it for copyTexImage2D. The extension specifically says
3. Should CopyTexImage2D, CopyTexSubImage{2D|3D} be supported for textures
with half-float and float channels?
RESOLUTION: No.
Therefore this should fail everywhere. If I understand correctly copyTexImage2D gets its type from the type of the source texture? That's not clear either, at least in ES 2.0
In any case it seems like the behavior should be consistent across devices.
,
Apr 12 2016
Right, ES3 spec also explicitly forbids float formats in CopyTexImage. We should add a check in the command buffer.
,
Apr 13 2016
The format restriction for copyTexImage2D only takes effect on internalformat argument of copyTexImage2D. In the attached test case, float texture is attached to fbo. Then, copyTeximage2D do copy from that fbo. According gles spec 3.0.4, "The image is taken from the current color buffer exactly as if these arguments were passed to ReadPixels with arguments format and type set according to table 3.15". So I think it should be NO_ERROR for copyTexImage2D in this case.
,
Apr 13 2016
The spec says "The error INVALID_OPERATION is generated if floating-point RGBA data is required; if signed integer RGBA data is required and the format of the current color buffer is not signed integer; if unsigned integer RGBA data is required and the format of the current color buffer is not unsigned integer; or if fixed-point RGBA data is required and the format of the current color buffer is not fixed-point." It seems to me that no floating-point to fixed-point data conversion is allowed. This language here is stricter than ReadPixels.
,
Apr 14 2016
The test case copies from a floating-point texture (attached to the current framebuffer) to a floating-point texture. No floating-point to fixed-point conversion should be occurring. This behavior should be covered, I think, under the ambiguously-defined behavior that OES_texture_float and OES_texture_half_float have in WebGL, where the texture types might or might not be renderable. Since they are, CopyTexImage2D is allowed. Someone should study EXT_color_buffer_float ( https://www.khronos.org/registry/gles/extensions/EXT/EXT_color_buffer_float.txt ) and see whether it affects the behavior of CopyTexImage2D. If it does, then in WebGL 2.0, this behavior should absolutely be defined in that version of WebGL. If that is not the case then we urgently need to fix it there. I'm marking this as Needs-Feedback under the hope that someone will do the research above and update this bug.
,
Apr 18 2016
I guess I'm not sure I understand OES_texture_float explicit calls out float and half float as unsupported Are you saying you think that's ambiguous because your not sure if it's referring to conversions rather than copying? In any case the problem right now is some WebGL allows it, others don't. There's no way to check except seeing if you get an error. I kind of read into the extension spec that it was explicitly not allowed
,
Jun 17 2016
kbr@ Are you still looking into this?
,
Jun 17 2016
The EXT_color_buffer_float explicitly enables float format for CopyTexImage https://www.khronos.org/registry/gles/extensions/EXT/EXT_color_buffer_float.txt OpenGL ES 3.0 In the first paragraph, change the sentence beginning "The error INVALID_OPERATION is generated ..." to * The error INVALID_OPERATION is generated if signed integer RGBA data is required and the format of the current color buffer is not signed integer; if unsigned integer RGBA data is required and the format of the current color buffer is not unsigned integer; or if * floating- or fixed-point RGBA data is required and the format of * the current color buffer is signed or unsigned integer.
,
Jun 21 2016
WebGL 1.0 implicitly allows the OES_texture_float and OES_texture_half_float to add support for rendering to floating-point textures. This was a deliberate design decision and I think that prohibiting CopyTexImage2D from floating-point renderbuffer to floating-point texture would destroy the performance of some WebGL 1.0 use cases. This will be more carefully defined in WebGL 2.0 + EXT_color_buffer_float. I'm going to close this as WontFix.
,
Jun 20 2017
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by zmo@chromium.org
, Apr 12 2016