Closed
Bug 745292
Opened 11 years ago
Closed 11 years ago
Log non-empty shader/program infoLogs as WebGL (JS) warnings
Categories
(Core :: Graphics: CanvasWebGL, defect)
Core
Graphics: CanvasWebGL
Tracking
()
RESOLVED
FIXED
mozilla15
People
(Reporter: bjacob, Assigned: bjacob)
Details
(Whiteboard: webgl-next)
Attachments
(1 file, 1 obsolete file)
12.51 KB,
patch
|
jgilbert
:
review+
|
Details | Diff | Splinter Review |
Will become really realistic once bug 743753 is resolved. Would be very helpful. Assumption here is that the infolog is always empty when there is no particular problem i.e. we don't have stupid compilers that write "Success!!!11!" to it.
Assignee | ||
Comment 1•11 years ago
|
||
Did some renaming of the new variable and constant introduced in bug 743753. See the comment about how in principle we can't get the shader infologs before glLinkProgram has been called. I wanted to have only one implementation of getting a shader/program's infolog, as that is a bit nontrivial (a shader infolog may come either from ANGLE or from the driver). Unfortunately GetShaderInfoLog converts to UTF16 which is useless for us here as JS warnings are 8bit strings. So I added overloads of Get{Shader,Program}InfoLog not doing the conversion. When a shader infolog has been reported, we don't report the program infolog as this is then, in most cases, just a less helpful duplicate of the information already given in the shader infolog.
Attachment #626806 -
Flags: review?(jgilbert)
Comment 2•11 years ago
|
||
Comment on attachment 626806 [details] [diff] [review] report shader/program infologs as warnings Review of attachment 626806 [details] [diff] [review]: ----------------------------------------------------------------- R- pending explanations. ::: content/canvas/src/WebGLContext.h @@ +1354,5 @@ > bool mDrawSinceContextLossTimerSet; > ContextStatus mContextStatus; > bool mContextLostErrorSet; > > + static const int sMaxWarningsToGenerate = 32; Yes this is static, but static+const should probably be 'kMaxWarningsToGenerate'. ::: content/canvas/src/WebGLContextUtils.cpp @@ +63,2 @@ > JS_ReportWarning(ccx, > "WebGL: no further warnings will be reported for this WebGL context " Surely 'no' should be capitalized? ::: content/canvas/src/WebGLContextValidate.cpp @@ +53,5 @@ > NS_ABORT_IF_FALSE(loc >= 0, "major oops in managing the attributes of a WebGL program"); > if (loc < mContext->mGLMaxVertexAttribs) { > mAttribsInUse[loc] = true; > } else { > + mContext->GenerateWarning("program exceeds MAX_VERTEX_ATTRIBS"); Is this actually not an InvalidOperation?
Attachment #626806 -
Flags: review?(jgilbert) → review-
Assignee | ||
Comment 3•11 years ago
|
||
(In reply to Jeff Gilbert [:jgilbert] from comment #2) > Comment on attachment 626806 [details] [diff] [review] > report shader/program infologs as warnings > > Review of attachment 626806 [details] [diff] [review]: > ----------------------------------------------------------------- > > R- pending explanations. > > ::: content/canvas/src/WebGLContext.h > @@ +1354,5 @@ > > bool mDrawSinceContextLossTimerSet; > > ContextStatus mContextStatus; > > bool mContextLostErrorSet; > > > > + static const int sMaxWarningsToGenerate = 32; > > Yes this is static, but static+const should probably be > 'kMaxWarningsToGenerate'. Actually, found a way to not even have to name this constant. > > ::: content/canvas/src/WebGLContextUtils.cpp > @@ +63,2 @@ > > JS_ReportWarning(ccx, > > "WebGL: no further warnings will be reported for this WebGL context " > > Surely 'no' should be capitalized? OK. > > ::: content/canvas/src/WebGLContextValidate.cpp > @@ +53,5 @@ > > NS_ABORT_IF_FALSE(loc >= 0, "major oops in managing the attributes of a WebGL program"); > > if (loc < mContext->mGLMaxVertexAttribs) { > > mAttribsInUse[loc] = true; > > } else { > > + mContext->GenerateWarning("program exceeds MAX_VERTEX_ATTRIBS"); > > Is this actually not an InvalidOperation? I don't think so: this WebGLProgram::UpdateInfo() is called upon program linking, this "program exceeds MAX_VERTEX_ATTRIBS" should simply be a program linking error, and program linking errors aren't GL errors.
Attachment #626806 -
Attachment is obsolete: true
Attachment #627212 -
Flags: review?(jgilbert)
Comment 4•11 years ago
|
||
Comment on attachment 627212 [details] [diff] [review] report shader/program infologs as warnings Review of attachment 627212 [details] [diff] [review]: ----------------------------------------------------------------- ::: content/canvas/src/WebGLContext.h @@ +1357,5 @@ > > + int mAlreadyGeneratedWarnings; > + > + bool ShouldGenerateWarnings() const { > + return mAlreadyGeneratedWarnings < 32; I don't love it, but it'll do.
Attachment #627212 -
Flags: review?(jgilbert) → review+
Assignee | ||
Comment 5•11 years ago
|
||
http://hg.mozilla.org/integration/mozilla-inbound/rev/90292e7ec6fb
Assignee: nobody → bjacob
Target Milestone: --- → mozilla15
Assignee | ||
Comment 6•11 years ago
|
||
Backed out: https://hg.mozilla.org/integration/mozilla-inbound/rev/e5ea5a2ba6f1 50465 ERROR TEST-UNEXPECTED-FAIL | /tests/content/canvas/test/webgl/test_webgl_conformance_test_suite.html | [conformance/context/context-lost.html] Test failed - gl.getProgramInfoLog(program) should be null (of type object). Was (of type string). 50468 ERROR TEST-UNEXPECTED-FAIL | /tests/content/canvas/test/webgl/test_webgl_conformance_test_suite.html | [conformance/context/context-lost.html] Test failed - gl.getShaderInfoLog(shader) should be null (of type object). Was (of type string).
Assignee | ||
Comment 7•11 years ago
|
||
New try: https://tbpl.mozilla.org/?tree=Try&rev=89d986d02cd4 Apparently, CopyASCIItoUTF16 doesn't preserve string voidness (nullity).
Assignee | ||
Comment 8•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/d92215a6eea1
Comment 9•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/d92215a6eea1
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•