[Video[ rename grDepthMask to gfxDepthMask

This commit is contained in:
zilmar 2017-05-25 08:51:36 +10:00
parent 704e132ddc
commit 6da2839b61
9 changed files with 29 additions and 29 deletions

View File

@ -92,7 +92,7 @@ static int SetupFBtoScreenCombiner(uint32_t texture_size, uint32_t opaque)
} }
gfxDepthBufferFunction(GR_CMP_ALWAYS); gfxDepthBufferFunction(GR_CMP_ALWAYS);
gfxCullMode(GR_CULL_DISABLE); gfxCullMode(GR_CULL_DISABLE);
grDepthMask(FXFALSE); gfxDepthMask(FXFALSE);
rdp.update |= UPDATE_COMBINE | UPDATE_ZBUF_ENABLED | UPDATE_CULL_MODE; rdp.update |= UPDATE_COMBINE | UPDATE_ZBUF_ENABLED | UPDATE_CULL_MODE;
return tmu; return tmu;
} }
@ -500,7 +500,7 @@ static void DrawHiresDepthBufferToScreen(FB_TO_SCREEN_INFO & fb_info)
GR_BLEND_ONE, GR_BLEND_ONE,
GR_BLEND_ZERO); GR_BLEND_ZERO);
gfxDepthBufferFunction(GR_CMP_ALWAYS); gfxDepthBufferFunction(GR_CMP_ALWAYS);
grDepthMask(FXFALSE); gfxDepthMask(FXFALSE);
gfxCullMode(GR_CULL_DISABLE); gfxCullMode(GR_CULL_DISABLE);
gfxTexCombine(GR_TMU1, gfxTexCombine(GR_TMU1,
GR_COMBINE_FUNCTION_NONE, GR_COMBINE_FUNCTION_NONE,

View File

@ -539,7 +539,7 @@ int InitGfx()
gfxDepthBufferMode(GR_DEPTHBUFFER_ZBUFFER); gfxDepthBufferMode(GR_DEPTHBUFFER_ZBUFFER);
gfxDepthBufferFunction(GR_CMP_LESS); gfxDepthBufferFunction(GR_CMP_LESS);
grDepthMask(FXTRUE); gfxDepthMask(FXTRUE);
ChangeSize(); ChangeSize();
@ -551,11 +551,11 @@ int InitGfx()
gfxDepthBufferFunction(GR_CMP_ALWAYS); gfxDepthBufferFunction(GR_CMP_ALWAYS);
grRenderBuffer(GR_BUFFER_BACKBUFFER); grRenderBuffer(GR_BUFFER_BACKBUFFER);
gfxColorMask(FXTRUE, FXTRUE); gfxColorMask(FXTRUE, FXTRUE);
grDepthMask(FXTRUE); gfxDepthMask(FXTRUE);
grBufferClear(0, 0, 0xFFFF); grBufferClear(0, 0, 0xFFFF);
grBufferSwap(0); grBufferSwap(0);
grBufferClear(0, 0, 0xFFFF); grBufferClear(0, 0, 0xFFFF);
grDepthMask(FXFALSE); gfxDepthMask(FXFALSE);
grTexFilterMode(0, GR_TEXTUREFILTER_BILINEAR, GR_TEXTUREFILTER_BILINEAR); grTexFilterMode(0, GR_TEXTUREFILTER_BILINEAR, GR_TEXTUREFILTER_BILINEAR);
grTexFilterMode(1, GR_TEXTUREFILTER_BILINEAR, GR_TEXTUREFILTER_BILINEAR); grTexFilterMode(1, GR_TEXTUREFILTER_BILINEAR, GR_TEXTUREFILTER_BILINEAR);
grTexClampMode(0, GR_TEXTURECLAMP_CLAMP, GR_TEXTURECLAMP_CLAMP); grTexClampMode(0, GR_TEXTURECLAMP_CLAMP, GR_TEXTURECLAMP_CLAMP);
@ -1116,7 +1116,7 @@ static void DrawFrameBuffer()
if (to_fullscreen) if (to_fullscreen)
GoToFullScreen(); GoToFullScreen();
grDepthMask(FXTRUE); gfxDepthMask(FXTRUE);
gfxColorMask(FXTRUE, FXTRUE); gfxColorMask(FXTRUE, FXTRUE);
grBufferClear(0, 0, 0xFFFF); grBufferClear(0, 0, 0xFFFF);
drawViRegBG(); drawViRegBG();
@ -1319,7 +1319,7 @@ void newSwapBuffers()
rdp.update |= UPDATE_SCISSOR | UPDATE_COMBINE | UPDATE_ZBUF_ENABLED | UPDATE_CULL_MODE; rdp.update |= UPDATE_SCISSOR | UPDATE_COMBINE | UPDATE_ZBUF_ENABLED | UPDATE_CULL_MODE;
gfxClipWindow(0, 0, g_scr_res_x, g_scr_res_y); gfxClipWindow(0, 0, g_scr_res_x, g_scr_res_y);
gfxDepthBufferFunction(GR_CMP_ALWAYS); gfxDepthBufferFunction(GR_CMP_ALWAYS);
grDepthMask(FXFALSE); gfxDepthMask(FXFALSE);
gfxCullMode(GR_CULL_DISABLE); gfxCullMode(GR_CULL_DISABLE);
if (g_capture_screen) if (g_capture_screen)
@ -1434,7 +1434,7 @@ void newSwapBuffers()
if (g_settings->wireframe() || g_settings->buff_clear() || (g_settings->hacks(CSettings::hack_PPL) && g_settings->ucode() == CSettings::ucode_S2DEX)) if (g_settings->wireframe() || g_settings->buff_clear() || (g_settings->hacks(CSettings::hack_PPL) && g_settings->ucode() == CSettings::ucode_S2DEX))
{ {
grDepthMask((g_settings->hacks(CSettings::hack_RE2) && g_settings->fb_depth_render_enabled()) ? FXFALSE : FXTRUE); gfxDepthMask((g_settings->hacks(CSettings::hack_RE2) && g_settings->fb_depth_render_enabled()) ? FXFALSE : FXTRUE);
grBufferClear(0, 0, 0xFFFF); grBufferClear(0, 0, 0xFFFF);
} }

View File

@ -287,12 +287,12 @@ void gfxDepthBufferFunction(GrCmpFnc_t function)
} }
} }
FX_ENTRY void FX_CALL void gfxDepthMask(FxBool mask)
grDepthMask(FxBool mask)
{ {
WriteTrace(TraceGlitch, TraceDebug, "mask: %d", mask); WriteTrace(TraceGlitch, TraceDebug, "mask: %d", mask);
glDepthMask(mask); glDepthMask(mask);
} }
float biasFactor = 0; float biasFactor = 0;
FX_ENTRY void FX_CALL FX_ENTRY void FX_CALL
grDepthBiasLevel(FxI32 level) grDepthBiasLevel(FxI32 level)

