Attempting to unbreak things in really really subtle ways.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3717 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2011-01-23 03:51:27 +00:00
parent 8fc0df0f44
commit efe2efa192
3 changed files with 15 additions and 3 deletions

View file

@ -2,6 +2,11 @@
struct progfuncs_s; struct progfuncs_s;
struct globalvars_s; struct globalvars_s;
struct texture_s; struct texture_s;
struct texnums_s;
struct vbo_s;
struct mesh_s;
struct batch_s;
struct entity_s;

View file

@ -2308,7 +2308,7 @@ static void BE_RenderMeshProgram(const shader_t *shader, const shaderpass_t *pas
int perm; int perm;
perm = 0; perm = 0;
/* if (TEXVALID(shaderstate.curtexnums->bump) && s->programhandle[perm|PERMUTATION_BUMPMAP].glsl) if (TEXVALID(shaderstate.curtexnums->bump) && s->programhandle[perm|PERMUTATION_BUMPMAP].glsl)
perm |= PERMUTATION_BUMPMAP; perm |= PERMUTATION_BUMPMAP;
if (TEXVALID(shaderstate.curtexnums->specular) && s->programhandle[perm|PERMUTATION_SPECULAR].glsl) if (TEXVALID(shaderstate.curtexnums->specular) && s->programhandle[perm|PERMUTATION_SPECULAR].glsl)
perm |= PERMUTATION_SPECULAR; perm |= PERMUTATION_SPECULAR;
@ -2319,7 +2319,7 @@ static void BE_RenderMeshProgram(const shader_t *shader, const shaderpass_t *pas
if (TEXVALID(shaderstate.curtexnums->upperoverlay) && s->programhandle[perm|PERMUTATION_UPPER].glsl) if (TEXVALID(shaderstate.curtexnums->upperoverlay) && s->programhandle[perm|PERMUTATION_UPPER].glsl)
perm |= PERMUTATION_UPPER; perm |= PERMUTATION_UPPER;
if (r_glsl_offsetmapping.ival && TEXVALID(shaderstate.curtexnums->bump) && s->programhandle[perm|PERMUTATION_OFFSET].glsl) if (r_glsl_offsetmapping.ival && TEXVALID(shaderstate.curtexnums->bump) && s->programhandle[perm|PERMUTATION_OFFSET].glsl)
perm |= PERMUTATION_OFFSET;*/ perm |= PERMUTATION_OFFSET;
GL_SelectProgram(s->programhandle[perm].glsl); GL_SelectProgram(s->programhandle[perm].glsl);
BE_SendPassBlendAndDepth(pass->shaderbits); BE_SendPassBlendAndDepth(pass->shaderbits);

View file

@ -711,7 +711,6 @@ static void Shader_EntityMergable ( shader_t *shader, shaderpass_t *pass, char *
/*program text is already loaded, this function parses the 'header' of it to see which permutations it provides, and how many times we need to recompile it*/ /*program text is already loaded, this function parses the 'header' of it to see which permutations it provides, and how many times we need to recompile it*/
static void Shader_LoadPermutations(union programhandle_u *handle, char *script, int qrtype) static void Shader_LoadPermutations(union programhandle_u *handle, char *script, int qrtype)
{ {
char *permutationdefines[PERMUTATIONS];
static char *permutationname[] = static char *permutationname[] =
{ {
"#define BUMP\n", "#define BUMP\n",
@ -722,6 +721,7 @@ static void Shader_LoadPermutations(union programhandle_u *handle, char *script,
"#define OFFSETMAPPING\n", "#define OFFSETMAPPING\n",
NULL NULL
}; };
char *permutationdefines[sizeof(permutationname)/sizeof(permutationname[0])];
unsigned int nopermutation = ~0u; unsigned int nopermutation = ~0u;
int p, n, pn; int p, n, pn;
char *end; char *end;
@ -789,6 +789,12 @@ struct sbuiltin_s
char *body; char *body;
} sbuiltins[] = } sbuiltins[] =
{ {
#ifdef GLQUAKE
/*a quick note on glsl versions:
gl versioning started with 110
gles versioning started at 100 and only had a single one defined
with gl3's combined support, gl3 supports 130+ and 100, but 110 requries compat extension
with gl4, versions are meant to match the gl version more closely, so gl4.0 uses 400.*/
{QR_OPENGL/*ES*/, 100, "default2d", {QR_OPENGL/*ES*/, 100, "default2d",
"#version 100\n" "#version 100\n"
"#ifdef VERTEX_SHADER\n" "#ifdef VERTEX_SHADER\n"
@ -1117,6 +1123,7 @@ struct sbuiltin_s
"}\n" "}\n"
"#endif\n" "#endif\n"
}, },
#endif
{QR_NONE} {QR_NONE}
}; };
static sgeneric_t *sgenerics; static sgeneric_t *sgenerics;