New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 602570 link

Starred by 3 users

Issue metadata

Status: WontFix
Owner:
OOO until 2019-01-24
Closed: Jun 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

copyTexImage2D does not fail on float textures on OSX

Project Member Reported by gman@chromium.org, Apr 12 2016

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.


 
webgl-copyteximage-float-issue.html
2.2 KB View Download

Comment 1 by zmo@chromium.org, Apr 12 2016

Cc: bajones@chromium.org qiankun....@intel.com yunchao...@intel.com

Comment 2 by zmo@chromium.org, Apr 12 2016

Right, ES3 spec also explicitly forbids float formats in CopyTexImage. We should add a check in the command buffer.
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.

Comment 4 by zmo@chromium.org, 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.

Comment 5 by kbr@chromium.org, Apr 14 2016

Labels: Needs-Feedback
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.

Comment 6 by gman@chromium.org, 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 

Labels: -Needs-Feedback
kbr@ Are you still looking into this?

Comment 8 by zmo@chromium.org, 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.

Comment 9 by kbr@chromium.org, Jun 21 2016

Owner: kbr@chromium.org
Status: WontFix (was: Available)
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.

Components: -Internals>GPU>WebGL Blink>WebGL

Sign in to add a comment