Repository navigation
Mario Kart World: full-speed cup intro movies (skip present pacing during large movies), on top of #553 #729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| // SPDX-License-Identifier: GPL-3.0-or-later | ||
| #pragma once | ||
|
|
||
| #include <array> | ||
| #include <span> | ||
|
|
||
| #include "shader_recompiler/frontend/ampere/program_override.h" | ||
|
|
||
| namespace VideoCommon { | ||
|
|
||
| // Experimental, opt-in workaround for a missing ground-height map. The original wave | ||
| // amplitudes and water exclusion mask still control the resulting displacement. | ||
| inline bool ApplyMkwZeroDepthFallback(std::span<const Shader::Ampere::Instruction> source, | ||
| Shader::Ampere::LoweredProgram& program) { | ||
| if (!program || source.size_bytes() != 0x3b0 || | ||
| Shader::Ampere::NativeProgramKey(source) != 0x5a4f3726590efb17ULL || | ||
| program.source_instruction_offsets.size() != source.size()) { | ||
| return false; | ||
| } | ||
| constexpr size_t next_source = 0x2d0 / sizeof(Shader::Ampere::Instruction); | ||
| const size_t insert = program.source_instruction_offsets[next_source]; | ||
| if (insert > program.instructions.size()) { | ||
| return false; | ||
| } | ||
| // At this point R8=(water-ground)*20, R9=water and R4=saturate(R8). | ||
| // Both R8 and R9 zero identifies the entirely empty pair, including neither | ||
| // real shallows (equal nonzero heights) nor dry ground (negative depth). | ||
| constexpr u64 always = u64{7} << 16; | ||
| constexpr std::array<u64, 3> fallback{ | ||
| // LOP.OR R250, R8, R9 (PT destination; no live predicate is changed). | ||
| 0x5c40000000000000ULL | always | 250 | (u64{8} << 8) | (u64{9} << 20) | | ||
| (u64{1} << 41) | (u64{7} << 48), | ||
| // ISET.EQ.U32.AND with float-result mode: 1.0 if empty, otherwise 0. | ||
| 0x5b50000000000000ULL | always | 250 | (u64{250} << 8) | (u64{255} << 20) | | ||
| (u64{7} << 39) | (u64{1} << 44) | (u64{2} << 49), | ||
| // Empty input has R4=0; other input ORs with zero and stays unchanged. | ||
| 0x5c40000000000000ULL | always | 4 | (u64{4} << 8) | (u64{250} << 20) | | ||
| (u64{1} << 41) | (u64{7} << 48), | ||
| }; | ||
| program.instructions.insert(program.instructions.begin() + insert, fallback.begin(), | ||
| fallback.end()); | ||
| // This exact shader has no branches or calls; its predicated EXITs need no relocation. | ||
| for (size_t index = next_source; index < program.source_instruction_offsets.size(); ++index) { | ||
| program.source_instruction_offsets[index] += static_cast<u32>(fallback.size()); | ||
| } | ||
| return true; | ||
| } | ||
|
|
||
| } // namespace VideoCommon |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -714,12 +714,13 @@ GraphicsPipeline* PipelineCache::CurrentGraphicsPipeline() { | |
| return CurrentGraphicsPipelineSlowPath(); | ||
| } | ||
|
|
||
| ComputePipeline* PipelineCache::CurrentComputePipeline() { | ||
| ComputePipeline* PipelineCache::CurrentComputePipeline(u64& native_key) { | ||
|
|
||
| const ShaderInfo* const shader{ComputeShader()}; | ||
| if (!shader) { | ||
| return nullptr; | ||
| } | ||
| native_key = shader->lowered_native ? shader->lowered_native->native_key : 0; | ||
| const auto& qmd{kepler_compute->launch_description}; | ||
| const ComputePipelineCacheKey key{ | ||
| .unique_hash = shader->unique_hash, | ||
|
|
@@ -749,7 +750,11 @@ void PipelineCache::LoadDiskResources(u64 title_id, std::stop_token stop_loading | |
| } | ||
|
|
||
| const auto shader_dir{Common::FS::GetEdenPath(Common::FS::EdenPath::ShaderDir)}; | ||
| const auto base_dir{shader_dir / fmt::format("{:016x}", title_id)}; | ||
| auto base_dir{shader_dir / fmt::format("{:016x}", title_id)}; | ||
| if (const char* enabled = std::getenv("EDEN_MKW_ZERO_DEPTH_FALLBACK"); | ||
| enabled != nullptr && enabled[0] == '1') { | ||
| base_dir /= "mkw_zero_depth_v1"; | ||
| } | ||
|
Comment on lines
+753
to
+757
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| if (!Common::FS::CreateDir(shader_dir) || !Common::FS::CreateDir(base_dir)) { | ||
| LOG_ERROR(Common_Filesystem, "Failed to create pipeline cache directories"); | ||
| return; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Timestamp frames from newly registered images.
The update is inside the
m_release_fencesbranch.RegisterBuffersupplies images without release fences, so the first frames do not activate the workaround. If a clip fits entirely in the initial image ring, it remains paced throughout. Move the update outside that branch, after the frame is written. (raw.githubusercontent.com)