View File

@ -219,12 +219,11 @@ void gfxDepthBufferFunction(GrCmpFnc_t function)
grDisplayGLError("gfxDepthBufferFunction"); grDisplayGLError("gfxDepthBufferFunction");
} }
FX_ENTRY void FX_CALL void gfxDepthMask(FxBool mask)
grDepthMask(FxBool mask)
{ {
WriteTrace(TraceGlitch, TraceDebug, "mask: %d", mask); WriteTrace(TraceGlitch, TraceDebug, "mask: %d", mask);
glDepthMask((GLboolean)mask); glDepthMask((GLboolean)mask);
grDisplayGLError("grDepthMask"); grDisplayGLError("gfxDepthMask");
} }
float biasFactor = 0; float biasFactor = 0;

View File

@ -45,6 +45,7 @@ void gfxVertexLayout(FxU32 param, FxI32 offset, FxU32 mode);
void gfxCullMode(GrCullMode_t mode); void gfxCullMode(GrCullMode_t mode);
void gfxDepthBufferMode(GrDepthBufferMode_t mode); void gfxDepthBufferMode(GrDepthBufferMode_t mode);
void gfxDepthBufferFunction(GrCmpFnc_t function); void gfxDepthBufferFunction(GrCmpFnc_t function);
void gfxDepthMask(FxBool mask);
extern uint32_t nbTextureUnits; extern uint32_t nbTextureUnits;
extern uint32_t g_scr_res_x, g_scr_res_y, g_res_x, g_res_y; extern uint32_t g_scr_res_x, g_scr_res_y, g_res_x, g_res_y;

View File

