From c9b5c7190db183083e8200f190b22d8a44d4d462 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 20 Jul 2017 17:30:08 +1000 Subject: [PATCH] [Video] Rename grTexCalcMemRequired to gfxTexCalcMemRequired --- Source/Project64-video/Main.cpp | 6 +++--- Source/Project64-video/Renderer/OGLEStextures.cpp | 4 ++-- Source/Project64-video/Renderer/OGLtextures.cpp | 7 ++----- Source/Project64-video/Renderer/Renderer.h | 1 + Source/Project64-video/TexBuffer.cpp | 2 +- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Source/Project64-video/Main.cpp b/Source/Project64-video/Main.cpp index 66e9ca464..8f8ad9eb8 100644 --- a/Source/Project64-video/Main.cpp +++ b/Source/Project64-video/Main.cpp @@ -231,14 +231,14 @@ void guLoadTextures() { gfxTextureBufferExt(GR_TMU1, voodoo.tex_min_addr[GR_TMU1], GFX_LOD_LOG2_256, GFX_LOD_LOG2_256, GR_ASPECT_LOG2_1x1, GFX_TEXFMT_RGB_565, GR_MIPMAPLEVELMASK_BOTH); - tbuf_size = 8 * grTexCalcMemRequired(GFX_LOD_LOG2_256, GFX_LOD_LOG2_256, + tbuf_size = 8 * gfxTexCalcMemRequired(GFX_LOD_LOG2_256, GFX_LOD_LOG2_256, GR_ASPECT_LOG2_1x1, GFX_TEXFMT_RGB_565); } else if (g_scr_res_x <= 1024) { gfxTextureBufferExt(GR_TMU0, voodoo.tex_min_addr[GR_TMU0], GFX_LOD_LOG2_1024, GFX_LOD_LOG2_1024, GR_ASPECT_LOG2_1x1, GFX_TEXFMT_RGB_565, GR_MIPMAPLEVELMASK_BOTH); - tbuf_size = grTexCalcMemRequired(GFX_LOD_LOG2_1024, GFX_LOD_LOG2_1024, + tbuf_size = gfxTexCalcMemRequired(GFX_LOD_LOG2_1024, GFX_LOD_LOG2_1024, GR_ASPECT_LOG2_1x1, GFX_TEXFMT_RGB_565); gfxRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT); gfxBufferClear(0, 0, 0xFFFF); @@ -248,7 +248,7 @@ void guLoadTextures() { gfxTextureBufferExt(GR_TMU0, voodoo.tex_min_addr[GR_TMU0], GFX_LOD_LOG2_2048, GFX_LOD_LOG2_2048, GR_ASPECT_LOG2_1x1, GFX_TEXFMT_RGB_565, GR_MIPMAPLEVELMASK_BOTH); - tbuf_size = grTexCalcMemRequired(GFX_LOD_LOG2_2048, GFX_LOD_LOG2_2048, + tbuf_size = gfxTexCalcMemRequired(GFX_LOD_LOG2_2048, GFX_LOD_LOG2_2048, GR_ASPECT_LOG2_1x1, GFX_TEXFMT_RGB_565); gfxRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT); gfxBufferClear(0, 0, 0xFFFF); diff --git a/Source/Project64-video/Renderer/OGLEStextures.cpp b/Source/Project64-video/Renderer/OGLEStextures.cpp index 24d482790..659625c7a 100644 --- a/Source/Project64-video/Renderer/OGLEStextures.cpp +++ b/Source/Project64-video/Renderer/OGLEStextures.cpp @@ -204,13 +204,13 @@ FxU32 gfxTexTextureMemRequired(FxU32 evenOdd, GrTexInfo *info) } FX_ENTRY FxU32 FX_CALL -grTexCalcMemRequired( +gfxTexCalcMemRequired( GrLOD_t lodmin, GrLOD_t lodmax, GrAspectRatio_t aspect, GrTextureFormat_t fmt) { WriteTrace(TraceGlitch, TraceDebug, "lodmin = %d, lodmax: %d aspect: %d fmt: %d", lodmin, lodmax, aspect, fmt); int width, height; - if (lodmax != lodmin) WriteTrace(TraceGlitch, TraceWarning, "grTexCalcMemRequired : loading more than one LOD"); + if (lodmax != lodmin) WriteTrace(TraceGlitch, TraceWarning, "gfxTexCalcMemRequired : loading more than one LOD"); if (aspect < 0) { diff --git a/Source/Project64-video/Renderer/OGLtextures.cpp b/Source/Project64-video/Renderer/OGLtextures.cpp index af836ef02..ca8d4a46a 100644 --- a/Source/Project64-video/Renderer/OGLtextures.cpp +++ b/Source/Project64-video/Renderer/OGLtextures.cpp @@ -204,14 +204,11 @@ FxU32 gfxTexTextureMemRequired(FxU32 evenOdd, GrTexInfo *info) return 0; } -FX_ENTRY FxU32 FX_CALL -grTexCalcMemRequired( - GrLOD_t lodmin, GrLOD_t lodmax, - GrAspectRatio_t aspect, GrTextureFormat_t fmt) +FxU32 gfxTexCalcMemRequired(GrLOD_t lodmin, GrLOD_t lodmax, GrAspectRatio_t aspect, GrTextureFormat_t fmt) { WriteTrace(TraceGlitch, TraceDebug, "lodmin = %d, lodmax: %d aspect: %d fmt: %d", lodmin, lodmax, aspect, fmt); int width, height; - if (lodmax != lodmin) WriteTrace(TraceGlitch, TraceWarning, "grTexCalcMemRequired : loading more than one LOD"); + if (lodmax != lodmin) WriteTrace(TraceGlitch, TraceWarning, "gfxTexCalcMemRequired : loading more than one LOD"); if (aspect < 0) { diff --git a/Source/Project64-video/Renderer/Renderer.h b/Source/Project64-video/Renderer/Renderer.h index 5e3cd16f5..5d00eca68 100644 --- a/Source/Project64-video/Renderer/Renderer.h +++ b/Source/Project64-video/Renderer/Renderer.h @@ -63,6 +63,7 @@ FxBool gfxLfbLock(GrLock_t type, GrBuffer_t buffer, GrLfbWriteMode_t writeMode, FxBool gfxLfbUnlock(GrLock_t type, GrBuffer_t buffer); FxBool gfxLfbReadRegion(GrBuffer_t src_buffer, FxU32 src_x, FxU32 src_y, FxU32 src_width, FxU32 src_height, FxU32 dst_stride, void *dst_data); FxBool gfxLfbWriteRegion(GrBuffer_t dst_buffer, FxU32 dst_x, FxU32 dst_y, GrLfbSrcFmt_t src_format, FxU32 src_width, FxU32 src_height, FxBool pixelPipeline, FxI32 src_stride, void *src_data); +FxU32 gfxTexCalcMemRequired(GrLOD_t lodmin, GrLOD_t lodmax, GrAspectRatio_t aspect, GrTextureFormat_t fmt); extern uint32_t nbTextureUnits; extern uint32_t g_scr_res_x, g_scr_res_y, g_res_x, g_res_y; diff --git a/Source/Project64-video/TexBuffer.cpp b/Source/Project64-video/TexBuffer.cpp index 3527c70ff..4c4cc9d18 100644 --- a/Source/Project64-video/TexBuffer.cpp +++ b/Source/Project64-video/TexBuffer.cpp @@ -126,7 +126,7 @@ static TBUFF_COLOR_IMAGE * AllocateTextureBuffer(COLOR_IMAGE & cimage) WriteTrace(TraceRDP, TraceDebug, "\nAllocateTextureBuffer. width: %d, height: %d, scr_width: %f, scr_height: %f, vi_width: %f, vi_height:%f, scale_x: %f, scale_y: %f, lr_u: %f, lr_v: %f, u_scale: %f, v_scale: %f", texbuf.width, texbuf.height, texbuf.scr_width, texbuf.scr_height, rdp.vi_width, rdp.vi_height, rdp.scale_x, rdp.scale_y, texbuf.lr_u, texbuf.lr_v, texbuf.u_scale, texbuf.v_scale); - uint32_t required = grTexCalcMemRequired(texbuf.info.smallLodLog2, texbuf.info.largeLodLog2, + uint32_t required = gfxTexCalcMemRequired(texbuf.info.smallLodLog2, texbuf.info.largeLodLog2, texbuf.info.aspectRatioLog2, texbuf.info.format); //find free space for (int i = 0; i < (nbTextureUnits > 2 ? 2 : 1); i++)