Bug 39077 - Map RGBA4/RGB5_A1 to RGBA and RGB565 to RGB in RenderbufferStorage
Summary: Map RGBA4/RGB5_A1 to RGBA and RGB565 to RGB in RenderbufferStorage
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:
 
Reported: 2010-05-13 11:05 PDT by Zhenyao Mo
Modified: 2010-05-20 18:06 PDT (History)
4 users (show)

See Also:


Attachments
patch (6.98 KB, patch)
2010-05-13 14:16 PDT, Zhenyao Mo
no flags Details | Formatted Diff | Diff
revised patch (6.77 KB, patch)
2010-05-17 18:01 PDT, Zhenyao Mo
no flags 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-05-13 11:05:13 PDT
The three supported internal color formats RGBA4/RGB5_A1/RGB565 may not be supported by Desktop OpenGL.  We need to map them to general RGBA and RGB.
Comment 1 Zhenyao Mo 2010-05-13 14:16:00 PDT
Created attachment 56021 [details]
patch

The same mapping is also added to command buffer implementation in Google Chrome.
Comment 2 Kenneth Russell 2010-05-13 18:46:24 PDT
Comment on attachment 56021 [details]
patch

Should we do a similar reverse mapping for getRenderbufferParameter(RENDERBUFFER_INTERNAL_FORMAT) so we don't return enums that are undefined or illegal in the WebGL spec?
Comment 3 Zhenyao Mo 2010-05-14 15:55:06 PDT
(In reply to comment #2)
> (From update of attachment 56021 [details])
> Should we do a similar reverse mapping for getRenderbufferParameter(RENDERBUFFER_INTERNAL_FORMAT) so we don't return enums that are undefined or illegal in the WebGL spec?

I just checked and realized the code for reverse mapping is already in place (see WebGLRenderingContext::getRenderbufferParameter and WebGLRenderingContext::renderbufferStorage).

It's added through this patch: https://bugs.webkit.org/show_bug.cgi?id=35611
Comment 4 Kenneth Russell 2010-05-14 18:02:53 PDT
(In reply to comment #3)
> (In reply to comment #2)
> > (From update of attachment 56021 [details] [details])
> > Should we do a similar reverse mapping for getRenderbufferParameter(RENDERBUFFER_INTERNAL_FORMAT) so we don't return enums that are undefined or illegal in the WebGL spec?
> 
> I just checked and realized the code for reverse mapping is already in place (see WebGLRenderingContext::getRenderbufferParameter and WebGLRenderingContext::renderbufferStorage).
> 
> It's added through this patch: https://bugs.webkit.org/show_bug.cgi?id=35611

Right, I'd forgotten all about that.

Looks good to me.
Comment 5 Eric Seidel (no email) 2010-05-17 15:49:24 PDT
Comment on attachment 56021 [details]
patch

Why so much  copy/paste code in the layout test?
Comment 6 Zhenyao Mo 2010-05-17 18:01:19 PDT
Created attachment 56298 [details]
revised patch

Reduced the code duplication in the test (responding to Eric Seidel's comment).
Comment 7 Dimitri Glazkov (Google) 2010-05-17 18:42:20 PDT
Comment on attachment 56298 [details]
revised patch

rs=me.
Comment 8 WebKit Commit Bot 2010-05-20 18:06:46 PDT
Comment on attachment 56298 [details]
revised patch

Clearing flags on attachment: 56298

Committed r59888: <http://trac.webkit.org/changeset/59888>
Comment 9 WebKit Commit Bot 2010-05-20 18:06:51 PDT
All reviewed patches have been landed.  Closing bug.