Closed
Bug 746740
Opened 13 years ago
Closed 13 years ago
Should GetProgramInfoLog throw if fGetProgramiv returns a -1?
Categories
(Core :: Graphics: CanvasWebGL, defect)
Tracking
()
RESOLVED
FIXED
mozilla15
People
(Reporter: bzbarsky, Assigned: jgilbert)
Details
(Whiteboard: webgl-conformance)
Attachments
(1 file, 1 obsolete file)
|
910 bytes,
patch
|
bjacob
:
review+
|
Details | Diff | Splinter Review |
2684 GLint k = -1;
2685 gl->fGetProgramiv(progname, LOCAL_GL_INFO_LOG_LENGTH, &k);
2686 if (k == -1)
2687 return NS_ERROR_FAILURE; // XXX GL error? shouldn't happen!
Updated•13 years ago
|
Whiteboard: webgl-conformance
| Assignee | ||
Comment 1•13 years ago
|
||
GL_INFO_LOG_LENGTH should return the (positive) length or 0, unless there is a GL error, in which case the contents of the param are guaranteed to not be changed.
GL_INVALID_ENUM: if pname is not an accepted value. (not relevant here)
GL_INVALID_VALUE: if program is not a value generated by OpenGL.
GL_INVALID_OPERATION: if program does not refer to a program object.
WebGL is almost certainly similar, so we should just propagate the error, which I believe is automatic. I think standard procedure is to return NS_OK and be sure we didn't touch the output.
| Assignee | ||
Comment 2•13 years ago
|
||
Comment 3•13 years ago
|
||
(In reply to Jeff Gilbert [:jgilbert] from comment #2)
> Created attachment 616347 [details] [diff] [review]
> Patch
Wouldn't this patch make the function return "undefined" to JavaScript?
This should be null, or preferably empty string imho (I'll open a thread on the WebGL mailing list about this).
| Reporter | ||
Comment 4•13 years ago
|
||
> Wouldn't this patch make the function return "undefined" to JavaScript?
It would make the function return emptystring. There is no way for this function to return undefined.
Comment 5•13 years ago
|
||
Comment on attachment 616347 [details] [diff] [review]
Patch
Review of attachment 616347 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/canvas/src/WebGLContextGL.cpp
@@ +2683,5 @@
>
> GLint k = -1;
> gl->fGetProgramiv(progname, LOCAL_GL_INFO_LOG_LENGTH, &k);
> if (k == -1)
> + return NS_OK; // GL error occurred, so bail before we do anything.
I would keep the ? from the comment: it is mysterious why this would ever happen.
Attachment #616347 -
Flags: review?(bjacob) → review+
| Assignee | ||
Comment 6•13 years ago
|
||
(In reply to Benoit Jacob [:bjacob] from comment #5)
> Comment on attachment 616347 [details] [diff] [review]
> Patch
>
> Review of attachment 616347 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: content/canvas/src/WebGLContextGL.cpp
> @@ +2683,5 @@
> >
> > GLint k = -1;
> > gl->fGetProgramiv(progname, LOCAL_GL_INFO_LOG_LENGTH, &k);
> > if (k == -1)
> > + return NS_OK; // GL error occurred, so bail before we do anything.
>
> I would keep the ? from the comment: it is mysterious why this would ever
> happen.
If we shouldn't ever get this, we should at least crash out here on debug.
| Assignee | ||
Updated•13 years ago
|
Attachment #616347 -
Flags: feedback?(jgilbert)
Comment 7•13 years ago
|
||
Jeff, can you close the loop on this one? Trying to reduce the list of open conformance bugs.
| Assignee | ||
Comment 8•13 years ago
|
||
Comment on attachment 616347 [details] [diff] [review]
Patch
Review of attachment 616347 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/canvas/src/WebGLContextGL.cpp
@@ +2683,5 @@
>
> GLint k = -1;
> gl->fGetProgramiv(progname, LOCAL_GL_INFO_LOG_LENGTH, &k);
> if (k == -1)
> + return NS_OK; // GL error occurred, so bail before we do anything.
This needs to set retval to null with |retval.SetIsVoid(true)| before returning.
Attachment #616347 -
Flags: feedback?(jgilbert) → feedback-
| Assignee | ||
Comment 9•13 years ago
|
||
Attachment #616347 -
Attachment is obsolete: true
Attachment #628468 -
Flags: review?(bjacob)
Updated•13 years ago
|
Attachment #628468 -
Flags: review?(bjacob) → review+
| Assignee | ||
Comment 10•13 years ago
|
||
Target Milestone: --- → mozilla15
Comment 11•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•