From a8cc4a50cbed6cccaf52944b4fe092d5a9d47b93 Mon Sep 17 00:00:00 2001 From: havoc Date: Mon, 23 Aug 2010 15:07:35 +0000 Subject: [PATCH] don't use TEXF_ALLOWUPDATES on fully-updated textures such as video git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10415 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=50614c010dff980a99dae156c35d392c64d58216 --- cl_gecko.c | 2 +- cl_video.c | 2 +- gl_draw.c | 2 +- gl_rmain.c | 6 +++--- r_textures.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cl_gecko.c b/cl_gecko.c index ec09b5c3..015b9bef 100644 --- a/cl_gecko.c +++ b/cl_gecko.c @@ -443,7 +443,7 @@ static void cl_gecko_updatecallback( rtexture_t *texture, void* callbackData ) { static void cl_gecko_linktexture( clgecko_t *instance ) { // TODO: assert that instance->texture == NULL instance->texture = R_LoadTexture2D( cl_geckotexturepool, instance->name, - instance->texWidth, instance->texHeight, NULL, TEXTYPE_BGRA, TEXF_ALPHA | TEXF_PERSISTENT | TEXF_ALLOWUPDATES, -1, NULL ); + instance->texWidth, instance->texHeight, NULL, TEXTYPE_BGRA, TEXF_ALPHA | TEXF_PERSISTENT, -1, NULL ); R_MakeTextureDynamic( instance->texture, cl_gecko_updatecallback, instance ); CL_LinkDynTexture( instance->name, instance->texture ); } diff --git a/cl_video.c b/cl_video.c index afba2119..a6a5e0ea 100644 --- a/cl_video.c +++ b/cl_video.c @@ -51,7 +51,7 @@ static void VideoUpdateCallback(rtexture_t *rt, void *data) { static void LinkVideoTexture( clvideo_t *video ) { video->cpif.tex = R_LoadTexture2D( cl_videotexturepool, video->cpif.name, - video->cpif.width, video->cpif.height, NULL, TEXTYPE_BGRA, TEXF_PERSISTENT | TEXF_ALLOWUPDATES, -1, NULL ); + video->cpif.width, video->cpif.height, NULL, TEXTYPE_BGRA, TEXF_PERSISTENT, -1, NULL ); R_MakeTextureDynamic( video->cpif.tex, VideoUpdateCallback, video ); CL_LinkDynTexture( video->cpif.name, video->cpif.tex ); } diff --git a/gl_draw.c b/gl_draw.c index 2dfbed88..601413df 100644 --- a/gl_draw.c +++ b/gl_draw.c @@ -536,7 +536,7 @@ cachepic_t *Draw_NewPic(const char *picname, int width, int height, int alpha, u pic->height = height; if (pic->tex) R_FreeTexture(pic->tex); - pic->tex = R_LoadTexture2D(drawtexturepool, picname, width, height, pixels_bgra, TEXTYPE_BGRA, (alpha ? TEXF_ALPHA : 0) | TEXF_ALLOWUPDATES, -1, NULL); + pic->tex = R_LoadTexture2D(drawtexturepool, picname, width, height, pixels_bgra, TEXTYPE_BGRA, (alpha ? TEXF_ALPHA : 0), -1, NULL); return pic; } diff --git a/gl_rmain.c b/gl_rmain.c index 84678fe5..f5c18f60 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -484,8 +484,8 @@ static void R_BuildFogTexture(void) } else { - r_texture_fogattenuation = R_LoadTexture2D(r_main_texturepool, "fogattenuation", FOGWIDTH, 1, &data1[0][0], TEXTYPE_BGRA, TEXF_FORCELINEAR | TEXF_CLAMP | TEXF_PERSISTENT | TEXF_ALLOWUPDATES, -1, NULL); - //r_texture_fogintensity = R_LoadTexture2D(r_main_texturepool, "fogintensity", FOGWIDTH, 1, &data2[0][0], TEXTYPE_BGRA, TEXF_FORCELINEAR | TEXF_CLAMP | TEXF_ALLOWUPDATES, NULL); + r_texture_fogattenuation = R_LoadTexture2D(r_main_texturepool, "fogattenuation", FOGWIDTH, 1, &data1[0][0], TEXTYPE_BGRA, TEXF_FORCELINEAR | TEXF_CLAMP | TEXF_PERSISTENT, -1, NULL); + //r_texture_fogintensity = R_LoadTexture2D(r_main_texturepool, "fogintensity", FOGWIDTH, 1, &data2[0][0], TEXTYPE_BGRA, TEXF_FORCELINEAR | TEXF_CLAMP, NULL); } } @@ -8497,7 +8497,7 @@ void R_UpdateVariables(void) } else { - r_texture_gammaramps = R_LoadTexture2D(r_main_texturepool, "gammaramps", RAMPWIDTH, 1, &rampbgr[0][0], TEXTYPE_BGRA, TEXF_FORCELINEAR | TEXF_CLAMP | TEXF_PERSISTENT | TEXF_ALLOWUPDATES, -1, NULL); + r_texture_gammaramps = R_LoadTexture2D(r_main_texturepool, "gammaramps", RAMPWIDTH, 1, &rampbgr[0][0], TEXTYPE_BGRA, TEXF_FORCELINEAR | TEXF_CLAMP | TEXF_PERSISTENT, -1, NULL); } } } diff --git a/r_textures.h b/r_textures.h index 18d3d14e..0cbad652 100644 --- a/r_textures.h +++ b/r_textures.h @@ -22,7 +22,7 @@ #define TEXF_COMPARE 0x00000800 // indicates texture should use lower precision where supported #define TEXF_LOWPRECISION 0x00001000 -// indicates texture should support R_UpdateTexture, actual uploads may be delayed until R_Mesh_TexBind if gl_nopartialtextureupdates is on +// indicates texture should support R_UpdateTexture on small regions, actual uploads may be delayed until R_Mesh_TexBind if gl_nopartialtextureupdates is on #define TEXF_ALLOWUPDATES 0x00002000 // indicates texture should be affected by gl_picmip_world and r_picmipworld (maybe others in the future) instead of gl_picmip_other #define TEXF_ISWORLD 0x00004000 -- 2.39.2