mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-03 06:20:57 +00:00
Disable GLSL alias model renderer on Win32+ATI/AMD until szo's bug with models drawing black can be fixed.
Replace GLAlias_SupportsShaders() with gl_glsl_alias_able variable. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1171 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
39bd217f6c
commit
91196a618f
4 changed files with 34 additions and 18 deletions
|
@ -373,7 +373,7 @@ void GL_MakeAliasModelDisplayLists_VBO (void)
|
||||||
unsigned short *indexes;
|
unsigned short *indexes;
|
||||||
aliasmesh_t *desc;
|
aliasmesh_t *desc;
|
||||||
|
|
||||||
if (!GLAlias_SupportsShaders())
|
if (!gl_glsl_alias_able)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// first, copy the verts onto the hunk
|
// first, copy the verts onto the hunk
|
||||||
|
@ -461,7 +461,7 @@ void GLMesh_LoadVertexBuffers (void)
|
||||||
int totalindexes = 0;
|
int totalindexes = 0;
|
||||||
int totalvbosize = 0;
|
int totalvbosize = 0;
|
||||||
|
|
||||||
if (!GLAlias_SupportsShaders())
|
if (!gl_glsl_alias_able)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// pass 1 - count the sizes we need
|
// pass 1 - count the sizes we need
|
||||||
|
|
|
@ -103,6 +103,7 @@ qboolean gl_vbo_able = false; //ericw
|
||||||
qboolean gl_glsl_able = false; //ericw
|
qboolean gl_glsl_able = false; //ericw
|
||||||
GLint gl_max_texture_units = 0; //ericw
|
GLint gl_max_texture_units = 0; //ericw
|
||||||
qboolean gl_glsl_gamma_able = false; //ericw
|
qboolean gl_glsl_gamma_able = false; //ericw
|
||||||
|
qboolean gl_glsl_alias_able = false; //ericw
|
||||||
|
|
||||||
PFNGLMULTITEXCOORD2FARBPROC GL_MTexCoord2fFunc = NULL; //johnfitz
|
PFNGLMULTITEXCOORD2FARBPROC GL_MTexCoord2fFunc = NULL; //johnfitz
|
||||||
PFNGLACTIVETEXTUREARBPROC GL_SelectTextureFunc = NULL; //johnfitz
|
PFNGLACTIVETEXTUREARBPROC GL_SelectTextureFunc = NULL; //johnfitz
|
||||||
|
@ -1059,7 +1060,7 @@ static void GL_CheckExtensions (void)
|
||||||
Con_Warning ("texture_non_power_of_two disabled at command line\n");
|
Con_Warning ("texture_non_power_of_two disabled at command line\n");
|
||||||
else if (GL_ParseExtensionList(gl_extensions, "GL_ARB_texture_non_power_of_two"))
|
else if (GL_ParseExtensionList(gl_extensions, "GL_ARB_texture_non_power_of_two"))
|
||||||
{
|
{
|
||||||
Con_Printf("FOUND: GL_ARB_texture_non_power_of_two\n");
|
Con_Printf("FOUND: ARB_texture_non_power_of_two\n");
|
||||||
gl_texture_NPOT = true;
|
gl_texture_NPOT = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1146,6 +1147,33 @@ static void GL_CheckExtensions (void)
|
||||||
{
|
{
|
||||||
Con_Warning ("GLSL gamma not available, using hardware gamma\n");
|
Con_Warning ("GLSL gamma not available, using hardware gamma\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GLSL alias model rendering
|
||||||
|
//
|
||||||
|
if (COM_CheckParm("-noglslalias"))
|
||||||
|
Con_Warning ("GLSL alias model rendering disabled at command line\n");
|
||||||
|
else if (gl_glsl_able && gl_vbo_able && gl_max_texture_units >= 3)
|
||||||
|
{
|
||||||
|
qboolean broken = false;
|
||||||
|
// Ugly hack to disable GLSL alias renderer on ATI/Win32
|
||||||
|
// (black model bug observed by szo)
|
||||||
|
#if defined(_WIN32)
|
||||||
|
if (strstr(gl_vendor, "ATI"))
|
||||||
|
broken = true;
|
||||||
|
#endif
|
||||||
|
if (broken && !COM_CheckParm("-glslalias"))
|
||||||
|
{
|
||||||
|
Con_Warning ("Unsupported hardware, GLSL alias rendering disabled (use -glslalias to force enable)\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gl_glsl_alias_able = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Con_Warning ("GLSL alias model rendering not available, using Fitz renderer\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -223,6 +223,7 @@ extern QS_PFNGLUNIFORM3FPROC GL_Uniform3fFunc;
|
||||||
extern QS_PFNGLUNIFORM4FPROC GL_Uniform4fFunc;
|
extern QS_PFNGLUNIFORM4FPROC GL_Uniform4fFunc;
|
||||||
extern qboolean gl_glsl_able;
|
extern qboolean gl_glsl_able;
|
||||||
extern qboolean gl_glsl_gamma_able;
|
extern qboolean gl_glsl_gamma_able;
|
||||||
|
extern qboolean gl_glsl_alias_able;
|
||||||
// ericw --
|
// ericw --
|
||||||
|
|
||||||
//ericw -- NPOT texture support
|
//ericw -- NPOT texture support
|
||||||
|
@ -354,7 +355,6 @@ GLint GL_GetUniformLocation (GLuint *programPtr, const char *name);
|
||||||
GLuint GL_CreateProgram (const GLchar *vertSource, const GLchar *fragSource, int numbindings, const glsl_attrib_binding_t *bindings);
|
GLuint GL_CreateProgram (const GLchar *vertSource, const GLchar *fragSource, int numbindings, const glsl_attrib_binding_t *bindings);
|
||||||
void R_DeleteShaders (void);
|
void R_DeleteShaders (void);
|
||||||
|
|
||||||
qboolean GLAlias_SupportsShaders (void);
|
|
||||||
void GLAlias_CreateShaders (void);
|
void GLAlias_CreateShaders (void);
|
||||||
void GL_DrawAliasShadow (entity_t *e);
|
void GL_DrawAliasShadow (entity_t *e);
|
||||||
void DrawGLTriangleFan (glpoly_t *p);
|
void DrawGLTriangleFan (glpoly_t *p);
|
||||||
|
|
|
@ -119,18 +119,6 @@ static void *GLARB_GetNormalOffset (aliashdr_t *hdr, int pose)
|
||||||
return (void *)(currententity->model->vboxyzofs + (hdr->numverts_vbo * pose * sizeof (meshxyz_t)) + normaloffs);
|
return (void *)(currententity->model->vboxyzofs + (hdr->numverts_vbo * pose * sizeof (meshxyz_t)) + normaloffs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
=============
|
|
||||||
GLAlias_SupportsShaders
|
|
||||||
|
|
||||||
Returns whether OpenGL has the capabilities we need for the shader path.
|
|
||||||
=============
|
|
||||||
*/
|
|
||||||
qboolean GLAlias_SupportsShaders (void)
|
|
||||||
{
|
|
||||||
return gl_glsl_able && gl_vbo_able && gl_max_texture_units >= 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=============
|
=============
|
||||||
GLAlias_CreateShaders
|
GLAlias_CreateShaders
|
||||||
|
@ -202,7 +190,7 @@ void GLAlias_CreateShaders (void)
|
||||||
" gl_FragColor = result;\n"
|
" gl_FragColor = result;\n"
|
||||||
"}\n";
|
"}\n";
|
||||||
|
|
||||||
if (!GLAlias_SupportsShaders())
|
if (!gl_glsl_alias_able)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
r_alias_program = GL_CreateProgram (vertSource, fragSource, sizeof(bindings)/sizeof(bindings[0]), bindings);
|
r_alias_program = GL_CreateProgram (vertSource, fragSource, sizeof(bindings)/sizeof(bindings[0]), bindings);
|
||||||
|
@ -748,7 +736,7 @@ void R_DrawAliasModel (entity_t *e)
|
||||||
}
|
}
|
||||||
// call fast path if possible. if the shader compliation failed for some reason,
|
// call fast path if possible. if the shader compliation failed for some reason,
|
||||||
// r_alias_program will be 0.
|
// r_alias_program will be 0.
|
||||||
else if (GLAlias_SupportsShaders() && (r_alias_program != 0))
|
else if (r_alias_program != 0)
|
||||||
{
|
{
|
||||||
GL_DrawAliasFrame_GLSL (paliashdr, lerpdata, tx, fb);
|
GL_DrawAliasFrame_GLSL (paliashdr, lerpdata, tx, fb);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue