mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-13 16:47:57 +00:00
gl2shim: add glsl100 support
This commit is contained in:
parent
202b228691
commit
342e0d3e2e
@ -6,9 +6,14 @@
|
|||||||
"#define in varying\n"
|
"#define in varying\n"
|
||||||
"#define texture texture2D\n"
|
"#define texture texture2D\n"
|
||||||
"#endif\n"
|
"#endif\n"
|
||||||
"#if VER >= 130\n"
|
"#if VER >= 130 || VER == 100\n"
|
||||||
"precision mediump float;\n"
|
"precision mediump float;\n"
|
||||||
"#endif\n"
|
"#endif\n"
|
||||||
|
"#if VER == 100\n"
|
||||||
|
"#define PREC mediump\n"
|
||||||
|
"#else\n"
|
||||||
|
"#define PREC\n"
|
||||||
|
"#endif\n"
|
||||||
"#if ATTR_TEXCOORD0\n"
|
"#if ATTR_TEXCOORD0\n"
|
||||||
"uniform sampler2D uTex0;\n"
|
"uniform sampler2D uTex0;\n"
|
||||||
"#endif\n"
|
"#endif\n"
|
||||||
@ -19,20 +24,20 @@
|
|||||||
"uniform float uAlphaTest;\n"
|
"uniform float uAlphaTest;\n"
|
||||||
"#endif\n"
|
"#endif\n"
|
||||||
"#if FEAT_FOG\n"
|
"#if FEAT_FOG\n"
|
||||||
"uniform vec4 uFog;\n"
|
"uniform PREC vec4 uFog;\n"
|
||||||
"#endif\n"
|
"#endif\n"
|
||||||
"uniform vec4 uColor;\n"
|
"uniform PREC vec4 uColor;\n"
|
||||||
"#if ATTR_COLOR\n"
|
"#if ATTR_COLOR\n"
|
||||||
"in vec4 vColor;\n"
|
"in PREC vec4 vColor;\n"
|
||||||
"#endif\n"
|
"#endif\n"
|
||||||
"#if ATTR_TEXCOORD0\n"
|
"#if ATTR_TEXCOORD0\n"
|
||||||
"in vec2 vTexCoord0;\n"
|
"in PREC vec2 vTexCoord0;\n"
|
||||||
"#endif\n"
|
"#endif\n"
|
||||||
"#if ATTR_TEXCOORD1\n"
|
"#if ATTR_TEXCOORD1\n"
|
||||||
"in vec2 vTexCoord1;\n"
|
"in PREC vec2 vTexCoord1;\n"
|
||||||
"#endif\n"
|
"#endif\n"
|
||||||
"#if ATTR_NORMAL\n"
|
"#if ATTR_NORMAL\n"
|
||||||
"in vec2 vNormal;\n"
|
"in PREC vec2 vNormal;\n"
|
||||||
"#endif\n"
|
"#endif\n"
|
||||||
"#if VER >= 300\n"
|
"#if VER >= 300\n"
|
||||||
"out vec4 oFragColor;\n"
|
"out vec4 oFragColor;\n"
|
||||||
@ -42,9 +47,9 @@
|
|||||||
"void main()\n"
|
"void main()\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
"#if ATTR_COLOR\n"
|
"#if ATTR_COLOR\n"
|
||||||
"vec4 c = vColor;\n"
|
"PREC vec4 c = vColor;\n"
|
||||||
"#else\n"
|
"#else\n"
|
||||||
"vec4 c = uColor;\n"
|
"PREC vec4 c = uColor;\n"
|
||||||
"#endif\n"
|
"#endif\n"
|
||||||
"#if ATTR_TEXCOORD0\n"
|
"#if ATTR_TEXCOORD0\n"
|
||||||
"c = c * texture(uTex0, vTexCoord0);\n"
|
"c = c * texture(uTex0, vTexCoord0);\n"
|
||||||
|
@ -583,7 +583,7 @@ int GL2_ShimInit( void )
|
|||||||
|
|
||||||
gl2wrap_config.version = 310;
|
gl2wrap_config.version = 310;
|
||||||
if( gEngfuncs.Sys_CheckParm("-minshaders") )
|
if( gEngfuncs.Sys_CheckParm("-minshaders") )
|
||||||
gl2wrap_config.version = 110;
|
gl2wrap_config.version = 100;
|
||||||
if(gl2wrap_config.buf_storage)
|
if(gl2wrap_config.buf_storage)
|
||||||
gl2wrap_config.incremental = true, gl2wrap_config.vao_mandatory = true;
|
gl2wrap_config.incremental = true, gl2wrap_config.vao_mandatory = true;
|
||||||
if(!pglBindVertexArray || !gl2wrap_config.vao_mandatory)
|
if(!pglBindVertexArray || !gl2wrap_config.vao_mandatory)
|
||||||
@ -658,7 +658,11 @@ int GL2_ShimInit( void )
|
|||||||
{
|
{
|
||||||
gl2wrap_config.version = 110;
|
gl2wrap_config.version = 110;
|
||||||
if(!GL2_InitProgs())
|
if(!GL2_InitProgs())
|
||||||
gEngfuncs.Host_Error("Failed to compile shaders!\n");
|
{
|
||||||
|
gl2wrap_config.version = 100;
|
||||||
|
if(!GL2_InitProgs())
|
||||||
|
gEngfuncs.Host_Error("Failed to compile shaders!\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user