Bug 46318 - Perform framebuffer attachment checking upon draw call rather than attachment
Summary: Perform framebuffer attachment checking upon draw call rather than attachment
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Zhenyao Mo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-22 16:18 PDT by Kenneth Russell
Modified: 2010-11-02 17:24 PDT (History)
3 users (show)

See Also:


Attachments
patch (26.81 KB, patch)
2010-10-28 16:18 PDT, Zhenyao Mo
kbr: review-
zmo: commit-queue-
Details | Formatted Diff | Diff
revised patch: responding to kbr's review (26.72 KB, patch)
2010-11-02 15:56 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 Kenneth Russell 2010-09-22 16:18:48 PDT
Per recent changes to the WebGL specification (Framebuffer Object Attachments, section 6.3), checks about the validity of the framebuffer configuration need to occur upon draw call rather than at the point a renderbuffer is attached to a framebuffer. In particular:

 - Attachments to more than one attachment point (DEPTH, STENCIL, DEPTH_STENCIL) are illegal.
 - The attachment's format must match that of the attachment point.

The reason for this is to avoid implicitly supporting separate depth+stencil (or packed depth+stencil) on some platforms and not others.
Comment 1 Zhenyao Mo 2010-10-28 16:18:12 PDT
Created attachment 72252 [details]
patch

I will commit the test change to khronos once reviewed.
Comment 2 Kenneth Russell 2010-11-02 11:44:55 PDT
Comment on attachment 72252 [details]
patch

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

Looks good overall. Couple of minor comments.

> WebCore/html/canvas/WebGLFramebuffer.cpp:38
> +static unsigned long getInternalFormat(WebGLObject* buffer)

You could use an anonymous namespace instead of static methods here.

> WebCore/html/canvas/WebGLFramebuffer.cpp:141
> +        return true;

This test seems redundant.

> WebCore/html/canvas/WebGLFramebuffer.h:49
> +    // readPixels, copyTexImage2D, copyTexSubImage2D if this frame bufferis

bufferis -> buffer is
Comment 3 Kenneth Russell 2010-11-02 11:52:53 PDT
Comment on attachment 72252 [details]
patch

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

Sorry, I noticed an issue after r+'ing the patch. Hopefully you get this email before landing.

> WebCore/html/canvas/WebGLRenderingContext.cpp:458
> +        return GraphicsContext3D::FRAMEBUFFER_INCOMPLETE_ATTACHMENT;

According to the spec this is supposed to be FRAMEBUFFER_UNSUPPORTED. Is there a reason to diverge? If not, please update the code and the test.
Comment 4 Zhenyao Mo 2010-11-02 15:56:22 PDT
Created attachment 72754 [details]
revised patch: responding to kbr's review
Comment 5 Kenneth Russell 2010-11-02 16:14:01 PDT
Comment on attachment 72754 [details]
revised patch: responding to kbr's review

Looks good. Thanks for taking care of this. Don't forget to sync the test with the Khronos repository.
Comment 6 Zhenyao Mo 2010-11-02 17:24:19 PDT
Committed r71190: <http://trac.webkit.org/changeset/71190>