Add print for textures flowing into main RAM, re-enable external PCX for 1000

This commit is contained in:
Steam Deck User 2023-03-16 22:20:57 -04:00
parent 49a9587180
commit d67952ca9b
2 changed files with 6 additions and 9 deletions

View file

@ -3041,6 +3041,7 @@ int GL_LoadTextureLM (const char *identifier, int width, int height, const byte
GL_LoadImages
================
*/
int total_overbudget_texturemem;
int GL_LoadImages (const char *identifier, int width, int height, const byte *data, qboolean stretch_to_power_of_two, int filter, int mipmap_level, int bpp)
{
int texture_index = -1;
@ -3190,7 +3191,7 @@ int GL_LoadImages (const char *identifier, int width, int height, const byte *da
// Allocate the RAM.
std::size_t buffer_size = GL_GetTexSize(texture.format, texture.width, texture.height, 0);
Con_Printf("Loading: %s [%dx%d](%0.2f KB)\n",texture.identifier,texture.width,texture.height, (float) buffer_size/1024);
Con_DPrintf("Loading: %s [%dx%d](%0.2f KB)\n",texture.identifier,texture.width,texture.height, (float) buffer_size/1024);
texture.ram = static_cast<texel*>(memalign(16, buffer_size));
@ -3226,6 +3227,10 @@ int GL_LoadImages (const char *identifier, int width, int height, const byte *da
{
free(texture.ram);
texture.ram = NULL;
} else {
Con_Printf("Couldn't fit %s into VRAM (%dkB)\n", identifier, buffer_size/1024);
total_overbudget_texturemem += buffer_size/1024;
Con_Printf("RESIDUAL VRAM: %d\n", total_overbudget_texturemem);
}
// Done.

View file

@ -2113,20 +2113,12 @@ void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype)
// HACK HACK HACK
sprintf (model2, "%s.mdl_%i", model, i);
// Sigh.. something is totally awry with memory and the Slim kinda band-aids it..
// Textures can occupy RAM and VRAM at the same time, ie RAM isnt being freed properly
// So PHAT ends up kicking the bucket with a lot of external textures.
#ifdef SLIM
pheader->gl_texturenum[i][0] =
pheader->gl_texturenum[i][1] =
pheader->gl_texturenum[i][2] =
pheader->gl_texturenum[i][3] = loadtextureimage (model2, 0, 0, qtrue, GU_LINEAR);
if (pheader->gl_texturenum[i][0] == 0)// did not find a matching TGA...
#endif // SLIM
{
sprintf (name, "%s_%i", loadmodel->name, i);
if(mod_h2)