diff options
author | Fabian Bieler <fabianbieler@fastmail.fm> | 2013-04-22 23:00:37 +0200 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2013-05-08 14:53:56 -0700 |
commit | d7434fb92faff1d27239d83f6e5a40032bf40257 (patch) | |
tree | 06223af5b94be0c8912fd94a0e21ccdb35520a60 | |
parent | 3f7a43d7de4b1eb25d5f036edaed4fc6bf1522fb (diff) |
pragma-macro-expansion: changed to extension-macro-expansion.
From the GLSL 1.10 specification:
"If an implementation does not recognize the tokens following #pragma, then it
will ignore that pragma."
So even without macro expansion the directive
#pragma debug(FOO)
should be ignored and the shader should compile.
Reviewed-by: Eric Anholt <eric@anholt.net>
-rw-r--r-- | tests/spec/glsl-1.10/preprocessor/extension-macro-expansion.vert | 19 | ||||
-rw-r--r-- | tests/spec/glsl-1.10/preprocessor/pragma-macro-expansion.vert | 20 |
2 files changed, 19 insertions, 20 deletions
diff --git a/tests/spec/glsl-1.10/preprocessor/extension-macro-expansion.vert b/tests/spec/glsl-1.10/preprocessor/extension-macro-expansion.vert new file mode 100644 index 000000000..8d92d0b32 --- /dev/null +++ b/tests/spec/glsl-1.10/preprocessor/extension-macro-expansion.vert @@ -0,0 +1,19 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.10 + * [end config] + * + * Page 13 (page 19 of the PDF) of the GLSL 1.10 spec says: + * + * "Macro expansion is not done on lines containing #extension and #version + * directives." + * + * Therefore, FOO will not be replaced by a valid behavior token. + */ +#define FOO disable +#extension all : FOO + +/* Some compilers generate spurious errors if a shader does not contain + * any code or declarations. + */ +int foo(void) { return 1; } diff --git a/tests/spec/glsl-1.10/preprocessor/pragma-macro-expansion.vert b/tests/spec/glsl-1.10/preprocessor/pragma-macro-expansion.vert deleted file mode 100644 index febe6458b..000000000 --- a/tests/spec/glsl-1.10/preprocessor/pragma-macro-expansion.vert +++ /dev/null @@ -1,20 +0,0 @@ -/* [config] - * expect_result: fail - * glsl_version: 1.10 - * [end config] - * - * Page 11 (page 17 of the PDF) of the GLSL 1.10 spec says: - * - * "Tokens following #pragma are not subject to preprocessor macro - * expansion." - * - * Therefore, debug(FOO) will be recognized as is. Since debug can only take - * the parameters "on" or "off", this will generate an error. - */ -#define FOO on -#pragma debug(FOO) - -/* Some compilers generate spurious errors if a shader does not contain - * any code or declarations. - */ -int foo(void) { return 1; } |