I thought it should be the line number also, but as I said I know it is 0-based because I have seen others who have this warning but with 0’s.
Additionally, I can freely add some blank lines, remove commented-out lines, etc., to move the lines of my declarations, but it always prints 4:1:, regardless of the actual line number of any of my declarations.
My fragment shader gives me:
WARNING: 0:5: warning(#239) Declaration should include a precision qualifier or the default precision should have been previously declaredLine 0??
#version 140?? This 4:1: and 0:5: junk is useless!
And
mediump is a so-far literally useless keyword that is not implemented.
Not even documented in my
OpenGL Shading Language Third Edition book. It is somehow related to OpenGL ES, but still not implemented.
Making this warning all-in-all entirely senseless, useless, and annoying.
Why do I care so much?
#1: I do not write code that generates warnings. Period. In fact it was MY idea at the office that anyone who submits warning-generating code on Friday has to pay 500円 per
warning.
#2: If you search for this exact string of text, you will find a variation of it:
ERROR: 0:2: '' : Declaration must include a precision qualifier or the default precision must have been previously declared.Which means at some point, either when I move to a newer version or to a lower version (as I will in order to maximize compatibility) I will get an error instead of a warning, and I will have to solve this.
Now here is the kicker.
I had already searched for this warning string before posting here but never saw anyone asking how to actually fix it. They just reported it along with a mess of other warnings/errors.
But just now when I went to get the ERROR version of this warning I found this:
http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=253424
You have to take a close look but someone finally posted a solution there.
precision mediump float;
And it nearly makes me just as unhappy.
OpenGL Shading Language Third Edition uses version 140 throughout and is meant to be an up-to-date reference for 140.
Yet “precision” isn’t in the index, and there are no example shaders using this keyword.
If lacking this line of code is guaranteed to cause a warning on every single shader in the book, it might be a good idea to address this issue in the book!
In fact “mediump” isn’t in the book either.
And doing my own research found me this:
http://www.opengl.org/registry/doc/GLSLangSpec.Full.1.40.05.pdf
The spec
does mention it, but you would already have to know what it is to know that it is relevant to this warning, especially after I already tried putting mediump in front of every variable with no luck.
I
still do not know what 4:1: and 0:5: were supposed to mean.
Yogurt Emperor