Changes r_pr_atiworkaround to r_pr_ati_fboworkaround and ports the detection code to SDLayer.

git-svn-id: https://svn.eduke32.com/eduke32@1445 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
plagman 2009-06-28 21:03:50 +00:00
parent f061313bef
commit 9556762493
5 changed files with 17 additions and 7 deletions

View file

@ -51,7 +51,7 @@ extern float pr_parallaxbias;
extern int32_t pr_overridespecular;
extern float pr_specularpower;
extern float pr_specularfactor;
extern int32_t pr_atiworkaround;
extern int32_t pr_ati_fboworkaround;
extern int32_t r_pr_maxlightpasses;

View file

@ -27,7 +27,7 @@ float pr_parallaxbias = 0.0f;
int32_t pr_overridespecular = 0;
float pr_specularpower = 15.0f;
float pr_specularfactor = 1.0f;
int32_t pr_atiworkaround = 0;
int32_t pr_ati_fboworkaround = 0;
int32_t r_pr_maxlightpasses = 5; // value of the cvar (not live value), used to detect changes
@ -4722,7 +4722,7 @@ static void polymer_initrendertargets(int32_t count)
prrts[i].ydim = 128 << pr_shadowdetail;
prrts[i].color = 0;
if (pr_atiworkaround) {
if (pr_ati_fboworkaround) {
bglGenTextures(1, &prrts[i].color);
bglBindTexture(prrts[i].target, prrts[i].color);

View file

@ -5997,7 +5997,7 @@ void polymost_initosdfuncs(void)
{ "r_pr_overridespecular", "r_pr_overridespecular: overrides specular material power and factor values with values from the pr_specularpower and pr_specularfactor cvars; use it to fine-tune DEF tokens", (void*)&pr_overridespecular, CVAR_BOOL | CVAR_NOSAVE, 0, 0, 1 },
{ "r_pr_specularpower", "r_pr_specularpower: overriden specular material power", (void*)&pr_specularpower, CVAR_FLOAT | CVAR_NOSAVE, 0, -10, 1000 },
{ "r_pr_specularfactor", "r_pr_specularfactor: overriden specular material factor", (void*)&pr_specularfactor, CVAR_FLOAT | CVAR_NOSAVE, 0, -10, 1000 },
{ "r_pr_atiworkaround", "r_pr_atiworkaround: enable this to workaround an ATI driver bug that causes sprite shadows to be square - you need to restart the renderer for it to take effect", (void*)&pr_atiworkaround, CVAR_BOOL | CVAR_NOSAVE, 0, 0, 1 },
{ "r_pr_ati_fboworkaround", "r_pr_ati_fboworkaround: enable this to workaround an ATI driver bug that causes sprite shadows to be square - you need to restart the renderer for it to take effect", (void*)&pr_ati_fboworkaround, CVAR_BOOL | CVAR_NOSAVE, 0, 0, 1 },
#endif
{ "r_models","r_models: enable/disable model rendering",(void *)&usemodels, CVAR_BOOL, 0, 0, 1 },

View file

@ -1114,6 +1114,14 @@ int32_t setvideomode(int32_t x, int32_t y, int32_t c, int32_t fs)
glinfo.version = (const char *)bglGetString(GL_VERSION);
glinfo.extensions = (const char *)bglGetString(GL_EXTENSIONS);
#ifdef POLYMER
if (!Bstrcmp(glinfo.vendor,"ATI Technologies Inc.")) {
pr_ati_fboworkaround = 1;
initprintf("Enabling ATI FBO color attachment workaround.\n");
} else pr_ati_fboworkaround = 0;
#endif
glinfo.maxanisotropy = 1.0;
glinfo.bgra = 0;
glinfo.texcompr = 0;

View file

@ -3386,9 +3386,11 @@ static int32_t SetupOpenGL(int32_t width, int32_t height, int32_t bitspp)
#ifdef POLYMER
else
{
if (!Bstrcmp(glinfo.vendor,"ATI Technologies Inc."))
pr_atiworkaround = 1;
else pr_atiworkaround = 0;
if (!Bstrcmp(glinfo.vendor,"ATI Technologies Inc.")) {
pr_ati_fboworkaround = 1;
initprintf("Enabling ATI FBO color attachment workaround.\n");
}
else pr_ati_fboworkaround = 0;
}
#endif
if (!forcegl && err)