Bug 212005 - [ANGLE] OES_texture_float_linear is core functionality in ES 3
Summary: [ANGLE] OES_texture_float_linear is core functionality in ES 3
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dean Jackson
URL:
Keywords: InRadar
Depends on: 210524
Blocks: 212170
  Show dependency treegraph
 
Reported: 2020-05-17 15:39 PDT by Dean Jackson
Modified: 2020-05-22 16:56 PDT (History)
8 users (show)

See Also:


Attachments
Patch (22.60 KB, patch)
2020-05-17 15:43 PDT, Dean Jackson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dean Jackson 2020-05-17 15:39:44 PDT
[ANGLE] OES_texture_float_linear is core functionality in ES 3
Comment 1 Radar WebKit Bug Importer 2020-05-17 15:40:27 PDT
<rdar://problem/63321499>
Comment 2 Dean Jackson 2020-05-17 15:43:26 PDT
Created attachment 399608 [details]
Patch
Comment 3 EWS Watchlist 2020-05-17 15:44:13 PDT
Note that there are important steps to take when updating ANGLE. See http://trac.webkit.org/wiki/UpdatingANGLE
Comment 4 Dean Jackson 2020-05-17 15:50:03 PDT
There are tests for this, but it won't change any expected results until 210524 is resolved.

The final patch will include a change to the expectations.
Comment 5 Kenneth Russell 2020-05-18 10:55:26 PDT
I'm still new to this part of ANGLE, but based on Geoff Lang's feedback on my similar change upstream in ANGLE, https://chromium-review.googlesource.com/2203283 , only formatutilsgl.cpp should be changed. The idea is that ANGLE's GL backend should be advertising the correct extensions to the frontend in order to make the frontend think that these formats are filterable.

Note also that OES_texture_half_float_linear is core in ES 3.0 - see Table 3.13 in the OpenGL ES 3.0.6 spec - but OES_texture_float_linear is still an extension.

I'm still struggling a bit to make my change pass tests on all devices so that it can be accepted into ANGLE.
Comment 6 Dean Jackson 2020-05-18 11:24:07 PDT
You're right - I misread the GL ES 3 documentation. For some reason I don't see iOS advertising this extension.
Comment 7 Dean Jackson 2020-05-18 11:32:45 PDT
I think I see the problem. There are some slightly complicated rules for what is filterable, including this:

      Further, OpenGL ES 3.0 requires that the required floating-point
      formats with 16-bits per component ('half-float') are filterable, but
      does not support filtering for floating-point formats with 32-bits per
      component.

      Some OpenGL ES 3.0 implementations want a way to indicate that the
      required floating-point formats with 32-bit per component are also
      filterable _without_ adding the additional unsized formats from
      OES_texture_float. This is achieved by exposing this extension without
      exposing OES_texture_float.

      For an OpenGL ES 3.0 implementation, the following holds for the
      combination of the OES_texture_float, OES_texture_float_linear,
      and OES_texture_half_float_linear extensions:

        - If none of these extensions are supported:
           - floating-point formats with 32-bit per component are not filterable
           - floating-point formats with 16-bit per component are filterable

        - If OES_texture_float_linear is supported:
           - all floating-point formats in Table 3.13 are filterable

        - If OES_texture_float and OES_texture_float_linear are supported:
           - all floating-point formats in Table 3.13 are filterable
           - all formats of type FLOAT added by OES_texture_float are filterable

        - If OES_texture_half_float and OES_texture_half_float_linear are
           supported:
           - all floating-point formats in Table 3.13 are filterable
           - all formats of type HALF_FLOAT_OES added by OES_texture_half_float
             are filterable
Comment 8 Kenneth Russell 2020-05-18 15:59:15 PDT
A note that the above text is from the OES_texture_float_linear extension:
https://www.khronos.org/registry/OpenGL/extensions/OES/OES_texture_float_linear.txt

Which scenario is the case on iOS? On ES 3.0 contexts, is OES_texture_float_linear supported, but not OES_texture_float?
Comment 9 Dean Jackson 2020-05-18 15:59:49 PDT
I'm going to edit the name of this bug from "OES_texture_float_linear is core functionality in ES 3" to "iOS mistakenly does not expose OES_texture_float_linear when using a GLES 3 context"

I don't know why iOS doesn't claim to expose this extension, seeing as the functionality works.
Comment 10 Dean Jackson 2020-05-18 16:02:50 PDT
(In reply to Kenneth Russell from comment #8)

> Which scenario is the case on iOS? On ES 3.0 contexts, is
> OES_texture_float_linear supported, but not OES_texture_float?

On iOS ES 3.0 contexts, neither OES_texture_float_linear or OES_texture_float are listed as supported extensions.

The latter case is ok, since floating point formats are supported by default, and you'd only expose that extension if you want indicate extra functionality on OES_texture_float_linear (support for the LUMINANCE, etc legacy formats).

But the problem is that iOS *does* support the functionality of OES_texture_float_linear without advertising it.
Comment 11 Dean Jackson 2020-05-18 16:06:34 PDT
And, as you know from the other bug, it doesn't claim to support OES_texture_float on ES 2.x contexts either.
Comment 12 Dean Jackson 2020-05-18 16:07:26 PDT
(In reply to Dean Jackson from comment #11)
> And, as you know from the other bug, it doesn't claim to support
> OES_texture_float on ES 2.x contexts either.

Oops. I'm wrong. It does advertise that on ES 2.x contexts. It doesn't advertise OES_texture_float_linear anywhere.
Comment 13 Kenneth Russell 2020-05-18 16:12:56 PDT
Current Safari on the iOS Simulator (without ANGLE) reports the following extensions from the WebGL 1.0 implementation:

EXT_blend_minmax
EXT_sRGB
OES_texture_float
OES_texture_float_linear
OES_texture_half_float
OES_texture_half_float_linear
OES_standard_derivatives
EXT_shader_texture_lod
EXT_texture_filter_anisotropic
OES_vertex_array_object
OES_element_index_uint
WEBGL_lose_context
WEBKIT_WEBGL_compressed_texture_pvrtc
WEBGL_depth_texture
ANGLE_instanced_arrays
WEBGL_debug_renderer_info

I think WebKit's pre-ANGLE implementation just advertised OES_texture_float_linear if the underlying OpenGL ES implementation supported it. Doesn't that mean that Apple's ES 2.0 contexts (= WebGL 1.0) advertise OES_texture_float_linear?
Comment 14 Dean Jackson 2020-05-18 16:19:33 PDT
I now suspect we were advertising support for something we didn't have, and the conformance test wasn't strong enough to detect that.
Comment 15 Dean Jackson 2020-05-18 17:13:35 PDT
Yes. It was a mistake we ever exposed this on iOS.