Skip to content

Commit

Permalink
port: finish drawing before copying the backbuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
fgsfdsfgs committed Oct 21, 2023
1 parent 6f0cb75 commit 81a5e97
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions port/fast3d/gfx_pc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions src/game/bondview.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/include/gbiex.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 81a5e97

Please sign in to comment.