Skip to content

Commit

Permalink
GPU: Add virtual call when buffers are swapped
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Jun 28, 2024
1 parent 0c3cf1f commit 80d1056
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/gpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1291,6 +1291,7 @@ void GPU::WriteGP1(u32 value)
SynchronizeCRTC();
m_crtc_state.regs.display_address_start = new_value;
UpdateCRTCDisplayParameters();
OnBufferSwapped();
}
}
break;
Expand Down Expand Up @@ -2833,6 +2834,10 @@ void GPU::DrawRendererStats()
{
}

void GPU::OnBufferSwapped()
{
}

void GPU::GetStatsString(SmallStringBase& str)
{
if (IsHardwareRenderer())
Expand Down
1 change: 1 addition & 0 deletions src/core/gpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ class GPU
virtual void UpdateCLUT(GPUTexturePaletteReg reg, bool clut_is_8bit) = 0;
virtual void UpdateDisplay() = 0;
virtual void DrawRendererStats();
virtual void OnBufferSwapped();

ALWAYS_INLINE_RELEASE void AddDrawTriangleTicks(s32 x1, s32 y1, s32 x2, s32 y2, s32 x3, s32 y3, bool shaded,
bool textured, bool semitransparent)
Expand Down
5 changes: 5 additions & 0 deletions src/core/gpu_hw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3412,6 +3412,11 @@ void GPU_HW::UpdateDownsamplingLevels()
g_gpu_device->RecycleTexture(std::move(m_downsample_texture));
}

void GPU_HW::OnBufferSwapped()
{
GL_INS("OnBufferSwapped()");
}

void GPU_HW::DownsampleFramebuffer()
{
GPUTexture* source = m_display_texture;
Expand Down
1 change: 1 addition & 0 deletions src/core/gpu_hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ class GPU_HW final : public GPU
void UpdateCLUT(GPUTexturePaletteReg reg, bool clut_is_8bit) override;
void FlushRender() override;
void DrawRendererStats() override;
void OnBufferSwapped() override;

bool BlitVRAMReplacementTexture(const TextureReplacementTexture* tex, u32 dst_x, u32 dst_y, u32 width, u32 height);

Expand Down

0 comments on commit 80d1056

Please sign in to comment.