Author Topic: [PATCH] Replace double underscores in GLSL macro names  (Read 1830 times)

0 Members and 1 Guest are viewing this topic.

Offline Plombo

  • 23
[PATCH] Replace double underscores in GLSL macro names
All versions of the GLSL specification contain the following text:
Quote
In addition, all identifiers containing two consecutive underscores (__) are reserved as possible future keywords.

Accordingly, this patch replaces all macro names containing double underscores.  The GLSL compiler in Mesa actually enforces this strictly, so the benefit is practical and not just theoretical.

Well, I suppose it is made slightly more theoretical by the fact that Mesa still doesn't support GL_EXT_gpu_shader4.  But it does support GLSL 1.30, so adding EXT_gpu_shader4 support to Mesa would just be a matter of tweaking some things in the parser.  I'll look into that.

Since it's not obvious from the patch itself, the patch was generated against r9660 of SVN.

Code: [Select]
---
 code/globalincs/def_files.cpp            |  316 +++++++++++++++---------------
 code/graphics/gropenglpostprocessing.cpp |   80 ++++----
 2 files changed, 198 insertions(+), 198 deletions(-)

diff --git a/code/globalincs/def_files.cpp b/code/globalincs/def_files.cpp
index 302a7a2..b413d16 100644
--- a/code/globalincs/def_files.cpp
+++ b/code/globalincs/def_files.cpp
@@ -1634,110 +1634,110 @@ char* Default_fxaa_fragment_shader =
 " #define FXAA_GATHER4_ALPHA 0\n"
 " #endif\n"
 "#endif\n"
-"#if (FXAA_QUALITY__PRESET == 10)\n"
-" #define FXAA_QUALITY__PS 3\n"
-" #define FXAA_QUALITY__P0 1.5\n"
-" #define FXAA_QUALITY__P1 3.0\n"
-" #define FXAA_QUALITY__P2 12.0\n"
+"#if (FXAA_QUALITY_PRESET == 10)\n"
+" #define FXAA_QUALITY_PS 3\n"
+" #define FXAA_QUALITY_P0 1.5\n"
+" #define FXAA_QUALITY_P1 3.0\n"
+" #define FXAA_QUALITY_P2 12.0\n"
 "#endif\n"
-"#if (FXAA_QUALITY__PRESET == 11)\n"
-" #define FXAA_QUALITY__PS 4\n"
-" #define FXAA_QUALITY__P0 1.0\n"
-" #define FXAA_QUALITY__P1 1.5\n"
-" #define FXAA_QUALITY__P2 3.0\n"
-" #define FXAA_QUALITY__P3 12.0\n"
+"#if (FXAA_QUALITY_PRESET == 11)\n"
+" #define FXAA_QUALITY_PS 4\n"
+" #define FXAA_QUALITY_P0 1.0\n"
+" #define FXAA_QUALITY_P1 1.5\n"
+" #define FXAA_QUALITY_P2 3.0\n"
+" #define FXAA_QUALITY_P3 12.0\n"
 "#endif\n"
-"#if (FXAA_QUALITY__PRESET == 12)\n"
-" #define FXAA_QUALITY__PS 5\n"
-" #define FXAA_QUALITY__P0 1.0\n"
-" #define FXAA_QUALITY__P1 1.5\n"
-" #define FXAA_QUALITY__P2 2.0\n"
-" #define FXAA_QUALITY__P3 4.0\n"
-" #define FXAA_QUALITY__P4 12.0\n"
+"#if (FXAA_QUALITY_PRESET == 12)\n"
+" #define FXAA_QUALITY_PS 5\n"
+" #define FXAA_QUALITY_P0 1.0\n"
+" #define FXAA_QUALITY_P1 1.5\n"
+" #define FXAA_QUALITY_P2 2.0\n"
+" #define FXAA_QUALITY_P3 4.0\n"
+" #define FXAA_QUALITY_P4 12.0\n"
 "#endif\n"
-"#if (FXAA_QUALITY__PRESET == 13)\n"
-" #define FXAA_QUALITY__PS 6\n"
-" #define FXAA_QUALITY__P0 1.0\n"
-" #define FXAA_QUALITY__P1 1.5\n"
-" #define FXAA_QUALITY__P2 2.0\n"
-" #define FXAA_QUALITY__P3 2.0\n"
-" #define FXAA_QUALITY__P4 4.0\n"
-" #define FXAA_QUALITY__P5 12.0\n"
+"#if (FXAA_QUALITY_PRESET == 13)\n"
+" #define FXAA_QUALITY_PS 6\n"
+" #define FXAA_QUALITY_P0 1.0\n"
+" #define FXAA_QUALITY_P1 1.5\n"
+" #define FXAA_QUALITY_P2 2.0\n"
+" #define FXAA_QUALITY_P3 2.0\n"
+" #define FXAA_QUALITY_P4 4.0\n"
+" #define FXAA_QUALITY_P5 12.0\n"
 "#endif\n"
-"#if (FXAA_QUALITY__PRESET == 14)\n"
-" #define FXAA_QUALITY__PS 7\n"
-" #define FXAA_QUALITY__P0 1.0\n"
-" #define FXAA_QUALITY__P1 1.5\n"
-" #define FXAA_QUALITY__P2 2.0\n"
-" #define FXAA_QUALITY__P3 2.0\n"
-" #define FXAA_QUALITY__P4 2.0\n"
-" #define FXAA_QUALITY__P5 4.0\n"
-" #define FXAA_QUALITY__P6 12.0\n"
+"#if (FXAA_QUALITY_PRESET == 14)\n"
+" #define FXAA_QUALITY_PS 7\n"
+" #define FXAA_QUALITY_P0 1.0\n"
+" #define FXAA_QUALITY_P1 1.5\n"
+" #define FXAA_QUALITY_P2 2.0\n"
+" #define FXAA_QUALITY_P3 2.0\n"
+" #define FXAA_QUALITY_P4 2.0\n"
+" #define FXAA_QUALITY_P5 4.0\n"
+" #define FXAA_QUALITY_P6 12.0\n"
 "#endif\n"
-"#if (FXAA_QUALITY__PRESET == 25)\n"
-" #define FXAA_QUALITY__PS 8\n"
-" #define FXAA_QUALITY__P0 1.0\n"
-" #define FXAA_QUALITY__P1 1.5\n"
-" #define FXAA_QUALITY__P2 2.0\n"
-" #define FXAA_QUALITY__P3 2.0\n"
-" #define FXAA_QUALITY__P4 2.0\n"
-" #define FXAA_QUALITY__P5 2.0\n"
-" #define FXAA_QUALITY__P6 4.0\n"
-" #define FXAA_QUALITY__P7 8.0\n"
+"#if (FXAA_QUALITY_PRESET == 25)\n"
+" #define FXAA_QUALITY_PS 8\n"
+" #define FXAA_QUALITY_P0 1.0\n"
+" #define FXAA_QUALITY_P1 1.5\n"
+" #define FXAA_QUALITY_P2 2.0\n"
+" #define FXAA_QUALITY_P3 2.0\n"
+" #define FXAA_QUALITY_P4 2.0\n"
+" #define FXAA_QUALITY_P5 2.0\n"
+" #define FXAA_QUALITY_P6 4.0\n"
+" #define FXAA_QUALITY_P7 8.0\n"
 "#endif\n"
