Bug 123915 - [WebGL] We should not allow generateMipMap on compressed textures
Summary: [WebGL] We should not allow generateMipMap on compressed textures
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac All
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords: InRadar
Depends on:
Blocks: 123916
  Show dependency treegraph
 
Reported: 2013-11-06 12:42 PST by Brent Fulgham
Modified: 2013-11-06 15:07 PST (History)
7 users (show)

See Also:


Attachments
Patch (5.49 KB, patch)
2013-11-06 13:17 PST, Brent Fulgham
dino: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2013-11-06 12:42:37 PST
The WebGL conformance test suite generates an error for the Mac WebGL implementation because our implementation of glGenerateMipmaps accepts compressed textures as inputs. The specification calls for this to generate a GL INVALID_OPERATION error with the message ""trying to generate mipmaps from compressed texture".

This bug enforces the WebGL 1.0 constraint on our software.
Comment 1 Brent Fulgham 2013-11-06 13:11:41 PST
<rdar://problem/15201274>
Comment 2 Brent Fulgham 2013-11-06 13:17:41 PST
Created attachment 216212 [details]
Patch
Comment 3 Dean Jackson 2013-11-06 13:25:50 PST
Comment on attachment 216212 [details]
Patch

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

> Source/WebCore/html/canvas/WebGLRenderingContext.cpp:2227
> +#if OS(DARWIN)

Considering this is WebGL conformance, do you think this should be on all platforms?
Comment 4 Brent Fulgham 2013-11-06 13:28:22 PST
(In reply to comment #3)
> (From update of attachment 216212 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=216212&action=review
> 
> > Source/WebCore/html/canvas/WebGLRenderingContext.cpp:2227
> > +#if OS(DARWIN)
> 
> Considering this is WebGL conformance, do you think this should be on all platforms?

Good question!  I changed from "glGenerateMipmapEXT" to "glGenerateMipmap", which might be all that is necessary on most platforms.  In those cases, GL itself should generate the error.

However, our own Apple implementation sneakily maps glGenerateMipmap -> glGenerateMipMapEXT so we can never get the desired error behavior.

It probably wouldn't hurt to remove the #if/def, since it just causes WebGL to generate the error, rather than the underlying GL implementation.

I'll go ahead and remove it while landing.
Comment 5 Brent Fulgham 2013-11-06 15:07:10 PST
Committed r158798: <http://trac.webkit.org/changeset/158798>