OpenGL 2.0 says that forward declaring a function, like you did in your example, works. You can give the prototype, then call it, then provide the body. This feature is intentionally provided, and...
Type: Posts; User: John Kessenich
OpenGL 2.0 says that forward declaring a function, like you did in your example, works. You can give the prototype, then call it, then provide the body. This feature is intentionally provided, and...
Yes, the specification says this is not allowed. We will fix it.
Were you using an out of date or non-standard C++ compiler? On Windows, we went to the .NET version of the compiler a long time...
Generally, what you say is not true. Could you email me an example? For example, the code
if (false)
3 + 2.4;
gets a semantic error for mixing ints and floats.
It is true...
Does declaring the array as a uniform, and setting it from the application work? Should be high performing. The language supports indirect indexing into uniform arrays.
Good, I was just exploring "heavy-weight" linking issues, which was the perceived problem I was responding to.
Yes, there is a required link step, which serves several purposes, but it need not be...
I'm not yet believing a statement along the lines that OpenGL 2.0 specification requires a significantly heavier-weight link step than the alternatives do.
Some things to note:
* If you have...
Collecting several responses here...
* I am interested in community feedback for the next version of the language. Version 1.1 reflects some of this over version 1.0. Not all features were...
Some compiling may deferred until linking, and this is likely, as global optimizations can be done then. OGL2 only requires parsing and returning language-level errors at compile time.
However,...
FYI, The following matrices have been added to an interim version of the shading language spec. Hopefully, you'll see them in reality sometime soon.
uniform mat4 gl_ModelViewMatrixInverse;...
Yes, there is general agreement that a vendor won't change default behavior.
GLSL can be expanded. A vendor is allowed to extend the language to support their hardware.
I hope this is can be...
What about this C++ code?
void foo(int a, int b) {}
void foo(int a, float b) {}
void bar()
{
foo(1, 2);
foo(1.0, 2);
foo(1, 2.0);
The danger and ambiguity in doing autopromotion is most clear when doing signature matching to overloaded functions. A general autopromotion capability in the language must address these...
Hi,
As an author of the OpenGL Shading Language Specification, I'm concerned about its portability.
One thing the specification says regarding the motivation of a high-level language is Now, a...
Usually with languages, the compiler that catches the most errors is the better one.
A hardware vendor is allowed to extend the standard library. We should have no problems here.
Casts are...
Note that if a matrix really is stored in column major order (encouraged by the way OGL specs are written), then a matrix row really is 4 scattered floats. So, there is some connection between the...
A couple of notes:
1. This is dangerous, as it goes against the spec., encouraging the authoring of shaders that are not portable.
2. "2" is, in fact, absolutely, an integer, not a float. To...
This should not be accepted by the compiler. The specification requires array sizes to be known at compile time.
As justification, note that uniforms can be changed at each primitive, meaning...
In practice, it will be a combination of the hardware, the compiler, and even the particular case whether or not both paths of a selection are evaluated. Compilers will try to be smart based on what...