-"#if (FXAA_QUALITY__PRESET == 26)\n"
-" #define FXAA_QUALITY__PS 9\n"
-" #define FXAA_QUALITY__P0 1.0\n"
-" #define FXAA_QUALITY__P1 1.5\n"
-" #define FXAA_QUALITY__P2 2.0\n"
-" #define FXAA_QUALITY__P3 2.0\n"
-" #define FXAA_QUALITY__P4 2.0\n"
-" #define FXAA_QUALITY__P5 2.0\n"
-" #define FXAA_QUALITY__P6 2.0\n"
-" #define FXAA_QUALITY__P7 4.0\n"
-" #define FXAA_QUALITY__P8 8.0\n"
+"#if (FXAA_QUALITY_PRESET == 26)\n"
+" #define FXAA_QUALITY_PS 9\n"
+" #define FXAA_QUALITY_P0 1.0\n"
+" #define FXAA_QUALITY_P1 1.5\n"
+" #define FXAA_QUALITY_P2 2.0\n"
+" #define FXAA_QUALITY_P3 2.0\n"
+" #define FXAA_QUALITY_P4 2.0\n"
+" #define FXAA_QUALITY_P5 2.0\n"
+" #define FXAA_QUALITY_P6 2.0\n"
+" #define FXAA_QUALITY_P7 4.0\n"
+" #define FXAA_QUALITY_P8 8.0\n"
 "#endif\n"
-"#if (FXAA_QUALITY__PRESET == 27)\n"
-" #define FXAA_QUALITY__PS 10\n"
-" #define FXAA_QUALITY__P0 1.0\n"
-" #define FXAA_QUALITY__P1 1.5\n"
-" #define FXAA_QUALITY__P2 2.0\n"
-" #define FXAA_QUALITY__P3 2.0\n"
-" #define FXAA_QUALITY__P4 2.0\n"
-" #define FXAA_QUALITY__P5 2.0\n"
-" #define FXAA_QUALITY__P6 2.0\n"
-" #define FXAA_QUALITY__P7 2.0\n"
-" #define FXAA_QUALITY__P8 4.0\n"
-" #define FXAA_QUALITY__P9 8.0\n"
+"#if (FXAA_QUALITY_PRESET == 27)\n"
+" #define FXAA_QUALITY_PS 10\n"
+" #define FXAA_QUALITY_P0 1.0\n"
+" #define FXAA_QUALITY_P1 1.5\n"
+" #define FXAA_QUALITY_P2 2.0\n"
+" #define FXAA_QUALITY_P3 2.0\n"
+" #define FXAA_QUALITY_P4 2.0\n"
+" #define FXAA_QUALITY_P5 2.0\n"
+" #define FXAA_QUALITY_P6 2.0\n"
+" #define FXAA_QUALITY_P7 2.0\n"
+" #define FXAA_QUALITY_P8 4.0\n"
+" #define FXAA_QUALITY_P9 8.0\n"
 "#endif\n"
-"#if (FXAA_QUALITY__PRESET == 28)\n"
-" #define FXAA_QUALITY__PS 11\n"
-" #define FXAA_QUALITY__P0 1.0\n"
-" #define FXAA_QUALITY__P1 1.5\n"
-" #define FXAA_QUALITY__P2 2.0\n"
-" #define FXAA_QUALITY__P3 2.0\n"
-" #define FXAA_QUALITY__P4 2.0\n"
-" #define FXAA_QUALITY__P5 2.0\n"
-" #define FXAA_QUALITY__P6 2.0\n"
-" #define FXAA_QUALITY__P7 2.0\n"
-" #define FXAA_QUALITY__P8 2.0\n"
-" #define FXAA_QUALITY__P9 4.0\n"
-" #define FXAA_QUALITY__P10 8.0\n"
+"#if (FXAA_QUALITY_PRESET == 28)\n"
+" #define FXAA_QUALITY_PS 11\n"
+" #define FXAA_QUALITY_P0 1.0\n"
+" #define FXAA_QUALITY_P1 1.5\n"
+" #define FXAA_QUALITY_P2 2.0\n"
+" #define FXAA_QUALITY_P3 2.0\n"
+" #define FXAA_QUALITY_P4 2.0\n"
+" #define FXAA_QUALITY_P5 2.0\n"
+" #define FXAA_QUALITY_P6 2.0\n"
+" #define FXAA_QUALITY_P7 2.0\n"
+" #define FXAA_QUALITY_P8 2.0\n"
+" #define FXAA_QUALITY_P9 4.0\n"
+" #define FXAA_QUALITY_P10 8.0\n"
 "#endif\n"
-"#if (FXAA_QUALITY__PRESET == 39)\n"
-" #define FXAA_QUALITY__PS 12\n"
-" #define FXAA_QUALITY__P0 1.0\n"
-" #define FXAA_QUALITY__P1 1.0\n"
-" #define FXAA_QUALITY__P2 1.0\n"
-" #define FXAA_QUALITY__P3 1.0\n"
-" #define FXAA_QUALITY__P4 1.0\n"
-" #define FXAA_QUALITY__P5 1.5\n"
-" #define FXAA_QUALITY__P6 2.0\n"
-" #define FXAA_QUALITY__P7 2.0\n"
-" #define FXAA_QUALITY__P8 2.0\n"
-" #define FXAA_QUALITY__P9 2.0\n"
-" #define FXAA_QUALITY__P10 4.0\n"
-" #define FXAA_QUALITY__P11 8.0\n"
+"#if (FXAA_QUALITY_PRESET == 39)\n"
+" #define FXAA_QUALITY_PS 12\n"
+" #define FXAA_QUALITY_P0 1.0\n"
+" #define FXAA_QUALITY_P1 1.0\n"
+" #define FXAA_QUALITY_P2 1.0\n"
+" #define FXAA_QUALITY_P3 1.0\n"
+" #define FXAA_QUALITY_P4 1.0\n"
+" #define FXAA_QUALITY_P5 1.5\n"
+" #define FXAA_QUALITY_P6 2.0\n"
+" #define FXAA_QUALITY_P7 2.0\n"
+" #define FXAA_QUALITY_P8 2.0\n"
+" #define FXAA_QUALITY_P9 2.0\n"
+" #define FXAA_QUALITY_P10 4.0\n"
+" #define FXAA_QUALITY_P11 8.0\n"
 "#endif\n"
 "#if (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)\n"
 " #define FxaaBool bool\n"
@@ -1896,11 +1896,11 @@ char* Default_fxaa_fragment_shader =
 " if (!horzSpan) posB.x += lengthSign * 0.5;\n"
 " if (horzSpan) posB.y += lengthSign * 0.5;\n"
 " FxaaFloat2 posN;\n"
-" posN.x = posB.x - offNP.x * FXAA_QUALITY__P0;\n"
-" posN.y = posB.y - offNP.y * FXAA_QUALITY__P0;\n"
+" posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;\n"
+" posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;\n"
 " FxaaFloat2 posP;\n"