@ -258,9 +258,9 @@ int OpenTextureBuffer(COLOR_IMAGE & cimage)
grRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT); grRenderBuffer(GR_BUFFER_TEXTUREBUFFER_EXT);
gfxTextureBufferExt(texbuf->tmu, texbuf->tex_addr, texbuf->info.smallLodLog2, texbuf->info.largeLodLog2, gfxTextureBufferExt(texbuf->tmu, texbuf->tex_addr, texbuf->info.smallLodLog2, texbuf->info.largeLodLog2,
texbuf->info.aspectRatioLog2, texbuf->info.format, GR_MIPMAPLEVELMASK_BOTH); texbuf->info.aspectRatioLog2, texbuf->info.format, GR_MIPMAPLEVELMASK_BOTH);
grDepthMask(FXFALSE); gfxDepthMask(FXFALSE);
grBufferClear(0, 0, 0xFFFF); grBufferClear(0, 0, 0xFFFF);
grDepthMask(FXTRUE); gfxDepthMask(FXTRUE);
grRenderBuffer(GR_BUFFER_BACKBUFFER); grRenderBuffer(GR_BUFFER_BACKBUFFER);
rdp.texbufs[i].count--; rdp.texbufs[i].count--;
if (j < rdp.texbufs[i].count) if (j < rdp.texbufs[i].count)
@ -300,9 +300,9 @@ int OpenTextureBuffer(COLOR_IMAGE & cimage)
if (rdp.cur_image->clear && g_settings->fb_hwfbe_buf_clear_enabled() && cimage.changed) if (rdp.cur_image->clear && g_settings->fb_hwfbe_buf_clear_enabled() && cimage.changed)
{ {
rdp.cur_image->clear = FALSE; rdp.cur_image->clear = FALSE;
grDepthMask(FXFALSE); gfxDepthMask(FXFALSE);
grBufferClear(0, 0, 0xFFFF); grBufferClear(0, 0, 0xFFFF);
grDepthMask(FXTRUE); gfxDepthMask(FXTRUE);
} }
//*/ //*/
// memset(gfx.RDRAM+cimage.addr, 0, cimage.width*cimage.height*cimage.size); // memset(gfx.RDRAM+cimage.addr, 0, cimage.width*cimage.height*cimage.size);
@ -341,7 +341,7 @@ static GrTextureFormat_t TexBufSetupCombiner(int force_rgb = FALSE)
GR_BLEND_ZERO); GR_BLEND_ZERO);
gfxClipWindow(0, 0, g_scr_res_x, g_scr_res_y); gfxClipWindow(0, 0, g_scr_res_x, g_scr_res_y);
gfxDepthBufferFunction(GR_CMP_ALWAYS); gfxDepthBufferFunction(GR_CMP_ALWAYS);
grDepthMask(FXFALSE); gfxDepthMask(FXFALSE);
gfxCullMode(GR_CULL_DISABLE); gfxCullMode(GR_CULL_DISABLE);
gfxFogMode(GR_FOG_DISABLE); gfxFogMode(GR_FOG_DISABLE);
GrTextureFormat_t buf_format = (rdp.tbuff_tex) ? rdp.tbuff_tex->info.format : GFX_TEXFMT_RGB_565; GrTextureFormat_t buf_format = (rdp.tbuff_tex) ? rdp.tbuff_tex->info.format : GFX_TEXFMT_RGB_565;

View File

@ -1776,15 +1776,15 @@ void update()
} }
if (rdp.flags & ZBUF_UPDATE) if (rdp.flags & ZBUF_UPDATE)
grDepthMask(FXTRUE); gfxDepthMask(FXTRUE);
else else
grDepthMask(FXFALSE); gfxDepthMask(FXFALSE);
} }
else else
{ {
grDepthBiasLevel(0); grDepthBiasLevel(0);
gfxDepthBufferFunction(GR_CMP_ALWAYS); gfxDepthBufferFunction(GR_CMP_ALWAYS);
grDepthMask(FXFALSE); gfxDepthMask(FXFALSE);
} }
} }

View File

