From c33e862b8a737a9b2e920f64541b812725fb626c Mon Sep 17 00:00:00 2001 From: zilmar Date: Fri, 18 Aug 2017 08:27:54 +1000 Subject: [PATCH] [Video] Remove voodoo.max_tex_size --- Source/Project64-video/FBtoScreen.cpp | 4 ++-- Source/Project64-video/Main.cpp | 16 ++++------------ Source/Project64-video/TexBuffer.cpp | 2 +- Source/Project64-video/TexCache.cpp | 2 +- Source/Project64-video/rdp.h | 1 - 5 files changed, 8 insertions(+), 17 deletions(-) diff --git a/Source/Project64-video/FBtoScreen.cpp b/Source/Project64-video/FBtoScreen.cpp index c77890318..b8a8827f0 100644 --- a/Source/Project64-video/FBtoScreen.cpp +++ b/Source/Project64-video/FBtoScreen.cpp @@ -266,7 +266,7 @@ bool DrawFrameBufferToScreen(FB_TO_SCREEN_INFO & fb_info) return false; uint32_t width = fb_info.lr_x - fb_info.ul_x + 1; uint32_t height = fb_info.lr_y - fb_info.ul_y + 1; - uint32_t max_size = minval(voodoo.max_tex_size, 512); + uint32_t max_size = 512; if (width > (uint32_t)max_size || height > (uint32_t)max_size) { DrawFrameBufferToScreen256(fb_info); @@ -525,7 +525,7 @@ void DrawDepthBufferToScreen(FB_TO_SCREEN_INFO & fb_info) { uint32_t width = fb_info.lr_x - fb_info.ul_x + 1; uint32_t height = fb_info.lr_y - fb_info.ul_y + 1; - if (width > (uint32_t)voodoo.max_tex_size || height > (uint32_t)voodoo.max_tex_size || width > 512) + if (width > (uint32_t)2048 || height > (uint32_t)2048 || width > 512) { DrawDepthBufferToScreen256(fb_info); return; diff --git a/Source/Project64-video/Main.cpp b/Source/Project64-video/Main.cpp index c285ab907..0bf0aaddc 100644 --- a/Source/Project64-video/Main.cpp +++ b/Source/Project64-video/Main.cpp @@ -219,14 +219,7 @@ int GetTexAddrNonUMA(int tmu, int texsize) void guLoadTextures() { int tbuf_size = 0; - if (voodoo.max_tex_size <= 256) - { - gfxTextureBufferExt(GFX_TMU1, voodoo.tex_min_addr[GFX_TMU1], GFX_LOD_LOG2_256, GFX_LOD_LOG2_256, - GFX_ASPECT_LOG2_1x1, GFX_TEXFMT_RGB_565, GFX_MIPMAPLEVELMASK_BOTH); - tbuf_size = 8 * gfxTexCalcMemRequired(GFX_LOD_LOG2_256, GFX_LOD_LOG2_256, - GFX_ASPECT_LOG2_1x1, GFX_TEXFMT_RGB_565); - } - else if (g_scr_res_x <= 1024) + if (g_scr_res_x <= 1024) { gfxTextureBufferExt(GFX_TMU0, voodoo.tex_min_addr[GFX_TMU0], GFX_LOD_LOG2_1024, GFX_LOD_LOG2_1024, GFX_ASPECT_LOG2_1x1, GFX_TEXFMT_RGB_565, GFX_MIPMAPLEVELMASK_BOTH); @@ -464,8 +457,7 @@ int InitGfx() to_fullscreen = FALSE; // get maximal texture size - voodoo.max_tex_size = 2048; - voodoo.sup_large_tex = (voodoo.max_tex_size > 256 && !g_settings->hacks(CSettings::hack_PPL)); + voodoo.sup_large_tex = !g_settings->hacks(CSettings::hack_PPL); voodoo.tex_min_addr[0] = voodoo.tex_min_addr[1] = gfxTexMinAddress(GFX_TMU0); voodoo.tex_max_addr[0] = voodoo.tex_max_addr[1] = gfxTexMaxAddress(GFX_TMU0); @@ -566,8 +558,8 @@ int InitGfx() options |= DUMP_TEX; } - g_ghq_use = (int)ext_ghq_init(voodoo.max_tex_size, // max texture width supported by hardware - voodoo.max_tex_size, // max texture height supported by hardware + g_ghq_use = (int)ext_ghq_init(2048, // max texture width supported by hardware + 2048, // max texture height supported by hardware voodoo.sup_32bit_tex ? 32 : 16, // max texture bpp supported by hardware options, g_settings->ghq_cache_size() * 1024 * 1024, // cache texture to system memory diff --git a/Source/Project64-video/TexBuffer.cpp b/Source/Project64-video/TexBuffer.cpp index ec80ff35d..6f8942895 100644 --- a/Source/Project64-video/TexBuffer.cpp +++ b/Source/Project64-video/TexBuffer.cpp @@ -35,7 +35,7 @@ static TBUFF_COLOR_IMAGE * AllocateTextureBuffer(COLOR_IMAGE & cimage) // texbuf.scr_height = texbuf.height * rdp.scale_y; uint16_t max_size = maxval((uint16_t)texbuf.scr_width, (uint16_t)texbuf.scr_height); - if (max_size > voodoo.max_tex_size) //texture size is too large + if (max_size > 2048) //texture size is too large return 0; uint32_t tex_size; //calculate LOD diff --git a/Source/Project64-video/TexCache.cpp b/Source/Project64-video/TexCache.cpp index 5da761846..07bb57fcd 100644 --- a/Source/Project64-video/TexCache.cpp +++ b/Source/Project64-video/TexCache.cpp @@ -1548,7 +1548,7 @@ void LoadTex(int id, gfxChipID_t tmu) int splits = cache->splits; if (ghqTexInfo.is_hires_tex) { - if (ghqTexInfo.tiles/*ghqTexInfo.untiled_width > max_tex_size*/) + if (ghqTexInfo.tiles) { cache->scale = 1.0f; cache->c_off = 0.5f; diff --git a/Source/Project64-video/rdp.h b/Source/Project64-video/rdp.h index a8fa1ff7f..68b0e9670 100644 --- a/Source/Project64-video/rdp.h +++ b/Source/Project64-video/rdp.h @@ -120,7 +120,6 @@ typedef struct { typedef struct { - int max_tex_size; int sup_large_tex; int sup_mirroring; int sup_32bit_tex;