-" posP.x = posB.x + offNP.x * FXAA_QUALITY__P0;\n"
-" posP.y = posB.y + offNP.y * FXAA_QUALITY__P0;\n"
+" posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;\n"
+" posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;\n"
 " FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;\n"
 " FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));\n"
 " FxaaFloat subpixE = subpixC * subpixC;\n"
@@ -1914,11 +1914,11 @@ char* Default_fxaa_fragment_shader =
 " lumaEndP -= lumaNN * 0.5;\n"
 " FxaaBool doneN = abs(lumaEndN) >= gradientScaled;\n"
 " FxaaBool doneP = abs(lumaEndP) >= gradientScaled;\n"
-" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P1;\n"
-" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P1;\n"
+" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;\n"
+" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;\n"
 " FxaaBool doneNP = (!doneN) || (!doneP);\n"
-" if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P1;\n"
-" if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P1;\n"
+" if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;\n"
+" if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;\n"
 " if (doneNP) {\n"
 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
@@ -1926,12 +1926,12 @@ char* Default_fxaa_fragment_shader =
 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
 " doneN = abs(lumaEndN) >= gradientScaled;\n"
 " doneP = abs(lumaEndP) >= gradientScaled;\n"
-" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P2;\n"
-" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P2;\n"
+" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;\n"
+" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;\n"
 " doneNP = (!doneN) || (!doneP);\n"
-" if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P2;\n"
-" if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P2;\n"
-" #if (FXAA_QUALITY__PS > 3)\n"
+" if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;\n"
+" if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;\n"
+" #if (FXAA_QUALITY_PS > 3)\n"
 " if (doneNP) {\n"
 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
@@ -1939,12 +1939,12 @@ char* Default_fxaa_fragment_shader =
 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
 " doneN = abs(lumaEndN) >= gradientScaled;\n"
 " doneP = abs(lumaEndP) >= gradientScaled;\n"
-" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P3;\n"
-" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P3;\n"
+" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;\n"
+" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;\n"
 " doneNP = (!doneN) || (!doneP);\n"
-" if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P3;\n"
-" if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P3;\n"
-" #if (FXAA_QUALITY__PS > 4)\n"
+" if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;\n"
+" if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;\n"
+" #if (FXAA_QUALITY_PS > 4)\n"
 " if (doneNP) {\n"
 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
@@ -1952,12 +1952,12 @@ char* Default_fxaa_fragment_shader =
 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
 " doneN = abs(lumaEndN) >= gradientScaled;\n"
 " doneP = abs(lumaEndP) >= gradientScaled;\n"
-" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P4;\n"
-" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P4;\n"
+" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;\n"
+" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;\n"
 " doneNP = (!doneN) || (!doneP);\n"
-" if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P4;\n"
-" if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P4;\n"
-" #if (FXAA_QUALITY__PS > 5)\n"
+" if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;\n"
+" if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;\n"
+" #if (FXAA_QUALITY_PS > 5)\n"
 " if (doneNP) {\n"
 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
@@ -1965,12 +1965,12 @@ char* Default_fxaa_fragment_shader =
 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
 " doneN = abs(lumaEndN) >= gradientScaled;\n"
 " doneP = abs(lumaEndP) >= gradientScaled;\n"
-" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P5;\n"
-" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P5;\n"
+" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;\n"
+" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;\n"
 " doneNP = (!doneN) || (!doneP);\n"
-" if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P5;\n"
-" if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P5;\n"
-" #if (FXAA_QUALITY__PS > 6)\n"
+" if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;\n"
+" if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;\n"
+" #if (FXAA_QUALITY_PS > 6)\n"
 " if (doneNP) {\n"
 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
@@ -1978,12 +1978,12 @@ char* Default_fxaa_fragment_shader =
 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
 " doneN = abs(lumaEndN) >= gradientScaled;\n"
 " doneP = abs(lumaEndP) >= gradientScaled;\n"
-" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P6;\n"
-" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P6;\n"
+" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;\n"
+" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;\n"
 " doneNP = (!doneN) || (!doneP);\n"
-" if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P6;\n"
-" if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P6;\n"
-" #if (FXAA_QUALITY__PS > 7)\n"
+" if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;\n"
+" if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;\n"
+" #if (FXAA_QUALITY_PS > 7)\n"
 " if (doneNP) {\n"
 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
@@ -1991,12 +1991,12 @@ char* Default_fxaa_fragment_shader =
 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
 " doneN = abs(lumaEndN) >= gradientScaled;\n"
 " doneP = abs(lumaEndP) >= gradientScaled;\n"
-" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P7;\n"
-" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P7;\n"
+" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;\n"
+" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;\n"
 " doneNP = (!doneN) || (!doneP);\n"
-" if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P7;\n"
-" if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P7;\n"
-" #if (FXAA_QUALITY__PS > 8)\n"
+" if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;\n"
+" if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;\n"
+" #if (FXAA_QUALITY_PS > 8)\n"
 " if (doneNP) {\n"
 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
@@ -2004,12 +2004,12 @@ char* Default_fxaa_fragment_shader =
 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
 " doneN = abs(lumaEndN) >= gradientScaled;\n"
 " doneP = abs(lumaEndP) >= gradientScaled;\n"
-" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P8;\n"
-" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P8;\n"
+" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;\n"
+" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;\n"
 " doneNP = (!doneN) || (!doneP);\n"
-" if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P8;\n"
-" if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P8;\n"
-" #if (FXAA_QUALITY__PS > 9)\n"
+" if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;\n"
+" if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;\n"
+" #if (FXAA_QUALITY_PS > 9)\n"
 " if (doneNP) {\n"
 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
@@ -2017,12 +2017,12 @@ char* Default_fxaa_fragment_shader =
 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
 " doneN = abs(lumaEndN) >= gradientScaled;\n"
 " doneP = abs(lumaEndP) >= gradientScaled;\n"
-" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P9;\n"
-" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P9;\n"
+" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;\n"
+" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;\n"
 " doneNP = (!doneN) || (!doneP);\n"
-" if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P9;\n"
-" if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P9;\n"
-" #if (FXAA_QUALITY__PS > 10)\n"
+" if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;\n"
+" if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;\n"
+" #if (FXAA_QUALITY_PS > 10)\n"
 " if (doneNP) {\n"
 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
@@ -2030,12 +2030,12 @@ char* Default_fxaa_fragment_shader =
 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
 " doneN = abs(lumaEndN) >= gradientScaled;\n"
 " doneP = abs(lumaEndP) >= gradientScaled;\n"
-" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P10;\n"
-" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P10;\n"
+" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;\n"
+" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;\n"
 " doneNP = (!doneN) || (!doneP);\n"
-" if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P10;\n"
-" if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P10;\n"
-" #if (FXAA_QUALITY__PS > 11)\n"
+" if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;\n"
+" if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;\n"
+" #if (FXAA_QUALITY_PS > 11)\n"
 " if (doneNP) {\n"
 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
@@ -2043,12 +2043,12 @@ char* Default_fxaa_fragment_shader =
 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
 " doneN = abs(lumaEndN) >= gradientScaled;\n"
 " doneP = abs(lumaEndP) >= gradientScaled;\n"
-" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P11;\n"
-" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P11;\n"
+" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;\n"
+" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;\n"
 " doneNP = (!doneN) || (!doneP);\n"
