Closed Bug 1259696 Opened 8 years ago Closed 8 years ago

WebGL crash: [@mozilla::WebGLTexture::CopyTexImage2D]

Categories

(Core :: Graphics: CanvasWebGL, defect)

All
macOS
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: posidron, Assigned: ethlin)

References

Details

(Keywords: crash, testcase)

Attachments

(3 files, 2 obsolete files)

Attached file callstack
Assignee: nobody → ethlin
Summary: Crash: [@mozilla::WebGLTexture::CopyTexImage2D] → WebGL crash: [@mozilla::WebGLTexture::CopyTexImage2D]
Attached patch Check read buffer mode. (obsolete) — Splinter Review
Check the read buffer mode in CopyTexImage.
Attachment #8735763 - Flags: review?(jgilbert)
Comment on attachment 8735763 [details] [diff] [review]
Check read buffer mode.

Review of attachment 8735763 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/canvas/WebGLContext.h
@@ +1387,5 @@
>      RefPtr<const webgl::LinkedProgramInfo> mActiveProgramLinkInfo;
>  
>      bool ValidateFramebufferTarget(GLenum target, const char* const info);
>  
> +    GLenum mReadBufferMode;

READ_BUFFER state is attached to each framebuffer, not part of global state. (GLES 3.0.4 p256)
Attachment #8735763 - Flags: review?(jgilbert) → review-
Attached patch Check read buffer mode. (obsolete) — Splinter Review
In this patch, I use the framebuffer's READ_BUFFER mode to do the check.
Attachment #8735763 - Attachment is obsolete: true
Attachment #8736341 - Flags: review?(jgilbert)
Comment on attachment 8736341 [details] [diff] [review]
Check read buffer mode.

Review of attachment 8736341 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/canvas/WebGLTextureUpload.cpp
@@ +1728,5 @@
> +    // GLES 3.0.4 p145:
> +    // "Calling CopyTexSubImage3D, CopyTexImage2D, or CopyTexSubImage2D will result in an
> +    //  INVALID_OPERATION error if any of the following conditions is true: READ_BUFFER
> +    //  is NONE"
> +    if (mContext->IsWebGL2() && srcMode == LOCAL_GL_NONE) {

Drop the IsWebGL2 part, since srcMode should always be non-NONE in WebGL 1.

@@ +1889,5 @@
> +    // GLES 3.0.4 p145:
> +    // "Calling CopyTexSubImage3D, CopyTexImage2D, or CopyTexSubImage2D will result in an
> +    //  INVALID_OPERATION error if any of the following conditions is true: READ_BUFFER
> +    //  is NONE"
> +    if (mContext->IsWebGL2() && srcMode == LOCAL_GL_NONE) {

Drop the IsWebGL2 part, since srcMode should always be non-NONE in WebGL 1.
Attachment #8736341 - Flags: review?(jgilbert) → review+
Address jgilbert's comments.
Attachment #8736341 - Attachment is obsolete: true
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/53400e993cb8
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in before you can comment on or make changes to this bug.