Closed
Bug 1257593
Opened 9 years ago
Closed 9 years ago
Handle webgl FramebufferTexture2D() with an unbound texture
Categories
(Core :: Graphics: CanvasWebGL, defect)
Core
Graphics: CanvasWebGL
Tracking
()
RESOLVED
FIXED
mozilla48
Tracking | Status | |
---|---|---|
firefox48 | --- | fixed |
People
(Reporter: jerry, Assigned: jerry)
References
Details
Attachments
(2 files, 6 obsolete files)
1.25 KB,
patch
|
jerry
:
review+
|
Details | Diff | Splinter Review |
1.95 KB,
patch
|
jerry
:
review+
|
Details | Diff | Splinter Review |
+++ This bug was initially created as a clone of Bug #1252414 +++
If we have webgl code like:
var texture = gl.createTexture(); // only createTexture(), but no bindBuffer()
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, texture, 0);
It will hit an assert at [1], since the texture is still an unbound texture.
I'm not sure how to handle this situation. So I try to return an InvalidOperation error for this case.
There is no clear item for this in webgl2 and opengles 3 spec.
https://www.khronos.org/opengles/sdk/docs/man32/html/glFramebufferTexture2D.xhtml
https://www.khronos.org/registry/webgl/specs/latest/2.0/
[1]
https://hg.mozilla.org/mozilla-central/annotate/5cfc10c14aaea2a449f74dcbb366179a45442dd6/dom/canvas/WebGLTexture.h#l306
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8731795 -
Flags: review?(jgilbert)
Assignee | ||
Updated•9 years ago
|
Attachment #8731795 -
Attachment is obsolete: true
Attachment #8731795 -
Flags: review?(jgilbert)
Comment 3•9 years ago
|
||
Comment on attachment 8732080 [details] [diff] [review]
Handle webgl FramebufferTexture2D() with an unbound texture. v2
Review of attachment 8732080 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/canvas/WebGLFramebuffer.cpp
@@ +623,5 @@
> if (!mContext->ValidateObjectAllowNull("framebufferTexture2D: texture", tex))
> return;
>
> if (tex) {
> + if (!tex->IsTexture()) {
Just `tex->HasEverBeenBound()` or `tex->Target() == LOCAL_GL_NONE`.
Attachment #8732080 -
Flags: review?(jgilbert) → review+
Comment 4•9 years ago
|
||
(In reply to Jeff Gilbert [:jgilbert] from comment #3)
> Comment on attachment 8732080 [details] [diff] [review]
> Handle webgl FramebufferTexture2D() with an unbound texture. v2
>
> Review of attachment 8732080 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: dom/canvas/WebGLFramebuffer.cpp
> @@ +623,5 @@
> > if (!mContext->ValidateObjectAllowNull("framebufferTexture2D: texture", tex))
> > return;
> >
> > if (tex) {
> > + if (!tex->IsTexture()) {
>
> Just `tex->HasEverBeenBound()` or `tex->Target() == LOCAL_GL_NONE`.
Er, `!tex->HasEveryBeenBound()`.
Assignee | ||
Updated•9 years ago
|
Attachment #8732080 -
Attachment is obsolete: true
Assignee | ||
Comment 6•9 years ago
|
||
Assignee | ||
Updated•9 years ago
|
Attachment #8732575 -
Attachment is obsolete: true
Assignee | ||
Comment 8•9 years ago
|
||
try link:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=15a296d686d6
Please land the attachment 8732588 [details] [diff] [review] to m-c.
Keywords: checkin-needed
Keywords: checkin-needed
Comment 10•9 years ago
|
||
Assignee | ||
Updated•9 years ago
|
Attachment #8732588 -
Attachment is obsolete: true
Assignee | ||
Comment 12•9 years ago
|
||
try:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=b9756b313c2f
Please land the attachment 8732713 [details] [diff] [review] to m-c.
Keywords: checkin-needed
Comment 13•9 years ago
|
||
I'm confused, comment 10 was a follow-up push to inbound to fix typo, not a backout.
Keywords: checkin-needed
Comment 14•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a41a84351d7c
https://hg.mozilla.org/mozilla-central/rev/ed173749281d
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Assignee | ||
Comment 15•9 years ago
|
||
Attachment #8736561 -
Flags: review?(jgilbert)
Comment 16•9 years ago
|
||
Comment on attachment 8736561 [details] [diff] [review]
test case for webgl framebufferTexture2D(). v1
Review of attachment 8736561 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/canvas/test/webgl-mochitest/test_webgl_fuzzy_pattern.html
@@ +12,5 @@
> + var canvas = document.createElement('canvas');
> + canvas.id = 'webglCanvas';
> + canvas.height = 512;
> + canvas.width = 512;
> + document.body.appendChild(canvas);
No need for anything but the `var canvas...` line here, so remove them.
Attachment #8736561 -
Flags: review?(jgilbert) → review+
Assignee | ||
Comment 17•9 years ago
|
||
Attachment #8737055 -
Flags: review+
Assignee | ||
Updated•9 years ago
|
Attachment #8736561 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Attachment #8737055 -
Attachment is obsolete: true
Assignee | ||
Comment 19•9 years ago
|
||
Assignee | ||
Comment 20•9 years ago
|
||
Please land the attachment 8738945 [details] [diff] [review] to m-c after the attachment 8738944 [details] [diff] [review] in bug 1252414 landed.
mochitest for this bug.
Comment 21•9 years ago
|
||
bugherder landing |
Keywords: checkin-needed
Comment 22•9 years ago
|
||
bugherder |
Status: REOPENED → RESOLVED
Closed: 9 years ago → 9 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•