port: finish drawing before copying the backbuffer

This commit is contained in:
fgsfds committed 2023-10-21 14:24:36 +02:00
1 parent 6f0cb752aa
commit 81a5e971ef
3 files changed
+8

No files matched your search

+3
View File
@@ -2652,6 +2652,9 @@ static void gfx_run_dl(Gfx* cmd) {
// TODO: skyRender uses these to render some types of skies and skybox water
// by issuing low-level ucode commands G_TRI_FILL and G_TRI_SHADE_TXTR
break;
case G_RDPFLUSH_EXT:
gfx_flush();
break;
case G_RDPPIPESYNC:
case G_RDPFULLSYNC:
case G_RDPLOADSYNC:
+2
View File
@@ -715,6 +715,7 @@ Gfx *bviewDrawFisheye(Gfx *gdl, u32 colour, u32 alpha, s32 shuttertime60, s8 sta
#ifndef PLATFORM_N64
// make a copy of the current back buffer contents that we will be using as a texture
gDPFlushEXT(gdl++);
gDPCopyFramebufferEXT(gdl++, g_PrevFrameFb, 0, 0, 0, G_ON);
gDPSetFramebufferTextureEXT(gdl++, 0, 0, 0, g_PrevFrameFb);
#endif
@@ -2659,6 +2660,7 @@ Gfx *bviewDrawHorizonScanner(Gfx *gdl)
return gdl;
}
// make a copy of what we have drawn so far and use it as a texture
gDPFlushEXT(gdl++);
gDPCopyFramebufferEXT(gdl++, g_PrevFrameFb, 0, 0, 0, G_ON);
gDPSetFramebufferTextureEXT(gdl++, 0, 0, 0, g_PrevFrameFb);
#endif
+3
View File
@@ -194,6 +194,7 @@
#define G_SETINTENSITY_EXT 0x40
#define G_COPYFB_EXT 0x41
#define G_IMAGERECT_EXT 0x42
#define G_RDPFLUSH_EXT 0x43
/* G_EXTRAGEOMETRYMODE flags */
@@ -292,6 +293,8 @@
#define gSPTextureRectangleEXT(p, xl, yl, xh, yh, tile, s, t, ds, dt) gSPTextureRectangleWideEXT(p, xl, yl, xh, yh, tile, s, t, ds, dt, G_OFF)
#define gSPTextureRectangleFlipEXT(p, xl, yl, xh, yh, tile, s, t, ds, dt) gSPTextureRectangleWideEXT(p, xl, yl, xh, yh, tile, s, t, ds, dt, G_ON)
#define gDPFlushEXT(pkt) gDPNoParam(pkt, G_RDPFLUSH_EXT)
#undef gDPFillRectangleScaled
#define gDPFillRectangleScaled(pkt, x1, y1, x2, y2) gDPFillRectangleEXT(pkt, (x1) * g_ScaleX, y1, (x2) * g_ScaleX, y2)