Dear all,
Can someone help me?
I just want to make clear if the two condition is sure in shading language.
1. define a function with unnamed arguments is not allowed in piglit.
> float a(float x, float )
> {
> return x;
> }
http://cgit.freedesktop.org/piglit/tree/tests/glslparsertest/glsl2/parameters-04.vert
2. declaration of function in function scope is allowed in piglit.
> void main() {
> float foo(float x);
> gl_FragColor = vec4(0.0, foo(0.5), 0.0, 1.0);
> }
http://cgit.freedesktop.org/piglit/tree/tests/glslparsertest/glsl2/local-function-03.frag
Thanks.
At 2013-11-25 16:08:28,chris <[email protected]> wrote:
This test should be pass but fail. (glslparsertest/glsl2/parameters-04.vert)
http://cgit.freedesktop.org/piglit/tree/tests/glslparsertest/glsl2/parameters-04.vert
// [config]
// expect_result: fail
// glsl_version: 1.10
//
// # NOTE: Config section was auto-generated from file
// # NOTE: 'glslparser.tests' at git revision
// # NOTE: 6cc17ae70b70d150aa1751f8e28db7b2a9bd50f0
// [end config]
/* FAIL - formal parameter lacks a name
*/
float a(float x, float )
{
return x;
}
glsl spec section 6.1.1
Hence, function definitions can have unnamed arguments.
The const qualifier cannot be used with out or inout, or a compile-time error
results. The above is used
both for function declarations (i.e., prototypes) and for function definitions.
Hence, function definitions
can have unnamed arguments.
_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit