diff options
author | Fabian Bieler <fabianbieler@fastmail.fm> | 2014-02-05 22:07:43 +0100 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2014-03-08 02:07:23 -0800 |
commit | 008dd254175c6f3e46e77c4ad533dfdd87f7d957 (patch) | |
tree | 129a88be3ef91dd781008d29822a092d874a4bd0 /src | |
parent | 1dff474b825da4d462a9396dfec55b95c03da9e8 (diff) |
glsl/gsraytrace: Use __LINE__ macro to set line numbers in GLSL source strings.
The hardcoded numbers are a few lines off at the moment.
Keeping track of the numbers through further modifications is inconvenient.
The __LINE__ "constant" takes care of this automatically.
v2: (by Kenneth Graunke) Don't specify the source string number
(caught by Ian Romanick).
Signed-off-by: Fabian Bieler <fabianbieler@fastmail.fm>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/glsl/gsraytrace.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/glsl/gsraytrace.cpp b/src/glsl/gsraytrace.cpp index 62a584d8..c21c667a 100644 --- a/src/glsl/gsraytrace.cpp +++ b/src/glsl/gsraytrace.cpp @@ -37,6 +37,10 @@ // TODO: use GL_EXT_transform_feedback or GL3 equivalent // TODO: port to piglit too +#define STRINGIFY_(x) #x +#define STRINGIFY(x) STRINGIFY_(x) +#define S__LINE__ STRINGIFY(__LINE__) + static const float INF=9999.9F; static int Win; @@ -67,7 +71,7 @@ float rot[9] = {1,0,0, 0,1,0, 0,0,1}; static const char* vsSource = " \n" "#version 120 \n" -"#line 63 63 \n" +"#line " S__LINE__ "\n" "#define SHADOWS \n" "#define RECURSION \n" " \n" @@ -249,7 +253,7 @@ static const char* vsSource = static const char* gsSource = "#version 120 \n" -"#line 245 245 \n" +"#line " S__LINE__ "\n" "#extension GL_ARB_geometry_shader4: require \n" " \n" "#define SHADOWS \n" @@ -388,7 +392,7 @@ static const char* gsSource = static const char* fsSource = "#version 120 \n" -"#line 384 384 \n" +"#line " S__LINE__ "\n" " \n" "#define SHADOWS \n" "#define RECURSION \n" |