Closed Bug 1219890 Opened 9 years ago Closed 9 years ago

Support WebGL2 on top of ES3

Categories

(Core :: Graphics: CanvasWebGL, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed

People

(Reporter: jrmuizel, Assigned: jrmuizel)

References

Details

(Whiteboard: [gfx-noted])

Attachments

(3 files, 2 obsolete files)

This is needed for ANGLE
Blocks: webgl2
Assignee: nobody → jmuizelaar
Whiteboard: [gfx-noted]
jgilbert, do you have any preferences for how to implement this? Should we duplicate the static arrays with es3 versions or should we build the arrays dynamically on the stack? How should we communicate the version required to the context?
Flags: needinfo?(jgilbert)
Let's construct arrays. Having static arrays is nice when the options are limited, but not really necessary when we'd have to have a large number.

Also it'd be nice to support printing out our chosen array, perhaps when MOZ_GL_SPEW=1?
Flags: needinfo?(jgilbert)
Attachment #8680877 - Attachment is obsolete: true
Attachment #8693074 - Flags: review?(jgilbert)
Attached patch Use es3 when appropriate (obsolete) — Splinter Review
Attachment #8693082 - Flags: review?(jgilbert)
Comment on attachment 8693074 [details] [diff] [review]
Construct context arguments on the stack

Review of attachment 8693074 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/gl/GLContextProviderEGL.cpp
@@ +498,5 @@
>  
>      EGLContext eglShareContext = shareContext ? shareContext->mContext
>                                                : EGL_NO_CONTEXT;
> +
> +    nsAutoTArray<EGLint, 6> contextAttribs;

It doesn't hurt to have the `, 6` here, but it's not something we should be worrying about in such cold code. I would omit this as premature optimization.

@@ +499,5 @@
>      EGLContext eglShareContext = shareContext ? shareContext->mContext
>                                                : EGL_NO_CONTEXT;
> +
> +    nsAutoTArray<EGLint, 6> contextAttribs;
> +    contextAttribs.AppendElement(LOCAL_EGL_CONTEXT_CLIENT_VERSION); contextAttribs.AppendElement(2);

Don't put two lines on one line. Surround with newlines to establish that these are a pair. Use a lambda if you want to make it very explicit.
Attachment #8693074 - Flags: review?(jgilbert) → review+
Comment on attachment 8693075 [details] [diff] [review]
Make assignment operator and copy constructor default.

Review of attachment 8693075 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/gl/SurfaceTypes.cpp
@@ +15,5 @@
>      Clear();
>  }
>  
> +/* These are defined out of line so that we don't need to include
> + * ISurfaceAllocator.h in the header */

Use `//` for short comments like this.

@@ +21,2 @@
>  SurfaceCaps&
> +SurfaceCaps::operator=(const SurfaceCaps& other) = default;

Tools I wish I had when I wrote this!
Attachment #8693075 - Flags: review?(jgilbert) → review+
Comment on attachment 8693082 [details] [diff] [review]
Use es3 when appropriate

Review of attachment 8693082 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/gl/GLContextProviderEGL.cpp
@@ +500,5 @@
>                                                : EGL_NO_CONTEXT;
>  
>      nsAutoTArray<EGLint, 6> contextAttribs;
> +    contextAttribs.AppendElement(LOCAL_EGL_CONTEXT_CLIENT_VERSION);
> +    if (caps.es3)

Use CreateContextFlags for this.

::: gfx/gl/SurfaceTypes.h
@@ +25,5 @@
>      bool depth, stencil;
>      bool antialias;
>      bool premultAlpha;
>      bool preserve;
> +    bool es3;

This is not how we should pass this down.
Attachment #8693082 - Flags: review?(jgilbert) → review-
How about this one.
Attachment #8693082 - Attachment is obsolete: true
Attachment #8694230 - Flags: review?(jgilbert)
Attachment #8694230 - Flags: review?(jgilbert) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: