diff options
| author | 2016-11-27 16:01:45 -0800 | |
|---|---|---|
| committer | 2016-11-27 16:01:45 -0800 | |
| commit | e279a6955edf644cf832dd329ac72931aea8add7 (patch) | |
| tree | 92e0ffea8d1ca855e5b7178224883de5cf33562a /src/core/hw/gpu.cpp | |
| parent | Merge pull request #2132 from wwylele/fix-fs-err (diff) | |
| parent | GPU: Remove the broken frame_skip option. (diff) | |
| download | yuzu-e279a6955edf644cf832dd329ac72931aea8add7.tar.gz yuzu-e279a6955edf644cf832dd329ac72931aea8add7.tar.xz yuzu-e279a6955edf644cf832dd329ac72931aea8add7.zip | |
Merge pull request #2222 from linkmauve/die-frameskip-die
Remove the broken frame_skip option
Diffstat (limited to 'src/core/hw/gpu.cpp')
| -rw-r--r-- | src/core/hw/gpu.cpp | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp index 28cb97d8e..45dedea68 100644 --- a/src/core/hw/gpu.cpp +++ b/src/core/hw/gpu.cpp | |||
| @@ -29,16 +29,12 @@ namespace GPU { | |||
| 29 | 29 | ||
| 30 | Regs g_regs; | 30 | Regs g_regs; |
| 31 | 31 | ||
| 32 | /// True if the current frame was skipped | ||
| 33 | bool g_skip_frame; | ||
| 34 | /// 268MHz CPU clocks / 60Hz frames per second | 32 | /// 268MHz CPU clocks / 60Hz frames per second |
| 35 | const u64 frame_ticks = 268123480ull / 60; | 33 | const u64 frame_ticks = 268123480ull / 60; |
| 36 | /// Event id for CoreTiming | 34 | /// Event id for CoreTiming |
| 37 | static int vblank_event; | 35 | static int vblank_event; |
| 38 | /// Total number of frames drawn | 36 | /// Total number of frames drawn |
| 39 | static u64 frame_count; | 37 | static u64 frame_count; |
| 40 | /// True if the last frame was skipped | ||
| 41 | static bool last_skip_frame; | ||
| 42 | 38 | ||
| 43 | template <typename T> | 39 | template <typename T> |
| 44 | inline void Read(T& var, const u32 raw_addr) { | 40 | inline void Read(T& var, const u32 raw_addr) { |
| @@ -519,20 +515,7 @@ template void Write<u8>(u32 addr, const u8 data); | |||
| 519 | /// Update hardware | 515 | /// Update hardware |
| 520 | static void VBlankCallback(u64 userdata, int cycles_late) { | 516 | static void VBlankCallback(u64 userdata, int cycles_late) { |
| 521 | frame_count++; | 517 | frame_count++; |
| 522 | last_skip_frame = g_skip_frame; | 518 | VideoCore::g_renderer->SwapBuffers(); |
| 523 | g_skip_frame = (frame_count & Settings::values.frame_skip) != 0; | ||
| 524 | |||
| 525 | // Swap buffers based on the frameskip mode, which is a little bit tricky. When | ||
| 526 | // a frame is being skipped, nothing is being rendered to the internal framebuffer(s). | ||
| 527 | // So, we should only swap frames if the last frame was rendered. The rules are: | ||
| 528 | // - If frameskip == 0 (disabled), always swap buffers | ||
| 529 | // - If frameskip == 1, swap buffers every other frame (starting from the first frame) | ||
| 530 | // - If frameskip > 1, swap buffers every frameskip^n frames (starting from the second frame) | ||
| 531 | if ((((Settings::values.frame_skip != 1) ^ last_skip_frame) && | ||
| 532 | last_skip_frame != g_skip_frame) || | ||
| 533 | Settings::values.frame_skip == 0) { | ||
| 534 | VideoCore::g_renderer->SwapBuffers(); | ||
| 535 | } | ||
| 536 | 519 | ||
| 537 | // Signal to GSP that GPU interrupt has occurred | 520 | // Signal to GSP that GPU interrupt has occurred |
| 538 | // TODO(yuriks): hwtest to determine if PDC0 is for the Top screen and PDC1 for the Sub | 521 | // TODO(yuriks): hwtest to determine if PDC0 is for the Top screen and PDC1 for the Sub |
| @@ -579,8 +562,6 @@ void Init() { | |||
| 579 | framebuffer_sub.color_format.Assign(Regs::PixelFormat::RGB8); | 562 | framebuffer_sub.color_format.Assign(Regs::PixelFormat::RGB8); |
| 580 | framebuffer_sub.active_fb = 0; | 563 | framebuffer_sub.active_fb = 0; |
| 581 | 564 | ||
| 582 | last_skip_frame = false; | ||
| 583 | g_skip_frame = false; | ||
| 584 | frame_count = 0; | 565 | frame_count = 0; |
| 585 | 566 | ||
| 586 | vblank_event = CoreTiming::RegisterEvent("GPU::VBlankCallback", VBlankCallback); | 567 | vblank_event = CoreTiming::RegisterEvent("GPU::VBlankCallback", VBlankCallback); |