Download Source Code/Yuzu/src/shader_recompiler/frontend/ir/patch.cpp from GilbertClaus/Emulator: direct link, hf CLI and curl.
- Browser
- Download file 806 Bytes
-
https://huggingface.co/GilbertClaus/Emulator/resolve/main/Source%20Code/Yuzu/src/shader_recompiler/frontend/ir/patch.cpp
- Command line
-
hf download 'hf://GilbertClaus/Emulator/Source Code/Yuzu/src/shader_recompiler/frontend/ir/patch.cpp'
-
curl -L -o patch.cpp https://huggingface.co/GilbertClaus/Emulator/resolve/main/Source%20Code/Yuzu/src/shader_recompiler/frontend/ir/patch.cpp
806 Bytes
| // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project | |
| // SPDX-License-Identifier: GPL-2.0-or-later | |
| namespace Shader::IR { | |
| bool IsGeneric(Patch patch) noexcept { | |
| return patch >= Patch::Component0 && patch <= Patch::Component119; | |
| } | |
| u32 GenericPatchIndex(Patch patch) { | |
| if (!IsGeneric(patch)) { | |
| throw InvalidArgument("Patch {} is not generic", patch); | |
| } | |
| return (static_cast<u32>(patch) - static_cast<u32>(Patch::Component0)) / 4; | |
| } | |
| u32 GenericPatchElement(Patch patch) { | |
| if (!IsGeneric(patch)) { | |
| throw InvalidArgument("Patch {} is not generic", patch); | |
| } | |
| return (static_cast<u32>(patch) - static_cast<u32>(Patch::Component0)) % 4; | |
| } | |
| } // namespace Shader::IR | |