Bug 48489 - Work around a Mac driver bug in generateMipmap
Summary: Work around a Mac driver bug in generateMipmap
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Zhenyao Mo
URL:
Keywords:
Depends on:
Blocks: 48528
  Show dependency treegraph
 
Reported: 2010-10-27 17:59 PDT by Zhenyao Mo
Modified: 2010-10-28 09:56 PDT (History)
4 users (show)

See Also:


Attachments
patch (4.71 KB, patch)
2010-10-27 18:06 PDT, Zhenyao Mo
kbr: review+
zmo: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zhenyao Mo 2010-10-27 17:59:44 PDT
If minFilter is not GL_LINEAR_MIPMAP_LINEAR when calling generateMipmap, following draw might show garbage data instead of the proper texture.
Comment 1 Zhenyao Mo 2010-10-27 18:06:17 PDT
Created attachment 72124 [details]
patch

Tested, Worlds of WebGL demo works with this patch in Chromium.
Comment 2 Kenneth Russell 2010-10-27 18:15:38 PDT
Comment on attachment 72124 [details]
patch

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

Excellent work tracking this down. There is one error in the ChangeLog though. Please fix before committing.

> WebCore/ChangeLog:9
> +        (WebCore::WebGLRenderingContext::generateMipmap): Make sure minFilter is set to LINEAR_MIPMAP_LINEAR before generateMipmap, and after the call, set it back to the original value.

This should be NEAREST_MIPMAP_LINEAR.
Comment 3 Mark Rowe (bdash) 2010-10-27 19:44:41 PDT
Can you please add a reference in the code to the bug report about the driver issue?  Without one it’s going to be more difficult to determine whether the underlying issue has been addressed.
Comment 4 Zhenyao Mo 2010-10-28 09:43:46 PDT
(In reply to comment #3)
> Can you please add a reference in the code to the bug report about the driver issue?  Without one it’s going to be more difficult to determine whether the underlying issue has been addressed.

OK, I created a bug for adding reference to bug reports.

https://bugs.webkit.org/show_bug.cgi?id=48528

I want to land this now.  I am working on a test case for the bug report.
Comment 5 Zhenyao Mo 2010-10-28 09:56:03 PDT
Committed r70784: <http://trac.webkit.org/changeset/70784>