From: havoc Date: Mon, 23 Aug 2010 15:07:35 +0000 (+0000) Subject: don't use TEXF_ALLOWUPDATES on fully-updated textures such as video X-Git-Tag: xonotic-v0.1.0preview~230^2~68 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=50614c010dff980a99dae156c35d392c64d58216;p=xonotic%2Fdarkplaces.git 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 --- 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 12960d78..59a5b603 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 d9bdfac4..6697db42 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 84a2974e..3fccfffd 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -497,8 +497,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); } } @@ -9474,7 +9474,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 fa6d645d..c8981183 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