From 95567624935603f02cd0f679c2b7ef7145f0174d Mon Sep 17 00:00:00 2001 From: plagman Date: Sun, 28 Jun 2009 21:03:50 +0000 Subject: [PATCH] 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 --- polymer/eduke32/build/include/polymer.h | 2 +- polymer/eduke32/build/src/polymer.c | 4 ++-- polymer/eduke32/build/src/polymost.c | 2 +- polymer/eduke32/build/src/sdlayer.c | 8 ++++++++ polymer/eduke32/build/src/winlayer.c | 8 +++++--- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/polymer/eduke32/build/include/polymer.h b/polymer/eduke32/build/include/polymer.h index 6930ab1da..416e22aaf 100644 --- a/polymer/eduke32/build/include/polymer.h +++ b/polymer/eduke32/build/include/polymer.h @@ -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; diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index bef64a04e..583d38d36 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -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); diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index c59553d7d..6f9f0cd52 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -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 }, diff --git a/polymer/eduke32/build/src/sdlayer.c b/polymer/eduke32/build/src/sdlayer.c index 64788e871..063d17e4e 100644 --- a/polymer/eduke32/build/src/sdlayer.c +++ b/polymer/eduke32/build/src/sdlayer.c @@ -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; diff --git a/polymer/eduke32/build/src/winlayer.c b/polymer/eduke32/build/src/winlayer.c index df270deb7..bbc745c26 100644 --- a/polymer/eduke32/build/src/winlayer.c +++ b/polymer/eduke32/build/src/winlayer.c @@ -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)