Closed Bug 908841 Opened 11 years ago Closed 11 years ago

WebGL2 Add more natively supported extensions

Categories

(Core :: Graphics: CanvasWebGL, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: guillaume.abadie, Assigned: guillaume.abadie)

References

Details

Attachments

(5 files)

Add native support of followed extension in WebGL 2:
 - OES_element_index_uint
 - OES_standard_derivatives
 - OES_texture_float
 - OES_texture_float_linear
 - WEBGL_depth_texture
The objective is to have:
 static const char* WebGLContext::GetExtensionString(WebGLExtensionID ext)

for following patches.
Attachment #794909 - Flags: review?(jgilbert)
Attachment #794907 - Flags: review?(jgilbert) → review+
Comment on attachment 794909 [details] [diff] [review]
patch step 2 - revision 1: New string conversion for WebGL extensions

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

::: content/canvas/src/WebGLContextExtensions.cpp
@@ +158,4 @@
>      {
> +        if (CompareWebGLExtensionName(name, "MOZ_WEBGL_lose_context")) {
> +            ext = WEBGL_lose_context;
> +        }

Why do we still have these? Why aren't they caught by the for loop above?
Comment on attachment 794913 [details] [diff] [review]
patch step 3 revision 1: Change the WebGL 2 validation system.

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

::: content/canvas/src/WebGL2Context.cpp
@@ +71,5 @@
> +        GLFeature::transform_feedback
> +    };
> +
> +    // check WebGL extensions that are supposed to be natively supported
> +    for (size_t i = 0; i < size_t(MOZ_ARRAY_LENGTH(sExtensionNativelySupportedArr)); i++)

Does MOZ_ARRAY_LENGTH really not return a size_t?
Attachment #794913 - Flags: review?(jgilbert) → review+
Attachment #794914 - Flags: review?(jgilbert) → review+
(In reply to Jeff Gilbert [:jgilbert] from comment #5)
> Comment on attachment 794909 [details] [diff] [review]
> patch step 2 - revision 1: New string conversion for WebGL extensions
> 
> Review of attachment 794909 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: content/canvas/src/WebGLContextExtensions.cpp
> @@ +158,4 @@
> >      {
> > +        if (CompareWebGLExtensionName(name, "MOZ_WEBGL_lose_context")) {
> > +            ext = WEBGL_lose_context;
> > +        }
> 
> Why do we still have these? Why aren't they caught by the for loop above?
Because if it were, we would have to put those strings in the const array, and so having different indices for same extensions to keep the 1:1 matching with the enumeration. So I did like that instead, and because we are not going to add MOZ_ prefix anymore thanks by the draft extension flag like Chrome does, it is okay to just accept them here for compatibility.
(In reply to Jeff Gilbert [:jgilbert] from comment #6)
> Comment on attachment 794913 [details] [diff] [review]
> patch step 3 revision 1: Change the WebGL 2 validation system.
> 
> Review of attachment 794913 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: content/canvas/src/WebGL2Context.cpp
> @@ +71,5 @@
> > +        GLFeature::transform_feedback
> > +    };
> > +
> > +    // check WebGL extensions that are supposed to be natively supported
> > +    for (size_t i = 0; i < size_t(MOZ_ARRAY_LENGTH(sExtensionNativelySupportedArr)); i++)
> 
> Does MOZ_ARRAY_LENGTH really not return a size_t?
Oups... Good catch! Fixed.
I have forgotten to qrefresh, again... So this patch just add constants in the WebGL 2's WebIDL.
Attachment #795519 - Flags: review?(jgilbert)
(In reply to Guillaume Abadie from comment #7)
> (In reply to Jeff Gilbert [:jgilbert] from comment #5)
> > Comment on attachment 794909 [details] [diff] [review]
> > patch step 2 - revision 1: New string conversion for WebGL extensions
> > 
> > Review of attachment 794909 [details] [diff] [review]:
> > -----------------------------------------------------------------
> > 
> > ::: content/canvas/src/WebGLContextExtensions.cpp
> > @@ +158,4 @@
> > >      {
> > > +        if (CompareWebGLExtensionName(name, "MOZ_WEBGL_lose_context")) {
> > > +            ext = WEBGL_lose_context;
> > > +        }
> > 
> > Why do we still have these? Why aren't they caught by the for loop above?
> Because if it were, we would have to put those strings in the const array,
> and so having different indices for same extensions to keep the 1:1 matching
> with the enumeration. So I did like that instead, and because we are not
> going to add MOZ_ prefix anymore thanks by the draft extension flag like
> Chrome does, it is okay to just accept them here for compatibility.

Oh, ok. It'd be nice to leave a comment that says 'check for vendor-prefixed extensions for backwards compatibility', or something.
Comment on attachment 794909 [details] [diff] [review]
patch step 2 - revision 1: New string conversion for WebGL extensions

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

::: content/canvas/src/WebGLContextExtensions.cpp
@@ +158,4 @@
>      {
> +        if (CompareWebGLExtensionName(name, "MOZ_WEBGL_lose_context")) {
> +            ext = WEBGL_lose_context;
> +        }

Let's leave a comment that these are here so we can still support the deprecated vendor-prefixed aliases.
Attachment #794909 - Flags: review?(jgilbert) → review+
Attachment #795519 - Flags: review?(jgilbert) → review+
(In reply to Jeff Gilbert [:jgilbert] from comment #11)
> Comment on attachment 794909 [details] [diff] [review]
> patch step 2 - revision 1: New string conversion for WebGL extensions
> 
> Review of attachment 794909 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: content/canvas/src/WebGLContextExtensions.cpp
> @@ +158,4 @@
> >      {
> > +        if (CompareWebGLExtensionName(name, "MOZ_WEBGL_lose_context")) {
> > +            ext = WEBGL_lose_context;
> > +        }
> 
> Let's leave a comment that these are here so we can still support the
> deprecated vendor-prefixed aliases.

Fixed! Thanks!
I don't see what docs this needs.
Keywords: dev-doc-needed
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: