Bug 206038 - [WebGL] Add all remaining WebGL2 implementation functions to GraphicsContextGL
Summary: [WebGL] Add all remaining WebGL2 implementation functions to GraphicsContextGL
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dean Jackson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-01-09 14:58 PST by Dean Jackson
Modified: 2020-01-10 11:00 PST (History)
7 users (show)

See Also:


Attachments
Patch (95.04 KB, patch)
2020-01-09 15:04 PST, Dean Jackson
simon.fraser: review+
Details | Formatted Diff | Diff
EWS (94.99 KB, patch)
2020-01-09 15:19 PST, 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-01-09 14:58:39 PST
[WebGL] Add all remaining WebGL2 implementation functions to GraphicsContextGL
Comment 1 Radar WebKit Bug Importer 2020-01-09 14:59:12 PST
<rdar://problem/58459051>
Comment 2 Dean Jackson 2020-01-09 15:04:43 PST
Created attachment 387278 [details]
Patch
Comment 3 Simon Fraser (smfr) 2020-01-09 15:10:08 PST
Comment on attachment 387278 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=387278&action=review

> Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h:365
> +    // ========== WebGL 2 entry points.

WebGL2 ?

> Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:2580
> +

blank line gasp
Comment 4 Don Olmstead 2020-01-09 15:12:59 PST
Comment on attachment 387278 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=387278&action=review

This is fine. Please wait for the EWS

> Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:2796
> +GCGLuint GraphicsContextGLOpenGL::getUniformBlockIndex(PlatformGLObject program, const String& uniformBlockName)
> +{
> +    UNUSED_PARAM(program);
> +    UNUSED_PARAM(uniformBlockName);
> +
> +    return 0;
> +}
> +
> +void GraphicsContextGLOpenGL::getActiveUniformBlockiv(PlatformGLObject program, GCGLuint uniformBlockIndex, GCGLenum pname, GCGLint* params)
> +{
> +    UNUSED_PARAM(program);
> +    UNUSED_PARAM(uniformBlockIndex);
> +    UNUSED_PARAM(pname);
> +    UNUSED_PARAM(params);
> +}
> +
> +String GraphicsContextGLOpenGL::getActiveUniformBlockName(PlatformGLObject program, GCGLuint uniformBlockIndex)
> +{
> +    UNUSED_PARAM(program);
> +    UNUSED_PARAM(uniformBlockIndex);
> +
> +    return emptyString();
> +}
> +
> +void GraphicsContextGLOpenGL::uniformBlockBinding(PlatformGLObject program, GCGLuint uniformBlockIndex, GCGLuint uniformBlockBinding)
> +{
> +    UNUSED_PARAM(program);
> +    UNUSED_PARAM(uniformBlockIndex);
> +    UNUSED_PARAM(uniformBlockBinding);
> +}

Even if its just a stub this should be wrapped too with the USE check since uniform block stuff is GL 3.1. Are we going to just assume that if its GL 3 that it has these functions or do we need additional USE checks?
Comment 5 Dean Jackson 2020-01-09 15:19:50 PST
Created attachment 387282 [details]
EWS
Comment 6 Dean Jackson 2020-01-10 10:33:42 PST
Comment on attachment 387278 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=387278&action=review

>> Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:2796
>> +}
> 
> Even if its just a stub this should be wrapped too with the USE check since uniform block stuff is GL 3.1. Are we going to just assume that if its GL 3 that it has these functions or do we need additional USE checks?

I'm not sure what's best here. If you only have GL 3 and not GL 3.1+, is there any point trying to expose WebGL 2? Can it be emulated?
Comment 7 Dean Jackson 2020-01-10 10:36:07 PST
Comment on attachment 387278 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=387278&action=review

>>> Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:2796
>>> +}
>> 
>> Even if its just a stub this should be wrapped too with the USE check since uniform block stuff is GL 3.1. Are we going to just assume that if its GL 3 that it has these functions or do we need additional USE checks?
> 
> I'm not sure what's best here. If you only have GL 3 and not GL 3.1+, is there any point trying to expose WebGL 2? Can it be emulated?

Oh, of course I'd still need the USE check. Sorry.
Comment 8 Dean Jackson 2020-01-10 10:42:09 PST
Comment on attachment 387278 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=387278&action=review

>>>> Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:2796
>>>> +}
>>> 
>>> Even if its just a stub this should be wrapped too with the USE check since uniform block stuff is GL 3.1. Are we going to just assume that if its GL 3 that it has these functions or do we need additional USE checks?
>> 
>> I'm not sure what's best here. If you only have GL 3 and not GL 3.1+, is there any point trying to expose WebGL 2? Can it be emulated?
> 
> Oh, of course I'd still need the USE check. Sorry.

The way it is now is confusing.

USE_OPENGL_3 doesn't differentiate between 3 and 3.1, so it seems we already assume that is good enough.

However, I think there is a difference between USE_OPENGL (which is deciding which backend to actually use) and USE_OPENGL_3 (which is signifying that it exists). I believe it should be HAS_OPENGL_3.

But are there any platforms that we compile to that have OpenGL 3 or below?
Comment 9 Don Olmstead 2020-01-10 10:53:04 PST
(In reply to Dean Jackson from comment #8)
> Comment on attachment 387278 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=387278&action=review
> 
> >>>> Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:2796
> >>>> +}
> >>> 
> >>> Even if its just a stub this should be wrapped too with the USE check since uniform block stuff is GL 3.1. Are we going to just assume that if its GL 3 that it has these functions or do we need additional USE checks?
> >> 
> >> I'm not sure what's best here. If you only have GL 3 and not GL 3.1+, is there any point trying to expose WebGL 2? Can it be emulated?
> > 
> > Oh, of course I'd still need the USE check. Sorry.
> 
> The way it is now is confusing.
> 
> USE_OPENGL_3 doesn't differentiate between 3 and 3.1, so it seems we already
> assume that is good enough.
> 
> However, I think there is a difference between USE_OPENGL (which is deciding
> which backend to actually use) and USE_OPENGL_3 (which is signifying that it
> exists). I believe it should be HAS_OPENGL_3.
> 
> But are there any platforms that we compile to that have OpenGL 3 or below?

Yea I agree that its confusing. I felt USE was probably safer because I'm not sure what sort of hardware Igalia was targeting with GTK and especially WPE since the later is embedded hardware and drivers might be crappy.

There's also the fact that with ANGLE there are backends that don't have it. Metal and Vulkan appear to be a no from the README. DirectX 9 doesn't but for Windows we're just supporting Windows 10 at this point which would have 11.

For our ports WinCairo and PlayStation just assuming OpenGL ES 3 is fine. I'd assume thats the same with Apple ports, minus AppleWin but fine for FTW.

Maybe worth a discussion with Igalians somewhere to get consensus?
Comment 10 Dean Jackson 2020-01-10 11:00:50 PST
Committed r254350: <https://trac.webkit.org/changeset/254350>