Bug 108812 - Fix the issue that some possible source formats are ignored for float textures in texture packing for CG port
Summary: Fix the issue that some possible source formats are ignored for float texture...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-04 03:43 PST by Jun Jiang
Modified: 2013-02-04 18:27 PST (History)
3 users (show)

See Also:


Attachments
Patch (3.88 KB, patch)
2013-02-04 04:02 PST, Jun Jiang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jun Jiang 2013-02-04 03:43:49 PST
There is a bug affecting CG port in the texture packing code when the destination type is float. The possible formats from DOM elements or ImageData are specified in function srcFormatComeFromDOMElementOrImageData() which was defined in GraphicsContext3D.h. For non-CG port, it could be only BGRA8 or RGBA8 only. But for CG port, there are several other possible formats. 
In the FormatConverter::convert(...) function, when the destination type is float, if the source format type is not float, then the source format must be from DOM elements or ImageData. In the conditional statement to check this kinds of combination, the possible source formats are hard coded to RGBA8 and BGRA8 which would result in early return for CG port when the source formats are of other possible formats(RGB8, etc). 
Moreover, there is a more precise checking for source formats from DOM elements or ImageData afterwards and the checking code stated above is really redundant. The other issue is that the unpack functions to convert other possible source formats(RGB8, etc) to RGBA32F is missing. What we need to do is adding those missing functions and remove the non-accurate checking code. 
Then it will go to the checking code like "if (!srcFormatComesFromDOMElementOrImageData && SrcFormat != DstFormat)" and make the right decision.
Comment 1 Jun Jiang 2013-02-04 04:02:36 PST
Created attachment 186343 [details]
Patch
Comment 2 Kenneth Russell 2013-02-04 18:03:38 PST
Comment on attachment 186343 [details]
Patch

Thanks for the patch. The fix looks good. r=me
Comment 3 WebKit Review Bot 2013-02-04 18:27:21 PST
Comment on attachment 186343 [details]
Patch

Clearing flags on attachment: 186343

Committed r141843: <http://trac.webkit.org/changeset/141843>
Comment 4 WebKit Review Bot 2013-02-04 18:27:24 PST
All reviewed patches have been landed.  Closing bug.