[Video] Remove voodoo.has_2mb_tex_boundary

This commit is contained in:
zilmar 2017-08-21 08:20:19 +10:00
parent 289ae755b1
commit a91d336846
4 changed files with 11 additions and 36 deletions

View File

@ -70,7 +70,7 @@ CRDP rdp;
CSettings * g_settings = NULL; CSettings * g_settings = NULL;
VOODOO voodoo = { 0, 0, 0, 0, VOODOO voodoo = { 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0 0, 0, 0, 0
}; };
@ -436,11 +436,6 @@ int InitGfx()
WriteTrace(TraceGlide64, TraceDebug, "-"); WriteTrace(TraceGlide64, TraceDebug, "-");
// 2Mb Texture boundary
voodoo.has_2mb_tex_boundary = false;
// we get better texture cache hits with UMA on
WriteTrace(TraceGlide64, TraceDebug, "Using TEXUMA extension");
ChangeSize(); ChangeSize();
#ifndef ANDROID #ifndef ANDROID
SetWindowDisplaySize((HWND)gfx.hWnd); SetWindowDisplaySize((HWND)gfx.hWnd);
@ -769,8 +764,6 @@ int CALL InitiateGFX(GFX_INFO Gfx_Info)
CRC_BuildTable(); CRC_BuildTable();
CountCombine(); CountCombine();
ZLUT_init(); ZLUT_init();
voodoo.has_2mb_tex_boundary = 0;
return TRUE; return TRUE;
} }

View File

@ -1646,15 +1646,6 @@ void LoadTex(int id, gfxChipID_t tmu)
uint32_t texture_size = gfxTexTextureMemRequired(GFX_MIPMAPLEVELMASK_BOTH, t_info); uint32_t texture_size = gfxTexTextureMemRequired(GFX_MIPMAPLEVELMASK_BOTH, t_info);
// Check for 2mb boundary
// Hiroshi Morii <koolsmoky@users.sourceforge.net> required only for V1,Rush, and V2
if (voodoo.has_2mb_tex_boundary &&
(voodoo.tmem_ptr[tmu] < TEXMEM_2MB_EDGE) && (voodoo.tmem_ptr[tmu] + texture_size > TEXMEM_2MB_EDGE))
{
voodoo.tmem_ptr[tmu] = TEXMEM_2MB_EDGE;
cache->tmem_addr = voodoo.tmem_ptr[tmu];
}
// Check for end of memory (too many textures to fit, clear cache) // Check for end of memory (too many textures to fit, clear cache)
if (voodoo.tmem_ptr[tmu] + texture_size >= voodoo.tex_max_addr[tmu]) if (voodoo.tmem_ptr[tmu] + texture_size >= voodoo.tex_max_addr[tmu])
{ {

View File

@ -671,15 +671,7 @@ bool TxHiResCache::loadHiResTextures(const char * dir_path, bool replace)
/* XXX: only ARGB8888 for now. comeback to this later... */ /* XXX: only ARGB8888 for now. comeback to this later... */
if (format == GFX_TEXFMT_ARGB_8888) { if (format == GFX_TEXFMT_ARGB_8888) {
#if TEXTURE_TILING #if TEXTURE_TILING
/* minification */
/* Glide64 style texture tiling */
/* NOTE: narrow wide textures can be tiled into 256x256 size textures */
/* adjust texture size to allow tiling for V1, Rush, V2, Banshee, V3 */
/* NOTE: we skip this for palette textures that need minification
* becasue it will look ugly. */
/* minification */
{ {
int ratio = 1; int ratio = 1;
@ -901,7 +893,7 @@ bool TxHiResCache::loadHiResTextures(const char * dir_path, bool replace)
case GFX_TEXFMT_ALPHA_8: /* no size benefit with dxtn */ case GFX_TEXFMT_ALPHA_8: /* no size benefit with dxtn */
; ;
} }
} }
/* compress it! */ /* compress it! */
if (dataSize) { if (dataSize) {
#if 0 /* TEST: dither before compression for better results with gradients */ #if 0 /* TEST: dither before compression for better results with gradients */
@ -923,13 +915,13 @@ bool TxHiResCache::loadHiResTextures(const char * dir_path, bool replace)
width = tmpwidth; width = tmpwidth;
height = tmpheight; height = tmpheight;
format = destformat = tmpformat; format = destformat = tmpformat;
} }
else { else {
free(tmptex); free(tmptex);
} }
}
} }
} }
}
else { else {
#if POW2_TEXTURES #if POW2_TEXTURES
#if (POW2_TEXTURES == 2) #if (POW2_TEXTURES == 2)
@ -945,7 +937,7 @@ bool TxHiResCache::loadHiResTextures(const char * dir_path, bool replace)
continue; continue;
} }
#endif #endif
} }
/* quantize */ /* quantize */
{ {
@ -990,9 +982,9 @@ bool TxHiResCache::loadHiResTextures(const char * dir_path, bool replace)
free(tex); free(tex);
tex = tmptex; tex = tmptex;
} }
}
} }
} }
}
/* last minute validations */ /* last minute validations */
if (!tex || !chksum || !width || !height || !format || width > _maxwidth || height > _maxheight) { if (!tex || !chksum || !width || !height || !format || width > _maxwidth || height > _maxheight) {
@ -1061,8 +1053,8 @@ bool TxHiResCache::loadHiResTextures(const char * dir_path, bool replace)
} }
free(tex); free(tex);
} }
} while (TextureDir.FindNext()); } while (TextureDir.FindNext());
} }
#endif #endif
return 1; return 1;
} }

View File

@ -120,7 +120,6 @@ typedef struct {
typedef struct typedef struct
{ {
int has_2mb_tex_boundary;
int gamma_correction; int gamma_correction;
int32_t gamma_table_size; int32_t gamma_table_size;
uint32_t *gamma_table_r; uint32_t *gamma_table_r;