[Video] Rename grTexTextureMemRequired to gfxTexTextureMemRequired

This commit is contained in:
zilmar 2017-05-23 17:32:25 +10:00
parent d5942628e9
commit e0f2ed0513
6 changed files with 17 additions and 20 deletions

View File

@ -147,7 +147,7 @@ static void DrawRE2Video256(FB_TO_SCREEN_INFO & fb_info)
}
t_info.format = GFX_TEXFMT_RGB_565;
t_info.data = tex;
int tmu = SetupFBtoScreenCombiner(grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &t_info), fb_info.opaque);
int tmu = SetupFBtoScreenCombiner(gfxTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &t_info), fb_info.opaque);
grTexDownloadMipMap(tmu,
voodoo.tex_min_addr[tmu] + voodoo.tmem_ptr[tmu],
GR_MIPMAPLEVELMASK_BOTH,
@ -178,7 +178,7 @@ static void DrawFrameBufferToScreen256(FB_TO_SCREEN_INFO & fb_info)
t_info.format = GFX_TEXFMT_ARGB_1555;
uint16_t * tex = (uint16_t*)texture_buffer;
t_info.data = tex;
uint32_t tex_size = grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &t_info);
uint32_t tex_size = gfxTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &t_info);
int tmu = SetupFBtoScreenCombiner(tex_size*width256*height256, fb_info.opaque);
uint16_t * src = (uint16_t*)image;
src += fb_info.ul_x + fb_info.ul_y * fb_info.width;
@ -364,7 +364,7 @@ bool DrawFrameBufferToScreen(FB_TO_SCREEN_INFO & fb_info)
t_info.data = tex;
}
int tmu = SetupFBtoScreenCombiner(grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &t_info), fb_info.opaque);
int tmu = SetupFBtoScreenCombiner(gfxTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &t_info), fb_info.opaque);
grTexDownloadMipMap(tmu,
voodoo.tex_min_addr[tmu] + voodoo.tmem_ptr[tmu],
GR_MIPMAPLEVELMASK_BOTH,
@ -412,7 +412,7 @@ static void DrawDepthBufferToScreen256(FB_TO_SCREEN_INFO & fb_info)
t_info.format = GFX_TEXFMT_ALPHA_INTENSITY_88;
uint16_t * tex = (uint16_t*)texture_buffer;
t_info.data = tex;
uint32_t tex_size = grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &t_info);
uint32_t tex_size = gfxTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &t_info);
int tmu = SetupFBtoScreenCombiner(tex_size*width256*height256, fb_info.opaque);
grConstantColorValue(rdp.fog_color);
grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
@ -595,7 +595,7 @@ void DrawDepthBufferToScreen(FB_TO_SCREEN_INFO & fb_info)
t_info.format = GFX_TEXFMT_ALPHA_INTENSITY_88;
t_info.data = tex;
int tmu = SetupFBtoScreenCombiner(grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &t_info), fb_info.opaque);
int tmu = SetupFBtoScreenCombiner(gfxTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &t_info), fb_info.opaque);
grConstantColorValue(rdp.fog_color);
grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_ONE,

View File

@ -308,7 +308,7 @@ void guLoadTextures()
GR_MIPMAPLEVELMASK_BOTH,
&fontTex);
offset_cursor = offset_font + grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &fontTex);
offset_cursor = offset_font + gfxTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &fontTex);
free(fontTex.data);
@ -337,7 +337,7 @@ void guLoadTextures()
&cursorTex);
// Round to higher 16
offset_textures = ((offset_cursor + grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &cursorTex))
offset_textures = ((offset_cursor + gfxTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &cursorTex))
& 0xFFFFFFF0) + 16;
free(cursorTex.data);
}

View File