-" if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P11;\n"
-" if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P11;\n"
-" #if (FXAA_QUALITY__PS > 12)\n"
+" if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;\n"
+" if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;\n"
+" #if (FXAA_QUALITY_PS > 12)\n"
 " if (doneNP) {\n"
 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
@@ -2056,11 +2056,11 @@ char* Default_fxaa_fragment_shader =
 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
 " doneN = abs(lumaEndN) >= gradientScaled;\n"
 " doneP = abs(lumaEndP) >= gradientScaled;\n"
-" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P12;\n"
-" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P12;\n"
+" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;\n"
+" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;\n"
 " doneNP = (!doneN) || (!doneP);\n"
-" if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P12;\n"
-" if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P12;\n"
+" if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;\n"
+" if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;\n"
 " }\n"
 " #endif\n"
 " }\n"
@@ -2110,7 +2110,7 @@ char* Default_fxaa_fragment_shader =
 "varying vec2 v_rcpFrame;\n"
 "noperspective varying vec2 v_pos;\n"
 "void main() {\n"
-" gl_FragColor = FxaaPixelShader(v_pos, tex0, v_rcpFrame, FXAA_QUALITY__SUBPIX, FXAA_QUALITY__EDGE_THRESHOLD, FXAA_QUALITY__EDGE_THRESHOLD_MIN);\n"
+" gl_FragColor = FxaaPixelShader(v_pos, tex0, v_rcpFrame, FXAA_QUALITY_SUBPIX, FXAA_QUALITY_EDGE_THRESHOLD, FXAA_QUALITY_EDGE_THRESHOLD_MIN);\n"
 "}";
 
 char *Default_blur_fragment_shader =
diff --git a/code/graphics/gropenglpostprocessing.cpp b/code/graphics/gropenglpostprocessing.cpp
index b461cb0..996be14 100644
--- a/code/graphics/gropenglpostprocessing.cpp
+++ b/code/graphics/gropenglpostprocessing.cpp
@@ -824,65 +824,65 @@ static char *opengl_post_load_shader(char *filename, int flags, int flags2)
 
  switch (Cmdline_fxaa_preset) {
  case 0:
- sflags += "#define FXAA_QUALITY__PRESET 10\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD (1.0/6.0)\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD_MIN (1.0/12.0)\n";
- sflags += "#define FXAA_QUALITY__SUBPIX 0.33\n";
+ sflags += "#define FXAA_QUALITY_PRESET 10\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD (1.0/6.0)\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD_MIN (1.0/12.0)\n";
+ sflags += "#define FXAA_QUALITY_SUBPIX 0.33\n";
  break;
  case 1:
- sflags += "#define FXAA_QUALITY__PRESET 11\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD (1.0/7.0)\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD_MIN (1.0/14.0)\n";
- sflags += "#define FXAA_QUALITY__SUBPIX 0.33\n";
+ sflags += "#define FXAA_QUALITY_PRESET 11\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD (1.0/7.0)\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD_MIN (1.0/14.0)\n";
+ sflags += "#define FXAA_QUALITY_SUBPIX 0.33\n";
  break;
  case 2:
- sflags += "#define FXAA_QUALITY__PRESET 12\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD (1.0/8.0)\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD_MIN (1.0/16.0)\n";
- sflags += "#define FXAA_QUALITY__SUBPIX 0.33\n";
+ sflags += "#define FXAA_QUALITY_PRESET 12\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD (1.0/8.0)\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD_MIN (1.0/16.0)\n";
+ sflags += "#define FXAA_QUALITY_SUBPIX 0.33\n";
  break;
  case 3:
- sflags += "#define FXAA_QUALITY__PRESET 13\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD (1.0/9.0)\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD_MIN (1.0/18.0)\n";
- sflags += "#define FXAA_QUALITY__SUBPIX 0.33\n";
+ sflags += "#define FXAA_QUALITY_PRESET 13\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD (1.0/9.0)\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD_MIN (1.0/18.0)\n";
+ sflags += "#define FXAA_QUALITY_SUBPIX 0.33\n";
  break;
  case 4:
- sflags += "#define FXAA_QUALITY__PRESET 14\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD (1.0/10.0)\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD_MIN (1.0/20.0)\n";
- sflags += "#define FXAA_QUALITY__SUBPIX 0.33\n";
+ sflags += "#define FXAA_QUALITY_PRESET 14\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD (1.0/10.0)\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD_MIN (1.0/20.0)\n";
+ sflags += "#define FXAA_QUALITY_SUBPIX 0.33\n";
  break;
  case 5:
- sflags += "#define FXAA_QUALITY__PRESET 25\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD (1.0/11.0)\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD_MIN (1.0/22.0)\n";
- sflags += "#define FXAA_QUALITY__SUBPIX 0.33\n";
+ sflags += "#define FXAA_QUALITY_PRESET 25\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD (1.0/11.0)\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD_MIN (1.0/22.0)\n";
+ sflags += "#define FXAA_QUALITY_SUBPIX 0.33\n";
  break;
  case 6:
- sflags += "#define FXAA_QUALITY__PRESET 26\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD (1.0/12.0)\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD_MIN (1.0/24.0)\n";
- sflags += "#define FXAA_QUALITY__SUBPIX 0.33\n";
+ sflags += "#define FXAA_QUALITY_PRESET 26\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD (1.0/12.0)\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD_MIN (1.0/24.0)\n";
+ sflags += "#define FXAA_QUALITY_SUBPIX 0.33\n";
  break;
  case 7:
  sflags += "#define FXAA_PC 1\n";
- sflags += "#define FXAA_QUALITY__PRESET 27\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD (1.0/13.0)\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD_MIN (1.0/26.0)\n";
- sflags += "#define FXAA_QUALITY__SUBPIX 0.33\n";
+ sflags += "#define FXAA_QUALITY_PRESET 27\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD (1.0/13.0)\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD_MIN (1.0/26.0)\n";
+ sflags += "#define FXAA_QUALITY_SUBPIX 0.33\n";
  break;
  case 8:
- sflags += "#define FXAA_QUALITY__PRESET 28\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD (1.0/14.0)\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD_MIN (1.0/28.0)\n";
- sflags += "#define FXAA_QUALITY__SUBPIX 0.33\n";
+ sflags += "#define FXAA_QUALITY_PRESET 28\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD (1.0/14.0)\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD_MIN (1.0/28.0)\n";
+ sflags += "#define FXAA_QUALITY_SUBPIX 0.33\n";
  break;
  case 9:
- sflags += "#define FXAA_QUALITY__PRESET 39\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD (1.0/15.0)\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD_MIN (1.0/32.0)\n";
- sflags += "#define FXAA_QUALITY__SUBPIX 0.33\n";
+ sflags += "#define FXAA_QUALITY_PRESET 39\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD (1.0/15.0)\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD_MIN (1.0/32.0)\n";
+ sflags += "#define FXAA_QUALITY_SUBPIX 0.33\n";
  break;
  }
 
--
1.7.9.5


 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: [PATCH] Replace double underscores in GLSL macro names