@ -2395,7 +2395,7 @@ void rdp_fillrect()
if (!g_settings->hacks(CSettings::hack_Hyperbike) || rdp.ci_width > 64) //do not clear main depth buffer for aux depth buffers if (!g_settings->hacks(CSettings::hack_Hyperbike) || rdp.ci_width > 64) //do not clear main depth buffer for aux depth buffers
{ {
update_scissor(); update_scissor();
grDepthMask(FXTRUE); gfxDepthMask(FXTRUE);
gfxColorMask(FXFALSE, FXFALSE); gfxColorMask(FXFALSE, FXFALSE);
grBufferClear(0, 0, rdp.fill_color ? rdp.fill_color & 0xFFFF : 0xFFFF); grBufferClear(0, 0, rdp.fill_color ? rdp.fill_color & 0xFFFF : 0xFFFF);
gfxColorMask(FXTRUE, FXTRUE); gfxColorMask(FXTRUE, FXTRUE);
@ -2437,9 +2437,9 @@ void rdp_fillrect()
((uint32_t)((float)((color & 0x07C0) >> 6) / 31.0f * 255.0f) << 16) | ((uint32_t)((float)((color & 0x07C0) >> 6) / 31.0f * 255.0f) << 16) |
((uint32_t)((float)((color & 0x003E) >> 1) / 31.0f * 255.0f) << 8); ((uint32_t)((float)((color & 0x003E) >> 1) / 31.0f * 255.0f) << 8);
} }
grDepthMask(FXFALSE); gfxDepthMask(FXFALSE);
grBufferClear(color, 0, 0xFFFF); grBufferClear(color, 0, 0xFFFF);
grDepthMask(FXTRUE); gfxDepthMask(FXTRUE);
rdp.update |= UPDATE_ZBUF_ENABLED; rdp.update |= UPDATE_ZBUF_ENABLED;
WriteTrace(TraceRDP, TraceDebug, "Fillrect - cleared the texture buffer"); WriteTrace(TraceRDP, TraceDebug, "Fillrect - cleared the texture buffer");
return; return;
@ -2522,7 +2522,7 @@ void rdp_fillrect()
gfxCullMode(GR_CULL_DISABLE); gfxCullMode(GR_CULL_DISABLE);
gfxFogMode(GR_FOG_DISABLE); gfxFogMode(GR_FOG_DISABLE);
gfxDepthBufferFunction(GR_CMP_ALWAYS); gfxDepthBufferFunction(GR_CMP_ALWAYS);
grDepthMask(FXFALSE); gfxDepthMask(FXFALSE);
rdp.update |= UPDATE_COMBINE | UPDATE_CULL_MODE | UPDATE_FOG_ENABLED | UPDATE_ZBUF_ENABLED; rdp.update |= UPDATE_COMBINE | UPDATE_CULL_MODE | UPDATE_FOG_ENABLED | UPDATE_ZBUF_ENABLED;
} }
@ -2721,9 +2721,9 @@ static void RestoreScale()
rdp.view_trans[1] *= rdp.scale_y; rdp.view_trans[1] *= rdp.scale_y;
rdp.update |= UPDATE_VIEWPORT | UPDATE_SCISSOR; rdp.update |= UPDATE_VIEWPORT | UPDATE_SCISSOR;
//* //*
grDepthMask(FXFALSE); gfxDepthMask(FXFALSE);
grBufferClear(0, 0, 0xFFFF); grBufferClear(0, 0, 0xFFFF);
grDepthMask(FXTRUE); gfxDepthMask(FXTRUE);
//*/ //*/
} }

View File

@ -173,7 +173,7 @@ void DrawHiresDepthImage(const DRAWIMAGE & d)
GR_BLEND_ONE, GR_BLEND_ONE,
GR_BLEND_ZERO); GR_BLEND_ZERO);
gfxDepthBufferFunction(GR_CMP_ALWAYS); gfxDepthBufferFunction(GR_CMP_ALWAYS);
grDepthMask(FXFALSE); gfxDepthMask(FXFALSE);
GrLOD_t LOD = g_scr_res_x > 1024 ? GFX_LOD_LOG2_2048 : GFX_LOD_LOG2_1024; GrLOD_t LOD = g_scr_res_x > 1024 ? GFX_LOD_LOG2_2048 : GFX_LOD_LOG2_1024;
@ -202,7 +202,7 @@ void DrawHiresDepthImage(const DRAWIMAGE & d)
grDrawTriangle(&v[2], &v[3], &v[1]); grDrawTriangle(&v[2], &v[3], &v[1]);
grRenderBuffer(GR_BUFFER_BACKBUFFER); grRenderBuffer(GR_BUFFER_BACKBUFFER);
grAuxBufferExt(GR_BUFFER_TEXTUREAUXBUFFER_EXT); grAuxBufferExt(GR_BUFFER_TEXTUREAUXBUFFER_EXT);
grDepthMask(FXTRUE); gfxDepthMask(FXTRUE);
} }
void DrawDepthImage(const DRAWIMAGE & d) void DrawDepthImage(const DRAWIMAGE & d)