glsl: set a size to gl_ClipDistance array

The purpose is to avoid issue on MS-Intel driver without
a dedicated hack in the compilation.

Code doesn't use it so I suspect others implement to discard the
statement.
This commit is contained in:
Gregory Hainaut 2015-08-25 18:57:02 +02:00
parent a1957a685d
commit bdc8038e7e
4 changed files with 8 additions and 17 deletions

View File

@ -217,16 +217,7 @@ std::string GSShaderOGL::GenGlslHeader(const std::string& entry, GLenum type, co
// AMD/nvidia define it to 0 // AMD/nvidia define it to 0
// intel window don't define it // intel window don't define it
// intel linux refuse to define it // intel linux refuse to define it
#ifdef _WINDOWS
// Intel doesn't suppport properly gl_ClipDistance
// (use the existing macro to disable it)
if (GLLoader::intel_buggy_driver)
header += "#define pGL_ES 1\n";
else
header += "#define pGL_ES 0\n";
#else
header += "#define pGL_ES 0\n"; header += "#define pGL_ES 0\n";
#endif
// Allow to puts several shader in 1 files // Allow to puts several shader in 1 files
switch (type) { switch (type) {

View File

@ -13,7 +13,7 @@ out gl_PerVertex {
vec4 gl_Position; vec4 gl_Position;
float gl_PointSize; float gl_PointSize;
#if !pGL_ES #if !pGL_ES
float gl_ClipDistance[]; float gl_ClipDistance[1];
#endif #endif
}; };

View File

@ -58,7 +58,7 @@ out gl_PerVertex {
vec4 gl_Position; vec4 gl_Position;
float gl_PointSize; float gl_PointSize;
#if !pGL_ES #if !pGL_ES
float gl_ClipDistance[]; float gl_ClipDistance[1];
#endif #endif
}; };
@ -144,7 +144,7 @@ in gl_PerVertex {
vec4 gl_Position; vec4 gl_Position;
float gl_PointSize; float gl_PointSize;
#if !pGL_ES #if !pGL_ES
float gl_ClipDistance[]; float gl_ClipDistance[1];
#endif #endif
} gl_in[]; } gl_in[];
//in int gl_PrimitiveIDIn; //in int gl_PrimitiveIDIn;
@ -153,7 +153,7 @@ out gl_PerVertex {
vec4 gl_Position; vec4 gl_Position;
float gl_PointSize; float gl_PointSize;
#if !pGL_ES #if !pGL_ES
float gl_ClipDistance[]; float gl_ClipDistance[1];
#endif #endif
}; };
//out int gl_PrimitiveID; //out int gl_PrimitiveID;

View File

@ -38,7 +38,7 @@ static const char* convert_glsl =
" vec4 gl_Position;\n" " vec4 gl_Position;\n"
" float gl_PointSize;\n" " float gl_PointSize;\n"
"#if !pGL_ES\n" "#if !pGL_ES\n"
" float gl_ClipDistance[];\n" " float gl_ClipDistance[1];\n"
"#endif\n" "#endif\n"
"};\n" "};\n"
"\n" "\n"
@ -665,7 +665,7 @@ static const char* tfx_vgs_glsl =
" vec4 gl_Position;\n" " vec4 gl_Position;\n"
" float gl_PointSize;\n" " float gl_PointSize;\n"
"#if !pGL_ES\n" "#if !pGL_ES\n"
" float gl_ClipDistance[];\n" " float gl_ClipDistance[1];\n"
"#endif\n" "#endif\n"
"};\n" "};\n"
"\n" "\n"
@ -751,7 +751,7 @@ static const char* tfx_vgs_glsl =
" vec4 gl_Position;\n" " vec4 gl_Position;\n"
" float gl_PointSize;\n" " float gl_PointSize;\n"
"#if !pGL_ES\n" "#if !pGL_ES\n"
" float gl_ClipDistance[];\n" " float gl_ClipDistance[1];\n"
"#endif\n" "#endif\n"
"} gl_in[];\n" "} gl_in[];\n"
"//in int gl_PrimitiveIDIn;\n" "//in int gl_PrimitiveIDIn;\n"
@ -760,7 +760,7 @@ static const char* tfx_vgs_glsl =
" vec4 gl_Position;\n" " vec4 gl_Position;\n"
" float gl_PointSize;\n" " float gl_PointSize;\n"
"#if !pGL_ES\n" "#if !pGL_ES\n"
" float gl_ClipDistance[];\n" " float gl_ClipDistance[1];\n"
"#endif\n" "#endif\n"
"};\n" "};\n"
"//out int gl_PrimitiveID;\n" "//out int gl_PrimitiveID;\n"