Mesa, why you so silly. The common implementation of glsl reserves identifiers starting with two underscores (because that's the tradition), not all identifiers that contain them.

Also: we're not using git at this time. Please provide patches in svn format.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Plombo

  • 23
Re: [PATCH] Replace double underscores in GLSL macro names
Mesa, why you so silly. The common implementation of glsl reserves identifiers starting with two underscores (because that's the tradition), not all identifiers that contain them.

That's what I thought too, until I looked in the GLSL specification and found that the GLSL spec itself reserves a pointlessly broad class of identifiers and Mesa takes its behavior straight from there... :rolleyes:

Also: we're not using git at this time. Please provide patches in svn format.

The patch format is exactly the same (unified diff), and any tool used to apply SVN patches should be able to apply the above patch as well.
« Last Edit: April 29, 2013, 11:53:26 pm by Plombo »

 

Offline niffiwan

  • 211
  • Eluder Class
Re: [PATCH] Replace double underscores in GLSL macro names
Also: we're not using git at this time. Please provide patches in svn format.

The patch format is exactly the same (unified diff), and any tool used to apply SVN patches should be able to apply the above patch as well.

you'd think so, but my experience with providing git patches has been that TortoiseSVN *hates* them :rolleyes:, so I now apply all git patches to a SVN repo & post the diff from that.
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline Plombo

  • 23
Re: [PATCH] Replace double underscores in GLSL macro names
The patch format is exactly the same (unified diff), and any tool used to apply SVN patches should be able to apply the above patch as well.

you'd think so, but my experience with providing git patches has been that TortoiseSVN *hates* them :rolleyes:, so I now apply all git patches to a SVN repo & post the diff from that.

Does it not have an equivalent to the -p1 option of command line patch?  That's the only reason I can think of that it wouldn't accept git patches.

Nonetheless, here is an "SVN format" (manually reformatted by me with a text editor) version of the patch:
Code: [Select]
Index: code/globalincs/def_files.cpp
===================================================================
--- code/globalincs/def_files.cpp (revision 9660)
+++ code/globalincs/def_files.cpp (working copy)
@@ -1634,110 +1634,110 @@
 " #define FXAA_GATHER4_ALPHA 0\n"
 " #endif\n"
 "#endif\n"
-"#if (FXAA_QUALITY__PRESET == 10)\n"
-" #define FXAA_QUALITY__PS 3\n"
-" #define FXAA_QUALITY__P0 1.5\n"
-" #define FXAA_QUALITY__P1 3.0\n"
-" #define FXAA_QUALITY__P2 12.0\n"
+"#if (FXAA_QUALITY_PRESET == 10)\n"
+" #define FXAA_QUALITY_PS 3\n"
+" #define FXAA_QUALITY_P0 1.5\n"
+" #define FXAA_QUALITY_P1 3.0\n"
+" #define FXAA_QUALITY_P2 12.0\n"
 "#endif\n"
-"#if (FXAA_QUALITY__PRESET == 11)\n"
-" #define FXAA_QUALITY__PS 4\n"
-" #define FXAA_QUALITY__P0 1.0\n"
-" #define FXAA_QUALITY__P1 1.5\n"
-" #define FXAA_QUALITY__P2 3.0\n"
-" #define FXAA_QUALITY__P3 12.0\n"
+"#if (FXAA_QUALITY_PRESET == 11)\n"
+" #define FXAA_QUALITY_PS 4\n"
+" #define FXAA_QUALITY_P0 1.0\n"
+" #define FXAA_QUALITY_P1 1.5\n"
+" #define FXAA_QUALITY_P2 3.0\n"
+" #define FXAA_QUALITY_P3 12.0\n"
 "#endif\n"
-"#if (FXAA_QUALITY__PRESET == 12)\n"
-" #define FXAA_QUALITY__PS 5\n"
-" #define FXAA_QUALITY__P0 1.0\n"
-" #define FXAA_QUALITY__P1 1.5\n"
-" #define FXAA_QUALITY__P2 2.0\n"
-" #define FXAA_QUALITY__P3 4.0\n"
-" #define FXAA_QUALITY__P4 12.0\n"
+"#if (FXAA_QUALITY_PRESET == 12)\n"
+" #define FXAA_QUALITY_PS 5\n"
+" #define FXAA_QUALITY_P0 1.0\n"
+" #define FXAA_QUALITY_P1 1.5\n"
+" #define FXAA_QUALITY_P2 2.0\n"
+" #define FXAA_QUALITY_P3 4.0\n"
+" #define FXAA_QUALITY_P4 12.0\n"
 "#endif\n"
-"#if (FXAA_QUALITY__PRESET == 13)\n"
-" #define FXAA_QUALITY__PS 6\n"
-" #define FXAA_QUALITY__P0 1.0\n"
-" #define FXAA_QUALITY__P1 1.5\n"
-" #define FXAA_QUALITY__P2 2.0\n"
-" #define FXAA_QUALITY__P3 2.0\n"
-" #define FXAA_QUALITY__P4 4.0\n"
-" #define FXAA_QUALITY__P5 12.0\n"
+"#if (FXAA_QUALITY_PRESET == 13)\n"
+" #define FXAA_QUALITY_PS 6\n"
+" #define FXAA_QUALITY_P0 1.0\n"
+" #define FXAA_QUALITY_P1 1.5\n"
+" #define FXAA_QUALITY_P2 2.0\n"
+" #define FXAA_QUALITY_P3 2.0\n"
+" #define FXAA_QUALITY_P4 4.0\n"
+" #define FXAA_QUALITY_P5 12.0\n"
 "#endif\n"
-"#if (FXAA_QUALITY__PRESET == 14)\n"
-" #define FXAA_QUALITY__PS 7\n"
-" #define FXAA_QUALITY__P0 1.0\n"
-" #define FXAA_QUALITY__P1 1.5\n"
-" #define FXAA_QUALITY__P2 2.0\n"
-" #define FXAA_QUALITY__P3 2.0\n"
-" #define FXAA_QUALITY__P4 2.0\n"
-" #define FXAA_QUALITY__P5 4.0\n"
-" #define FXAA_QUALITY__P6 12.0\n"
+"#if (FXAA_QUALITY_PRESET == 14)\n"
+" #define FXAA_QUALITY_PS 7\n"
+" #define FXAA_QUALITY_P0 1.0\n"
+" #define FXAA_QUALITY_P1 1.5\n"
+" #define FXAA_QUALITY_P2 2.0\n"
+" #define FXAA_QUALITY_P3 2.0\n"
+" #define FXAA_QUALITY_P4 2.0\n"
+" #define FXAA_QUALITY_P5 4.0\n"
+" #define FXAA_QUALITY_P6 12.0\n"
 "#endif\n"
-"#if (FXAA_QUALITY__PRESET == 25)\n"
-" #define FXAA_QUALITY__PS 8\n"
-" #define FXAA_QUALITY__P0 1.0\n"
-" #define FXAA_QUALITY__P1 1.5\n"
-" #define FXAA_QUALITY__P2 2.0\n"
-" #define FXAA_QUALITY__P3 2.0\n"
-" #define FXAA_QUALITY__P4 2.0\n"
-" #define FXAA_QUALITY__P5 2.0\n"
-" #define FXAA_QUALITY__P6 4.0\n"
-" #define FXAA_QUALITY__P7 8.0\n"
+"#if (FXAA_QUALITY_PRESET == 25)\n"
+" #define FXAA_QUALITY_PS 8\n"
+" #define FXAA_QUALITY_P0 1.0\n"
+" #define FXAA_QUALITY_P1 1.5\n"
+" #define FXAA_QUALITY_P2 2.0\n"
+" #define FXAA_QUALITY_P3 2.0\n"
+" #define FXAA_QUALITY_P4 2.0\n"
+" #define FXAA_QUALITY_P5 2.0\n"
+" #define FXAA_QUALITY_P6 4.0\n"
+" #define FXAA_QUALITY_P7 8.0\n"
 "#endif\n"
-"#if (FXAA_QUALITY__PRESET == 26)\n"
-" #define FXAA_QUALITY__PS 9\n"
-" #define FXAA_QUALITY__P0 1.0\n"
-" #define FXAA_QUALITY__P1 1.5\n"
-" #define FXAA_QUALITY__P2 2.0\n"
-" #define FXAA_QUALITY__P3 2.0\n"
-" #define FXAA_QUALITY__P4 2.0\n"
-" #define FXAA_QUALITY__P5 2.0\n"
-" #define FXAA_QUALITY__P6 2.0\n"
-" #define FXAA_QUALITY__P7 4.0\n"
-" #define FXAA_QUALITY__P8 8.0\n"
+"#if (FXAA_QUALITY_PRESET == 26)\n"
+" #define FXAA_QUALITY_PS 9\n"
+" #define FXAA_QUALITY_P0 1.0\n"
+" #define FXAA_QUALITY_P1 1.5\n"
+" #define FXAA_QUALITY_P2 2.0\n"
+" #define FXAA_QUALITY_P3 2.0\n"
+" #define FXAA_QUALITY_P4 2.0\n"
+" #define FXAA_QUALITY_P5 2.0\n"
+" #define FXAA_QUALITY_P6 2.0\n"
+" #define FXAA_QUALITY_P7 4.0\n"
+" #define FXAA_QUALITY_P8 8.0\n"
 "#endif\n"
-"#if (FXAA_QUALITY__PRESET == 27)\n"
-" #define FXAA_QUALITY__PS 10\n"
-" #define FXAA_QUALITY__P0 1.0\n"
-" #define FXAA_QUALITY__P1 1.5\n"
-" #define FXAA_QUALITY__P2 2.0\n"
-" #define FXAA_QUALITY__P3 2.0\n"
-" #define FXAA_QUALITY__P4 2.0\n"
-" #define FXAA_QUALITY__P5 2.0\n"
-" #define FXAA_QUALITY__P6 2.0\n"
-" #define FXAA_QUALITY__P7 2.0\n"
-" #define FXAA_QUALITY__P8 4.0\n"
-" #define FXAA_QUALITY__P9 8.0\n"
+"#if (FXAA_QUALITY_PRESET == 27)\n"
+" #define FXAA_QUALITY_PS 10\n"
+" #define FXAA_QUALITY_P0 1.0\n"
+" #define FXAA_QUALITY_P1 1.5\n"
+" #define FXAA_QUALITY_P2 2.0\n"
+" #define FXAA_QUALITY_P3 2.0\n"
+" #define FXAA_QUALITY_P4 2.0\n"
+" #define FXAA_QUALITY_P5 2.0\n"
+" #define FXAA_QUALITY_P6 2.0\n"
+" #define FXAA_QUALITY_P7 2.0\n"
+" #define FXAA_QUALITY_P8 4.0\n"
+" #define FXAA_QUALITY_P9 8.0\n"
 "#endif\n"
-"#if (FXAA_QUALITY__PRESET == 28)\n"
-" #define FXAA_QUALITY__PS 11\n"
-" #define FXAA_QUALITY__P0 1.0\n"
-" #define FXAA_QUALITY__P1 1.5\n"
-" #define FXAA_QUALITY__P2 2.0\n"
-" #define FXAA_QUALITY__P3 2.0\n"
-" #define FXAA_QUALITY__P4 2.0\n"
-" #define FXAA_QUALITY__P5 2.0\n"
-" #define FXAA_QUALITY__P6 2.0\n"
-" #define FXAA_QUALITY__P7 2.0\n"
-" #define FXAA_QUALITY__P8 2.0\n"
-" #define FXAA_QUALITY__P9 4.0\n"
-" #define FXAA_QUALITY__P10 8.0\n"
+"#if (FXAA_QUALITY_PRESET == 28)\n"
+" #define FXAA_QUALITY_PS 11\n"
+" #define FXAA_QUALITY_P0 1.0\n"
+" #define FXAA_QUALITY_P1 1.5\n"
+" #define FXAA_QUALITY_P2 2.0\n"
+" #define FXAA_QUALITY_P3 2.0\n"
+" #define FXAA_QUALITY_P4 2.0\n"
+" #define FXAA_QUALITY_P5 2.0\n"
+" #define FXAA_QUALITY_P6 2.0\n"
+" #define FXAA_QUALITY_P7 2.0\n"
+" #define FXAA_QUALITY_P8 2.0\n"
+" #define FXAA_QUALITY_P9 4.0\n"
+" #define FXAA_QUALITY_P10 8.0\n"
 "#endif\n"
-"#if (FXAA_QUALITY__PRESET == 39)\n"
-" #define FXAA_QUALITY__PS 12\n"
-" #define FXAA_QUALITY__P0 1.0\n"
-" #define FXAA_QUALITY__P1 1.0\n"
-" #define FXAA_QUALITY__P2 1.0\n"
-" #define FXAA_QUALITY__P3 1.0\n"
-" #define FXAA_QUALITY__P4 1.0\n"
-" #define FXAA_QUALITY__P5 1.5\n"
-" #define FXAA_QUALITY__P6 2.0\n"
-" #define FXAA_QUALITY__P7 2.0\n"
-" #define FXAA_QUALITY__P8 2.0\n"
-" #define FXAA_QUALITY__P9 2.0\n"
-" #define FXAA_QUALITY__P10 4.0\n"
-" #define FXAA_QUALITY__P11 8.0\n"
+"#if (FXAA_QUALITY_PRESET == 39)\n"
+" #define FXAA_QUALITY_PS 12\n"
+" #define FXAA_QUALITY_P0 1.0\n"
+" #define FXAA_QUALITY_P1 1.0\n"
+" #define FXAA_QUALITY_P2 1.0\n"
+" #define FXAA_QUALITY_P3 1.0\n"
+" #define FXAA_QUALITY_P4 1.0\n"
+" #define FXAA_QUALITY_P5 1.5\n"
+" #define FXAA_QUALITY_P6 2.0\n"
+" #define FXAA_QUALITY_P7 2.0\n"
+" #define FXAA_QUALITY_P8 2.0\n"
+" #define FXAA_QUALITY_P9 2.0\n"
+" #define FXAA_QUALITY_P10 4.0\n"
+" #define FXAA_QUALITY_P11 8.0\n"
 "#endif\n"
 "#if (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)\n"
 " #define FxaaBool bool\n"
@@ -1896,11 +1896,11 @@
 " if (!horzSpan) posB.x += lengthSign * 0.5;\n"
 " if (horzSpan) posB.y += lengthSign * 0.5;\n"
 " FxaaFloat2 posN;\n"
-" posN.x = posB.x - offNP.x * FXAA_QUALITY__P0;\n"
-" posN.y = posB.y - offNP.y * FXAA_QUALITY__P0;\n"
+" posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;\n"
+" posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;\n"
 " FxaaFloat2 posP;\n"
-" posP.x = posB.x + offNP.x * FXAA_QUALITY__P0;\n"
-" posP.y = posB.y + offNP.y * FXAA_QUALITY__P0;\n"
+" posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;\n"
+" posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;\n"
 " FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;\n"
 " FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));\n"
 " FxaaFloat subpixE = subpixC * subpixC;\n"
@@ -1914,11 +1914,11 @@
 " lumaEndP -= lumaNN * 0.5;\n"
 " FxaaBool doneN = abs(lumaEndN) >= gradientScaled;\n"
 " FxaaBool doneP = abs(lumaEndP) >= gradientScaled;\n"
-" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P1;\n"
-" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P1;\n"
+" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;\n"
+" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;\n"
 " FxaaBool doneNP = (!doneN) || (!doneP);\n"
-" if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P1;\n"
-" if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P1;\n"
+" if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;\n"
+" if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;\n"
 " if (doneNP) {\n"
 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
@@ -1926,12 +1926,12 @@
 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
 " doneN = abs(lumaEndN) >= gradientScaled;\n"
 " doneP = abs(lumaEndP) >= gradientScaled;\n"
-" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P2;\n"
-" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P2;\n"
+" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;\n"
+" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;\n"
 " doneNP = (!doneN) || (!doneP);\n"
-" if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P2;\n"
-" if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P2;\n"
-" #if (FXAA_QUALITY__PS > 3)\n"
+" if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;\n"
+" if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;\n"
+" #if (FXAA_QUALITY_PS > 3)\n"
 " if (doneNP) {\n"
 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
@@ -1939,12 +1939,12 @@
 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
 " doneN = abs(lumaEndN) >= gradientScaled;\n"
 " doneP = abs(lumaEndP) >= gradientScaled;\n"
-" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P3;\n"
-" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P3;\n"
+" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;\n"
+" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;\n"
 " doneNP = (!doneN) || (!doneP);\n"
-" if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P3;\n"
-" if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P3;\n"
-" #if (FXAA_QUALITY__PS > 4)\n"
+" if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;\n"
+" if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;\n"
+" #if (FXAA_QUALITY_PS > 4)\n"
 " if (doneNP) {\n"
 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
@@ -1952,12 +1952,12 @@
 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
 " doneN = abs(lumaEndN) >= gradientScaled;\n"
 " doneP = abs(lumaEndP) >= gradientScaled;\n"
-" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P4;\n"
-" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P4;\n"
+" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;\n"
+" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;\n"
 " doneNP = (!doneN) || (!doneP);\n"
-" if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P4;\n"
-" if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P4;\n"
-" #if (FXAA_QUALITY__PS > 5)\n"
+" if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;\n"
+" if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;\n"
+" #if (FXAA_QUALITY_PS > 5)\n"
 " if (doneNP) {\n"
 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
@@ -1965,12 +1965,12 @@
 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
 " doneN = abs(lumaEndN) >= gradientScaled;\n"
 " doneP = abs(lumaEndP) >= gradientScaled;\n"
-" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P5;\n"
-" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P5;\n"
+" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;\n"
+" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;\n"
 " doneNP = (!doneN) || (!doneP);\n"
-" if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P5;\n"
-" if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P5;\n"
-" #if (FXAA_QUALITY__PS > 6)\n"
+" if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;\n"
+" if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;\n"
+" #if (FXAA_QUALITY_PS > 6)\n"
 " if (doneNP) {\n"
 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
@@ -1978,12 +1978,12 @@
 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
 " doneN = abs(lumaEndN) >= gradientScaled;\n"
 " doneP = abs(lumaEndP) >= gradientScaled;\n"
-" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P6;\n"
-" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P6;\n"
+" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;\n"
+" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;\n"
 " doneNP = (!doneN) || (!doneP);\n"
-" if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P6;\n"
-" if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P6;\n"
-" #if (FXAA_QUALITY__PS > 7)\n"
+" if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;\n"
+" if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;\n"
+" #if (FXAA_QUALITY_PS > 7)\n"
 " if (doneNP) {\n"
 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
@@ -1991,12 +1991,12 @@
 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
 " doneN = abs(lumaEndN) >= gradientScaled;\n"
 " doneP = abs(lumaEndP) >= gradientScaled;\n"
-" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P7;\n"
-" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P7;\n"
+" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;\n"
+" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;\n"
 " doneNP = (!doneN) || (!doneP);\n"
-" if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P7;\n"
-" if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P7;\n"
-" #if (FXAA_QUALITY__PS > 8)\n"
+" if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;\n"
+" if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;\n"
+" #if (FXAA_QUALITY_PS > 8)\n"
 " if (doneNP) {\n"
 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
@@ -2004,12 +2004,12 @@
 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
 " doneN = abs(lumaEndN) >= gradientScaled;\n"
 " doneP = abs(lumaEndP) >= gradientScaled;\n"
-" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P8;\n"
-" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P8;\n"
+" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;\n"
+" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;\n"
 " doneNP = (!doneN) || (!doneP);\n"
-" if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P8;\n"
-" if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P8;\n"
-" #if (FXAA_QUALITY__PS > 9)\n"
+" if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;\n"
+" if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;\n"
+" #if (FXAA_QUALITY_PS > 9)\n"
 " if (doneNP) {\n"
 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
@@ -2017,12 +2017,12 @@
 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
 " doneN = abs(lumaEndN) >= gradientScaled;\n"
 " doneP = abs(lumaEndP) >= gradientScaled;\n"
-" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P9;\n"
-" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P9;\n"
+" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;\n"
+" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;\n"
 " doneNP = (!doneN) || (!doneP);\n"
-" if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P9;\n"
-" if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P9;\n"
-" #if (FXAA_QUALITY__PS > 10)\n"
+" if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;\n"
+" if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;\n"
+" #if (FXAA_QUALITY_PS > 10)\n"
 " if (doneNP) {\n"
 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
@@ -2030,12 +2030,12 @@
 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
 " doneN = abs(lumaEndN) >= gradientScaled;\n"
 " doneP = abs(lumaEndP) >= gradientScaled;\n"
-" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P10;\n"
-" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P10;\n"
+" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;\n"
+" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;\n"
 " doneNP = (!doneN) || (!doneP);\n"
-" if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P10;\n"
-" if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P10;\n"
-" #if (FXAA_QUALITY__PS > 11)\n"
+" if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;\n"
+" if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;\n"
+" #if (FXAA_QUALITY_PS > 11)\n"
 " if (doneNP) {\n"
 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
@@ -2043,12 +2043,12 @@
 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
 " doneN = abs(lumaEndN) >= gradientScaled;\n"
 " doneP = abs(lumaEndP) >= gradientScaled;\n"
-" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P11;\n"
-" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P11;\n"
+" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;\n"
+" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;\n"
 " doneNP = (!doneN) || (!doneP);\n"
-" if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P11;\n"
-" if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P11;\n"
-" #if (FXAA_QUALITY__PS > 12)\n"
+" if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;\n"
+" if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;\n"
+" #if (FXAA_QUALITY_PS > 12)\n"
 " if (doneNP) {\n"
 " if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n"
 " if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n"
@@ -2056,11 +2056,11 @@
 " if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n"
 " doneN = abs(lumaEndN) >= gradientScaled;\n"
 " doneP = abs(lumaEndP) >= gradientScaled;\n"
-" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P12;\n"
-" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P12;\n"
+" if (!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;\n"
+" if (!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;\n"
 " doneNP = (!doneN) || (!doneP);\n"
-" if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P12;\n"
-" if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P12;\n"
+" if (!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;\n"
+" if (!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;\n"
 " }\n"
 " #endif\n"
 " }\n"
@@ -2110,7 +2110,7 @@
 "varying vec2 v_rcpFrame;\n"
 "noperspective varying vec2 v_pos;\n"
 "void main() {\n"
-" gl_FragColor = FxaaPixelShader(v_pos, tex0, v_rcpFrame, FXAA_QUALITY__SUBPIX, FXAA_QUALITY__EDGE_THRESHOLD, FXAA_QUALITY__EDGE_THRESHOLD_MIN);\n"
+" gl_FragColor = FxaaPixelShader(v_pos, tex0, v_rcpFrame, FXAA_QUALITY_SUBPIX, FXAA_QUALITY_EDGE_THRESHOLD, FXAA_QUALITY_EDGE_THRESHOLD_MIN);\n"
 "}";
 
 char *Default_blur_fragment_shader =
Index: code/graphics/gropenglpostprocessing.cpp
===================================================================
--- code/graphics/gropenglpostprocessing.cpp (revision 9660)
+++ code/graphics/gropenglpostprocessing.cpp (working copy)
@@ -824,65 +824,65 @@
 
  switch (Cmdline_fxaa_preset) {
  case 0:
- sflags += "#define FXAA_QUALITY__PRESET 10\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD (1.0/6.0)\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD_MIN (1.0/12.0)\n";
- sflags += "#define FXAA_QUALITY__SUBPIX 0.33\n";
+ sflags += "#define FXAA_QUALITY_PRESET 10\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD (1.0/6.0)\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD_MIN (1.0/12.0)\n";
+ sflags += "#define FXAA_QUALITY_SUBPIX 0.33\n";
  break;
  case 1:
- sflags += "#define FXAA_QUALITY__PRESET 11\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD (1.0/7.0)\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD_MIN (1.0/14.0)\n";
- sflags += "#define FXAA_QUALITY__SUBPIX 0.33\n";
+ sflags += "#define FXAA_QUALITY_PRESET 11\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD (1.0/7.0)\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD_MIN (1.0/14.0)\n";
+ sflags += "#define FXAA_QUALITY_SUBPIX 0.33\n";
  break;
  case 2:
- sflags += "#define FXAA_QUALITY__PRESET 12\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD (1.0/8.0)\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD_MIN (1.0/16.0)\n";
- sflags += "#define FXAA_QUALITY__SUBPIX 0.33\n";
+ sflags += "#define FXAA_QUALITY_PRESET 12\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD (1.0/8.0)\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD_MIN (1.0/16.0)\n";
+ sflags += "#define FXAA_QUALITY_SUBPIX 0.33\n";
  break;
  case 3:
- sflags += "#define FXAA_QUALITY__PRESET 13\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD (1.0/9.0)\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD_MIN (1.0/18.0)\n";
- sflags += "#define FXAA_QUALITY__SUBPIX 0.33\n";
+ sflags += "#define FXAA_QUALITY_PRESET 13\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD (1.0/9.0)\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD_MIN (1.0/18.0)\n";
+ sflags += "#define FXAA_QUALITY_SUBPIX 0.33\n";
  break;
  case 4:
- sflags += "#define FXAA_QUALITY__PRESET 14\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD (1.0/10.0)\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD_MIN (1.0/20.0)\n";
- sflags += "#define FXAA_QUALITY__SUBPIX 0.33\n";
+ sflags += "#define FXAA_QUALITY_PRESET 14\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD (1.0/10.0)\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD_MIN (1.0/20.0)\n";
+ sflags += "#define FXAA_QUALITY_SUBPIX 0.33\n";
  break;
  case 5:
- sflags += "#define FXAA_QUALITY__PRESET 25\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD (1.0/11.0)\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD_MIN (1.0/22.0)\n";
- sflags += "#define FXAA_QUALITY__SUBPIX 0.33\n";
+ sflags += "#define FXAA_QUALITY_PRESET 25\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD (1.0/11.0)\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD_MIN (1.0/22.0)\n";
+ sflags += "#define FXAA_QUALITY_SUBPIX 0.33\n";
  break;
  case 6:
- sflags += "#define FXAA_QUALITY__PRESET 26\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD (1.0/12.0)\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD_MIN (1.0/24.0)\n";
- sflags += "#define FXAA_QUALITY__SUBPIX 0.33\n";
+ sflags += "#define FXAA_QUALITY_PRESET 26\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD (1.0/12.0)\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD_MIN (1.0/24.0)\n";
+ sflags += "#define FXAA_QUALITY_SUBPIX 0.33\n";
  break;
  case 7:
  sflags += "#define FXAA_PC 1\n";
- sflags += "#define FXAA_QUALITY__PRESET 27\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD (1.0/13.0)\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD_MIN (1.0/26.0)\n";
- sflags += "#define FXAA_QUALITY__SUBPIX 0.33\n";
+ sflags += "#define FXAA_QUALITY_PRESET 27\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD (1.0/13.0)\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD_MIN (1.0/26.0)\n";
+ sflags += "#define FXAA_QUALITY_SUBPIX 0.33\n";
  break;
  case 8:
- sflags += "#define FXAA_QUALITY__PRESET 28\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD (1.0/14.0)\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD_MIN (1.0/28.0)\n";
- sflags += "#define FXAA_QUALITY__SUBPIX 0.33\n";
+ sflags += "#define FXAA_QUALITY_PRESET 28\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD (1.0/14.0)\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD_MIN (1.0/28.0)\n";
+ sflags += "#define FXAA_QUALITY_SUBPIX 0.33\n";
  break;
  case 9:
- sflags += "#define FXAA_QUALITY__PRESET 39\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD (1.0/15.0)\n";
- sflags += "#define FXAA_QUALITY__EDGE_THRESHOLD_MIN (1.0/32.0)\n";
- sflags += "#define FXAA_QUALITY__SUBPIX 0.33\n";
+ sflags += "#define FXAA_QUALITY_PRESET 39\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD (1.0/15.0)\n";
+ sflags += "#define FXAA_QUALITY_EDGE_THRESHOLD_MIN (1.0/32.0)\n";
+ sflags += "#define FXAA_QUALITY_SUBPIX 0.33\n";
  break;
  }
 
--
1.7.9.5
« Last Edit: April 30, 2013, 12:16:58 am by Plombo »

  

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: [PATCH] Replace double underscores in GLSL macro names
I've committed this patch to trunk.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns