Bug 39077

Summary: Map RGBA4/RGB5_A1 to RGBA and RGB565 to RGB in RenderbufferStorage
Product: WebKit Reporter: Zhenyao Mo <zmo>
Component: WebGLAssignee: Zhenyao Mo <zmo>
Status: RESOLVED FIXED    
Severity: Normal CC: cmarrin, commit-queue, kbr, oliver
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
patch
none
revised patch none

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.