diff options
| author | 2016-11-27 21:06:42 +0000 | |
|---|---|---|
| committer | 2016-11-27 21:19:56 +0000 | |
| commit | 0820c994629a53e81dd521388a67154c8c8f9318 (patch) | |
| tree | b8f91a0cbaf3c6eab3fd98c968191f900b808dde /src | |
| parent | Merge pull request #2168 from mailwl/mic (diff) | |
| download | yuzu-0820c994629a53e81dd521388a67154c8c8f9318.tar.gz yuzu-0820c994629a53e81dd521388a67154c8c8f9318.tar.xz yuzu-0820c994629a53e81dd521388a67154c8c8f9318.zip | |
GPU: Remove the broken frame_skip option.
Fixes #1960.
Diffstat (limited to '')
| -rw-r--r-- | src/citra/config.cpp | 1 | ||||
| -rw-r--r-- | src/citra/default_ini.h | 4 | ||||
| -rw-r--r-- | src/citra_qt/config.cpp | 2 | ||||
| -rw-r--r-- | src/core/hw/gpu.cpp | 21 | ||||
| -rw-r--r-- | src/core/hw/gpu.h | 1 | ||||
| -rw-r--r-- | src/core/settings.h | 1 | ||||
| -rw-r--r-- | src/video_core/command_processor.cpp | 4 |
7 files changed, 1 insertions, 33 deletions
diff --git a/src/citra/config.cpp b/src/citra/config.cpp index fd30bfc85..fe74fcd72 100644 --- a/src/citra/config.cpp +++ b/src/citra/config.cpp | |||
| @@ -59,7 +59,6 @@ void Config::ReadValues() { | |||
| 59 | 59 | ||
| 60 | // Core | 60 | // Core |
| 61 | Settings::values.use_cpu_jit = sdl2_config->GetBoolean("Core", "use_cpu_jit", true); | 61 | Settings::values.use_cpu_jit = sdl2_config->GetBoolean("Core", "use_cpu_jit", true); |
| 62 | Settings::values.frame_skip = sdl2_config->GetInteger("Core", "frame_skip", 0); | ||
| 63 | 62 | ||
| 64 | // Renderer | 63 | // Renderer |
| 65 | Settings::values.use_hw_renderer = sdl2_config->GetBoolean("Renderer", "use_hw_renderer", true); | 64 | Settings::values.use_hw_renderer = sdl2_config->GetBoolean("Renderer", "use_hw_renderer", true); |
diff --git a/src/citra/default_ini.h b/src/citra/default_ini.h index b22627a2f..b98dc4d83 100644 --- a/src/citra/default_ini.h +++ b/src/citra/default_ini.h | |||
| @@ -42,10 +42,6 @@ pad_circle_modifier_scale = | |||
| 42 | # 0: Interpreter (slow), 1 (default): JIT (fast) | 42 | # 0: Interpreter (slow), 1 (default): JIT (fast) |
| 43 | use_cpu_jit = | 43 | use_cpu_jit = |
| 44 | 44 | ||
| 45 | # The applied frameskip amount. Must be a power of two. | ||
| 46 | # 0 (default): No frameskip, 1: x2 frameskip, 2: x4 frameskip, 3: x8 frameskip, etc. | ||
| 47 | frame_skip = | ||
| 48 | |||
| 49 | [Renderer] | 45 | [Renderer] |
| 50 | # Whether to use software or hardware rendering. | 46 | # Whether to use software or hardware rendering. |
| 51 | # 0: Software, 1 (default): Hardware | 47 | # 0: Software, 1 (default): Hardware |
diff --git a/src/citra_qt/config.cpp b/src/citra_qt/config.cpp index 3d2312619..3cdfe6443 100644 --- a/src/citra_qt/config.cpp +++ b/src/citra_qt/config.cpp | |||
| @@ -39,7 +39,6 @@ void Config::ReadValues() { | |||
| 39 | 39 | ||
| 40 | qt_config->beginGroup("Core"); | 40 | qt_config->beginGroup("Core"); |
| 41 | Settings::values.use_cpu_jit = qt_config->value("use_cpu_jit", true).toBool(); | 41 | Settings::values.use_cpu_jit = qt_config->value("use_cpu_jit", true).toBool(); |
| 42 | Settings::values.frame_skip = qt_config->value("frame_skip", 0).toInt(); | ||
| 43 | qt_config->endGroup(); | 42 | qt_config->endGroup(); |
| 44 | 43 | ||
| 45 | qt_config->beginGroup("Renderer"); | 44 | qt_config->beginGroup("Renderer"); |
| @@ -146,7 +145,6 @@ void Config::SaveValues() { | |||
| 146 | 145 | ||
| 147 | qt_config->beginGroup("Core"); | 146 | qt_config->beginGroup("Core"); |
| 148 | qt_config->setValue("use_cpu_jit", Settings::values.use_cpu_jit); | 147 | qt_config->setValue("use_cpu_jit", Settings::values.use_cpu_jit); |
| 149 | qt_config->setValue("frame_skip", Settings::values.frame_skip); | ||
| 150 | qt_config->endGroup(); | 148 | qt_config->endGroup(); |
| 151 | 149 | ||
| 152 | qt_config->beginGroup("Renderer"); | 150 | qt_config->beginGroup("Renderer"); |
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); |
diff --git a/src/core/hw/gpu.h b/src/core/hw/gpu.h index 32ddc5697..d53381216 100644 --- a/src/core/hw/gpu.h +++ b/src/core/hw/gpu.h | |||
| @@ -316,7 +316,6 @@ ASSERT_REG_POSITION(command_processor_config, 0x00638); | |||
| 316 | static_assert(sizeof(Regs) == 0x1000 * sizeof(u32), "Invalid total size of register set"); | 316 | static_assert(sizeof(Regs) == 0x1000 * sizeof(u32), "Invalid total size of register set"); |
| 317 | 317 | ||
| 318 | extern Regs g_regs; | 318 | extern Regs g_regs; |
| 319 | extern bool g_skip_frame; | ||
| 320 | 319 | ||
| 321 | template <typename T> | 320 | template <typename T> |
| 322 | void Read(T& var, const u32 addr); | 321 | void Read(T& var, const u32 addr); |
diff --git a/src/core/settings.h b/src/core/settings.h index e931953d7..7470fdbeb 100644 --- a/src/core/settings.h +++ b/src/core/settings.h | |||
| @@ -78,7 +78,6 @@ struct Values { | |||
| 78 | 78 | ||
| 79 | // Core | 79 | // Core |
| 80 | bool use_cpu_jit; | 80 | bool use_cpu_jit; |
| 81 | int frame_skip; | ||
| 82 | 81 | ||
| 83 | // Data Storage | 82 | // Data Storage |
| 84 | bool use_virtual_sd; | 83 | bool use_virtual_sd; |
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp index b7c32035e..c80c96762 100644 --- a/src/video_core/command_processor.cpp +++ b/src/video_core/command_processor.cpp | |||
| @@ -52,10 +52,6 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) { | |||
| 52 | if (id >= regs.NumIds()) | 52 | if (id >= regs.NumIds()) |
| 53 | return; | 53 | return; |
| 54 | 54 | ||
| 55 | // If we're skipping this frame, only allow trigger IRQ | ||
| 56 | if (GPU::g_skip_frame && id != PICA_REG_INDEX(trigger_irq)) | ||
| 57 | return; | ||
| 58 | |||
| 59 | // TODO: Figure out how register masking acts on e.g. vs.uniform_setup.set_value | 55 | // TODO: Figure out how register masking acts on e.g. vs.uniform_setup.set_value |
| 60 | u32 old_value = regs[id]; | 56 | u32 old_value = regs[id]; |
| 61 | 57 | ||