Bug 206038

Summary: [WebGL] Add all remaining WebGL2 implementation functions to GraphicsContextGL
Product: WebKit Reporter: Dean Jackson <dino>
Component: New BugsAssignee: Dean Jackson <dino>
Status: RESOLVED FIXED    
Severity: Normal CC: don.olmstead, ews-watchlist, graouts, kondapallykalyan, noam, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
simon.fraser: review+
EWS none

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>