Bug 48489

Summary: Work around a Mac driver bug in generateMipmap
Product: WebKit Reporter: Zhenyao Mo <zmo>
Component: WebGLAssignee: Zhenyao Mo <zmo>
Status: RESOLVED FIXED    
Severity: Normal CC: cmarrin, enne, kbr, mrowe
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 48528    
Attachments:
Description Flags
patch kbr: review+, zmo: commit-queue-

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>