@ -156,13 +156,11 @@ FxU32 gfxTexMaxAddress(GrChipID_t tmu)
return tmu*TMU_SIZE + TMU_SIZE - 1;
}
FX_ENTRY FxU32 FX_CALL
grTexTextureMemRequired(FxU32 evenOdd,
GrTexInfo *info)
FxU32 gfxTexTextureMemRequired(FxU32 evenOdd, GrTexInfo *info)
{
WriteTrace(TraceGlitch, TraceDebug, "evenOdd = %d", evenOdd);
int width, height;
if (info->largeLodLog2 != info->smallLodLog2) WriteTrace(TraceGlitch, TraceWarning, "grTexTextureMemRequired : loading more than one LOD");
if (info->largeLodLog2 != info->smallLodLog2) WriteTrace(TraceGlitch, TraceWarning, "gfxTexTextureMemRequired : loading more than one LOD");
if (info->aspectRatioLog2 < 0)
{
@ -200,7 +198,7 @@ grTexTextureMemRequired(FxU32 evenOdd,
case GFX_TEXFMT_ARGB_CMP_FXT1:
return ((((width + 0x7)&~0x7)*((height + 0x3)&~0x3)) >> 1);
default:
WriteTrace(TraceGlitch, TraceWarning, "grTexTextureMemRequired : unknown texture format: %x", info->format);
WriteTrace(TraceGlitch, TraceWarning, "gfxTexTextureMemRequired : unknown texture format: %x", info->format);
}
return 0;
}
@ -250,7 +248,7 @@ grTexCalcMemRequired(
case GFX_TEXFMT_ARGB_CMP_FXT1:
return ((((width + 0x7)&~0x7)*((height + 0x3)&~0x3)) >> 1);
default:
WriteTrace(TraceGlitch, TraceWarning, "grTexTextureMemRequired : unknown texture format: %x", fmt);
WriteTrace(TraceGlitch, TraceWarning, "gfxTexTextureMemRequired : unknown texture format: %x", fmt);
}
return 0;
}

View File

@ -157,13 +157,11 @@ FxU32 gfxTexMaxAddress(GrChipID_t tmu)
return tmu*TMU_SIZE + TMU_SIZE - 1;
}
FX_ENTRY FxU32 FX_CALL
grTexTextureMemRequired(FxU32 evenOdd,
GrTexInfo *info)
FxU32 gfxTexTextureMemRequired(FxU32 evenOdd, GrTexInfo *info)
{
WriteTrace(TraceGlitch, TraceDebug, "evenOdd = %d", evenOdd);
int width, height;
if (info->largeLodLog2 != info->smallLodLog2) WriteTrace(TraceGlitch, TraceWarning, "grTexTextureMemRequired : loading more than one LOD");
if (info->largeLodLog2 != info->smallLodLog2) WriteTrace(TraceGlitch, TraceWarning, "gfxTexTextureMemRequired : loading more than one LOD");
if (info->aspectRatioLog2 < 0)
{
@ -201,7 +199,7 @@ grTexTextureMemRequired(FxU32 evenOdd,
case GFX_TEXFMT_ARGB_CMP_FXT1:
return ((((width + 0x7)&~0x7)*((height + 0x3)&~0x3)) >> 1);
default:
WriteTrace(TraceGlitch, TraceWarning, "grTexTextureMemRequired : unknown texture format: %x", info->format);
WriteTrace(TraceGlitch, TraceWarning, "gfxTexTextureMemRequired : unknown texture format: %x", info->format);
}
return 0;
}
@ -251,7 +249,7 @@ grTexCalcMemRequired(
case GFX_TEXFMT_ARGB_CMP_FXT1:
return ((((width + 0x7)&~0x7)*((height + 0x3)&~0x3)) >> 1);
default:
WriteTrace(TraceGlitch, TraceWarning, "grTexTextureMemRequired : unknown texture format: %x", fmt);
WriteTrace(TraceGlitch, TraceWarning, "gfxTexTextureMemRequired : unknown texture format: %x", fmt);
}
return 0;
}

View File

@ -22,6 +22,7 @@ FxU32 gfxTexMinAddress(GrChipID_t tmu);
FxBool gfxSstWinClose(GrContext_t context);
void gfxTextureBufferExt(GrChipID_t tmu, FxU32 startAddress, GrLOD_t lodmin, GrLOD_t lodmax, GrAspectRatio_t aspect, GrTextureFormat_t fmt, FxU32 evenOdd);
FxU32 gfxTexMaxAddress(GrChipID_t tmu);
FxU32 gfxTexTextureMemRequired(FxU32 evenOdd, GrTexInfo *info);
extern uint32_t nbTextureUnits;
extern uint32_t g_scr_res_x, g_scr_res_y, g_res_x, g_res_y;

View File

@ -1653,7 +1653,7 @@ void LoadTex(int id, int tmu)
t_info->largeLodLog2 = lod;
t_info->aspectRatioLog2 = aspect;
uint32_t texture_size = grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, t_info);
uint32_t texture_size = gfxTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, t_info);
// Check for 2mb boundary
// Hiroshi Morii <koolsmoky@users.sourceforge.net> required only for V1,Rush, and V2