Merge remote-tracking branch 'upstream/main' into fs-cleanup

This commit is contained in:
Stephen Miller 2025-02-20 15:39:57 -06:00
commit b52b6ae04b
106 changed files with 5570 additions and 2737 deletions

View File

@ -10,7 +10,7 @@ if grep -nrI '\s$' src *.yml *.txt *.md Doxyfile .gitignore .gitmodules .ci* dis
fi
# Default clang-format points to default 3.5 version one
CLANG_FORMAT=clang-format-18
CLANG_FORMAT=clang-format-19
$CLANG_FORMAT --version
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then

View File

@ -30,9 +30,9 @@ jobs:
- name: Install
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main'
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main'
sudo apt update
sudo apt install clang-format-18
sudo apt install clang-format-19
- name: Build
env:
COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}

View File

@ -22,10 +22,9 @@ jobs:
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.SHADPS4_TOKEN_REPO }}
title: "Qt GUI: Update Translation"
commit-message: "[ci skip] Qt GUI: Update Translation."
committer: "shadPS4 Bot <Shadps4Boot@users.noreply.github.com>"
author: "shadPS4 Bot <Shadps4Boot@users.noreply.github.com>"
body: "Daily update of translation sources."
branch: update-translation
delete-branch: true

View File

@ -766,11 +766,11 @@ set(SHADER_RECOMPILER src/shader_recompiler/exception.h
src/shader_recompiler/ir/passes/identity_removal_pass.cpp
src/shader_recompiler/ir/passes/ir_passes.h
src/shader_recompiler/ir/passes/lower_buffer_format_to_raw.cpp
src/shader_recompiler/ir/passes/lower_shared_mem_to_registers.cpp
src/shader_recompiler/ir/passes/resource_tracking_pass.cpp
src/shader_recompiler/ir/passes/ring_access_elimination.cpp
src/shader_recompiler/ir/passes/shader_info_collection_pass.cpp
src/shader_recompiler/ir/passes/shared_memory_barrier_pass.cpp
src/shader_recompiler/ir/passes/shared_memory_to_storage_pass.cpp
src/shader_recompiler/ir/passes/ssa_rewrite_pass.cpp
src/shader_recompiler/ir/abstract_syntax_list.h
src/shader_recompiler/ir/attribute.cpp

View File

@ -13,33 +13,49 @@ First and foremost, Clang 18 is the **recommended compiler** as it is used for o
#### Debian & Ubuntu
```
sudo apt install build-essential clang git cmake libasound2-dev libpulse-dev libopenal-dev libssl-dev zlib1g-dev libedit-dev libudev-dev libevdev-dev libsdl2-dev libjack-dev libsndio-dev qt6-base-dev qt6-tools-dev qt6-multimedia-dev libvulkan-dev vulkan-validationlayers
```bash
sudo apt install build-essential clang git cmake libasound2-dev \
libpulse-dev libopenal-dev libssl-dev zlib1g-dev libedit-dev \
libudev-dev libevdev-dev libsdl2-dev libjack-dev libsndio-dev \
qt6-base-dev qt6-tools-dev qt6-multimedia-dev libvulkan-dev \
vulkan-validationlayers libpng-dev
```
#### Fedora
```
sudo dnf install clang git cmake libatomic alsa-lib-devel pipewire-jack-audio-connection-kit-devel openal-devel openssl-devel libevdev-devel libudev-devel libXext-devel qt6-qtbase-devel qt6-qtbase-private-devel qt6-qtmultimedia-devel qt6-qtsvg-devel qt6-qttools-devel vulkan-devel vulkan-validation-layers
```bash
sudo dnf install clang git cmake libatomic alsa-lib-devel \
pipewire-jack-audio-connection-kit-devel openal-devel \
openssl-devel libevdev-devel libudev-devel libXext-devel \
qt6-qtbase-devel qt6-qtbase-private-devel \
qt6-qtmultimedia-devel qt6-qtsvg-devel qt6-qttools-devel \
vulkan-devel vulkan-validation-layers libpng-devel
```
#### Arch Linux
```
sudo pacman -S base-devel clang git cmake sndio jack2 openal qt6-base qt6-declarative qt6-multimedia sdl2 vulkan-validation-layers
```bash
sudo pacman -S base-devel clang git cmake sndio jack2 openal \
qt6-base qt6-declarative qt6-multimedia sdl2 \
vulkan-validation-layers libpng
```
**Note**: The `shadps4-git` AUR package is not maintained by any of the developers, and it uses the default compiler, which is often set to GCC. Use at your own discretion.
#### OpenSUSE
```
sudo zypper install clang git cmake libasound2 libpulse-devel libsndio7 libjack-devel openal-soft-devel libopenssl-devel zlib-devel libedit-devel systemd-devel libevdev-devel qt6-base-devel qt6-multimedia-devel qt6-svg-devel qt6-linguist-devel qt6-gui-private-devel vulkan-devel vulkan-validationlayers
```bash
sudo zypper install clang git cmake libasound2 libpulse-devel \
libsndio7 libjack-devel openal-soft-devel libopenssl-devel \
zlib-devel libedit-devel systemd-devel libevdev-devel \
qt6-base-devel qt6-multimedia-devel qt6-svg-devel \
qt6-linguist-devel qt6-gui-private-devel vulkan-devel \
vulkan-validationlayers libpng-devel
```
#### NixOS
```
```bash
nix-shell shell.nix
```
@ -50,7 +66,7 @@ You can try one of two methods:
- Search the packages by name and install them with your package manager, or
- Install [distrobox](https://distrobox.it/), create a container using any of the distributions cited above as a base, for Arch Linux you'd do:
```
```bash
distrobox create --name archlinux --init --image archlinux:latest
```
@ -59,7 +75,7 @@ This option is **highly recommended** for distributions with immutable/atomic fi
### Cloning
```
```bash
git clone --recursive https://github.com/shadps4-emu/shadPS4.git
cd shadPS4
```
@ -72,7 +88,7 @@ There are 3 options you can choose from. Option 1 is **highly recommended**.
1. Generate the build directory in the shadPS4 directory.
```
```bash
cmake -S . -B build/ -DENABLE_QT_GUI=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
```
@ -80,7 +96,7 @@ To disable the Qt GUI, remove the `-DENABLE_QT_GUI=ON` flag. To change the build
2. Use CMake to build the project:
```
```bash
cmake --build ./build --parallel$(nproc)
```
@ -88,13 +104,13 @@ If your computer freezes during this step, this could be caused by excessive sys
Now run the emulator. If Qt was enabled at configure time:
```
```bash
./build/shadps4
```
Otherwise, specify the path to your PKG's boot file:
```
```bash
./build/shadps4 /"PATH"/"TO"/"GAME"/"FOLDER"/eboot.bin
```

View File

@ -69,6 +69,9 @@ To automatically populate the necessary files to run shadPS4.exe, run in a comma
## Option 2: MSYS2/MinGW
> [!IMPORTANT]
> Building with MSYS2 is broken as of right now, the only way to build on Windows is to use [Option 1: Visual Studio 2022](https://github.com/shadps4-emu/shadPS4/blob/main/documents/building-windows.md#option-1-visual-studio-2022).
### (Prerequisite) Download [**MSYS2**](https://www.msys2.org/)
Go through the MSYS2 installation as normal

View File

@ -46,6 +46,7 @@ pkgs.mkShell {
pkgs.stb
pkgs.qt6.qtwayland
pkgs.wayland-protocols
pkgs.libpng
];
shellHook = ''

View File

@ -68,6 +68,7 @@ static bool vkCrashDiagnostic = false;
static bool vkHostMarkers = false;
static bool vkGuestMarkers = false;
static bool rdocEnable = false;
static bool isFpsColor = true;
static s16 cursorState = HideCursorState::Idle;
static int cursorHideTimeout = 5; // 5 seconds (default)
static bool useUnifiedInputConfig = true;
@ -282,6 +283,10 @@ bool isRdocEnabled() {
return rdocEnable;
}
bool fpsColor() {
return isFpsColor;
}
u32 vblankDiv() {
return vblankDivider;
}
@ -757,6 +762,7 @@ void load(const std::filesystem::path& path) {
isDebugDump = toml::find_or<bool>(debug, "DebugDump", false);
isShaderDebug = toml::find_or<bool>(debug, "CollectShader", false);
isFpsColor = toml::find_or<bool>(debug, "FPSColor", true);
}
if (data.contains("GUI")) {
@ -807,8 +813,8 @@ void load(const std::filesystem::path& path) {
// Check if the loaded language is in the allowed list
const std::vector<std::string> allowed_languages = {
"ar_SA", "da_DK", "de_DE", "el_GR", "en_US", "es_ES", "fa_IR", "fi_FI", "fr_FR", "hu_HU",
"id_ID", "it_IT", "ja_JP", "ko_KR", "lt_LT", "nl_NL", "no_NO", "pl_PL", "pt_BR", "ro_RO",
"ru_RU", "sq_AL", "sv_SE", "tr_TR", "uk_UA", "vi_VN", "zh_CN", "zh_TW"};
"id_ID", "it_IT", "ja_JP", "ko_KR", "lt_LT", "nb_NO", "nl_NL", "pl_PL", "pt_BR", "pt_PT",
"ro_RO", "ru_RU", "sq_AL", "sv_SE", "tr_TR", "uk_UA", "vi_VN", "zh_CN", "zh_TW"};
if (std::find(allowed_languages.begin(), allowed_languages.end(), emulator_language) ==
allowed_languages.end()) {
@ -881,6 +887,7 @@ void save(const std::filesystem::path& path) {
data["Vulkan"]["rdocEnable"] = rdocEnable;
data["Debug"]["DebugDump"] = isDebugDump;
data["Debug"]["CollectShader"] = isShaderDebug;
data["Debug"]["FPSColor"] = isFpsColor;
data["Keys"]["TrophyKey"] = trophyKey;

View File

@ -67,6 +67,7 @@ bool copyGPUCmdBuffers();
bool dumpShaders();
bool patchShaders();
bool isRdocEnabled();
bool fpsColor();
u32 vblankDiv();
void setDebugDump(bool enable);

View File

@ -144,37 +144,39 @@ void OnGameLoaded() {
std::string type = patchLineIt->attribute("Type").value();
std::string address = patchLineIt->attribute("Address").value();
std::string patchValue = patchLineIt->attribute("Value").value();
std::string maskOffsetStr = patchLineIt->attribute("type").value();
std::string maskOffsetStr = patchLineIt->attribute("Offset").value();
std::string targetStr = "";
std::string sizeStr = "";
if (type == "mask_jump32") {
std::string patchValue = patchLineIt->attribute("Value").value();
targetStr = patchLineIt->attribute("Target").value();
sizeStr = patchLineIt->attribute("Size").value();
} else {
patchValue = convertValueToHex(type, patchValue);
}
bool littleEndian = false;
if (type == "bytes16") {
littleEndian = true;
} else if (type == "bytes32") {
littleEndian = true;
} else if (type == "bytes64") {
if (type == "bytes16" || type == "bytes32" || type == "bytes64") {
littleEndian = true;
}
MemoryPatcher::PatchMask patchMask = MemoryPatcher::PatchMask::None;
int maskOffsetValue = 0;
if (type == "mask") {
if (type == "mask")
patchMask = MemoryPatcher::PatchMask::Mask;
// im not sure if this works, there is no games to test the mask
// offset on yet
if (!maskOffsetStr.empty())
maskOffsetValue = std::stoi(maskOffsetStr, 0, 10);
}
if (type == "mask_jump32")
patchMask = MemoryPatcher::PatchMask::Mask_Jump32;
MemoryPatcher::PatchMemory(currentPatchName, address, patchValue, false,
littleEndian, patchMask, maskOffsetValue);
if (type == "mask" || type == "mask_jump32" && !maskOffsetStr.empty()) {
maskOffsetValue = std::stoi(maskOffsetStr, 0, 10);
}
MemoryPatcher::PatchMemory(currentPatchName, address, patchValue,
targetStr, sizeStr, false, littleEndian,
patchMask, maskOffsetValue);
}
}
}
@ -279,6 +281,10 @@ void OnGameLoaded() {
lineObject["Address"] = attributes.value("Address").toString();
lineObject["Value"] = attributes.value("Value").toString();
lineObject["Offset"] = attributes.value("Offset").toString();
if (lineObject["Type"].toString() == "mask_jump32") {
lineObject["Target"] = attributes.value("Target").toString();
lineObject["Size"] = attributes.value("Size").toString();
}
linesArray.append(lineObject);
}
}
@ -292,37 +298,40 @@ void OnGameLoaded() {
QString patchValue = lineObject["Value"].toString();
QString maskOffsetStr = lineObject["Offset"].toString();
patchValue = QString::fromStdString(
convertValueToHex(type.toStdString(), patchValue.toStdString()));
QString targetStr;
QString sizeStr;
if (type == "mask_jump32") {
QString valueAttributeStr = lineObject["Value"].toString();
targetStr = lineObject["Value"].toString();
sizeStr = lineObject["Size"].toString();
} else {
patchValue = QString::fromStdString(convertValueToHex(
type.toStdString(), patchValue.toStdString()));
}
bool littleEndian = false;
if (type == "bytes16") {
if (type == "bytes16" || type == "bytes32" || type == "bytes64")
littleEndian = true;
} else if (type == "bytes32") {
littleEndian = true;
} else if (type == "bytes64") {
littleEndian = true;
}
MemoryPatcher::PatchMask patchMask = MemoryPatcher::PatchMask::None;
int maskOffsetValue = 0;
if (type == "mask") {
if (type == "mask")
patchMask = MemoryPatcher::PatchMask::Mask;
// im not sure if this works, there is no games to test the mask
// offset on yet
if (!maskOffsetStr.toStdString().empty())
maskOffsetValue = std::stoi(maskOffsetStr.toStdString(), 0, 10);
}
if (type == "mask_jump32")
patchMask = MemoryPatcher::PatchMask::Mask_Jump32;
MemoryPatcher::PatchMemory(currentPatchName, address.toStdString(),
patchValue.toStdString(), false,
littleEndian, patchMask, maskOffsetValue);
if (type == "mask" ||
type == "mask_jump32" && !maskOffsetStr.toStdString().empty()) {
maskOffsetValue = std::stoi(maskOffsetStr.toStdString(), 0, 10);
}
MemoryPatcher::PatchMemory(
currentPatchName, address.toStdString(), patchValue.toStdString(),
targetStr.toStdString(), sizeStr.toStdString(), false, littleEndian,
patchMask, maskOffsetValue);
}
}
}
@ -351,7 +360,7 @@ void ApplyPendingPatches() {
if (currentPatch.gameSerial != g_game_serial)
continue;
PatchMemory(currentPatch.modNameStr, currentPatch.offsetStr, currentPatch.valueStr,
PatchMemory(currentPatch.modNameStr, currentPatch.offsetStr, currentPatch.valueStr, "", "",
currentPatch.isOffset, currentPatch.littleEndian, currentPatch.patchMask,
currentPatch.maskOffset);
}
@ -359,8 +368,9 @@ void ApplyPendingPatches() {
pending_patches.clear();
}
void PatchMemory(std::string modNameStr, std::string offsetStr, std::string valueStr, bool isOffset,
bool littleEndian, PatchMask patchMask, int maskOffset) {
void PatchMemory(std::string modNameStr, std::string offsetStr, std::string valueStr,
std::string targetStr, std::string sizeStr, bool isOffset, bool littleEndian,
PatchMask patchMask, int maskOffset) {
// Send a request to modify the process memory.
void* cheatAddress = nullptr;
@ -377,7 +387,83 @@ void PatchMemory(std::string modNameStr, std::string offsetStr, std::string valu
cheatAddress = reinterpret_cast<void*>(PatternScan(offsetStr) + maskOffset);
}
// TODO: implement mask_jump32
if (patchMask == PatchMask::Mask_Jump32) {
int jumpSize = std::stoi(sizeStr);
constexpr int MAX_PATTERN_LENGTH = 256;
if (jumpSize < 5) {
LOG_ERROR(Loader, "Jump size must be at least 5 bytes");
return;
}
if (jumpSize > MAX_PATTERN_LENGTH) {
LOG_ERROR(Loader, "Jump size must be no more than {} bytes.", MAX_PATTERN_LENGTH);
return;
}
// Find the base address using "Address"
uintptr_t baseAddress = PatternScan(offsetStr);
if (baseAddress == 0) {
LOG_ERROR(Loader, "PatternScan failed for mask_jump32 with pattern: {}", offsetStr);
return;
}
uintptr_t patchAddress = baseAddress + maskOffset;
// Fills the original region (jumpSize bytes) with NOPs
std::vector<u8> nopBytes(jumpSize, 0x90);
std::memcpy(reinterpret_cast<void*>(patchAddress), nopBytes.data(), nopBytes.size());
// Use "Target" to locate the start of the code cave
uintptr_t jump_target = PatternScan(targetStr);
if (jump_target == 0) {
LOG_ERROR(Loader, "PatternScan failed to Target with pattern: {}", targetStr);
return;
}
// Converts the Value attribute to a byte array (payload)
std::vector<u8> payload;
for (size_t i = 0; i < valueStr.length(); i += 2) {
std::string tempStr = valueStr.substr(i, 2);
const char* byteStr = tempStr.c_str();
char* endPtr;
unsigned int byteVal = std::strtoul(byteStr, &endPtr, 16);
if (endPtr != byteStr + 2) {
LOG_ERROR(Loader, "Invalid byte in Value: {}", valueStr.substr(i, 2));
return;
}
payload.push_back(static_cast<u8>(byteVal));
}
// Calculates the end of the code cave (where the return jump will be inserted)
uintptr_t code_cave_end = jump_target + payload.size();
// Write the payload to the code cave, from jump_target
std::memcpy(reinterpret_cast<void*>(jump_target), payload.data(), payload.size());
// Inserts the initial jump in the original region to divert to the code cave
u8 jumpInstruction[5];
jumpInstruction[0] = 0xE9;
s32 relJump = static_cast<s32>(jump_target - patchAddress - 5);
std::memcpy(&jumpInstruction[1], &relJump, sizeof(relJump));
std::memcpy(reinterpret_cast<void*>(patchAddress), jumpInstruction,
sizeof(jumpInstruction));
// Inserts jump back at the end of the code cave to resume execution after patching
u8 jumpBack[5];
jumpBack[0] = 0xE9;
// Calculates the relative offset to return to the instruction immediately following the
// overwritten region
s32 target_return = static_cast<s32>((patchAddress + jumpSize) - (code_cave_end + 5));
std::memcpy(&jumpBack[1], &target_return, sizeof(target_return));
std::memcpy(reinterpret_cast<void*>(code_cave_end), jumpBack, sizeof(jumpBack));
LOG_INFO(Loader,
"Applied Patch mask_jump32: {}, PatchAddress: {:#x}, JumpTarget: {:#x}, "
"CodeCaveEnd: {:#x}, JumpSize: {}",
modNameStr, patchAddress, jump_target, code_cave_end, jumpSize);
return;
}
if (cheatAddress == nullptr) {
LOG_ERROR(Loader, "Failed to get address for patch {}", modNameStr);

View File

@ -38,8 +38,9 @@ void OnGameLoaded();
void AddPatchToQueue(patchInfo patchToAdd);
void ApplyPendingPatches();
void PatchMemory(std::string modNameStr, std::string offsetStr, std::string valueStr, bool isOffset,
bool littleEndian, PatchMask patchMask = PatchMask::None, int maskOffset = 0);
void PatchMemory(std::string modNameStr, std::string offsetStr, std::string valueStr,
std::string targetStr, std::string sizeStr, bool isOffset, bool littleEndian,
PatchMask patchMask = PatchMask::None, int maskOffset = 0);
static std::vector<int32_t> PatternToByte(const std::string& pattern);
uintptr_t PatternScan(const std::string& signature);

View File

@ -339,7 +339,9 @@ void CondvarWait(Condvar& cv, std::unique_lock<Lock>& lk, std::stop_token token,
}
std::stop_callback callback(token, [&] {
{ std::scoped_lock lk2{*lk.mutex()}; }
{
std::scoped_lock lk2{*lk.mutex()};
}
cv.notify_all();
});

View File

@ -259,7 +259,19 @@ void L::DrawAdvanced() {
void L::DrawSimple() {
const float frameRate = DebugState.Framerate;
if (Config::fpsColor()) {
if (frameRate < 10) {
PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.0f, 0.0f, 1.0f)); // Red
} else if (frameRate >= 10 && frameRate < 20) {
PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.5f, 0.0f, 1.0f)); // Orange
} else {
PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 1.0f, 1.0f, 1.0f)); // White
}
} else {
PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 1.0f, 1.0f, 1.0f)); // White
}
Text("%d FPS (%.1f ms)", static_cast<int>(std::round(frameRate)), 1000.0f / frameRate);
PopStyleColor();
}
static void LoadSettings(const char* line) {

View File

@ -56,6 +56,23 @@ void MemoryManager::SetupMemoryRegions(u64 flexible_size, bool use_extended_mem1
total_flexible_size, total_direct_size);
}
u64 MemoryManager::ClampRangeSize(VAddr virtual_addr, u64 size) {
static constexpr u64 MinSizeToClamp = 1_GB;
// Dont bother with clamping if the size is small so we dont pay a map lookup on every buffer.
if (size < MinSizeToClamp) {
return size;
}
const auto vma = FindVMA(virtual_addr);
ASSERT_MSG(vma != vma_map.end(), "Attempted to access invalid GPU address {:#x}", virtual_addr);
const u64 clamped_size =
std::min<u64>(size, vma->second.base + vma->second.size - virtual_addr);
if (size != clamped_size) {
LOG_WARNING(Kernel_Vmm, "Clamped requested buffer range addr={:#x}, size={:#x} to {:#x}",
virtual_addr, size, clamped_size);
}
return clamped_size;
}
bool MemoryManager::TryWriteBacking(void* address, const void* data, u32 num_bytes) {
const VAddr virtual_addr = std::bit_cast<VAddr>(address);
const auto& vma = FindVMA(virtual_addr)->second;
@ -314,11 +331,11 @@ int MemoryManager::MapMemory(void** out_addr, VAddr virtual_addr, size_t size, M
if (type == VMAType::Direct) {
new_vma.phys_base = phys_addr;
rasterizer->MapMemory(mapped_addr, size);
}
if (type == VMAType::Flexible) {
flexible_usage += size;
}
rasterizer->MapMemory(mapped_addr, size);
return ORBIS_OK;
}
@ -406,12 +423,10 @@ u64 MemoryManager::UnmapBytesFromEntry(VAddr virtual_addr, VirtualMemoryArea vma
if (type == VMAType::Free) {
return adjusted_size;
}
if (type == VMAType::Direct || type == VMAType::Pooled) {
rasterizer->UnmapMemory(virtual_addr, adjusted_size);
}
if (type == VMAType::Flexible) {
flexible_usage -= adjusted_size;
}
rasterizer->UnmapMemory(virtual_addr, adjusted_size);
// Mark region as free and attempt to coalesce it with neighbours.
const auto new_it = CarveVMA(virtual_addr, adjusted_size);

View File

@ -164,6 +164,8 @@ public:
return virtual_addr >= vma_map.begin()->first && virtual_addr < end_addr;
}
u64 ClampRangeSize(VAddr virtual_addr, u64 size);
bool TryWriteBacking(void* address, const void* data, u32 num_bytes);
void SetupMemoryRegions(u64 flexible_size, bool use_extended_mem1, bool use_extended_mem2);

View File

@ -57,7 +57,7 @@
</font>
</property>
<property name="text">
<string>shadPS4</string>
<string notr="true">shadPS4</string>
</property>
</widget>
<widget class="QLabel" name="shad_text">

View File

@ -71,7 +71,8 @@ void CheatsPatches::setupUI() {
QLabel* gameImageLabel = new QLabel();
if (!m_gameImage.isNull()) {
gameImageLabel->setPixmap(m_gameImage.scaled(275, 275, Qt::KeepAspectRatio));
gameImageLabel->setPixmap(
m_gameImage.scaled(275, 275, Qt::KeepAspectRatio, Qt::SmoothTransformation));
} else {
gameImageLabel->setText(tr("No Image Available"));
}
@ -91,9 +92,11 @@ void CheatsPatches::setupUI() {
gameVersionLabel->setAlignment(Qt::AlignLeft);
gameInfoLayout->addWidget(gameVersionLabel);
if (m_gameSize.left(4) != "0.00") {
QLabel* gameSizeLabel = new QLabel(tr("Size: ") + m_gameSize);
gameSizeLabel->setAlignment(Qt::AlignLeft);
gameInfoLayout->addWidget(gameSizeLabel);
}
// Add a text area for instructions and 'Patch' descriptions
instructionsTextEdit = new QTextEdit();
@ -1343,7 +1346,7 @@ void CheatsPatches::applyCheat(const QString& modName, bool enabled) {
// Determine if the hint field is present
bool isHintPresent = m_cheats[modName].hasHint;
MemoryPatcher::PatchMemory(modNameStr, offsetStr, valueStr, !isHintPresent, false);
MemoryPatcher::PatchMemory(modNameStr, offsetStr, valueStr, "", "", !isHintPresent, false);
}
}
@ -1365,28 +1368,23 @@ void CheatsPatches::applyPatch(const QString& patchName, bool enabled) {
bool littleEndian = false;
if (type == "bytes16") {
littleEndian = true;
} else if (type == "bytes32") {
littleEndian = true;
} else if (type == "bytes64") {
if (type == "bytes16" || type == "bytes32" || type == "bytes64") {
littleEndian = true;
}
MemoryPatcher::PatchMask patchMask = MemoryPatcher::PatchMask::None;
int maskOffsetValue = 0;
if (type == "mask") {
if (type == "mask")
patchMask = MemoryPatcher::PatchMask::Mask;
// im not sure if this works, there is no games to test the mask offset on yet
if (!maskOffsetStr.toStdString().empty())
maskOffsetValue = std::stoi(maskOffsetStr.toStdString(), 0, 10);
}
if (type == "mask_jump32")
patchMask = MemoryPatcher::PatchMask::Mask_Jump32;
if (type == "mask" || type == "mask_jump32" && !maskOffsetStr.toStdString().empty()) {
maskOffsetValue = std::stoi(maskOffsetStr.toStdString(), 0, 10);
}
if (MemoryPatcher::g_eboot_address == 0) {
MemoryPatcher::patchInfo addingPatch;
addingPatch.gameSerial = patchInfo.serial.toStdString();
@ -1402,7 +1400,8 @@ void CheatsPatches::applyPatch(const QString& patchName, bool enabled) {
continue;
}
MemoryPatcher::PatchMemory(patchName.toStdString(), address.toStdString(),
patchValue.toStdString(), false, littleEndian, patchMask);
patchValue.toStdString(), "", "", false, littleEndian,
patchMask);
}
}
}

View File

@ -3,9 +3,9 @@
#include <fstream>
#include <QMessageBox>
#include <QPushButton>
#include "common/path_util.h"
#include "control_settings.h"
#include "kbm_config_dialog.h"
#include "ui_control_settings.h"
ControlSettings::ControlSettings(std::shared_ptr<GameInfoClass> game_info_get, QWidget* parent)
@ -16,7 +16,7 @@ ControlSettings::ControlSettings(std::shared_ptr<GameInfoClass> game_info_get, Q
AddBoxItems();
SetUIValuestoMappings();
ui->KBMButton->setFocus();
UpdateLightbarColor();
connect(ui->buttonBox, &QDialogButtonBox::clicked, this, [this](QAbstractButton* button) {
if (button == ui->buttonBox->button(QDialogButtonBox::Save)) {
@ -29,11 +29,7 @@ ControlSettings::ControlSettings(std::shared_ptr<GameInfoClass> game_info_get, Q
});
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QWidget::close);
connect(ui->KBMButton, &QPushButton::clicked, this, [this] {
auto KBMWindow = new EditorDialog(this);
KBMWindow->exec();
SetUIValuestoMappings();
});
connect(ui->ProfileComboBox, &QComboBox::currentTextChanged, this, [this] {
GetGameTitle();
SetUIValuestoMappings();
@ -61,6 +57,27 @@ ControlSettings::ControlSettings(std::shared_ptr<GameInfoClass> game_info_get, Q
[this](int value) { ui->RStickLeftBox->setCurrentIndex(value); });
connect(ui->RStickLeftBox, &QComboBox::currentIndexChanged, this,
[this](int value) { ui->RStickRightBox->setCurrentIndex(value); });
connect(ui->RSlider, &QSlider::valueChanged, this, [this](int value) {
QString RedValue = QString("%1").arg(value, 3, 10, QChar('0'));
QString RValue = tr("R:") + " " + RedValue;
ui->RLabel->setText(RValue);
UpdateLightbarColor();
});
connect(ui->GSlider, &QSlider::valueChanged, this, [this](int value) {
QString GreenValue = QString("%1").arg(value, 3, 10, QChar('0'));
QString GValue = tr("G:") + " " + GreenValue;
ui->GLabel->setText(GValue);
UpdateLightbarColor();
});
connect(ui->BSlider, &QSlider::valueChanged, this, [this](int value) {
QString BlueValue = QString("%1").arg(value, 3, 10, QChar('0'));
QString BValue = tr("B:") + " " + BlueValue;
ui->BLabel->setText(BValue);
UpdateLightbarColor();
});
}
void ControlSettings::SaveControllerConfig(bool CloseOnSave) {
@ -121,7 +138,7 @@ void ControlSettings::SaveControllerConfig(bool CloseOnSave) {
if (std::find(ControllerInputs.begin(), ControllerInputs.end(), input_string) !=
ControllerInputs.end() ||
output_string == "analog_deadzone") {
output_string == "analog_deadzone" || output_string == "override_controller_color") {
line.erase();
continue;
}
@ -227,6 +244,14 @@ void ControlSettings::SaveControllerConfig(bool CloseOnSave) {
deadzonevalue = std::to_string(ui->RightDeadzoneSlider->value());
lines.push_back("analog_deadzone = rightjoystick, " + deadzonevalue + ", 127");
lines.push_back("");
std::string OverrideLB = ui->LightbarCheckBox->isChecked() ? "true" : "false";
std::string LightBarR = std::to_string(ui->RSlider->value());
std::string LightBarG = std::to_string(ui->GSlider->value());
std::string LightBarB = std::to_string(ui->BSlider->value());
lines.push_back("override_controller_color = " + OverrideLB + ", " + LightBarR + ", " +
LightBarG + ", " + LightBarB);
std::vector<std::string> save;
bool CurrentLineEmpty = false, LastLineEmpty = false;
for (auto const& line : lines) {
@ -243,6 +268,9 @@ void ControlSettings::SaveControllerConfig(bool CloseOnSave) {
output_file.close();
Config::SetUseUnifiedInputConfig(!ui->PerGameCheckBox->isChecked());
Config::SetOverrideControllerColor(ui->LightbarCheckBox->isChecked());
Config::SetControllerCustomColor(ui->RSlider->value(), ui->GSlider->value(),
ui->BSlider->value());
Config::save(Common::FS::GetUserPath(Common::FS::PathType::UserDir) / "config.toml");
if (CloseOnSave)
@ -278,6 +306,12 @@ void ControlSettings::SetDefault() {
ui->LeftDeadzoneSlider->setValue(2);
ui->RightDeadzoneSlider->setValue(2);
ui->RSlider->setValue(0);
ui->GSlider->setValue(0);
ui->BSlider->setValue(255);
ui->LightbarCheckBox->setChecked(false);
ui->PerGameCheckBox->setChecked(false);
}
void ControlSettings::AddBoxItems() {
@ -351,7 +385,7 @@ void ControlSettings::SetUIValuestoMappings() {
if (std::find(ControllerInputs.begin(), ControllerInputs.end(), input_string) !=
ControllerInputs.end() ||
output_string == "analog_deadzone") {
output_string == "analog_deadzone" || output_string == "override_controller_color") {
if (input_string == "cross") {
ui->ABox->setCurrentText(QString::fromStdString(output_string));
CrossExists = true;
@ -436,9 +470,45 @@ void ControlSettings::SetUIValuestoMappings() {
ui->RightDeadzoneSlider->setValue(2);
ui->RightDeadzoneValue->setText("2");
}
} else if (output_string == "override_controller_color") {
std::size_t comma_pos = line.find(',');
if (comma_pos != std::string::npos) {
std::string overridestring = line.substr(equal_pos + 1, comma_pos);
bool override = overridestring.contains("true") ? true : false;
ui->LightbarCheckBox->setChecked(override);
std::string lightbarstring = line.substr(comma_pos + 1);
std::size_t comma_pos2 = lightbarstring.find(',');
if (comma_pos2 != std::string::npos) {
std::string Rstring = lightbarstring.substr(0, comma_pos2);
ui->RSlider->setValue(std::stoi(Rstring));
QString RedValue = QString("%1").arg(std::stoi(Rstring), 3, 10, QChar('0'));
QString RValue = tr("R:") + " " + RedValue;
ui->RLabel->setText(RValue);
}
std::string GBstring = lightbarstring.substr(comma_pos2 + 1);
std::size_t comma_pos3 = GBstring.find(',');
if (comma_pos3 != std::string::npos) {
std::string Gstring = GBstring.substr(0, comma_pos3);
ui->GSlider->setValue(std::stoi(Gstring));
QString GreenValue =
QString("%1").arg(std::stoi(Gstring), 3, 10, QChar('0'));
QString GValue = tr("G:") + " " + GreenValue;
ui->GLabel->setText(GValue);
std::string Bstring = GBstring.substr(comma_pos3 + 1);
ui->BSlider->setValue(std::stoi(Bstring));
QString BlueValue =
QString("%1").arg(std::stoi(Bstring), 3, 10, QChar('0'));
QString BValue = tr("B:") + " " + BlueValue;
ui->BLabel->setText(BValue);
}
}
}
}
}
file.close();
// If an entry does not exist in the config file, we assume the user wants it unmapped
if (!CrossExists)
@ -490,8 +560,6 @@ void ControlSettings::SetUIValuestoMappings() {
ui->RStickUpBox->setCurrentText("unmapped");
ui->RStickDownBox->setCurrentText("unmapped");
}
file.close();
}
void ControlSettings::GetGameTitle() {
@ -507,4 +575,13 @@ void ControlSettings::GetGameTitle() {
}
}
void ControlSettings::UpdateLightbarColor() {
ui->LightbarColorFrame->setStyleSheet("");
QString RValue = QString::number(ui->RSlider->value());
QString GValue = QString::number(ui->GSlider->value());
QString BValue = QString::number(ui->BSlider->value());
QString colorstring = "background-color: rgb(" + RValue + "," + GValue + "," + BValue + ")";
ui->LightbarColorFrame->setStyleSheet(colorstring);
}
ControlSettings::~ControlSettings() {}

View File

@ -18,6 +18,7 @@ public:
private Q_SLOTS:
void SaveControllerConfig(bool CloseOnSave);
void SetDefault();
void UpdateLightbarColor();
private:
std::unique_ptr<Ui::ControlSettings> ui;

View File

@ -11,8 +11,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1012</width>
<height>721</height>
<width>1043</width>
<height>792</height>
</rect>
</property>
<property name="windowTitle">
@ -25,43 +25,28 @@
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="frameShape">
<enum>QFrame::Shape::NoFrame</enum>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QTabWidget" name="tabWidget">
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>994</width>
<height>673</height>
<width>1019</width>
<height>732</height>
</rect>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Control Settings</string>
</attribute>
<layout class="QVBoxLayout" name="mainLayout">
<property name="leftMargin">
<number>5</number>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1021</width>
<height>731</height>
</rect>
</property>
<property name="topMargin">
<number>5</number>
</property>
<property name="rightMargin">
<number>5</number>
</property>
<property name="bottomMargin">
<number>5</number>
</property>
<item>
<layout class="QHBoxLayout" name="bottomLayout">
<layout class="QHBoxLayout" name="RemapLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout_left">
<property name="spacing">
@ -538,7 +523,7 @@
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_middle" stretch="0,0,0,0">
<layout class="QVBoxLayout" name="verticalLayout_middle" stretch="0,0,0,0,0">
<property name="spacing">
<number>0</number>
</property>
@ -686,37 +671,27 @@
</item>
<item>
<layout class="QVBoxLayout" name="layout_system_buttons">
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Policy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="spacing">
<number>10</number>
</property>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="title">
<string>KBM Controls</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_11">
<item>
<widget class="QPushButton" name="KBMButton">
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>KBM Editor</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
@ -912,6 +887,167 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<layout class="QVBoxLayout" name="verticalLayout_14">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="font">
<font>
<bold>false</bold>
</font>
</property>
<property name="title">
<string>Color Adjustment</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_18">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QLabel" name="RLabel">
<property name="font">
<font>
<bold>false</bold>
</font>
</property>
<property name="text">
<string notr="true">R: 000</string>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="RSlider">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximum">
<number>255</number>
</property>
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="QLabel" name="GLabel">
<property name="font">
<font>
<bold>false</bold>
</font>
</property>
<property name="text">
<string notr="true">G: 000</string>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="GSlider">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximum">
<number>255</number>
</property>
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_11">
<item>
<widget class="QLabel" name="BLabel">
<property name="font">
<font>
<bold>false</bold>
</font>
</property>
<property name="text">
<string notr="true">B: 255</string>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="BSlider">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximum">
<number>255</number>
</property>
<property name="value">
<number>255</number>
</property>
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_17">
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="font">
<font>
<bold>false</bold>
</font>
</property>
<property name="title">
<string>Override Lightbar Color</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_19">
<item>
<widget class="QCheckBox" name="LightbarCheckBox">
<property name="font">
<font>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Override Color</string>
</property>
</widget>
</item>
<item>
<widget class="QFrame" name="LightbarColorFrame">
<property name="frameShape">
<enum>QFrame::Shape::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Shadow::Raised</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</item>
<item>
@ -1354,8 +1490,6 @@
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</widget>

View File

@ -196,14 +196,28 @@ void GameGridFrame::SetGridBackgroundImage(int row, int column) {
void GameGridFrame::RefreshGridBackgroundImage() {
QPalette palette;
if (!backgroundImage.isNull() && Config::getShowBackgroundImage()) {
palette.setBrush(QPalette::Base,
QBrush(backgroundImage.scaled(size(), Qt::IgnoreAspectRatio)));
QSize widgetSize = size();
QPixmap scaledPixmap =
QPixmap::fromImage(backgroundImage)
.scaled(widgetSize, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
int x = (widgetSize.width() - scaledPixmap.width()) / 2;
int y = (widgetSize.height() - scaledPixmap.height()) / 2;
QPixmap finalPixmap(widgetSize);
finalPixmap.fill(Qt::transparent);
QPainter painter(&finalPixmap);
painter.drawPixmap(x, y, scaledPixmap);
palette.setBrush(QPalette::Base, QBrush(finalPixmap));
}
QColor transparentColor = QColor(135, 206, 235, 40);
palette.setColor(QPalette::Highlight, transparentColor);
this->setPalette(palette);
}
void GameGridFrame::resizeEvent(QResizeEvent* event) {
QTableWidget::resizeEvent(event);
RefreshGridBackgroundImage();
}
bool GameGridFrame::IsValidCellSelected() {
return validCellSelected;
}

View File

@ -3,6 +3,7 @@
#pragma once
#include <QPainter>
#include <QScrollBar>
#include "background_music_player.h"
@ -21,6 +22,7 @@ Q_SIGNALS:
public Q_SLOTS:
void SetGridBackgroundImage(int row, int column);
void RefreshGridBackgroundImage();
void resizeEvent(QResizeEvent* event);
void PlayBackgroundMusic(QString path);
void onCurrentCellChanged(int currentRow, int currentColumn, int previousRow,
int previousColumn);

View File

@ -11,6 +11,7 @@
class QLineEdit;
class GameInstallDialog final : public QDialog {
Q_OBJECT
public:
GameInstallDialog();
~GameInstallDialog();

View File

@ -200,14 +200,28 @@ void GameListFrame::SetListBackgroundImage(QTableWidgetItem* item) {
void GameListFrame::RefreshListBackgroundImage() {
QPalette palette;
if (!backgroundImage.isNull() && Config::getShowBackgroundImage()) {
palette.setBrush(QPalette::Base,
QBrush(backgroundImage.scaled(size(), Qt::IgnoreAspectRatio)));
QSize widgetSize = size();
QPixmap scaledPixmap =
QPixmap::fromImage(backgroundImage)
.scaled(widgetSize, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
int x = (widgetSize.width() - scaledPixmap.width()) / 2;
int y = (widgetSize.height() - scaledPixmap.height()) / 2;
QPixmap finalPixmap(widgetSize);
finalPixmap.fill(Qt::transparent);
QPainter painter(&finalPixmap);
painter.drawPixmap(x, y, scaledPixmap);
palette.setBrush(QPalette::Base, QBrush(finalPixmap));
}
QColor transparentColor = QColor(135, 206, 235, 40);
palette.setColor(QPalette::Highlight, transparentColor);
this->setPalette(palette);
}
void GameListFrame::resizeEvent(QResizeEvent* event) {
QTableWidget::resizeEvent(event);
RefreshListBackgroundImage();
}
void GameListFrame::SortNameAscending(int columnIndex) {
std::sort(m_game_info->m_games.begin(), m_game_info->m_games.end(),
[columnIndex](const GameInfo& a, const GameInfo& b) {

View File

@ -30,6 +30,7 @@ Q_SIGNALS:
public Q_SLOTS:
void SetListBackgroundImage(QTableWidgetItem* item);
void RefreshListBackgroundImage();
void resizeEvent(QResizeEvent* event);
void SortNameAscending(int columnIndex);
void SortNameDescending(int columnIndex);
void PlayBackgroundMusic(QTableWidgetItem* item);

View File

@ -161,6 +161,7 @@ public:
if (selected == &openSfoViewer) {
PSF psf;
QString gameName = QString::fromStdString(m_games[itemID].name);
std::filesystem::path game_folder_path = m_games[itemID].path;
std::filesystem::path game_update_path = game_folder_path;
game_update_path += "-UPDATE";
@ -234,7 +235,7 @@ public:
tableWidget->horizontalHeader()->setVisible(false);
tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed);
tableWidget->setWindowTitle(tr("SFO Viewer"));
tableWidget->setWindowTitle(tr("SFO Viewer for ") + gameName);
tableWidget->show();
}
}

View File

@ -57,7 +57,7 @@ bool MainWindow::Init() {
SetLastIconSizeBullet();
GetPhysicalDevices();
// show ui
setMinimumSize(350, minimumSizeHint().height());
setMinimumSize(720, 405);
std::string window_title = "";
if (Common::isRelease) {
window_title = fmt::format("shadPS4 v{}", Common::VERSION);
@ -965,6 +965,9 @@ void MainWindow::InstallDragDropPkg(std::filesystem::path file, int pkgNum, int
dialog.setAutoClose(true);
dialog.setRange(0, nfiles);
dialog.setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter,
dialog.size(), this->geometry()));
QFutureWatcher<void> futureWatcher;
connect(&futureWatcher, &QFutureWatcher<void>::finished, this, [=, this]() {
if (pkgNum == nPkg) {

View File

@ -536,7 +536,7 @@ void SettingsDialog::updateNoteTextEdit(const QString& elementName) {
} else if (elementName == "fullscreenCheckBox") {
text = tr("Enable Full Screen:\\nAutomatically puts the game window into full-screen mode.\\nThis can be toggled by pressing the F11 key.");
} else if (elementName == "separateUpdatesCheckBox") {
text = tr("Enable Separate Update Folder:\\nEnables installing game updates into a separate folder for easy management.\\nThis can be manually created by adding the extracted update to the game folder with the name 'CUSA00000-UPDATE' where the CUSA ID matches the game's ID.");
text = tr("Enable Separate Update Folder:\\nEnables installing game updates into a separate folder for easy management.\\nThis can be manually created by adding the extracted update to the game folder with the name \"CUSA00000-UPDATE\" where the CUSA ID matches the game's ID.");
} else if (elementName == "showSplashCheckBox") {
text = tr("Show Splash Screen:\\nShows the game's splash screen (a special image) while the game is starting.");
} else if (elementName == "discordRPCCheckbox") {
@ -548,7 +548,7 @@ void SettingsDialog::updateNoteTextEdit(const QString& elementName) {
} else if (elementName == "logTypeGroupBox") {
text = tr("Log Type:\\nSets whether to synchronize the output of the log window for performance. May have adverse effects on emulation.");
} else if (elementName == "logFilter") {
text = tr("Log Filter:\nFilters the log to only print specific information.\nExamples: 'Core:Trace' 'Lib.Pad:Debug Common.Filesystem:Error' '*:Critical'\\nLevels: Trace, Debug, Info, Warning, Error, Critical - in this order, a specific level silences all levels preceding it in the list and logs every level after it.");
text = tr("Log Filter:\\nFilters the log to only print specific information.\\nExamples: \"Core:Trace\" \"Lib.Pad:Debug Common.Filesystem:Error\" \"*:Critical\"\\nLevels: Trace, Debug, Info, Warning, Error, Critical - in this order, a specific level silences all levels preceding it in the list and logs every level after it.");
#ifdef ENABLE_UPDATER
} else if (elementName == "updaterGroupBox") {
text = tr("Update:\\nRelease: Official versions released every month that may be very outdated, but are more reliable and tested.\\nNightly: Development versions that have all the latest features and fixes, but may contain bugs and are less stable.");
@ -562,7 +562,7 @@ void SettingsDialog::updateNoteTextEdit(const QString& elementName) {
} else if (elementName == "disableTrophycheckBox") {
text = tr("Disable Trophy Pop-ups:\\nDisable in-game trophy notifications. Trophy progress can still be tracked using the Trophy Viewer (right-click the game in the main window).");
} else if (elementName == "enableCompatibilityCheckBox") {
text = tr("Display Compatibility Data:\\nDisplays game compatibility information in table view. Enable 'Update Compatibility On Startup' to get up-to-date information.");
text = tr("Display Compatibility Data:\\nDisplays game compatibility information in table view. Enable \"Update Compatibility On Startup\" to get up-to-date information.");
} else if (elementName == "checkCompatibilityOnStartupCheckBox") {
text = tr("Update Compatibility On Startup:\\nAutomatically update the compatibility database when shadPS4 starts.");
} else if (elementName == "updateCompatibilityButton") {
@ -580,7 +580,7 @@ void SettingsDialog::updateNoteTextEdit(const QString& elementName) {
// Graphics
if (elementName == "graphicsAdapterGroupBox") {
text = tr("Graphics Device:\\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\\nor select 'Auto Select' to automatically determine it.");
text = tr("Graphics Device:\\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\\nor select \"Auto Select\" to automatically determine it.");
} else if (elementName == "widthGroupBox" || elementName == "heightGroupBox") {
text = tr("Width/Height:\\nSets the size of the emulator window at launch, which can be resized during gameplay.\\nThis is different from the in-game resolution.");
} else if (elementName == "heightDivider") {

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation>حول shadPS4</translation>
</message>
<message>
<source>shadPS4</source>
<translation type="unfinished">shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation>shadPS4 هو محاكي تجريبي مفتوح المصدر لجهاز PlayStation 4.</translation>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation type="unfinished">Configure Controls</translation>
</message>
<message>
<source>Control Settings</source>
<translation type="unfinished">Control Settings</translation>
</message>
<message>
<source>D-Pad</source>
<translation type="unfinished">D-Pad</translation>
@ -469,14 +461,6 @@
<source>L2 / LT</source>
<translation type="unfinished">L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation type="unfinished">KBM Controls</translation>
</message>
<message>
<source>KBM Editor</source>
<translation type="unfinished">KBM Editor</translation>
</message>
<message>
<source>Back</source>
<translation type="unfinished">Back</translation>
@ -533,6 +517,30 @@
<source>Right Stick</source>
<translation type="unfinished">Right Stick</translation>
</message>
<message>
<source>Color Adjustment</source>
<translation type="unfinished">Color Adjustment</translation>
</message>
<message>
<source>R:</source>
<translation type="unfinished">R:</translation>
</message>
<message>
<source>G:</source>
<translation type="unfinished">G:</translation>
</message>
<message>
<source>B:</source>
<translation type="unfinished">B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation type="unfinished">Override Lightbar Color</translation>
</message>
<message>
<source>Override Color</source>
<translation type="unfinished">Override Color</translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -855,6 +863,10 @@
<source>Save Data</source>
<translation type="unfinished">Save Data</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation type="unfinished">SFO Viewer for </translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation type="unfinished">About shadPS4</translation>
</message>
<message>
<source>shadPS4</source>
<translation type="unfinished">shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation type="unfinished">shadPS4 is an experimental open-source emulator for the PlayStation 4.</translation>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation type="unfinished">Configure Controls</translation>
</message>
<message>
<source>Control Settings</source>
<translation type="unfinished">Control Settings</translation>
</message>
<message>
<source>D-Pad</source>
<translation type="unfinished">D-Pad</translation>
@ -469,14 +461,6 @@
<source>L2 / LT</source>
<translation type="unfinished">L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation type="unfinished">KBM Controls</translation>
</message>
<message>
<source>KBM Editor</source>
<translation type="unfinished">KBM Editor</translation>
</message>
<message>
<source>Back</source>
<translation type="unfinished">Back</translation>
@ -533,6 +517,30 @@
<source>Right Stick</source>
<translation type="unfinished">Right Stick</translation>
</message>
<message>
<source>Color Adjustment</source>
<translation type="unfinished">Color Adjustment</translation>
</message>
<message>
<source>R:</source>
<translation type="unfinished">R:</translation>
</message>
<message>
<source>G:</source>
<translation type="unfinished">G:</translation>
</message>
<message>
<source>B:</source>
<translation type="unfinished">B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation type="unfinished">Override Lightbar Color</translation>
</message>
<message>
<source>Override Color</source>
<translation type="unfinished">Override Color</translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -855,6 +863,10 @@
<source>Save Data</source>
<translation type="unfinished">Save Data</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation type="unfinished">SFO Viewer for </translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation>Über shadPS4</translation>
</message>
<message>
<source>shadPS4</source>
<translation type="unfinished">shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation>shadPS4 ist ein experimenteller Open-Source-Emulator für die Playstation 4.</translation>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation type="unfinished">Configure Controls</translation>
</message>
<message>
<source>Control Settings</source>
<translation type="unfinished">Control Settings</translation>
</message>
<message>
<source>D-Pad</source>
<translation type="unfinished">D-Pad</translation>
@ -469,14 +461,6 @@
<source>L2 / LT</source>
<translation type="unfinished">L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation type="unfinished">KBM Controls</translation>
</message>
<message>
<source>KBM Editor</source>
<translation type="unfinished">KBM Editor</translation>
</message>
<message>
<source>Back</source>
<translation type="unfinished">Back</translation>
@ -533,6 +517,30 @@
<source>Right Stick</source>
<translation type="unfinished">Right Stick</translation>
</message>
<message>
<source>Color Adjustment</source>
<translation type="unfinished">Color Adjustment</translation>
</message>
<message>
<source>R:</source>
<translation type="unfinished">R:</translation>
</message>
<message>
<source>G:</source>
<translation type="unfinished">G:</translation>
</message>
<message>
<source>B:</source>
<translation type="unfinished">B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation type="unfinished">Override Lightbar Color</translation>
</message>
<message>
<source>Override Color</source>
<translation type="unfinished">Override Color</translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -855,6 +863,10 @@
<source>Save Data</source>
<translation type="unfinished">Save Data</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation type="unfinished">SFO Viewer for </translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation type="unfinished">About shadPS4</translation>
</message>
<message>
<source>shadPS4</source>
<translation type="unfinished">shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation type="unfinished">shadPS4 is an experimental open-source emulator for the PlayStation 4.</translation>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation type="unfinished">Configure Controls</translation>
</message>
<message>
<source>Control Settings</source>
<translation type="unfinished">Control Settings</translation>
</message>
<message>
<source>D-Pad</source>
<translation type="unfinished">D-Pad</translation>
@ -469,14 +461,6 @@
<source>L2 / LT</source>
<translation type="unfinished">L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation type="unfinished">KBM Controls</translation>
</message>
<message>
<source>KBM Editor</source>
<translation type="unfinished">KBM Editor</translation>
</message>
<message>
<source>Back</source>
<translation type="unfinished">Back</translation>
@ -533,6 +517,30 @@
<source>Right Stick</source>
<translation type="unfinished">Right Stick</translation>
</message>
<message>
<source>Color Adjustment</source>
<translation type="unfinished">Color Adjustment</translation>
</message>
<message>
<source>R:</source>
<translation type="unfinished">R:</translation>
</message>
<message>
<source>G:</source>
<translation type="unfinished">G:</translation>
</message>
<message>
<source>B:</source>
<translation type="unfinished">B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation type="unfinished">Override Lightbar Color</translation>
</message>
<message>
<source>Override Color</source>
<translation type="unfinished">Override Color</translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -855,6 +863,10 @@
<source>Save Data</source>
<translation type="unfinished">Save Data</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation type="unfinished">SFO Viewer for </translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation>About shadPS4</translation>
</message>
<message>
<source>shadPS4</source>
<translation>shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation>shadPS4 is an experimental open-source emulator for the PlayStation 4.</translation>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Control Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>D-Pad</source>
<translation type="unfinished"></translation>
@ -469,14 +461,6 @@
<source>L2 / LT</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>KBM Controls</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>KBM Editor</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Back</source>
<translation type="unfinished"></translation>
@ -533,6 +517,30 @@
<source>Right Stick</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Color Adjustment</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>R:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>G:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>B:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Override Color</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -855,6 +863,10 @@
<source>Save Data</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation>Acerca de shadPS4</translation>
</message>
<message>
<source>shadPS4</source>
<translation type="unfinished">shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation>shadPS4 es un emulador experimental de código abierto para la PlayStation 4.</translation>
@ -98,7 +94,7 @@
</message>
<message>
<source>Error</source>
<translation type="unfinished">Error</translation>
<translation>Error</translation>
</message>
<message>
<source>No patch selected.</source>
@ -257,7 +253,7 @@
</message>
<message>
<source>Error</source>
<translation type="unfinished">Error</translation>
<translation>Error</translation>
</message>
<message>
<source>Network error:</source>
@ -321,7 +317,7 @@
</message>
<message>
<source>No</source>
<translation type="unfinished">No</translation>
<translation>No</translation>
</message>
<message>
<source>Hide Changelog</source>
@ -372,7 +368,7 @@
</message>
<message>
<source>Error</source>
<translation type="unfinished">Error</translation>
<translation>Error</translation>
</message>
<message>
<source>Unable to update compatibility data! Try again later.</source>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation>Configurar Controles</translation>
</message>
<message>
<source>Control Settings</source>
<translation type="unfinished">Control Settings</translation>
</message>
<message>
<source>D-Pad</source>
<translation type="unfinished">D-Pad</translation>
@ -469,14 +461,6 @@
<source>L2 / LT</source>
<translation type="unfinished">L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation type="unfinished">KBM Controls</translation>
</message>
<message>
<source>KBM Editor</source>
<translation>Editor KBM</translation>
</message>
<message>
<source>Back</source>
<translation type="unfinished">Back</translation>
@ -533,6 +517,30 @@
<source>Right Stick</source>
<translation type="unfinished">Right Stick</translation>
</message>
<message>
<source>Color Adjustment</source>
<translation type="unfinished">Color Adjustment</translation>
</message>
<message>
<source>R:</source>
<translation type="unfinished">R:</translation>
</message>
<message>
<source>G:</source>
<translation type="unfinished">G:</translation>
</message>
<message>
<source>B:</source>
<translation type="unfinished">B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation type="unfinished">Override Lightbar Color</translation>
</message>
<message>
<source>Override Color</source>
<translation type="unfinished">Override Color</translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -855,6 +863,10 @@
<source>Save Data</source>
<translation type="unfinished">Save Data</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation type="unfinished">SFO Viewer for </translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation>درباره ShadPS4</translation>
</message>
<message>
<source>shadPS4</source>
<translation>ShadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation>یک شبیه ساز متن باز برای پلی استیشن 4 است. </translation>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation type="unfinished">Configure Controls</translation>
</message>
<message>
<source>Control Settings</source>
<translation type="unfinished">Control Settings</translation>
</message>
<message>
<source>D-Pad</source>
<translation type="unfinished">D-Pad</translation>
@ -469,14 +461,6 @@
<source>L2 / LT</source>
<translation type="unfinished">L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation type="unfinished">KBM Controls</translation>
</message>
<message>
<source>KBM Editor</source>
<translation type="unfinished">KBM Editor</translation>
</message>
<message>
<source>Back</source>
<translation type="unfinished">Back</translation>
@ -533,6 +517,30 @@
<source>Right Stick</source>
<translation type="unfinished">Right Stick</translation>
</message>
<message>
<source>Color Adjustment</source>
<translation type="unfinished">Color Adjustment</translation>
</message>
<message>
<source>R:</source>
<translation type="unfinished">R:</translation>
</message>
<message>
<source>G:</source>
<translation type="unfinished">G:</translation>
</message>
<message>
<source>B:</source>
<translation type="unfinished">B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation type="unfinished">Override Lightbar Color</translation>
</message>
<message>
<source>Override Color</source>
<translation type="unfinished">Override Color</translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -855,6 +863,10 @@
<source>Save Data</source>
<translation type="unfinished">Save Data</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation type="unfinished">SFO Viewer for </translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation>Tietoa shadPS4:sta</translation>
</message>
<message>
<source>shadPS4</source>
<translation type="unfinished">shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation>shadPS4 on kokeellinen avoimen lähdekoodin PlayStation 4 emulaattori.</translation>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation type="unfinished">Configure Controls</translation>
</message>
<message>
<source>Control Settings</source>
<translation type="unfinished">Control Settings</translation>
</message>
<message>
<source>D-Pad</source>
<translation type="unfinished">D-Pad</translation>
@ -469,14 +461,6 @@
<source>L2 / LT</source>
<translation type="unfinished">L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation type="unfinished">KBM Controls</translation>
</message>
<message>
<source>KBM Editor</source>
<translation type="unfinished">KBM Editor</translation>
</message>
<message>
<source>Back</source>
<translation type="unfinished">Back</translation>
@ -533,6 +517,30 @@
<source>Right Stick</source>
<translation type="unfinished">Right Stick</translation>
</message>
<message>
<source>Color Adjustment</source>
<translation type="unfinished">Color Adjustment</translation>
</message>
<message>
<source>R:</source>
<translation type="unfinished">R:</translation>
</message>
<message>
<source>G:</source>
<translation type="unfinished">G:</translation>
</message>
<message>
<source>B:</source>
<translation type="unfinished">B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation type="unfinished">Override Lightbar Color</translation>
</message>
<message>
<source>Override Color</source>
<translation type="unfinished">Override Color</translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -855,6 +863,10 @@
<source>Save Data</source>
<translation type="unfinished">Save Data</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation type="unfinished">SFO Viewer for </translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation>À propos de shadPS4</translation>
</message>
<message>
<source>shadPS4</source>
<translation>shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation>shadPS4 est un émulateur open-source expérimental de la PlayStation 4.</translation>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation>Configurer les Commandes</translation>
</message>
<message>
<source>Control Settings</source>
<translation>Paramètres de Contrôle</translation>
</message>
<message>
<source>D-Pad</source>
<translation>Croix directionnelle</translation>
@ -469,14 +461,6 @@
<source>L2 / LT</source>
<translation>L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation>Commandes KBM</translation>
</message>
<message>
<source>KBM Editor</source>
<translation>Éditeur KBM</translation>
</message>
<message>
<source>Back</source>
<translation>Retour</translation>
@ -533,6 +517,30 @@
<source>Right Stick</source>
<translation>Joystick Droit</translation>
</message>
<message>
<source>Color Adjustment</source>
<translation type="unfinished">Color Adjustment</translation>
</message>
<message>
<source>R:</source>
<translation type="unfinished">R:</translation>
</message>
<message>
<source>G:</source>
<translation type="unfinished">G:</translation>
</message>
<message>
<source>B:</source>
<translation type="unfinished">B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation type="unfinished">Override Lightbar Color</translation>
</message>
<message>
<source>Override Color</source>
<translation type="unfinished">Override Color</translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -855,6 +863,10 @@
<source>Save Data</source>
<translation>Enregistrer les Données</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation>Visionneuse SFO pour </translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>
@ -1721,7 +1733,7 @@
</message>
<message>
<source>Save Data Path:\nThe folder where game save data will be saved.</source>
<translation type="unfinished">Save Data Path:\nThe folder where game save data will be saved.</translation>
<translation>Chemin de sauvegarde :\nLe dossier les sauvegardes du jeu sont enregistré.</translation>
</message>
<message>
<source>Browse:\nBrowse for a folder to set as the save data path.</source>
@ -1745,11 +1757,11 @@
</message>
<message>
<source>Set the volume of the background music.</source>
<translation type="unfinished">Set the volume of the background music.</translation>
<translation>Volume de la musique de fond.</translation>
</message>
<message>
<source>Enable Motion Controls</source>
<translation type="unfinished">Enable Motion Controls</translation>
<translation>Activer les Mouvements</translation>
</message>
<message>
<source>Save Data Path</source>

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation>A shadPS4-ről</translation>
</message>
<message>
<source>shadPS4</source>
<translation type="unfinished">shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation>A shadPS4 egy kezdetleges, open-source PlayStation 4 emulátor.</translation>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation type="unfinished">Configure Controls</translation>
</message>
<message>
<source>Control Settings</source>
<translation type="unfinished">Control Settings</translation>
</message>
<message>
<source>D-Pad</source>
<translation type="unfinished">D-Pad</translation>
@ -469,14 +461,6 @@
<source>L2 / LT</source>
<translation type="unfinished">L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation type="unfinished">KBM Controls</translation>
</message>
<message>
<source>KBM Editor</source>
<translation type="unfinished">KBM Editor</translation>
</message>
<message>
<source>Back</source>
<translation type="unfinished">Back</translation>
@ -533,6 +517,30 @@
<source>Right Stick</source>
<translation type="unfinished">Right Stick</translation>
</message>
<message>
<source>Color Adjustment</source>
<translation type="unfinished">Color Adjustment</translation>
</message>
<message>
<source>R:</source>
<translation type="unfinished">R:</translation>
</message>
<message>
<source>G:</source>
<translation type="unfinished">G:</translation>
</message>
<message>
<source>B:</source>
<translation type="unfinished">B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation type="unfinished">Override Lightbar Color</translation>
</message>
<message>
<source>Override Color</source>
<translation type="unfinished">Override Color</translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -855,6 +863,10 @@
<source>Save Data</source>
<translation type="unfinished">Save Data</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation type="unfinished">SFO Viewer for </translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation type="unfinished">About shadPS4</translation>
</message>
<message>
<source>shadPS4</source>
<translation type="unfinished">shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation type="unfinished">shadPS4 is an experimental open-source emulator for the PlayStation 4.</translation>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation type="unfinished">Configure Controls</translation>
</message>
<message>
<source>Control Settings</source>
<translation type="unfinished">Control Settings</translation>
</message>
<message>
<source>D-Pad</source>
<translation type="unfinished">D-Pad</translation>
@ -469,14 +461,6 @@
<source>L2 / LT</source>
<translation type="unfinished">L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation type="unfinished">KBM Controls</translation>
</message>
<message>
<source>KBM Editor</source>
<translation type="unfinished">KBM Editor</translation>
</message>
<message>
<source>Back</source>
<translation type="unfinished">Back</translation>
@ -533,6 +517,30 @@
<source>Right Stick</source>
<translation type="unfinished">Right Stick</translation>
</message>
<message>
<source>Color Adjustment</source>
<translation type="unfinished">Color Adjustment</translation>
</message>
<message>
<source>R:</source>
<translation type="unfinished">R:</translation>
</message>
<message>
<source>G:</source>
<translation type="unfinished">G:</translation>
</message>
<message>
<source>B:</source>
<translation type="unfinished">B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation type="unfinished">Override Lightbar Color</translation>
</message>
<message>
<source>Override Color</source>
<translation type="unfinished">Override Color</translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -855,6 +863,10 @@
<source>Save Data</source>
<translation type="unfinished">Save Data</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation type="unfinished">SFO Viewer for </translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation>Riguardo shadPS4</translation>
</message>
<message>
<source>shadPS4</source>
<translation>shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation>shadPS4 è un emulatore sperimentale open-source per PlayStation 4.</translation>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation>Configura Comandi</translation>
</message>
<message>
<source>Control Settings</source>
<translation>Impostazioni dei Comandi</translation>
</message>
<message>
<source>D-Pad</source>
<translation>Croce direzionale</translation>
@ -469,14 +461,6 @@
<source>L2 / LT</source>
<translation>L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation>Controlli Tastiera/Mouse</translation>
</message>
<message>
<source>KBM Editor</source>
<translation>Editor Tastiera/Mouse</translation>
</message>
<message>
<source>Back</source>
<translation>Indietro</translation>
@ -533,6 +517,30 @@
<source>Right Stick</source>
<translation>Levetta Destra</translation>
</message>
<message>
<source>Color Adjustment</source>
<translation>Regolazione Colore</translation>
</message>
<message>
<source>R:</source>
<translation>R:</translation>
</message>
<message>
<source>G:</source>
<translation>V:</translation>
</message>
<message>
<source>B:</source>
<translation>B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation>Sostituisci Colore Lightbar</translation>
</message>
<message>
<source>Override Color</source>
<translation>Sostituisci Colore</translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -855,6 +863,10 @@
<source>Save Data</source>
<translation>Dati Salvataggio</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation>Visualizzatore SFO per </translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>
@ -1581,7 +1593,7 @@
</message>
<message>
<source>Update:\nRelease: Official versions released every month that may be very outdated, but are more reliable and tested.\nNightly: Development versions that have all the latest features and fixes, but may contain bugs and are less stable.</source>
<translation>Aggiornamento:\nRelease: Versioni ufficiali rilasciate ogni mese che potrebbero essere molto datate, ma sono più affidabili e testate.\nNightly: Versioni di sviluppo che hanno tutte le ultime funzionalità e correzioni, ma potrebbero contenere bug e sono meno stabili.</translation>
<translation>Aggiornamento:\nRilascio: Versioni ufficiali rilasciate ogni mese che possono essere molto obsolete, ma sono più affidabili e testati.\nNotturno: Le versioni di sviluppo che hanno tutte le ultime funzionalità e correzioni, ma possono contenere bug e sono meno stabili.</translation>
</message>
<message>
<source>Background Image:\nControl the opacity of the game background image.</source>
@ -1649,7 +1661,7 @@
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation>Dispositivo Grafico:\nIn sistemi con più GPU, seleziona la GPU che l&apos;emulatore utilizzerà dall&apos;elenco a discesa,\no seleziona &quot;Auto Select&quot; per determinarlo automaticamente.</translation>
<translation>Dispositivo Grafico:\nIn sistemi con più GPU, seleziona la GPU che l&apos;emulatore utilizzerà dall&apos;elenco a discesa,\no seleziona &quot;Selezione Automatica&quot; per determinarlo automaticamente.</translation>
</message>
<message>
<source>Width/Height:\nSets the size of the emulator window at launch, which can be resized during gameplay.\nThis is different from the in-game resolution.</source>

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation>shadPS4について</translation>
</message>
<message>
<source>shadPS4</source>
<translation type="unfinished">shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation>shadPS4はPlayStation 4</translation>
@ -411,35 +407,31 @@
<name>ControlSettings</name>
<message>
<source>Configure Controls</source>
<translation type="unfinished">Configure Controls</translation>
</message>
<message>
<source>Control Settings</source>
<translation type="unfinished">Control Settings</translation>
<translation></translation>
</message>
<message>
<source>D-Pad</source>
<translation type="unfinished">D-Pad</translation>
<translation></translation>
</message>
<message>
<source>Up</source>
<translation type="unfinished">Up</translation>
<translation></translation>
</message>
<message>
<source>Left</source>
<translation type="unfinished">Left</translation>
<translation></translation>
</message>
<message>
<source>Right</source>
<translation type="unfinished">Right</translation>
<translation></translation>
</message>
<message>
<source>Down</source>
<translation type="unfinished">Down</translation>
<translation></translation>
</message>
<message>
<source>Left Stick Deadzone (def:2 max:127)</source>
<translation type="unfinished">Left Stick Deadzone (def:2 max:127)</translation>
<translation>既定:2 最大:127</translation>
</message>
<message>
<source>Left Deadzone</source>
@ -447,7 +439,7 @@
</message>
<message>
<source>Left Stick</source>
<translation type="unfinished">Left Stick</translation>
<translation></translation>
</message>
<message>
<source>Config Selection</source>
@ -463,19 +455,11 @@
</message>
<message>
<source>L1 / LB</source>
<translation type="unfinished">L1 / LB</translation>
<translation>L1 / LB</translation>
</message>
<message>
<source>L2 / LT</source>
<translation type="unfinished">L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation type="unfinished">KBM Controls</translation>
</message>
<message>
<source>KBM Editor</source>
<translation type="unfinished">KBM Editor</translation>
<translation>L2 / LT</translation>
</message>
<message>
<source>Back</source>
@ -483,23 +467,23 @@
</message>
<message>
<source>R1 / RB</source>
<translation type="unfinished">R1 / RB</translation>
<translation>R1 / RB</translation>
</message>
<message>
<source>R2 / RT</source>
<translation type="unfinished">R2 / RT</translation>
<translation>R2 / RT</translation>
</message>
<message>
<source>L3</source>
<translation type="unfinished">L3</translation>
<translation>L3</translation>
</message>
<message>
<source>Options / Start</source>
<translation type="unfinished">Options / Start</translation>
<translation>Options / Start</translation>
</message>
<message>
<source>R3</source>
<translation type="unfinished">R3</translation>
<translation>R3</translation>
</message>
<message>
<source>Face Buttons</source>
@ -507,23 +491,23 @@
</message>
<message>
<source>Triangle / Y</source>
<translation type="unfinished">Triangle / Y</translation>
<translation> / Y</translation>
</message>
<message>
<source>Square / X</source>
<translation type="unfinished">Square / X</translation>
<translation> / X</translation>
</message>
<message>
<source>Circle / B</source>
<translation type="unfinished">Circle / B</translation>
<translation> / B</translation>
</message>
<message>
<source>Cross / A</source>
<translation type="unfinished">Cross / A</translation>
<translation> / A</translation>
</message>
<message>
<source>Right Stick Deadzone (def:2, max:127)</source>
<translation type="unfinished">Right Stick Deadzone (def:2, max:127)</translation>
<translation>既定:2, 最大:127</translation>
</message>
<message>
<source>Right Deadzone</source>
@ -531,7 +515,31 @@
</message>
<message>
<source>Right Stick</source>
<translation type="unfinished">Right Stick</translation>
<translation></translation>
</message>
<message>
<source>Color Adjustment</source>
<translation type="unfinished">Color Adjustment</translation>
</message>
<message>
<source>R:</source>
<translation type="unfinished">R:</translation>
</message>
<message>
<source>G:</source>
<translation type="unfinished">G:</translation>
</message>
<message>
<source>B:</source>
<translation type="unfinished">B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation type="unfinished">Override Lightbar Color</translation>
</message>
<message>
<source>Override Color</source>
<translation type="unfinished">Override Color</translation>
</message>
</context>
<context>
@ -576,7 +584,7 @@
</message>
<message>
<source>Directory to install DLC</source>
<translation type="unfinished">Directory to install DLC</translation>
<translation>DLCをインストールするディレクトリ</translation>
</message>
</context>
<context>
@ -595,7 +603,7 @@
</message>
<message>
<source>Compatibility</source>
<translation type="unfinished">Compatibility</translation>
<translation></translation>
</message>
<message>
<source>Region</source>
@ -674,23 +682,23 @@
<name>GameListUtils</name>
<message>
<source>B</source>
<translation type="unfinished">B</translation>
<translation>B</translation>
</message>
<message>
<source>KB</source>
<translation type="unfinished">KB</translation>
<translation>KB</translation>
</message>
<message>
<source>MB</source>
<translation type="unfinished">MB</translation>
<translation>MB</translation>
</message>
<message>
<source>GB</source>
<translation type="unfinished">GB</translation>
<translation>GB</translation>
</message>
<message>
<source>TB</source>
<translation type="unfinished">TB</translation>
<translation>TB</translation>
</message>
</context>
<context>
@ -741,11 +749,11 @@
</message>
<message>
<source>Copy Version</source>
<translation type="unfinished">Copy Version</translation>
<translation></translation>
</message>
<message>
<source>Copy Size</source>
<translation type="unfinished">Copy Size</translation>
<translation></translation>
</message>
<message>
<source>Copy All</source>
@ -821,7 +829,7 @@
</message>
<message>
<source>DLC</source>
<translation type="unfinished">DLC</translation>
<translation>DLC</translation>
</message>
<message>
<source>Delete %1</source>
@ -833,28 +841,32 @@
</message>
<message>
<source>Open Update Folder</source>
<translation type="unfinished">Open Update Folder</translation>
<translation></translation>
</message>
<message>
<source>Delete Save Data</source>
<translation type="unfinished">Delete Save Data</translation>
<translation></translation>
</message>
<message>
<source>This game has no update folder to open!</source>
<translation type="unfinished">This game has no update folder to open!</translation>
<translation></translation>
</message>
<message>
<source>Failed to convert icon.</source>
<translation type="unfinished">Failed to convert icon.</translation>
<translation></translation>
</message>
<message>
<source>This game has no save data to delete!</source>
<translation type="unfinished">This game has no save data to delete!</translation>
<translation></translation>
</message>
<message>
<source>Save Data</source>
<translation type="unfinished">Save Data</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation type="unfinished">SFO Viewer for </translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>
@ -872,7 +884,7 @@
</message>
<message>
<source>Delete PKG File on Install</source>
<translation type="unfinished">Delete PKG File on Install</translation>
<translation>PKGファイルを削除</translation>
</message>
</context>
<context>
@ -1151,15 +1163,15 @@
</message>
<message>
<source>Run Game</source>
<translation type="unfinished">Run Game</translation>
<translation></translation>
</message>
<message>
<source>Eboot.bin file not found</source>
<translation type="unfinished">Eboot.bin file not found</translation>
<translation>Eboot.bin </translation>
</message>
<message>
<source>PKG File (*.PKG *.pkg)</source>
<translation type="unfinished">PKG File (*.PKG *.pkg)</translation>
<translation>PKGファイル (*.PKG *.pkg)</translation>
</message>
<message>
<source>PKG is a patch or DLC, please install the game first!</source>
@ -1167,11 +1179,11 @@
</message>
<message>
<source>Game is already running!</source>
<translation type="unfinished">Game is already running!</translation>
<translation></translation>
</message>
<message>
<source>shadPS4</source>
<translation type="unfinished">shadPS4</translation>
<translation>shadPS4</translation>
</message>
</context>
<context>
@ -1238,7 +1250,7 @@
</message>
<message>
<source>Package</source>
<translation type="unfinished">Package</translation>
<translation></translation>
</message>
</context>
<context>
@ -1393,7 +1405,7 @@
</message>
<message>
<source>Enable HDR</source>
<translation type="unfinished">Enable HDR</translation>
<translation>HDRを有効化</translation>
</message>
<message>
<source>Paths</source>
@ -1493,7 +1505,7 @@
</message>
<message>
<source>Opacity</source>
<translation type="unfinished">Opacity</translation>
<translation></translation>
</message>
<message>
<source>Play title music</source>
@ -1729,7 +1741,7 @@
</message>
<message>
<source>Borderless</source>
<translation type="unfinished">Borderless</translation>
<translation></translation>
</message>
<message>
<source>True</source>
@ -1737,19 +1749,19 @@
</message>
<message>
<source>Release</source>
<translation type="unfinished">Release</translation>
<translation>Release</translation>
</message>
<message>
<source>Nightly</source>
<translation type="unfinished">Nightly</translation>
<translation>Nightly</translation>
</message>
<message>
<source>Set the volume of the background music.</source>
<translation type="unfinished">Set the volume of the background music.</translation>
<translation></translation>
</message>
<message>
<source>Enable Motion Controls</source>
<translation type="unfinished">Enable Motion Controls</translation>
<translation></translation>
</message>
<message>
<source>Save Data Path</source>
@ -1761,11 +1773,11 @@
</message>
<message>
<source>async</source>
<translation type="unfinished">async</translation>
<translation></translation>
</message>
<message>
<source>sync</source>
<translation type="unfinished">sync</translation>
<translation></translation>
</message>
<message>
<source>Auto Select</source>

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation type="unfinished">About shadPS4</translation>
</message>
<message>
<source>shadPS4</source>
<translation type="unfinished">shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation type="unfinished">shadPS4 is an experimental open-source emulator for the PlayStation 4.</translation>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation type="unfinished">Configure Controls</translation>
</message>
<message>
<source>Control Settings</source>
<translation type="unfinished">Control Settings</translation>
</message>
<message>
<source>D-Pad</source>
<translation type="unfinished">D-Pad</translation>
@ -469,14 +461,6 @@
<source>L2 / LT</source>
<translation type="unfinished">L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation type="unfinished">KBM Controls</translation>
</message>
<message>
<source>KBM Editor</source>
<translation type="unfinished">KBM Editor</translation>
</message>
<message>
<source>Back</source>
<translation type="unfinished">Back</translation>
@ -533,6 +517,30 @@
<source>Right Stick</source>
<translation type="unfinished">Right Stick</translation>
</message>
<message>
<source>Color Adjustment</source>
<translation type="unfinished">Color Adjustment</translation>
</message>
<message>
<source>R:</source>
<translation type="unfinished">R:</translation>
</message>
<message>
<source>G:</source>
<translation type="unfinished">G:</translation>
</message>
<message>
<source>B:</source>
<translation type="unfinished">B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation type="unfinished">Override Lightbar Color</translation>
</message>
<message>
<source>Override Color</source>
<translation type="unfinished">Override Color</translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -855,6 +863,10 @@
<source>Save Data</source>
<translation type="unfinished">Save Data</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation type="unfinished">SFO Viewer for </translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation type="unfinished">About shadPS4</translation>
</message>
<message>
<source>shadPS4</source>
<translation type="unfinished">shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation type="unfinished">shadPS4 is an experimental open-source emulator for the PlayStation 4.</translation>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation type="unfinished">Configure Controls</translation>
</message>
<message>
<source>Control Settings</source>
<translation type="unfinished">Control Settings</translation>
</message>
<message>
<source>D-Pad</source>
<translation type="unfinished">D-Pad</translation>
@ -469,14 +461,6 @@
<source>L2 / LT</source>
<translation type="unfinished">L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation type="unfinished">KBM Controls</translation>
</message>
<message>
<source>KBM Editor</source>
<translation type="unfinished">KBM Editor</translation>
</message>
<message>
<source>Back</source>
<translation type="unfinished">Back</translation>
@ -533,6 +517,30 @@
<source>Right Stick</source>
<translation type="unfinished">Right Stick</translation>
</message>
<message>
<source>Color Adjustment</source>
<translation type="unfinished">Color Adjustment</translation>
</message>
<message>
<source>R:</source>
<translation type="unfinished">R:</translation>
</message>
<message>
<source>G:</source>
<translation type="unfinished">G:</translation>
</message>
<message>
<source>B:</source>
<translation type="unfinished">B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation type="unfinished">Override Lightbar Color</translation>
</message>
<message>
<source>Override Color</source>
<translation type="unfinished">Override Color</translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -855,6 +863,10 @@
<source>Save Data</source>
<translation type="unfinished">Save Data</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation type="unfinished">SFO Viewer for </translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>

View File

@ -2,17 +2,13 @@
<!-- SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project
SPDX-License-Identifier: GPL-2.0-or-later -->
<!DOCTYPE TS>
<TS version="2.1" language="no_NO" sourcelanguage="en">
<TS version="2.1" language="nb_NO" sourcelanguage="en">
<context>
<name>AboutDialog</name>
<message>
<source>About shadPS4</source>
<translation>Om shadPS4</translation>
</message>
<message>
<source>shadPS4</source>
<translation type="unfinished">shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation>shadPS4 er en eksperimentell åpen kildekode-emulator for PlayStation 4.</translation>
@ -230,7 +226,7 @@
</message>
<message>
<source>Directory does not exist:</source>
<translation>Mappen eksisterer ikke:</translation>
<translation>Mappa eksisterer ikke:</translation>
</message>
<message>
<source>Failed to open files.json for reading.</source>
@ -411,87 +407,75 @@
<name>ControlSettings</name>
<message>
<source>Configure Controls</source>
<translation type="unfinished">Configure Controls</translation>
</message>
<message>
<source>Control Settings</source>
<translation type="unfinished">Control Settings</translation>
<translation>Sett opp kontroller</translation>
</message>
<message>
<source>D-Pad</source>
<translation type="unfinished">D-Pad</translation>
<translation>D-Pad</translation>
</message>
<message>
<source>Up</source>
<translation type="unfinished">Up</translation>
<translation>Opp</translation>
</message>
<message>
<source>Left</source>
<translation type="unfinished">Left</translation>
<translation>Venstre</translation>
</message>
<message>
<source>Right</source>
<translation type="unfinished">Right</translation>
<translation>Høyre</translation>
</message>
<message>
<source>Down</source>
<translation type="unfinished">Down</translation>
<translation>Ned</translation>
</message>
<message>
<source>Left Stick Deadzone (def:2 max:127)</source>
<translation type="unfinished">Left Stick Deadzone (def:2 max:127)</translation>
<translation>Venstre analog dødsone (def:2, maks:127)</translation>
</message>
<message>
<source>Left Deadzone</source>
<translation type="unfinished">Left Deadzone</translation>
<translation>Venstre dødsone</translation>
</message>
<message>
<source>Left Stick</source>
<translation type="unfinished">Left Stick</translation>
<translation>Venstre analog</translation>
</message>
<message>
<source>Config Selection</source>
<translation type="unfinished">Config Selection</translation>
<translation>Utvalg av oppsett</translation>
</message>
<message>
<source>Common Config</source>
<translation type="unfinished">Common Config</translation>
<translation>Felles oppsett</translation>
</message>
<message>
<source>Use per-game configs</source>
<translation type="unfinished">Use per-game configs</translation>
<translation>Bruk oppsett per spill</translation>
</message>
<message>
<source>L1 / LB</source>
<translation type="unfinished">L1 / LB</translation>
<translation>L1 / LB</translation>
</message>
<message>
<source>L2 / LT</source>
<translation type="unfinished">L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation type="unfinished">KBM Controls</translation>
</message>
<message>
<source>KBM Editor</source>
<translation type="unfinished">KBM Editor</translation>
<translation>L2 / LT</translation>
</message>
<message>
<source>Back</source>
<translation type="unfinished">Back</translation>
<translation>Tilbake</translation>
</message>
<message>
<source>R1 / RB</source>
<translation type="unfinished">R1 / RB</translation>
<translation>R1 / RB</translation>
</message>
<message>
<source>R2 / RT</source>
<translation type="unfinished">R2 / RT</translation>
<translation>R2 / RT</translation>
</message>
<message>
<source>L3</source>
<translation type="unfinished">L3</translation>
<translation>L3</translation>
</message>
<message>
<source>Options / Start</source>
@ -499,39 +483,63 @@
</message>
<message>
<source>R3</source>
<translation type="unfinished">R3</translation>
<translation>R3</translation>
</message>
<message>
<source>Face Buttons</source>
<translation type="unfinished">Face Buttons</translation>
<translation>Handlingsknapper</translation>
</message>
<message>
<source>Triangle / Y</source>
<translation type="unfinished">Triangle / Y</translation>
<translation>Triangel / Y</translation>
</message>
<message>
<source>Square / X</source>
<translation type="unfinished">Square / X</translation>
<translation>Firkant / X</translation>
</message>
<message>
<source>Circle / B</source>
<translation type="unfinished">Circle / B</translation>
<translation>Sirkel / B</translation>
</message>
<message>
<source>Cross / A</source>
<translation type="unfinished">Cross / A</translation>
<translation>Kryss / A</translation>
</message>
<message>
<source>Right Stick Deadzone (def:2, max:127)</source>
<translation type="unfinished">Right Stick Deadzone (def:2, max:127)</translation>
<translation>Høyre analog dødsone (def:2, maks:127)</translation>
</message>
<message>
<source>Right Deadzone</source>
<translation type="unfinished">Right Deadzone</translation>
<translation>Høyre dødsone</translation>
</message>
<message>
<source>Right Stick</source>
<translation type="unfinished">Right Stick</translation>
<translation>Høyre analog</translation>
</message>
<message>
<source>Color Adjustment</source>
<translation type="unfinished">Color Adjustment</translation>
</message>
<message>
<source>R:</source>
<translation type="unfinished">R:</translation>
</message>
<message>
<source>G:</source>
<translation type="unfinished">G:</translation>
</message>
<message>
<source>B:</source>
<translation type="unfinished">B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation type="unfinished">Override Lightbar Color</translation>
</message>
<message>
<source>Override Color</source>
<translation type="unfinished">Override Color</translation>
</message>
</context>
<context>
@ -576,7 +584,7 @@
</message>
<message>
<source>Directory to install DLC</source>
<translation type="unfinished">Directory to install DLC</translation>
<translation>Mappe for å installere DLC</translation>
</message>
</context>
<context>
@ -599,7 +607,7 @@
</message>
<message>
<source>Region</source>
<translation type="unfinished">Region</translation>
<translation>Region</translation>
</message>
<message>
<source>Firmware</source>
@ -627,15 +635,15 @@
</message>
<message>
<source>h</source>
<translation type="unfinished">h</translation>
<translation>h</translation>
</message>
<message>
<source>m</source>
<translation type="unfinished">m</translation>
<translation>m</translation>
</message>
<message>
<source>s</source>
<translation type="unfinished">s</translation>
<translation>s</translation>
</message>
<message>
<source>Compatibility is untested</source>
@ -674,23 +682,23 @@
<name>GameListUtils</name>
<message>
<source>B</source>
<translation type="unfinished">B</translation>
<translation>B</translation>
</message>
<message>
<source>KB</source>
<translation type="unfinished">KB</translation>
<translation>KB</translation>
</message>
<message>
<source>MB</source>
<translation type="unfinished">MB</translation>
<translation>MB</translation>
</message>
<message>
<source>GB</source>
<translation type="unfinished">GB</translation>
<translation>GB</translation>
</message>
<message>
<source>TB</source>
<translation type="unfinished">TB</translation>
<translation>TB</translation>
</message>
</context>
<context>
@ -717,15 +725,15 @@
</message>
<message>
<source>Open Game Folder</source>
<translation>Åpne spillmappen</translation>
<translation>Åpne spillmappa</translation>
</message>
<message>
<source>Open Save Data Folder</source>
<translation>Åpne lagrede datamappen</translation>
<translation>Åpne lagrede datamappa</translation>
</message>
<message>
<source>Open Log Folder</source>
<translation>Åpne loggmappen</translation>
<translation>Åpne loggmappa</translation>
</message>
<message>
<source>Copy info...</source>
@ -821,7 +829,7 @@
</message>
<message>
<source>DLC</source>
<translation type="unfinished">DLC</translation>
<translation>DLC</translation>
</message>
<message>
<source>Delete %1</source>
@ -833,27 +841,31 @@
</message>
<message>
<source>Open Update Folder</source>
<translation type="unfinished">Open Update Folder</translation>
<translation>Åpne oppdateringsmappa</translation>
</message>
<message>
<source>Delete Save Data</source>
<translation type="unfinished">Delete Save Data</translation>
<translation>Slett lagret data</translation>
</message>
<message>
<source>This game has no update folder to open!</source>
<translation type="unfinished">This game has no update folder to open!</translation>
<translation>Dette spillet har ingen oppdateringsmappe å åpne!</translation>
</message>
<message>
<source>Failed to convert icon.</source>
<translation type="unfinished">Failed to convert icon.</translation>
<translation>Klarte ikke konvertere ikon.</translation>
</message>
<message>
<source>This game has no save data to delete!</source>
<translation type="unfinished">This game has no save data to delete!</translation>
<translation>Dette spillet har ingen lagret data å slette!</translation>
</message>
<message>
<source>Save Data</source>
<translation type="unfinished">Save Data</translation>
<translation>Lagret data</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation type="unfinished">SFO Viewer for </translation>
</message>
</context>
<context>
@ -868,11 +880,11 @@
</message>
<message>
<source>Install All Queued to Selected Folder</source>
<translation type="unfinished">Install All Queued to Selected Folder</translation>
<translation>Installer alle i til den valgte mappa</translation>
</message>
<message>
<source>Delete PKG File on Install</source>
<translation type="unfinished">Delete PKG File on Install</translation>
<translation>Slett PKG-fila ved installering</translation>
</message>
</context>
<context>
@ -899,7 +911,7 @@
</message>
<message>
<source>Configure...</source>
<translation>Konfigurer...</translation>
<translation>Sett opp...</translation>
</message>
<message>
<source>Install application from a .pkg file</source>
@ -911,7 +923,7 @@
</message>
<message>
<source>Open shadPS4 Folder</source>
<translation type="unfinished">Open shadPS4 Folder</translation>
<translation>Åpne shadPS4 mappa</translation>
</message>
<message>
<source>Exit</source>
@ -943,7 +955,7 @@
</message>
<message>
<source>Medium</source>
<translation type="unfinished">Medium</translation>
<translation>Middels</translation>
</message>
<message>
<source>Large</source>
@ -1151,27 +1163,27 @@
</message>
<message>
<source>Run Game</source>
<translation type="unfinished">Run Game</translation>
<translation>Kjør spill</translation>
</message>
<message>
<source>Eboot.bin file not found</source>
<translation type="unfinished">Eboot.bin file not found</translation>
<translation>Klarte ikke finne Eboot.bin-fila</translation>
</message>
<message>
<source>PKG File (*.PKG *.pkg)</source>
<translation type="unfinished">PKG File (*.PKG *.pkg)</translation>
<translation>PKG-fil (*.PKG *.pkg)</translation>
</message>
<message>
<source>PKG is a patch or DLC, please install the game first!</source>
<translation type="unfinished">PKG is a patch or DLC, please install the game first!</translation>
<translation>PKG er en programrettelse eller DLC. Installer spillet rst!</translation>
</message>
<message>
<source>Game is already running!</source>
<translation type="unfinished">Game is already running!</translation>
<translation>Spillet kjører allerede!</translation>
</message>
<message>
<source>shadPS4</source>
<translation type="unfinished">shadPS4</translation>
<translation>shadPS4</translation>
</message>
</context>
<context>
@ -1194,7 +1206,7 @@
</message>
<message>
<source>Installed</source>
<translation type="unfinished">Installed</translation>
<translation>Installert</translation>
</message>
<message>
<source>Size</source>
@ -1202,27 +1214,27 @@
</message>
<message>
<source>Category</source>
<translation type="unfinished">Category</translation>
<translation>Kategori</translation>
</message>
<message>
<source>Type</source>
<translation type="unfinished">Type</translation>
<translation>Type</translation>
</message>
<message>
<source>App Ver</source>
<translation type="unfinished">App Ver</translation>
<translation>Programversjon</translation>
</message>
<message>
<source>FW</source>
<translation type="unfinished">FW</translation>
<translation>FV</translation>
</message>
<message>
<source>Region</source>
<translation type="unfinished">Region</translation>
<translation>Region</translation>
</message>
<message>
<source>Flags</source>
<translation type="unfinished">Flags</translation>
<translation>Flagg</translation>
</message>
<message>
<source>Path</source>
@ -1238,7 +1250,7 @@
</message>
<message>
<source>Package</source>
<translation type="unfinished">Package</translation>
<translation>Pakke</translation>
</message>
</context>
<context>
@ -1253,7 +1265,7 @@
</message>
<message>
<source>System</source>
<translation type="unfinished">System</translation>
<translation>System</translation>
</message>
<message>
<source>Console Language</source>
@ -1265,11 +1277,11 @@
</message>
<message>
<source>Emulator</source>
<translation type="unfinished">Emulator</translation>
<translation>Emulator</translation>
</message>
<message>
<source>Enable Fullscreen</source>
<translation>Aktiver fullskjerm</translation>
<translation>Bruk fullskjerm</translation>
</message>
<message>
<source>Fullscreen Mode</source>
@ -1277,7 +1289,7 @@
</message>
<message>
<source>Enable Separate Update Folder</source>
<translation>Aktiver seperat oppdateringsmappe</translation>
<translation>Bruk seperat oppdateringsmappe</translation>
</message>
<message>
<source>Default tab when opening settings</source>
@ -1293,7 +1305,7 @@
</message>
<message>
<source>Enable Discord Rich Presence</source>
<translation>Aktiver Discord Rich Presence</translation>
<translation>Bruk Discord Rich Presence</translation>
</message>
<message>
<source>Username</source>
@ -1309,7 +1321,7 @@
</message>
<message>
<source>Logger</source>
<translation type="unfinished">Logger</translation>
<translation>Loggføring</translation>
</message>
<message>
<source>Log Type</source>
@ -1341,7 +1353,7 @@
</message>
<message>
<source>s</source>
<translation type="unfinished">s</translation>
<translation>s</translation>
</message>
<message>
<source>Controller</source>
@ -1385,15 +1397,15 @@
</message>
<message>
<source>Enable Shaders Dumping</source>
<translation>Aktiver skyggeleggerdumping</translation>
<translation>Bruk skyggeleggerdumping</translation>
</message>
<message>
<source>Enable NULL GPU</source>
<translation>Aktiver NULL GPU</translation>
<translation>Bruk NULL GPU</translation>
</message>
<message>
<source>Enable HDR</source>
<translation type="unfinished">Enable HDR</translation>
<translation>Bruk HDR</translation>
</message>
<message>
<source>Paths</source>
@ -1417,23 +1429,23 @@
</message>
<message>
<source>Enable Debug Dumping</source>
<translation>Aktiver feilrettingsdumping</translation>
<translation>Bruk feilrettingsdumping</translation>
</message>
<message>
<source>Enable Vulkan Validation Layers</source>
<translation>Aktiver Vulkan Validation Layers</translation>
<translation>Bruk Vulkan Validation Layers</translation>
</message>
<message>
<source>Enable Vulkan Synchronization Validation</source>
<translation>Aktiver Vulkan synkroniseringslag</translation>
<translation>Bruk Vulkan Validation Layers</translation>
</message>
<message>
<source>Enable RenderDoc Debugging</source>
<translation>Aktiver RenderDoc feilretting</translation>
<translation>Bruk RenderDoc feilsøking</translation>
</message>
<message>
<source>Enable Crash Diagnostics</source>
<translation>Aktiver krasjdiagnostikk</translation>
<translation>Bruk krasjdiagnostikk</translation>
</message>
<message>
<source>Collect Shaders</source>
@ -1461,7 +1473,7 @@
</message>
<message>
<source>Always Show Changelog</source>
<translation type="unfinished">Always Show Changelog</translation>
<translation>Vis alltid endringsloggen</translation>
</message>
<message>
<source>Update Channel</source>
@ -1549,11 +1561,11 @@
</message>
<message>
<source>Enable Full Screen:\nAutomatically puts the game window into full-screen mode.\nThis can be toggled by pressing the F11 key.</source>
<translation>Aktiver fullskjerm:\nSetter spillvinduet automatisk i fullskjermmodus.\nDette kan slås av ved å trykke F11-tasten.</translation>
<translation>Bruk fullskjerm:\nSetter spillvinduet automatisk i fullskjermmodus.\nDette kan slås av ved å trykke F11-tasten.</translation>
</message>
<message>
<source>Enable Separate Update Folder:\nEnables installing game updates into a separate folder for easy management.\nThis can be manually created by adding the extracted update to the game folder with the name &quot;CUSA00000-UPDATE&quot; where the CUSA ID matches the game&apos;s ID.</source>
<translation>Aktiver separat oppdateringsmappe:\nAktiverer installering av spill i en egen mappe for enkel administrasjon.</translation>
<translation>Bruk separat oppdateringsmappe:\n Gjør det mulig å installere spilloppdateringer i en egen mappe for enkel administrasjon.\nDette kan gjøres manuelt ved å legge til den utpakkede oppdateringen, til spillmappa med navnet &quot;CUSA00000-UPDATE&quot; der CUSA-ID-en samsvarer med spillets-ID.</translation>
</message>
<message>
<source>Show Splash Screen:\nShows the game&apos;s splash screen (a special image) while the game is starting.</source>
@ -1561,7 +1573,7 @@
</message>
<message>
<source>Enable Discord Rich Presence:\nDisplays the emulator icon and relevant information on your Discord profile.</source>
<translation>Aktiver Discord Rich Presence:\nViser emulatorikonet og relevant informasjon Discord-profilen din.</translation>
<translation>Bruk Discord Rich Presence:\nViser emulatorikonet og relevant informasjon Discord-profilen din.</translation>
</message>
<message>
<source>Username:\nSets the PS4&apos;s account username, which may be displayed by some games.</source>
@ -1589,7 +1601,7 @@
</message>
<message>
<source>Play Title Music:\nIf a game supports it, enable playing special music when selecting the game in the GUI.</source>
<translation>Spille tittelmusikk:\nHvis et spill støtter det, aktiveres det spesiell musikk når du velger spillet i menyen.</translation>
<translation>Spill av tittelmusikk:\nHvis et spill støtter det, brukes det spesiell musikk når du velger spillet i menyen.</translation>
</message>
<message>
<source>Disable Trophy Pop-ups:\nDisable in-game trophy notifications. Trophy progress can still be tracked using the Trophy Viewer (right-click the game in the main window).</source>
@ -1609,7 +1621,7 @@
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation>Vis kompatibilitets-data:\nViser informasjon om spillkompatibilitet i tabellvisning. Aktiver &quot;Oppdater kompatibilitets-data ved oppstart&quot; for oppdatert informasjon.</translation>
<translation>Vis kompatibilitets-data:\nViser informasjon om spillkompatibilitet i tabellvisning. Bruk &quot;Oppdater kompatibilitets-data ved oppstart&quot; for oppdatert informasjon.</translation>
</message>
<message>
<source>Update Compatibility On Startup:\nAutomatically update the compatibility database when shadPS4 starts.</source>
@ -1649,7 +1661,7 @@
</message>
<message>
<source>Graphics Device:\nOn multiple GPU systems, select the GPU the emulator will use from the drop down list,\nor select &quot;Auto Select&quot; to automatically determine it.</source>
<translation>Grafikkenhet:\nI systemer med flere GPU-er, velg GPU-en emulatoren skal bruke fra rullegardinlisten,\neller velg &quot;Auto Select&quot; for å velge automatisk.</translation>
<translation>Grafikkenhet:\nI systemer med flere GPU-er, velg GPU-en emulatoren skal bruke fra rullegardinlisten,\neller &quot;Velg automatisk&quot;.</translation>
</message>
<message>
<source>Width/Height:\nSets the size of the emulator window at launch, which can be resized during gameplay.\nThis is different from the in-game resolution.</source>
@ -1661,15 +1673,15 @@
</message>
<message>
<source>Enable Shaders Dumping:\nFor the sake of technical debugging, saves the games shaders to a folder as they render.</source>
<translation>Aktiver skyggeleggerdumping:\nFor teknisk feilsøking lagrer skyggeleggerne fra spillet i en mappe mens de gjengis.</translation>
<translation>Bruk skyggeleggerdumping:\nFor teknisk feilsøking lagrer skyggeleggerne fra spillet i en mappe mens de gjengis.</translation>
</message>
<message>
<source>Enable Null GPU:\nFor the sake of technical debugging, disables game rendering as if there were no graphics card.</source>
<translation>Aktiver Null GPU:\nFor teknisk feilsøking deaktiverer spillets-gjengivelse som om det ikke var noe grafikkort.</translation>
<translation>Bruk Null GPU:\nFor teknisk feilsøking deaktiverer spillets-gjengivelse som om det ikke var noen grafikkort.</translation>
</message>
<message>
<source>Enable HDR:\nEnables HDR in games that support it.\nYour monitor must have support for the BT2020 PQ color space and the RGB10A2 swapchain format.</source>
<translation type="unfinished">Enable HDR:\nEnables HDR in games that support it.\nYour monitor must have support for the BT2020 PQ color space and the RGB10A2 swapchain format.</translation>
<translation>Bruk HDR:\nTillater bruk av HDR i spill som støtter det.\nSkjermen din ha støtte for BT2020 PQ fargerom og RGB10A2 swapchain-format.</translation>
</message>
<message>
<source>Game Folders:\nThe list of folders to check for installed games.</source>
@ -1685,27 +1697,27 @@
</message>
<message>
<source>Enable Debug Dumping:\nSaves the import and export symbols and file header information of the currently running PS4 program to a directory.</source>
<translation>Aktiver feilrettingsdumping:\nLagrer import- og eksport-symbolene og filoverskriftsinformasjonen til det nåværende kjørende PS4-programmet i en katalog.</translation>
<translation>Bruk feilrettingsdumping:\nLagrer import- og eksport-symbolene og filoverskrifts-informasjonen til det nåværende kjørende PS4-programmet i en mappe.</translation>
</message>
<message>
<source>Enable Vulkan Validation Layers:\nEnables a system that validates the state of the Vulkan renderer and logs information about its internal state.\nThis will reduce performance and likely change the behavior of emulation.</source>
<translation>Aktiver Vulkan Validation Layers:\nAktiverer et system som validerer tilstanden til Vulkan-gjengiveren og logger informasjon om dens indre tilstand. Dette vil redusere ytelsen og sannsynligvis endre emulatorens atferd.</translation>
<translation>Bruk Vulkan Validation Layers:\nAktiverer et system som bekrefter tilstanden til Vulkan-gjengiveren og logger informasjon om dens indre tilstand.\n Dette vil redusere ytelsen og sannsynligvis endre emulatorens atferd.</translation>
</message>
<message>
<source>Enable Vulkan Synchronization Validation:\nEnables a system that validates the timing of Vulkan rendering tasks.\nThis will reduce performance and likely change the behavior of emulation.</source>
<translation>Aktiver Vulkan synkronisering validering:\nAktiverer et system som validerer frekvens tiden av Vulkan-gjengivelsensoppgaver. Dette vil redusere ytelsen og sannsynligvis endre emulatorens atferd.</translation>
<translation>Bruk Vulkan synkronisering validering:\nEt system som bekrefter frekvens tiden av Vulkan-gjengivelseoppgaver.\nDette vil redusere ytelsen og sannsynligvis endre emulatorens atferd.</translation>
</message>
<message>
<source>Enable RenderDoc Debugging:\nIf enabled, the emulator will provide compatibility with Renderdoc to allow capture and analysis of the currently rendered frame.</source>
<translation>Aktiver RenderDoc feilsøking:\nHvis aktivert, vil emulatoren gi kompatibilitet med RenderDoc for å tillate opptak og analyse av det nåværende gjengitte bildet.</translation>
<translation>Bruk RenderDoc feilsøking:\nHvis brukt, vil emulatoren gi kompatibilitet med RenderDoc for å tillate opptak og analyse av det nåværende gjengitte bildet.</translation>
</message>
<message>
<source>Collect Shaders:\nYou need this enabled to edit shaders with the debug menu (Ctrl + F10).</source>
<translation>Lagre skyggeleggere:\nDu trenger dette aktivert for å redigere skyggeleggerne med feilsøkingsmenyen (Ctrl + F10).</translation>
<translation>Lagre skyggeleggere:\nDu trenger dette for å redigere skyggeleggerne med feilsøkingsmenyen (Ctrl + F10).</translation>
</message>
<message>
<source>Crash Diagnostics:\nCreates a .yaml file with info about the Vulkan state at the time of crashing.\nUseful for debugging &apos;Device lost&apos; errors. If you have this enabled, you should enable Host AND Guest Debug Markers.\nDoes not work on Intel GPUs.\nYou need Vulkan Validation Layers enabled and the Vulkan SDK for this to work.</source>
<translation>Krasjdiagnostikk:\nOppretter en .yaml-fil med informasjon om Vulkan-tilstanden ved krasj.\nNyttig for feilsøking &apos;Device lost&apos; feil. Hvis du har dette aktivert, burde du aktivere vert OG gjestefeilsøkingsmarkører.\nFunker ikke med Intel GPU-er.\nDu trenger Vulkan Validation Layers og Vulkan SDK for at dette skal fungere.</translation>
<translation>Krasjdiagnostikk:\nOppretter en .yaml-fil med informasjon om Vulkan-tilstanden ved krasj.\nNyttig for feilsøking &apos;Device lost&apos; feil. Hvis dette brukes, burde du aktivere vert OG gjestefeilsøkingsmarkører.\nFunker ikke med Intel GPU-er.\nDu trenger Vulkan Validation Layers og Vulkan SDK for at dette skal fungere.</translation>
</message>
<message>
<source>Copy GPU Buffers:\nGets around race conditions involving GPU submits.\nMay or may not help with PM4 type 0 crashes.</source>
@ -1713,11 +1725,11 @@
</message>
<message>
<source>Host Debug Markers:\nInserts emulator-side information like markers for specific AMDGPU commands around Vulkan commands, as well as giving resources debug names.\nIf you have this enabled, you should enable Crash Diagnostics.\nUseful for programs like RenderDoc.</source>
<translation>Vertsfeilsøkingsmarkører:\nSetter inn emulator-side informasjon som markører for spesifikke AMDGPU-kommandoer rundt Vulkan-kommandoer, i tillegg til å gi ressurser feilrettingsnavn.\nHvis du har dette aktivert, burde du aktivere krasjdiagnostikk.\nNyttig for programmer som RenderDoc.</translation>
<translation>Vertsfeilsøkingsmarkører:\nSetter inn emulator-side informasjon som markører for spesifikke AMDGPU-kommandoer rundt Vulkan-kommandoer, i tillegg til å gi ressurser feilrettingsnavn.\nHvis dette brukes, burde du også bruke krasjdiagnostikk.\nNyttig for programmer som RenderDoc.</translation>
</message>
<message>
<source>Guest Debug Markers:\nInserts any debug markers the game itself has added to the command buffer.\nIf you have this enabled, you should enable Crash Diagnostics.\nUseful for programs like RenderDoc.</source>
<translation>Gjestefeilsøkingsmarkører:\nSetter inn eventuelle feilsøkingsmarkører spillet selv har lagt til kommandobufferen.\nHvis du har dette aktivert, burde du aktivere krasjdiagnostikk.\nNyttig for programmer som RenderDoc.</translation>
<translation>Gjestefeilsøkingsmarkører:\nSetter inn eventuelle feilsøkingsmarkører spillet selv har lagt til kommandobufferen.\nHvis dette brukes, burde du også bruke krasjdiagnostikk.\nNyttig for programmer som RenderDoc.</translation>
</message>
<message>
<source>Save Data Path:\nThe folder where game save data will be saved.</source>
@ -1729,11 +1741,11 @@
</message>
<message>
<source>Borderless</source>
<translation type="unfinished">Borderless</translation>
<translation>Kantløs</translation>
</message>
<message>
<source>True</source>
<translation type="unfinished">True</translation>
<translation>Sant</translation>
</message>
<message>
<source>Release</source>
@ -1745,11 +1757,11 @@
</message>
<message>
<source>Set the volume of the background music.</source>
<translation type="unfinished">Set the volume of the background music.</translation>
<translation>Sett volumet til bakgrunnsmusikken.</translation>
</message>
<message>
<source>Enable Motion Controls</source>
<translation type="unfinished">Enable Motion Controls</translation>
<translation>Bruk bevegelseskontroller</translation>
</message>
<message>
<source>Save Data Path</source>
@ -1769,7 +1781,7 @@
</message>
<message>
<source>Auto Select</source>
<translation type="unfinished">Auto Select</translation>
<translation>Velg automatisk</translation>
</message>
<message>
<source>Directory to install games</source>
@ -1777,7 +1789,7 @@
</message>
<message>
<source>Directory to save data</source>
<translation type="unfinished">Directory to save data</translation>
<translation>Mappe for lagring av data</translation>
</message>
</context>
<context>

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation type="unfinished">About shadPS4</translation>
</message>
<message>
<source>shadPS4</source>
<translation type="unfinished">shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation type="unfinished">shadPS4 is an experimental open-source emulator for the PlayStation 4.</translation>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation type="unfinished">Configure Controls</translation>
</message>
<message>
<source>Control Settings</source>
<translation type="unfinished">Control Settings</translation>
</message>
<message>
<source>D-Pad</source>
<translation type="unfinished">D-Pad</translation>
@ -469,14 +461,6 @@
<source>L2 / LT</source>
<translation type="unfinished">L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation type="unfinished">KBM Controls</translation>
</message>
<message>
<source>KBM Editor</source>
<translation type="unfinished">KBM Editor</translation>
</message>
<message>
<source>Back</source>
<translation type="unfinished">Back</translation>
@ -533,6 +517,30 @@
<source>Right Stick</source>
<translation type="unfinished">Right Stick</translation>
</message>
<message>
<source>Color Adjustment</source>
<translation type="unfinished">Color Adjustment</translation>
</message>
<message>
<source>R:</source>
<translation type="unfinished">R:</translation>
</message>
<message>
<source>G:</source>
<translation type="unfinished">G:</translation>
</message>
<message>
<source>B:</source>
<translation type="unfinished">B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation type="unfinished">Override Lightbar Color</translation>
</message>
<message>
<source>Override Color</source>
<translation type="unfinished">Override Color</translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -855,6 +863,10 @@
<source>Save Data</source>
<translation type="unfinished">Save Data</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation type="unfinished">SFO Viewer for </translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation>O programie</translation>
</message>
<message>
<source>shadPS4</source>
<translation type="unfinished">shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation>shadPS4 to eksperymentalny otwartoźródłowy emulator konsoli PlayStation 4.</translation>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation type="unfinished">Configure Controls</translation>
</message>
<message>
<source>Control Settings</source>
<translation type="unfinished">Control Settings</translation>
</message>
<message>
<source>D-Pad</source>
<translation type="unfinished">D-Pad</translation>
@ -469,14 +461,6 @@
<source>L2 / LT</source>
<translation type="unfinished">L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation type="unfinished">KBM Controls</translation>
</message>
<message>
<source>KBM Editor</source>
<translation type="unfinished">KBM Editor</translation>
</message>
<message>
<source>Back</source>
<translation type="unfinished">Back</translation>
@ -533,6 +517,30 @@
<source>Right Stick</source>
<translation type="unfinished">Right Stick</translation>
</message>
<message>
<source>Color Adjustment</source>
<translation type="unfinished">Color Adjustment</translation>
</message>
<message>
<source>R:</source>
<translation type="unfinished">R:</translation>
</message>
<message>
<source>G:</source>
<translation type="unfinished">G:</translation>
</message>
<message>
<source>B:</source>
<translation type="unfinished">B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation type="unfinished">Override Lightbar Color</translation>
</message>
<message>
<source>Override Color</source>
<translation type="unfinished">Override Color</translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -855,6 +863,10 @@
<source>Save Data</source>
<translation type="unfinished">Save Data</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation type="unfinished">SFO Viewer for </translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>

View File

@ -9,17 +9,13 @@
<source>About shadPS4</source>
<translation>Sobre o shadPS4</translation>
</message>
<message>
<source>shadPS4</source>
<translation>shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation>shadPS4 é um emulador experimental de código-fonte aberto para o PlayStation 4.</translation>
</message>
<message>
<source>This software should not be used to play games you have not legally obtained.</source>
<translation>Este programa não deve ser usado para jogar jogos piratas.</translation>
<translation>Este programa não deve ser usado para jogar jogos que tenham sido obtidos ilegalmente.</translation>
</message>
</context>
<context>
@ -281,7 +277,7 @@
</message>
<message>
<source>No download URL found for the specified asset.</source>
<translation>Nenhuma URL de download encontrada para o asset especificado.</translation>
<translation>Nenhuma URL de download encontrada para o recurso especificado.</translation>
</message>
<message>
<source>Your version is already up to date!</source>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation>Configurar Controles</translation>
</message>
<message>
<source>Control Settings</source>
<translation>Configurações do Controle</translation>
</message>
<message>
<source>D-Pad</source>
<translation>Direcional</translation>
@ -469,14 +461,6 @@
<source>L2 / LT</source>
<translation>L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation>Controles T/M</translation>
</message>
<message>
<source>KBM Editor</source>
<translation>Editor T/M</translation>
</message>
<message>
<source>Back</source>
<translation>Voltar</translation>
@ -533,6 +517,30 @@
<source>Right Stick</source>
<translation>Analógico Direito</translation>
</message>
<message>
<source>Color Adjustment</source>
<translation>Ajuste de Cores</translation>
</message>
<message>
<source>R:</source>
<translation>R:</translation>
</message>
<message>
<source>G:</source>
<translation>G:</translation>
</message>
<message>
<source>B:</source>
<translation>B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation>Substituir cor da Lightbar</translation>
</message>
<message>
<source>Override Color</source>
<translation>Substituir a Cor</translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -855,6 +863,10 @@
<source>Save Data</source>
<translation>Dados Salvos</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation>Visualizador de SFO para </translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>
@ -1309,7 +1321,7 @@
</message>
<message>
<source>Logger</source>
<translation>Registro-Log</translation>
<translation>Registros de Log</translation>
</message>
<message>
<source>Log Type</source>
@ -1497,7 +1509,7 @@
</message>
<message>
<source>Play title music</source>
<translation>Reproduzir música de abertura</translation>
<translation>Reproduzir Música do Título</translation>
</message>
<message>
<source>Update Compatibility Database On Startup</source>
@ -1573,7 +1585,7 @@
</message>
<message>
<source>Log Type:\nSets whether to synchronize the output of the log window for performance. May have adverse effects on emulation.</source>
<translation>Tipo do Registro:\nDetermina se a saída da janela de log deve ser sincronizada por motivos de desempenho. Pode impactar negativamente a emulação.</translation>
<translation>Tipo de Registro:\nDetermina se a saída da janela de log deve ser sincronizada por motivos de desempenho. Pode impactar negativamente a emulação.</translation>
</message>
<message>
<source>Log Filter:\nFilters the log to only print specific information.\nExamples: &quot;Core:Trace&quot; &quot;Lib.Pad:Debug Common.Filesystem:Error&quot; &quot;*:Critical&quot;\nLevels: Trace, Debug, Info, Warning, Error, Critical - in this order, a specific level silences all levels preceding it in the list and logs every level after it.</source>
@ -1585,7 +1597,7 @@
</message>
<message>
<source>Background Image:\nControl the opacity of the game background image.</source>
<translation>Imagem de fundo:\nControle a opacidade da imagem de fundo do jogo.</translation>
<translation>Imagem de Fundo:\nControla a transparência da imagem de fundo do jogo.</translation>
</message>
<message>
<source>Play Title Music:\nIf a game supports it, enable playing special music when selecting the game in the GUI.</source>
@ -1705,7 +1717,7 @@
</message>
<message>
<source>Crash Diagnostics:\nCreates a .yaml file with info about the Vulkan state at the time of crashing.\nUseful for debugging &apos;Device lost&apos; errors. If you have this enabled, you should enable Host AND Guest Debug Markers.\nDoes not work on Intel GPUs.\nYou need Vulkan Validation Layers enabled and the Vulkan SDK for this to work.</source>
<translation>Diagnósticos de Falha:\nCria um arquivo .yaml com informações sobre o estado do Vulkan no momento da falha.\nÚtil para depuração de erros de &apos;Device lost&apos;. Se você tiver isto habilitado, você deve habilitar os Marcadores de Depuração de Host E DE Convidado.\nNão funciona em GPUs Intel.\nVocê precisa ter as Camadas de Validação Vulkan habilitadas e o Vulkan SDK para que isso funcione.</translation>
<translation>Diagnóstico de Falhas:\nCria um arquivo .yaml com informações sobre o estado do Vulkan no momento da falha.\nÚtil para depuração de erros de &apos;Device lost&apos;. Se isto estiver ativado, você deve habilitar os Marcadores de Depuração de Host E DE Convidado.\nNão funciona em GPUs Intel.\nVocê precisa ter as Camadas de Validação Vulkan habilitadas e o Vulkan SDK para que isso funcione.</translation>
</message>
<message>
<source>Copy GPU Buffers:\nGets around race conditions involving GPU submits.\nMay or may not help with PM4 type 0 crashes.</source>
@ -1721,11 +1733,11 @@
</message>
<message>
<source>Save Data Path:\nThe folder where game save data will be saved.</source>
<translation>Diretório dos Dados Salvos:\nA pasta que onde os dados de salvamento de jogo serão salvos.</translation>
<translation>Caminho dos Dados Salvos:\nA pasta que onde os dados de salvamento de jogo serão salvos.</translation>
</message>
<message>
<source>Browse:\nBrowse for a folder to set as the save data path.</source>
<translation>Navegar:\nProcure uma pasta para definir como o caminho para salvar dados.</translation>
<translation>Procurar:\nProcure uma pasta para definir como o caminho para salvar dados.</translation>
</message>
<message>
<source>Borderless</source>

File diff suppressed because it is too large Load Diff

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation type="unfinished">About shadPS4</translation>
</message>
<message>
<source>shadPS4</source>
<translation type="unfinished">shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation type="unfinished">shadPS4 is an experimental open-source emulator for the PlayStation 4.</translation>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation type="unfinished">Configure Controls</translation>
</message>
<message>
<source>Control Settings</source>
<translation type="unfinished">Control Settings</translation>
</message>
<message>
<source>D-Pad</source>
<translation type="unfinished">D-Pad</translation>
@ -469,14 +461,6 @@
<source>L2 / LT</source>
<translation type="unfinished">L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation type="unfinished">KBM Controls</translation>
</message>
<message>
<source>KBM Editor</source>
<translation type="unfinished">KBM Editor</translation>
</message>
<message>
<source>Back</source>
<translation type="unfinished">Back</translation>
@ -533,6 +517,30 @@
<source>Right Stick</source>
<translation type="unfinished">Right Stick</translation>
</message>
<message>
<source>Color Adjustment</source>
<translation type="unfinished">Color Adjustment</translation>
</message>
<message>
<source>R:</source>
<translation type="unfinished">R:</translation>
</message>
<message>
<source>G:</source>
<translation type="unfinished">G:</translation>
</message>
<message>
<source>B:</source>
<translation type="unfinished">B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation type="unfinished">Override Lightbar Color</translation>
</message>
<message>
<source>Override Color</source>
<translation type="unfinished">Override Color</translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -855,6 +863,10 @@
<source>Save Data</source>
<translation type="unfinished">Save Data</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation type="unfinished">SFO Viewer for </translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation>О shadPS4</translation>
</message>
<message>
<source>shadPS4</source>
<translation>shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation>shadPS4 это экспериментальный эмулятор с открытым исходным кодом для PlayStation 4.</translation>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation>Настроить управление</translation>
</message>
<message>
<source>Control Settings</source>
<translation>Настройки управления</translation>
</message>
<message>
<source>D-Pad</source>
<translation>Крестовина</translation>
@ -469,17 +461,9 @@
<source>L2 / LT</source>
<translation>L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation type="unfinished">KBM Controls</translation>
</message>
<message>
<source>KBM Editor</source>
<translation type="unfinished">KBM Editor</translation>
</message>
<message>
<source>Back</source>
<translation type="unfinished">Back</translation>
<translation>Назад</translation>
</message>
<message>
<source>R1 / RB</source>
@ -533,6 +517,30 @@
<source>Right Stick</source>
<translation>Правый стик</translation>
</message>
<message>
<source>Color Adjustment</source>
<translation>Настройка цвета</translation>
</message>
<message>
<source>R:</source>
<translation>R:</translation>
</message>
<message>
<source>G:</source>
<translation>G:</translation>
</message>
<message>
<source>B:</source>
<translation>B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation>Заменить цвет световой панели</translation>
</message>
<message>
<source>Override Color</source>
<translation>Заменить цвет</translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -855,6 +863,10 @@
<source>Save Data</source>
<translation>Сохранения</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation>Просмотр SFO для</translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>
@ -1238,7 +1250,7 @@
</message>
<message>
<source>Package</source>
<translation type="unfinished">Package</translation>
<translation>Пакет</translation>
</message>
</context>
<context>

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation>Rreth shadPS4</translation>
</message>
<message>
<source>shadPS4</source>
<translation>shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation>shadPS4 është një emulator eksperimental me burim hapur për PlayStation 4.</translation>
@ -325,7 +321,7 @@
</message>
<message>
<source>Hide Changelog</source>
<translation>Fshih ndryshimet</translation>
<translation>Fshih Ndryshimet</translation>
</message>
<message>
<source>Changes</source>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation>Konfiguro kontrollet</translation>
</message>
<message>
<source>Control Settings</source>
<translation>Cilësimet e kontrollit</translation>
</message>
<message>
<source>D-Pad</source>
<translation>D-Pad</translation>
@ -469,14 +461,6 @@
<source>L2 / LT</source>
<translation>L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation>Kontrollet Tastierë/Mi</translation>
</message>
<message>
<source>KBM Editor</source>
<translation>Redaktues Tastierë/Mi</translation>
</message>
<message>
<source>Back</source>
<translation>Mbrapa</translation>
@ -533,6 +517,30 @@
<source>Right Stick</source>
<translation>Leva e djathtë</translation>
</message>
<message>
<source>Color Adjustment</source>
<translation>Rregullimi i Ngjyrave</translation>
</message>
<message>
<source>R:</source>
<translation>R:</translation>
</message>
<message>
<source>G:</source>
<translation>G:</translation>
</message>
<message>
<source>B:</source>
<translation>B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation>Zëvendëso Ngjyrën e Shiritit ndriçimit</translation>
</message>
<message>
<source>Override Color</source>
<translation>Zëvendëso Ngjyrën</translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -757,11 +765,11 @@
</message>
<message>
<source>Delete Game</source>
<translation>Fshi lojën</translation>
<translation>Fshi Lojën</translation>
</message>
<message>
<source>Delete Update</source>
<translation>Fshi përditësimin</translation>
<translation>Fshi Përditësimin</translation>
</message>
<message>
<source>Delete DLC</source>
@ -837,7 +845,7 @@
</message>
<message>
<source>Delete Save Data</source>
<translation>Fshi dhënat e ruajtjes</translation>
<translation>Fshi Dhënat e Ruajtjes</translation>
</message>
<message>
<source>This game has no update folder to open!</source>
@ -855,6 +863,10 @@
<source>Save Data</source>
<translation> dhënat e ruajtjes</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation>Shikuesi SFO për </translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>
@ -911,7 +923,7 @@
</message>
<message>
<source>Open shadPS4 Folder</source>
<translation>Hap dosjen e shadPS4</translation>
<translation>Hap Dosjen e shadPS4</translation>
</message>
<message>
<source>Exit</source>
@ -1261,7 +1273,7 @@
</message>
<message>
<source>Emulator Language</source>
<translation>Gjuha e emulatorit</translation>
<translation>Gjuha e Emulatorit</translation>
</message>
<message>
<source>Emulator</source>
@ -1737,7 +1749,7 @@
</message>
<message>
<source>Release</source>
<translation>Botimi</translation>
<translation>Release</translation>
</message>
<message>
<source>Nightly</source>

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation>Om shadPS4</translation>
</message>
<message>
<source>shadPS4</source>
<translation>shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation>shadPS4 är en experimentell emulator för PlayStation 4 baserad öppen källkod.</translation>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation>Konfigurera kontroller</translation>
</message>
<message>
<source>Control Settings</source>
<translation>Kontrollerinställningar</translation>
</message>
<message>
<source>D-Pad</source>
<translation>Riktningsknappar</translation>
@ -469,14 +461,6 @@
<source>L2 / LT</source>
<translation>L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation>KBM-kontroller</translation>
</message>
<message>
<source>KBM Editor</source>
<translation>KBM-redigerare</translation>
</message>
<message>
<source>Back</source>
<translation>Bakåt</translation>
@ -533,6 +517,30 @@
<source>Right Stick</source>
<translation>Höger spak</translation>
</message>
<message>
<source>Color Adjustment</source>
<translation>Färgjustering</translation>
</message>
<message>
<source>R:</source>
<translation>R:</translation>
</message>
<message>
<source>G:</source>
<translation>G:</translation>
</message>
<message>
<source>B:</source>
<translation>B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation>Åsidosätt ljusrampens färg</translation>
</message>
<message>
<source>Override Color</source>
<translation>Åsidosätt färg</translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -855,6 +863,10 @@
<source>Save Data</source>
<translation>Sparat data</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation>SFO-visare för </translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation>shadPS4 Hakkında</translation>
</message>
<message>
<source>shadPS4</source>
<translation>shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation>shadPS4, PlayStation 4 için deneysel bir ık kaynak kodlu emülatördür.</translation>
@ -26,7 +22,7 @@
<name>CheatsPatches</name>
<message>
<source>Cheats / Patches for </source>
<translation type="unfinished">Cheats / Patches for </translation>
<translation>Hileler / Yamalar: </translation>
</message>
<message>
<source>Cheats/Patches are experimental.\nUse with caution.\n\nDownload cheats individually by selecting the repository and clicking the download button.\nIn the Patches tab, you can download all patches at once, choose which ones you want to use, and save your selection.\n\nSince we do not develop the Cheats/Patches,\nplease report issues to the cheat author.\n\nCreated a new cheat? Visit:\n</source>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation>Kontrolleri Yapılandır</translation>
</message>
<message>
<source>Control Settings</source>
<translation>Kontrol Ayarları</translation>
</message>
<message>
<source>D-Pad</source>
<translation>Yön Düğmeleri</translation>
@ -439,11 +431,11 @@
</message>
<message>
<source>Left Stick Deadzone (def:2 max:127)</source>
<translation type="unfinished">Left Stick Deadzone (def:2 max:127)</translation>
<translation>Sol Analog Ö Bölgesi (şu an:2, en çok:127)</translation>
</message>
<message>
<source>Left Deadzone</source>
<translation type="unfinished">Left Deadzone</translation>
<translation>Sol Ö Bölge</translation>
</message>
<message>
<source>Left Stick</source>
@ -451,7 +443,7 @@
</message>
<message>
<source>Config Selection</source>
<translation type="unfinished">Config Selection</translation>
<translation>Yapılandırma Seçimi</translation>
</message>
<message>
<source>Common Config</source>
@ -459,7 +451,7 @@
</message>
<message>
<source>Use per-game configs</source>
<translation type="unfinished">Use per-game configs</translation>
<translation>Oyuna özel yapılandırmaları kullan</translation>
</message>
<message>
<source>L1 / LB</source>
@ -469,14 +461,6 @@
<source>L2 / LT</source>
<translation>L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation type="unfinished">KBM Controls</translation>
</message>
<message>
<source>KBM Editor</source>
<translation type="unfinished">KBM Editor</translation>
</message>
<message>
<source>Back</source>
<translation>Geri</translation>
@ -495,7 +479,7 @@
</message>
<message>
<source>Options / Start</source>
<translation type="unfinished">Options / Start</translation>
<translation>Seçenekler / Başlat</translation>
</message>
<message>
<source>R3</source>
@ -503,7 +487,7 @@
</message>
<message>
<source>Face Buttons</source>
<translation type="unfinished">Face Buttons</translation>
<translation>Eylem Düğmeleri</translation>
</message>
<message>
<source>Triangle / Y</source>
@ -523,16 +507,40 @@
</message>
<message>
<source>Right Stick Deadzone (def:2, max:127)</source>
<translation type="unfinished">Right Stick Deadzone (def:2, max:127)</translation>
<translation>Sağ Analog Ö Bölgesi (şu an:2, en çok:127)</translation>
</message>
<message>
<source>Right Deadzone</source>
<translation type="unfinished">Right Deadzone</translation>
<translation>Sağ Ö Bölge</translation>
</message>
<message>
<source>Right Stick</source>
<translation>Sağ Analog</translation>
</message>
<message>
<source>Color Adjustment</source>
<translation>Renk Ayarları</translation>
</message>
<message>
<source>R:</source>
<translation>K:</translation>
</message>
<message>
<source>G:</source>
<translation>Y:</translation>
</message>
<message>
<source>B:</source>
<translation>M:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation>ıklı Çubuk Rengini Geçersiz Kıl</translation>
</message>
<message>
<source>Override Color</source>
<translation>Rengi Geçersiz Kıl</translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -655,7 +663,7 @@
</message>
<message>
<source>Game has game-breaking glitches or unplayable performance</source>
<translation type="unfinished">Game has game-breaking glitches or unplayable performance</translation>
<translation>Oyunu bozan hatalar ya da oynanamayan performans</translation>
</message>
<message>
<source>Game can be completed with playable performance and no major glitches</source>
@ -725,7 +733,7 @@
</message>
<message>
<source>Open Log Folder</source>
<translation>Log Klasörünü </translation>
<translation>Günlük Klasörünü </translation>
</message>
<message>
<source>Copy info...</source>
@ -809,7 +817,7 @@
</message>
<message>
<source>This game has no update to delete!</source>
<translation type="unfinished">This game has no update to delete!</translation>
<translation>Bu oyunun silinecek güncellemesi yok!</translation>
</message>
<message>
<source>Update</source>
@ -817,7 +825,7 @@
</message>
<message>
<source>This game has no DLC to delete!</source>
<translation type="unfinished">This game has no DLC to delete!</translation>
<translation>Bu oyunun silinecek indirilebilir içeriği yok!</translation>
</message>
<message>
<source>DLC</source>
@ -825,11 +833,11 @@
</message>
<message>
<source>Delete %1</source>
<translation type="unfinished">Delete %1</translation>
<translation>Sil: %1</translation>
</message>
<message>
<source>Are you sure you want to delete %1&apos;s %2 directory?</source>
<translation type="unfinished">Are you sure you want to delete %1&apos;s %2 directory?</translation>
<translation>%1%2 adlı oyunun dizinini silmek istediğinize emin misiniz?</translation>
</message>
<message>
<source>Open Update Folder</source>
@ -841,20 +849,24 @@
</message>
<message>
<source>This game has no update folder to open!</source>
<translation type="unfinished">This game has no update folder to open!</translation>
<translation>Bu oyunun ılacak güncelleme klasörü yok!</translation>
</message>
<message>
<source>Failed to convert icon.</source>
<translation type="unfinished">Failed to convert icon.</translation>
<translation>Simge dönüştürülemedi.</translation>
</message>
<message>
<source>This game has no save data to delete!</source>
<translation type="unfinished">This game has no save data to delete!</translation>
<translation>Bu oyunun silinecek kayıt verisi yok!</translation>
</message>
<message>
<source>Save Data</source>
<translation>Kayıt Verisi</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation>SFO Görüntüleyici: </translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>
@ -864,7 +876,7 @@
</message>
<message>
<source>Select which directory you want to install to.</source>
<translation type="unfinished">Select which directory you want to install to.</translation>
<translation>Hangi dizine yüklemek istediğinizi seçin.</translation>
</message>
<message>
<source>Install All Queued to Selected Folder</source>
@ -872,7 +884,7 @@
</message>
<message>
<source>Delete PKG File on Install</source>
<translation type="unfinished">Delete PKG File on Install</translation>
<translation>Yüklemede PKG Dosyasını Sil</translation>
</message>
</context>
<context>
@ -1163,7 +1175,7 @@
</message>
<message>
<source>PKG is a patch or DLC, please install the game first!</source>
<translation type="unfinished">PKG is a patch or DLC, please install the game first!</translation>
<translation>PKG bir yama ya da indirilebilir içerik, lütfen önce oyunu yükleyin!</translation>
</message>
<message>
<source>Game is already running!</source>
@ -1194,7 +1206,7 @@
</message>
<message>
<source>Installed</source>
<translation type="unfinished">Installed</translation>
<translation>Yüklü</translation>
</message>
<message>
<source>Size</source>
@ -1206,15 +1218,15 @@
</message>
<message>
<source>Type</source>
<translation type="unfinished">Type</translation>
<translation>Tür</translation>
</message>
<message>
<source>App Ver</source>
<translation type="unfinished">App Ver</translation>
<translation>Uygulama Sürümü</translation>
</message>
<message>
<source>FW</source>
<translation type="unfinished">FW</translation>
<translation>Sistem Yazılımı</translation>
</message>
<message>
<source>Region</source>
@ -1349,7 +1361,7 @@
</message>
<message>
<source>Back Button Behavior</source>
<translation>Geri Dön Butonu Davranışı</translation>
<translation>Geri Dönme Butonu Davranışı</translation>
</message>
<message>
<source>Graphics</source>
@ -1433,23 +1445,23 @@
</message>
<message>
<source>Enable Crash Diagnostics</source>
<translation type="unfinished">Enable Crash Diagnostics</translation>
<translation>Çökme Tanılamalarını Etkinleştir</translation>
</message>
<message>
<source>Collect Shaders</source>
<translation type="unfinished">Collect Shaders</translation>
<translation>Gölgelendiricileri Topla</translation>
</message>
<message>
<source>Copy GPU Buffers</source>
<translation type="unfinished">Copy GPU Buffers</translation>
<translation>GPU Arabelleklerini Kopyala</translation>
</message>
<message>
<source>Host Debug Markers</source>
<translation type="unfinished">Host Debug Markers</translation>
<translation>Ana Bilgisayar Hata Ayıklama İşaretleyicileri</translation>
</message>
<message>
<source>Guest Debug Markers</source>
<translation type="unfinished">Guest Debug Markers</translation>
<translation>Konuk Hata Ayıklama İşaretleyicileri</translation>
</message>
<message>
<source>Update</source>
@ -1569,7 +1581,7 @@
</message>
<message>
<source>Trophy Key:\nKey used to decrypt trophies. Must be obtained from your jailbroken console.\nMust contain only hex characters.</source>
<translation type="unfinished">Trophy Key:\nKey used to decrypt trophies. Must be obtained from your jailbroken console.\nMust contain only hex characters.</translation>
<translation>Kupa Anahtarı:\nKupaların şifresini çözmek için kullanılan anahtardır. Jailbreak yapılmış konsolunuzdan alınmalıdır.\nYalnızca onaltılık karakterler içermelidir.</translation>
</message>
<message>
<source>Log Type:\nSets whether to synchronize the output of the log window for performance. May have adverse effects on emulation.</source>
@ -1585,15 +1597,15 @@
</message>
<message>
<source>Background Image:\nControl the opacity of the game background image.</source>
<translation type="unfinished">Background Image:\nControl the opacity of the game background image.</translation>
<translation>Arka Plan Resmi:\nOyunun arka plan resmi görünürlüğünü ayarlayın.</translation>
</message>
<message>
<source>Play Title Music:\nIf a game supports it, enable playing special music when selecting the game in the GUI.</source>
<translation>Başlık Müziklerini Çal:\nEğer bir oyun bunu destekliyorsa, GUI&apos;de oyunu seçtiğinizde özel müziklerin çalmasını etkinleştirir.</translation>
<translation>Oyun Müziklerini Çal:\nEğer oyun destekliyorsa, arayüzde oyunu seçtiğinizde özel müzik çalmasını etkinleştirir.</translation>
</message>
<message>
<source>Disable Trophy Pop-ups:\nDisable in-game trophy notifications. Trophy progress can still be tracked using the Trophy Viewer (right-click the game in the main window).</source>
<translation type="unfinished">Disable Trophy Pop-ups:\nDisable in-game trophy notifications. Trophy progress can still be tracked using the Trophy Viewer (right-click the game in the main window).</translation>
<translation>Kupa ılır Pencerelerini Devre Dışı Bırak:\nOyun için kupa bildirimlerini devre dışı bırakın. Kupa ilerlemesi hala Kupa Görüntüleyicisi kullanılarak takip edilebilir (ana menüde oyuna sağ tıklayın).</translation>
</message>
<message>
<source>Hide Cursor:\nChoose when the cursor will disappear:\nNever: You will always see the mouse.\nidle: Set a time for it to disappear after being idle.\nAlways: you will never see the mouse.</source>
@ -1609,15 +1621,15 @@
</message>
<message>
<source>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</source>
<translation type="unfinished">Display Compatibility Data:\nDisplays game compatibility information in table view. Enable &quot;Update Compatibility On Startup&quot; to get up-to-date information.</translation>
<translation>Uyumluluk Verilerini Göster:\nOyun uyumluluk bilgilerini tablo görünümünde görüntüler. Güncel bilgileri almak için &quot;Başlangıçta Uyumluluk Veritabanını Güncelle&quot;yi etkinleştirin.</translation>
</message>
<message>
<source>Update Compatibility On Startup:\nAutomatically update the compatibility database when shadPS4 starts.</source>
<translation type="unfinished">Update Compatibility On Startup:\nAutomatically update the compatibility database when shadPS4 starts.</translation>
<translation>Başlangıçta Uyumluluk Veritabanını Güncelle:\nshadPS4 başlatıldığında uyumluluk veritabanını otomatik olarak güncelleyin.</translation>
</message>
<message>
<source>Update Compatibility Database:\nImmediately update the compatibility database.</source>
<translation type="unfinished">Update Compatibility Database:\nImmediately update the compatibility database.</translation>
<translation>Uyumluluk Veritabanını Güncelle:\nUyumluluk veri tabanını hemen güncelleyin.</translation>
</message>
<message>
<source>Never</source>
@ -1701,7 +1713,7 @@
</message>
<message>
<source>Collect Shaders:\nYou need this enabled to edit shaders with the debug menu (Ctrl + F10).</source>
<translation type="unfinished">Collect Shaders:\nYou need this enabled to edit shaders with the debug menu (Ctrl + F10).</translation>
<translation>Gölgelendiricileri Topla:\nHata ayıklama menüsüyle (Ctrl + F10) gölgelendiricileri düzenlemek için bunun etkinleştirilmesi gerekir.</translation>
</message>
<message>
<source>Crash Diagnostics:\nCreates a .yaml file with info about the Vulkan state at the time of crashing.\nUseful for debugging &apos;Device lost&apos; errors. If you have this enabled, you should enable Host AND Guest Debug Markers.\nDoes not work on Intel GPUs.\nYou need Vulkan Validation Layers enabled and the Vulkan SDK for this to work.</source>
@ -1709,7 +1721,7 @@
</message>
<message>
<source>Copy GPU Buffers:\nGets around race conditions involving GPU submits.\nMay or may not help with PM4 type 0 crashes.</source>
<translation type="unfinished">Copy GPU Buffers:\nGets around race conditions involving GPU submits.\nMay or may not help with PM4 type 0 crashes.</translation>
<translation>GPU Arabelleklerini Kopyala:\nGPU gönderimlerini içeren yarış koşullarının etrafından dolaşır.\nPM4 tip 0 çökmelerine yardımcı olabilir veya olmayabilir.</translation>
</message>
<message>
<source>Host Debug Markers:\nInserts emulator-side information like markers for specific AMDGPU commands around Vulkan commands, as well as giving resources debug names.\nIf you have this enabled, you should enable Crash Diagnostics.\nUseful for programs like RenderDoc.</source>
@ -1717,15 +1729,15 @@
</message>
<message>
<source>Guest Debug Markers:\nInserts any debug markers the game itself has added to the command buffer.\nIf you have this enabled, you should enable Crash Diagnostics.\nUseful for programs like RenderDoc.</source>
<translation type="unfinished">Guest Debug Markers:\nInserts any debug markers the game itself has added to the command buffer.\nIf you have this enabled, you should enable Crash Diagnostics.\nUseful for programs like RenderDoc.</translation>
<translation>Konuk Hata Ayıklama İşaretleyicileri\nOyunun kendisinin komut arabelleğine eklediği tüm hata ayıklama işaretlerini ekler.\nBunu etkinleştirdiyseniz, Çökme Tanılamalarını etkinleştirmeniz gerekir.\nRenderDoc gibi programlar için kullanışlıdır.</translation>
</message>
<message>
<source>Save Data Path:\nThe folder where game save data will be saved.</source>
<translation type="unfinished">Save Data Path:\nThe folder where game save data will be saved.</translation>
<translation>Kayıt Verileri Yolu:\nOyun kayıt verilerinin kaydedileceği klasördür.</translation>
</message>
<message>
<source>Browse:\nBrowse for a folder to set as the save data path.</source>
<translation type="unfinished">Browse:\nBrowse for a folder to set as the save data path.</translation>
<translation>Gözat:\nVerileri kaydetme yolu olarak ayarlamak için bir klasöre göz atın.</translation>
</message>
<message>
<source>Borderless</source>
@ -1733,7 +1745,7 @@
</message>
<message>
<source>True</source>
<translation type="unfinished">True</translation>
<translation>Gerçek Ekran</translation>
</message>
<message>
<source>Release</source>
@ -1741,7 +1753,7 @@
</message>
<message>
<source>Nightly</source>
<translation type="unfinished">Nightly</translation>
<translation>Günlük</translation>
</message>
<message>
<source>Set the volume of the background music.</source>
@ -1749,7 +1761,7 @@
</message>
<message>
<source>Enable Motion Controls</source>
<translation type="unfinished">Enable Motion Controls</translation>
<translation>Hareket Kontrollerini Etkinleştir</translation>
</message>
<message>
<source>Save Data Path</source>
@ -1769,7 +1781,7 @@
</message>
<message>
<source>Auto Select</source>
<translation type="unfinished">Auto Select</translation>
<translation>Otomatik Seç</translation>
</message>
<message>
<source>Directory to install games</source>

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation>Про shadPS4</translation>
</message>
<message>
<source>shadPS4</source>
<translation type="unfinished">shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation>shadPS4 - це експериментальний емулятор з відкритим вихідним кодом для PlayStation 4.</translation>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation type="unfinished">Configure Controls</translation>
</message>
<message>
<source>Control Settings</source>
<translation type="unfinished">Control Settings</translation>
</message>
<message>
<source>D-Pad</source>
<translation type="unfinished">D-Pad</translation>
@ -469,14 +461,6 @@
<source>L2 / LT</source>
<translation type="unfinished">L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation type="unfinished">KBM Controls</translation>
</message>
<message>
<source>KBM Editor</source>
<translation type="unfinished">KBM Editor</translation>
</message>
<message>
<source>Back</source>
<translation type="unfinished">Back</translation>
@ -533,6 +517,30 @@
<source>Right Stick</source>
<translation type="unfinished">Right Stick</translation>
</message>
<message>
<source>Color Adjustment</source>
<translation type="unfinished">Color Adjustment</translation>
</message>
<message>
<source>R:</source>
<translation type="unfinished">R:</translation>
</message>
<message>
<source>G:</source>
<translation type="unfinished">G:</translation>
</message>
<message>
<source>B:</source>
<translation type="unfinished">B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation type="unfinished">Override Lightbar Color</translation>
</message>
<message>
<source>Override Color</source>
<translation type="unfinished">Override Color</translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -855,6 +863,10 @@
<source>Save Data</source>
<translation>Збереження</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation type="unfinished">SFO Viewer for </translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation>Về shadPS4</translation>
</message>
<message>
<source>shadPS4</source>
<translation type="unfinished">shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation>shadPS4 một trình giả lập thử nghiệm nguồn mở cho PlayStation 4.</translation>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation>Cấu hình điều khiển</translation>
</message>
<message>
<source>Control Settings</source>
<translation>Cài đt điều khiển</translation>
</message>
<message>
<source>D-Pad</source>
<translation type="unfinished">D-Pad</translation>
@ -469,14 +461,6 @@
<source>L2 / LT</source>
<translation type="unfinished">L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation type="unfinished">KBM Controls</translation>
</message>
<message>
<source>KBM Editor</source>
<translation type="unfinished">KBM Editor</translation>
</message>
<message>
<source>Back</source>
<translation type="unfinished">Back</translation>
@ -533,6 +517,30 @@
<source>Right Stick</source>
<translation type="unfinished">Right Stick</translation>
</message>
<message>
<source>Color Adjustment</source>
<translation type="unfinished">Color Adjustment</translation>
</message>
<message>
<source>R:</source>
<translation type="unfinished">R:</translation>
</message>
<message>
<source>G:</source>
<translation type="unfinished">G:</translation>
</message>
<message>
<source>B:</source>
<translation type="unfinished">B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation type="unfinished">Override Lightbar Color</translation>
</message>
<message>
<source>Override Color</source>
<translation type="unfinished">Override Color</translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -855,6 +863,10 @@
<source>Save Data</source>
<translation type="unfinished">Save Data</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation type="unfinished">SFO Viewer for </translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation> shadPS4</translation>
</message>
<message>
<source>shadPS4</source>
<translation>shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation>shadPS4 PlayStation 4 </translation>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation></translation>
</message>
<message>
<source>Control Settings</source>
<translation></translation>
</message>
<message>
<source>D-Pad</source>
<translation>D-Pad</translation>
@ -469,14 +461,6 @@
<source>L2 / LT</source>
<translation>L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation></translation>
</message>
<message>
<source>KBM Editor</source>
<translation></translation>
</message>
<message>
<source>Back</source>
<translation>Back</translation>
@ -495,7 +479,7 @@
</message>
<message>
<source>Options / Start</source>
<translation> / </translation>
<translation>Options / Start</translation>
</message>
<message>
<source>R3</source>
@ -533,6 +517,30 @@
<source>Right Stick</source>
<translation></translation>
</message>
<message>
<source>Color Adjustment</source>
<translation></translation>
</message>
<message>
<source>R:</source>
<translation></translation>
</message>
<message>
<source>G:</source>
<translation>绿</translation>
</message>
<message>
<source>B:</source>
<translation></translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation></translation>
</message>
<message>
<source>Override Color</source>
<translation></translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -855,6 +863,10 @@
<source>Save Data</source>
<translation></translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation>SFO - </translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>
@ -1238,7 +1250,7 @@
</message>
<message>
<source>Package</source>
<translation type="unfinished">Package</translation>
<translation>Package</translation>
</message>
</context>
<context>
@ -1377,7 +1389,7 @@
</message>
<message>
<source>Vblank Divider</source>
<translation type="unfinished">Vblank Divider</translation>
<translation>Vblank Divider</translation>
</message>
<message>
<source>Advanced</source>

View File

@ -9,10 +9,6 @@
<source>About shadPS4</source>
<translation type="unfinished">About shadPS4</translation>
</message>
<message>
<source>shadPS4</source>
<translation type="unfinished">shadPS4</translation>
</message>
<message>
<source>shadPS4 is an experimental open-source emulator for the PlayStation 4.</source>
<translation type="unfinished">shadPS4 is an experimental open-source emulator for the PlayStation 4.</translation>
@ -413,10 +409,6 @@
<source>Configure Controls</source>
<translation type="unfinished">Configure Controls</translation>
</message>
<message>
<source>Control Settings</source>
<translation type="unfinished">Control Settings</translation>
</message>
<message>
<source>D-Pad</source>
<translation type="unfinished">D-Pad</translation>
@ -469,14 +461,6 @@
<source>L2 / LT</source>
<translation type="unfinished">L2 / LT</translation>
</message>
<message>
<source>KBM Controls</source>
<translation type="unfinished">KBM Controls</translation>
</message>
<message>
<source>KBM Editor</source>
<translation type="unfinished">KBM Editor</translation>
</message>
<message>
<source>Back</source>
<translation type="unfinished">Back</translation>
@ -533,6 +517,30 @@
<source>Right Stick</source>
<translation type="unfinished">Right Stick</translation>
</message>
<message>
<source>Color Adjustment</source>
<translation type="unfinished">Color Adjustment</translation>
</message>
<message>
<source>R:</source>
<translation type="unfinished">R:</translation>
</message>
<message>
<source>G:</source>
<translation type="unfinished">G:</translation>
</message>
<message>
<source>B:</source>
<translation type="unfinished">B:</translation>
</message>
<message>
<source>Override Lightbar Color</source>
<translation type="unfinished">Override Lightbar Color</translation>
</message>
<message>
<source>Override Color</source>
<translation type="unfinished">Override Color</translation>
</message>
</context>
<context>
<name>ElfViewer</name>
@ -855,6 +863,10 @@
<source>Save Data</source>
<translation type="unfinished">Save Data</translation>
</message>
<message>
<source>SFO Viewer for </source>
<translation type="unfinished">SFO Viewer for </translation>
</message>
</context>
<context>
<name>InstallDirSelect</name>

View File

@ -97,6 +97,7 @@ void SDLInputEngine::Init() {
SDL_CloseGamepad(m_gamepad);
m_gamepad = nullptr;
}
int gamepad_count;
SDL_JoystickID* gamepads = SDL_GetGamepads(&gamepad_count);
if (!gamepads) {
@ -108,12 +109,26 @@ void SDLInputEngine::Init() {
SDL_free(gamepads);
return;
}
LOG_INFO(Input, "Got {} gamepads. Opening the first one.", gamepad_count);
if (!(m_gamepad = SDL_OpenGamepad(gamepads[0]))) {
m_gamepad = SDL_OpenGamepad(gamepads[0]);
if (!m_gamepad) {
LOG_ERROR(Input, "Failed to open gamepad 0: {}", SDL_GetError());
SDL_free(gamepads);
return;
}
SDL_Joystick* joystick = SDL_GetGamepadJoystick(m_gamepad);
Uint16 vendor = SDL_GetJoystickVendor(joystick);
Uint16 product = SDL_GetJoystickProduct(joystick);
bool isDualSense = (vendor == 0x054C && product == 0x0CE6);
LOG_INFO(Input, "Gamepad Vendor: {:04X}, Product: {:04X}", vendor, product);
if (isDualSense) {
LOG_INFO(Input, "Detected DualSense Controller");
}
if (Config::getIsMotionControlsEnabled()) {
if (SDL_SetGamepadSensorEnabled(m_gamepad, SDL_SENSOR_GYRO, true)) {
m_gyro_poll_rate = SDL_GetGamepadSensorDataRate(m_gamepad, SDL_SENSOR_GYRO);
@ -126,12 +141,23 @@ void SDLInputEngine::Init() {
LOG_INFO(Input, "Accel initialized, poll rate: {}", m_accel_poll_rate);
} else {
LOG_ERROR(Input, "Failed to initialize accel controls for gamepad");
};
}
}
SDL_free(gamepads);
int* rgb = Config::GetControllerCustomColor();
if (isDualSense) {
if (SDL_SetJoystickLED(joystick, rgb[0], rgb[1], rgb[2]) == 0) {
LOG_INFO(Input, "Set DualSense LED to R:{} G:{} B:{}", rgb[0], rgb[1], rgb[2]);
} else {
LOG_ERROR(Input, "Failed to set DualSense LED: {}", SDL_GetError());
}
} else {
SetLightBarRGB(rgb[0], rgb[1], rgb[2]);
}
}
void SDLInputEngine::SetLightBarRGB(u8 r, u8 g, u8 b) {
if (m_gamepad) {

View File

@ -242,14 +242,17 @@ void SetupCapabilities(const Info& info, const Profile& profile, EmitContext& ct
ctx.AddCapability(spv::Capability::Image1D);
ctx.AddCapability(spv::Capability::Sampled1D);
ctx.AddCapability(spv::Capability::ImageQuery);
ctx.AddCapability(spv::Capability::Int8);
ctx.AddCapability(spv::Capability::Int16);
ctx.AddCapability(spv::Capability::Int64);
ctx.AddCapability(spv::Capability::UniformAndStorageBuffer8BitAccess);
ctx.AddCapability(spv::Capability::UniformAndStorageBuffer16BitAccess);
if (info.uses_fp16) {
ctx.AddCapability(spv::Capability::Float16);
ctx.AddCapability(spv::Capability::Int16);
}
if (info.uses_fp64) {
ctx.AddCapability(spv::Capability::Float64);
}
ctx.AddCapability(spv::Capability::Int64);
if (info.has_storage_images) {
ctx.AddCapability(spv::Capability::StorageImageExtendedFormats);
ctx.AddCapability(spv::Capability::StorageImageReadWithoutFormat);

View File

@ -21,14 +21,41 @@ Id SharedAtomicU32(EmitContext& ctx, Id offset, Id value,
return (ctx.*atomic_func)(ctx.U32[1], pointer, scope, semantics, value);
}
Id BufferAtomicU32BoundsCheck(EmitContext& ctx, Id index, Id buffer_size, auto emit_func) {
if (Sirit::ValidId(buffer_size)) {
// Bounds checking enabled, wrap in a conditional branch to make sure that
// the atomic is not mistakenly executed when the index is out of bounds.
const Id in_bounds = ctx.OpULessThan(ctx.U1[1], index, buffer_size);
const Id ib_label = ctx.OpLabel();
const Id oob_label = ctx.OpLabel();
const Id end_label = ctx.OpLabel();
ctx.OpBranchConditional(in_bounds, ib_label, oob_label);
ctx.AddLabel(ib_label);
const Id ib_result = emit_func();
ctx.OpBranch(end_label);
ctx.AddLabel(oob_label);
const Id oob_result = ctx.u32_zero_value;
ctx.OpBranch(end_label);
ctx.AddLabel(end_label);
return ctx.OpPhi(ctx.U32[1], ib_result, ib_label, oob_result, oob_label);
}
// Bounds checking not enabled, just perform the atomic operation.
return emit_func();
}
Id BufferAtomicU32(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address, Id value,
Id (Sirit::Module::*atomic_func)(Id, Id, Id, Id, Id)) {
auto& buffer = ctx.buffers[handle];
const auto& buffer = ctx.buffers[handle];
if (Sirit::ValidId(buffer.offset)) {
address = ctx.OpIAdd(ctx.U32[1], address, buffer.offset);
}
const Id index = ctx.OpShiftRightLogical(ctx.U32[1], address, ctx.ConstU32(2u));
const Id ptr = ctx.OpAccessChain(buffer.pointer_type, buffer.id, ctx.u32_zero_value, index);
const auto [id, pointer_type] = buffer[EmitContext::BufferAlias::U32];
const Id ptr = ctx.OpAccessChain(pointer_type, id, ctx.u32_zero_value, index);
const auto [scope, semantics]{AtomicArgs(ctx)};
return BufferAtomicU32BoundsCheck(ctx, index, buffer.size_dwords, [&] {
return (ctx.*atomic_func)(ctx.U32[1], ptr, scope, semantics, value);
});
}
Id ImageAtomicU32(EmitContext& ctx, IR::Inst* inst, u32 handle, Id coords, Id value,
@ -165,17 +192,17 @@ Id EmitImageAtomicExchange32(EmitContext& ctx, IR::Inst* inst, u32 handle, Id co
}
Id EmitDataAppend(EmitContext& ctx, u32 gds_addr, u32 binding) {
auto& buffer = ctx.buffers[binding];
const Id ptr = ctx.OpAccessChain(buffer.pointer_type, buffer.id, ctx.u32_zero_value,
ctx.ConstU32(gds_addr));
const auto& buffer = ctx.buffers[binding];
const auto [id, pointer_type] = buffer[EmitContext::BufferAlias::U32];
const Id ptr = ctx.OpAccessChain(pointer_type, id, ctx.u32_zero_value, ctx.ConstU32(gds_addr));
const auto [scope, semantics]{AtomicArgs(ctx)};
return ctx.OpAtomicIIncrement(ctx.U32[1], ptr, scope, semantics);
}
Id EmitDataConsume(EmitContext& ctx, u32 gds_addr, u32 binding) {
auto& buffer = ctx.buffers[binding];
const Id ptr = ctx.OpAccessChain(buffer.pointer_type, buffer.id, ctx.u32_zero_value,
ctx.ConstU32(gds_addr));
const auto& buffer = ctx.buffers[binding];
const auto [id, pointer_type] = buffer[EmitContext::BufferAlias::U32];
const Id ptr = ctx.OpAccessChain(pointer_type, id, ctx.u32_zero_value, ctx.ConstU32(gds_addr));
const auto [scope, semantics]{AtomicArgs(ctx)};
return ctx.OpAtomicIDecrement(ctx.U32[1], ptr, scope, semantics);
}

View File

@ -160,31 +160,42 @@ void EmitGetGotoVariable(EmitContext&) {
UNREACHABLE_MSG("Unreachable instruction");
}
using BufferAlias = EmitContext::BufferAlias;
Id EmitReadConst(EmitContext& ctx, IR::Inst* inst) {
u32 flatbuf_off_dw = inst->Flags<u32>();
ASSERT(ctx.srt_flatbuf.binding >= 0);
ASSERT(flatbuf_off_dw > 0);
Id index = ctx.ConstU32(flatbuf_off_dw);
auto& buffer = ctx.srt_flatbuf;
const Id ptr{ctx.OpAccessChain(buffer.pointer_type, buffer.id, ctx.u32_zero_value, index)};
const u32 flatbuf_off_dw = inst->Flags<u32>();
const auto& srt_flatbuf = ctx.buffers.back();
ASSERT(srt_flatbuf.binding >= 0 && flatbuf_off_dw > 0 &&
srt_flatbuf.buffer_type == BufferType::ReadConstUbo);
const auto [id, pointer_type] = srt_flatbuf[BufferAlias::U32];
const Id ptr{
ctx.OpAccessChain(pointer_type, id, ctx.u32_zero_value, ctx.ConstU32(flatbuf_off_dw))};
return ctx.OpLoad(ctx.U32[1], ptr);
}
Id EmitReadConstBuffer(EmitContext& ctx, u32 handle, Id index) {
auto& buffer = ctx.buffers[handle];
const auto& buffer = ctx.buffers[handle];
index = ctx.OpIAdd(ctx.U32[1], index, buffer.offset_dwords);
const Id ptr{ctx.OpAccessChain(buffer.pointer_type, buffer.id, ctx.u32_zero_value, index)};
return ctx.OpLoad(buffer.data_types->Get(1), ptr);
const auto [id, pointer_type] = buffer[BufferAlias::U32];
const Id ptr{ctx.OpAccessChain(pointer_type, id, ctx.u32_zero_value, index)};
const Id result{ctx.OpLoad(ctx.U32[1], ptr)};
if (Sirit::ValidId(buffer.size_dwords)) {
const Id in_bounds = ctx.OpULessThan(ctx.U1[1], index, buffer.size_dwords);
return ctx.OpSelect(ctx.U32[1], in_bounds, result, ctx.u32_zero_value);
} else {
return result;
}
}
Id EmitReadStepRate(EmitContext& ctx, int rate_idx) {
const auto index{rate_idx == 0 ? PushData::Step0Index : PushData::Step1Index};
return ctx.OpLoad(
ctx.U32[1], ctx.OpAccessChain(ctx.TypePointer(spv::StorageClass::PushConstant, ctx.U32[1]),
ctx.push_data_block,
rate_idx == 0 ? ctx.u32_zero_value : ctx.u32_one_value));
ctx.push_data_block, ctx.ConstU32(index)));
}
Id EmitGetAttributeForGeometry(EmitContext& ctx, IR::Attribute attr, u32 comp, Id index) {
static Id EmitGetAttributeForGeometry(EmitContext& ctx, IR::Attribute attr, u32 comp, Id index) {
if (IR::IsPosition(attr)) {
ASSERT(attr == IR::Attribute::Position0);
const auto position_arr_ptr = ctx.TypePointer(spv::StorageClass::Input, ctx.F32[4]);
@ -285,6 +296,8 @@ Id EmitGetAttributeU32(EmitContext& ctx, IR::Attribute attr, u32 comp) {
return EmitReadStepRate(ctx, 0);
case IR::Attribute::InstanceId1:
return EmitReadStepRate(ctx, 1);
case IR::Attribute::WorkgroupIndex:
return ctx.workgroup_index_id;
case IR::Attribute::WorkgroupId:
return ctx.OpCompositeExtract(ctx.U32[1], ctx.OpLoad(ctx.U32[3], ctx.workgroup_id), comp);
case IR::Attribute::LocalInvocationId:
@ -397,69 +410,113 @@ void EmitSetPatch(EmitContext& ctx, IR::Patch patch, Id value) {
}
template <u32 N>
static Id EmitLoadBufferU32xN(EmitContext& ctx, u32 handle, Id address) {
auto& buffer = ctx.buffers[handle];
address = ctx.OpIAdd(ctx.U32[1], address, buffer.offset);
static Id EmitLoadBufferBoundsCheck(EmitContext& ctx, Id index, Id buffer_size, Id result,
bool is_float) {
if (Sirit::ValidId(buffer_size)) {
// Bounds checking enabled, wrap in a select.
const auto result_type = is_float ? ctx.F32[N] : ctx.U32[N];
auto compare_index = index;
auto zero_value = is_float ? ctx.f32_zero_value : ctx.u32_zero_value;
if (N > 1) {
compare_index = ctx.OpIAdd(ctx.U32[1], index, ctx.ConstU32(N - 1));
std::array<Id, N> zero_ids;
zero_ids.fill(zero_value);
zero_value = ctx.ConstantComposite(result_type, zero_ids);
}
const Id in_bounds = ctx.OpULessThan(ctx.U1[1], compare_index, buffer_size);
return ctx.OpSelect(result_type, in_bounds, result, zero_value);
}
// Bounds checking not enabled, just return the plain value.
return result;
}
template <u32 N, BufferAlias alias>
static Id EmitLoadBufferB32xN(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address) {
const auto flags = inst->Flags<IR::BufferInstInfo>();
const auto& spv_buffer = ctx.buffers[handle];
if (Sirit::ValidId(spv_buffer.offset)) {
address = ctx.OpIAdd(ctx.U32[1], address, spv_buffer.offset);
}
const Id index = ctx.OpShiftRightLogical(ctx.U32[1], address, ctx.ConstU32(2u));
if constexpr (N == 1) {
const Id ptr{ctx.OpAccessChain(buffer.pointer_type, buffer.id, ctx.u32_zero_value, index)};
return ctx.OpLoad(buffer.data_types->Get(1), ptr);
} else {
const auto& data_types = alias == BufferAlias::U32 ? ctx.U32 : ctx.F32;
const auto [id, pointer_type] = spv_buffer[alias];
boost::container::static_vector<Id, N> ids;
for (u32 i = 0; i < N; i++) {
const Id index_i = ctx.OpIAdd(ctx.U32[1], index, ctx.ConstU32(i));
const Id ptr{
ctx.OpAccessChain(buffer.pointer_type, buffer.id, ctx.u32_zero_value, index_i)};
ids.push_back(ctx.OpLoad(buffer.data_types->Get(1), ptr));
}
return ctx.OpCompositeConstruct(buffer.data_types->Get(N), ids);
const Id index_i = i == 0 ? index : ctx.OpIAdd(ctx.U32[1], index, ctx.ConstU32(i));
const Id ptr_i = ctx.OpAccessChain(pointer_type, id, ctx.u32_zero_value, index_i);
const Id result_i = ctx.OpLoad(data_types[1], ptr_i);
if (!flags.typed) {
// Untyped loads have bounds checking per-component.
ids.push_back(EmitLoadBufferBoundsCheck<1>(ctx, index_i, spv_buffer.size_dwords,
result_i, alias == BufferAlias::F32));
} else {
ids.push_back(result_i);
}
}
Id EmitLoadBufferU8(EmitContext& ctx, IR::Inst*, u32 handle, Id address) {
const Id byte_index{ctx.OpBitwiseAnd(ctx.U32[1], address, ctx.ConstU32(3u))};
const Id bit_offset{ctx.OpShiftLeftLogical(ctx.U32[1], byte_index, ctx.ConstU32(3u))};
const Id dword{EmitLoadBufferU32xN<1>(ctx, handle, address)};
return ctx.OpBitFieldUExtract(ctx.U32[1], dword, bit_offset, ctx.ConstU32(8u));
const Id result = N == 1 ? ids[0] : ctx.OpCompositeConstruct(data_types[N], ids);
if (flags.typed) {
// Typed loads have single bounds check for the whole load.
return EmitLoadBufferBoundsCheck<N>(ctx, index, spv_buffer.size_dwords, result,
alias == BufferAlias::F32);
}
return result;
}
Id EmitLoadBufferU16(EmitContext& ctx, IR::Inst*, u32 handle, Id address) {
const Id byte_index{ctx.OpBitwiseAnd(ctx.U32[1], address, ctx.ConstU32(2u))};
const Id bit_offset{ctx.OpShiftLeftLogical(ctx.U32[1], byte_index, ctx.ConstU32(3u))};
const Id dword{EmitLoadBufferU32xN<1>(ctx, handle, address)};
return ctx.OpBitFieldUExtract(ctx.U32[1], dword, bit_offset, ctx.ConstU32(16u));
Id EmitLoadBufferU8(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address) {
const auto& spv_buffer = ctx.buffers[handle];
if (Sirit::ValidId(spv_buffer.offset)) {
address = ctx.OpIAdd(ctx.U32[1], address, spv_buffer.offset);
}
const auto [id, pointer_type] = spv_buffer[BufferAlias::U8];
const Id ptr{ctx.OpAccessChain(pointer_type, id, ctx.u32_zero_value, address)};
const Id result{ctx.OpUConvert(ctx.U32[1], ctx.OpLoad(ctx.U8, ptr))};
return EmitLoadBufferBoundsCheck<1>(ctx, address, spv_buffer.size, result, false);
}
Id EmitLoadBufferU32(EmitContext& ctx, IR::Inst*, u32 handle, Id address) {
return EmitLoadBufferU32xN<1>(ctx, handle, address);
Id EmitLoadBufferU16(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address) {
const auto& spv_buffer = ctx.buffers[handle];
if (Sirit::ValidId(spv_buffer.offset)) {
address = ctx.OpIAdd(ctx.U32[1], address, spv_buffer.offset);
}
const auto [id, pointer_type] = spv_buffer[BufferAlias::U16];
const Id index = ctx.OpShiftRightLogical(ctx.U32[1], address, ctx.ConstU32(1u));
const Id ptr{ctx.OpAccessChain(pointer_type, id, ctx.u32_zero_value, index)};
const Id result{ctx.OpUConvert(ctx.U32[1], ctx.OpLoad(ctx.U16, ptr))};
return EmitLoadBufferBoundsCheck<1>(ctx, index, spv_buffer.size_shorts, result, false);
}
Id EmitLoadBufferU32x2(EmitContext& ctx, IR::Inst*, u32 handle, Id address) {
return EmitLoadBufferU32xN<2>(ctx, handle, address);
Id EmitLoadBufferU32(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address) {
return EmitLoadBufferB32xN<1, BufferAlias::U32>(ctx, inst, handle, address);
}
Id EmitLoadBufferU32x3(EmitContext& ctx, IR::Inst*, u32 handle, Id address) {
return EmitLoadBufferU32xN<3>(ctx, handle, address);
Id EmitLoadBufferU32x2(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address) {
return EmitLoadBufferB32xN<2, BufferAlias::U32>(ctx, inst, handle, address);
}
Id EmitLoadBufferU32x4(EmitContext& ctx, IR::Inst*, u32 handle, Id address) {
return EmitLoadBufferU32xN<4>(ctx, handle, address);
Id EmitLoadBufferU32x3(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address) {
return EmitLoadBufferB32xN<3, BufferAlias::U32>(ctx, inst, handle, address);
}
Id EmitLoadBufferU32x4(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address) {
return EmitLoadBufferB32xN<4, BufferAlias::U32>(ctx, inst, handle, address);
}
Id EmitLoadBufferF32(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address) {
return ctx.OpBitcast(ctx.F32[1], EmitLoadBufferU32(ctx, inst, handle, address));
return EmitLoadBufferB32xN<1, BufferAlias::F32>(ctx, inst, handle, address);
}
Id EmitLoadBufferF32x2(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address) {
return ctx.OpBitcast(ctx.F32[2], EmitLoadBufferU32x2(ctx, inst, handle, address));
return EmitLoadBufferB32xN<2, BufferAlias::F32>(ctx, inst, handle, address);
}
Id EmitLoadBufferF32x3(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address) {
return ctx.OpBitcast(ctx.F32[3], EmitLoadBufferU32x3(ctx, inst, handle, address));
return EmitLoadBufferB32xN<3, BufferAlias::F32>(ctx, inst, handle, address);
}
Id EmitLoadBufferF32x4(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address) {
return ctx.OpBitcast(ctx.F32[4], EmitLoadBufferU32x4(ctx, inst, handle, address));
return EmitLoadBufferB32xN<4, BufferAlias::F32>(ctx, inst, handle, address);
}
Id EmitLoadBufferFormatF32(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address) {
@ -467,69 +524,117 @@ Id EmitLoadBufferFormatF32(EmitContext& ctx, IR::Inst* inst, u32 handle, Id addr
}
template <u32 N>
static void EmitStoreBufferU32xN(EmitContext& ctx, u32 handle, Id address, Id value) {
auto& buffer = ctx.buffers[handle];
address = ctx.OpIAdd(ctx.U32[1], address, buffer.offset);
const Id index = ctx.OpShiftRightLogical(ctx.U32[1], address, ctx.ConstU32(2u));
if constexpr (N == 1) {
const Id ptr{ctx.OpAccessChain(buffer.pointer_type, buffer.id, ctx.u32_zero_value, index)};
ctx.OpStore(ptr, value);
} else {
for (u32 i = 0; i < N; i++) {
const Id index_i = ctx.OpIAdd(ctx.U32[1], index, ctx.ConstU32(i));
const Id ptr =
ctx.OpAccessChain(buffer.pointer_type, buffer.id, ctx.u32_zero_value, index_i);
ctx.OpStore(ptr, ctx.OpCompositeExtract(buffer.data_types->Get(1), value, i));
void EmitStoreBufferBoundsCheck(EmitContext& ctx, Id index, Id buffer_size, auto emit_func) {
if (Sirit::ValidId(buffer_size)) {
// Bounds checking enabled, wrap in a conditional branch.
auto compare_index = index;
if (N > 1) {
index = ctx.OpIAdd(ctx.U32[1], index, ctx.ConstU32(N - 1));
}
const Id in_bounds = ctx.OpULessThan(ctx.U1[1], compare_index, buffer_size);
const Id in_bounds_label = ctx.OpLabel();
const Id merge_label = ctx.OpLabel();
ctx.OpSelectionMerge(merge_label, spv::SelectionControlMask::MaskNone);
ctx.OpBranchConditional(in_bounds, in_bounds_label, merge_label);
ctx.AddLabel(in_bounds_label);
emit_func();
ctx.OpBranch(merge_label);
ctx.AddLabel(merge_label);
return;
}
// Bounds checking not enabled, just perform the store.
emit_func();
}
template <u32 N, BufferAlias alias>
static void EmitStoreBufferB32xN(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address,
Id value) {
const auto flags = inst->Flags<IR::BufferInstInfo>();
const auto& spv_buffer = ctx.buffers[handle];
if (Sirit::ValidId(spv_buffer.offset)) {
address = ctx.OpIAdd(ctx.U32[1], address, spv_buffer.offset);
}
const Id index = ctx.OpShiftRightLogical(ctx.U32[1], address, ctx.ConstU32(2u));
const auto& data_types = alias == BufferAlias::U32 ? ctx.U32 : ctx.F32;
const auto [id, pointer_type] = spv_buffer[alias];
auto store = [&] {
for (u32 i = 0; i < N; i++) {
const Id index_i = i == 0 ? index : ctx.OpIAdd(ctx.U32[1], index, ctx.ConstU32(i));
const Id ptr_i = ctx.OpAccessChain(pointer_type, id, ctx.u32_zero_value, index_i);
const Id value_i = N == 1 ? value : ctx.OpCompositeExtract(data_types[1], value, i);
auto store_i = [&]() { ctx.OpStore(ptr_i, value_i); };
if (!flags.typed) {
// Untyped stores have bounds checking per-component.
EmitStoreBufferBoundsCheck<1>(ctx, index_i, spv_buffer.size_dwords, store_i);
} else {
store_i();
}
}
};
if (flags.typed) {
// Typed stores have single bounds check for the whole store.
EmitStoreBufferBoundsCheck<N>(ctx, index, spv_buffer.size_dwords, store);
} else {
store();
}
}
void EmitStoreBufferU8(EmitContext& ctx, IR::Inst*, u32 handle, Id address, Id value) {
const Id byte_index{ctx.OpBitwiseAnd(ctx.U32[1], address, ctx.ConstU32(3u))};
const Id bit_offset{ctx.OpShiftLeftLogical(ctx.U32[1], byte_index, ctx.ConstU32(3u))};
const Id dword{EmitLoadBufferU32xN<1>(ctx, handle, address)};
const Id new_val{ctx.OpBitFieldInsert(ctx.U32[1], dword, value, bit_offset, ctx.ConstU32(8u))};
EmitStoreBufferU32xN<1>(ctx, handle, address, new_val);
const auto& spv_buffer = ctx.buffers[handle];
if (Sirit::ValidId(spv_buffer.offset)) {
address = ctx.OpIAdd(ctx.U32[1], address, spv_buffer.offset);
}
const auto [id, pointer_type] = spv_buffer[BufferAlias::U8];
const Id ptr{ctx.OpAccessChain(pointer_type, id, ctx.u32_zero_value, address)};
const Id result{ctx.OpUConvert(ctx.U8, value)};
EmitStoreBufferBoundsCheck<1>(ctx, address, spv_buffer.size, [&] { ctx.OpStore(ptr, result); });
}
void EmitStoreBufferU16(EmitContext& ctx, IR::Inst*, u32 handle, Id address, Id value) {
const Id byte_index{ctx.OpBitwiseAnd(ctx.U32[1], address, ctx.ConstU32(2u))};
const Id bit_offset{ctx.OpShiftLeftLogical(ctx.U32[1], byte_index, ctx.ConstU32(3u))};
const Id dword{EmitLoadBufferU32xN<1>(ctx, handle, address)};
const Id new_val{ctx.OpBitFieldInsert(ctx.U32[1], dword, value, bit_offset, ctx.ConstU32(16u))};
EmitStoreBufferU32xN<1>(ctx, handle, address, new_val);
const auto& spv_buffer = ctx.buffers[handle];
if (Sirit::ValidId(spv_buffer.offset)) {
address = ctx.OpIAdd(ctx.U32[1], address, spv_buffer.offset);
}
const auto [id, pointer_type] = spv_buffer[BufferAlias::U16];
const Id index = ctx.OpShiftRightLogical(ctx.U32[1], address, ctx.ConstU32(1u));
const Id ptr{ctx.OpAccessChain(pointer_type, id, ctx.u32_zero_value, index)};
const Id result{ctx.OpUConvert(ctx.U16, value)};
EmitStoreBufferBoundsCheck<1>(ctx, index, spv_buffer.size_shorts,
[&] { ctx.OpStore(ptr, result); });
}
void EmitStoreBufferU32(EmitContext& ctx, IR::Inst*, u32 handle, Id address, Id value) {
EmitStoreBufferU32xN<1>(ctx, handle, address, value);
void EmitStoreBufferU32(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address, Id value) {
EmitStoreBufferB32xN<1, BufferAlias::U32>(ctx, inst, handle, address, value);
}
void EmitStoreBufferU32x2(EmitContext& ctx, IR::Inst*, u32 handle, Id address, Id value) {
EmitStoreBufferU32xN<2>(ctx, handle, address, value);
void EmitStoreBufferU32x2(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address, Id value) {
EmitStoreBufferB32xN<2, BufferAlias::U32>(ctx, inst, handle, address, value);
}
void EmitStoreBufferU32x3(EmitContext& ctx, IR::Inst*, u32 handle, Id address, Id value) {
EmitStoreBufferU32xN<3>(ctx, handle, address, value);
void EmitStoreBufferU32x3(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address, Id value) {
EmitStoreBufferB32xN<3, BufferAlias::U32>(ctx, inst, handle, address, value);
}
void EmitStoreBufferU32x4(EmitContext& ctx, IR::Inst*, u32 handle, Id address, Id value) {
EmitStoreBufferU32xN<4>(ctx, handle, address, value);
void EmitStoreBufferU32x4(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address, Id value) {
EmitStoreBufferB32xN<4, BufferAlias::U32>(ctx, inst, handle, address, value);
}
void EmitStoreBufferF32(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address, Id value) {
EmitStoreBufferU32(ctx, inst, handle, address, ctx.OpBitcast(ctx.U32[1], value));
EmitStoreBufferB32xN<1, BufferAlias::F32>(ctx, inst, handle, address, value);
}
void EmitStoreBufferF32x2(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address, Id value) {
EmitStoreBufferU32x2(ctx, inst, handle, address, ctx.OpBitcast(ctx.U32[2], value));
EmitStoreBufferB32xN<2, BufferAlias::F32>(ctx, inst, handle, address, value);
}
void EmitStoreBufferF32x3(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address, Id value) {
EmitStoreBufferU32x3(ctx, inst, handle, address, ctx.OpBitcast(ctx.U32[3], value));
EmitStoreBufferB32xN<3, BufferAlias::F32>(ctx, inst, handle, address, value);
}
void EmitStoreBufferF32x4(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address, Id value) {
EmitStoreBufferU32x4(ctx, inst, handle, address, ctx.OpBitcast(ctx.U32[4], value));
EmitStoreBufferB32xN<4, BufferAlias::F32>(ctx, inst, handle, address, value);
}
void EmitStoreBufferFormatF32(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address, Id value) {

View File

@ -9,65 +9,35 @@ namespace Shader::Backend::SPIRV {
Id EmitLoadSharedU32(EmitContext& ctx, Id offset) {
const Id shift_id{ctx.ConstU32(2U)};
const Id index{ctx.OpShiftRightArithmetic(ctx.U32[1], offset, shift_id)};
if (ctx.info.has_emulated_shared_memory) {
const Id pointer =
ctx.OpAccessChain(ctx.shared_u32, ctx.shared_memory_u32, ctx.u32_zero_value, index);
return ctx.OpLoad(ctx.U32[1], pointer);
} else {
const Id pointer = ctx.OpAccessChain(ctx.shared_u32, ctx.shared_memory_u32, index);
return ctx.OpLoad(ctx.U32[1], pointer);
}
}
Id EmitLoadSharedU64(EmitContext& ctx, Id offset) {
const Id shift_id{ctx.ConstU32(2U)};
const Id base_index{ctx.OpShiftRightArithmetic(ctx.U32[1], offset, shift_id)};
const Id next_index{ctx.OpIAdd(ctx.U32[1], base_index, ctx.ConstU32(1U))};
if (ctx.info.has_emulated_shared_memory) {
const Id lhs_pointer{ctx.OpAccessChain(ctx.shared_u32, ctx.shared_memory_u32,
ctx.u32_zero_value, base_index)};
const Id rhs_pointer{ctx.OpAccessChain(ctx.shared_u32, ctx.shared_memory_u32,
ctx.u32_zero_value, next_index)};
return ctx.OpCompositeConstruct(ctx.U32[2], ctx.OpLoad(ctx.U32[1], lhs_pointer),
ctx.OpLoad(ctx.U32[1], rhs_pointer));
} else {
const Id lhs_pointer{ctx.OpAccessChain(ctx.shared_u32, ctx.shared_memory_u32, base_index)};
const Id rhs_pointer{ctx.OpAccessChain(ctx.shared_u32, ctx.shared_memory_u32, next_index)};
return ctx.OpCompositeConstruct(ctx.U32[2], ctx.OpLoad(ctx.U32[1], lhs_pointer),
ctx.OpLoad(ctx.U32[1], rhs_pointer));
}
}
void EmitWriteSharedU32(EmitContext& ctx, Id offset, Id value) {
const Id shift{ctx.ConstU32(2U)};
const Id word_offset{ctx.OpShiftRightArithmetic(ctx.U32[1], offset, shift)};
if (ctx.info.has_emulated_shared_memory) {
const Id pointer = ctx.OpAccessChain(ctx.shared_u32, ctx.shared_memory_u32,
ctx.u32_zero_value, word_offset);
ctx.OpStore(pointer, value);
} else {
const Id pointer = ctx.OpAccessChain(ctx.shared_u32, ctx.shared_memory_u32, word_offset);
ctx.OpStore(pointer, value);
}
}
void EmitWriteSharedU64(EmitContext& ctx, Id offset, Id value) {
const Id shift{ctx.ConstU32(2U)};
const Id word_offset{ctx.OpShiftRightArithmetic(ctx.U32[1], offset, shift)};
const Id next_offset{ctx.OpIAdd(ctx.U32[1], word_offset, ctx.ConstU32(1U))};
if (ctx.info.has_emulated_shared_memory) {
const Id lhs_pointer{ctx.OpAccessChain(ctx.shared_u32, ctx.shared_memory_u32,
ctx.u32_zero_value, word_offset)};
const Id rhs_pointer{ctx.OpAccessChain(ctx.shared_u32, ctx.shared_memory_u32,
ctx.u32_zero_value, next_offset)};
ctx.OpStore(lhs_pointer, ctx.OpCompositeExtract(ctx.U32[1], value, 0U));
ctx.OpStore(rhs_pointer, ctx.OpCompositeExtract(ctx.U32[1], value, 1U));
} else {
const Id lhs_pointer{ctx.OpAccessChain(ctx.shared_u32, ctx.shared_memory_u32, word_offset)};
const Id rhs_pointer{ctx.OpAccessChain(ctx.shared_u32, ctx.shared_memory_u32, next_offset)};
ctx.OpStore(lhs_pointer, ctx.OpCompositeExtract(ctx.U32[1], value, 0U));
ctx.OpStore(rhs_pointer, ctx.OpCompositeExtract(ctx.U32[1], value, 1U));
}
}
} // namespace Shader::Backend::SPIRV

View File

@ -11,7 +11,10 @@ void EmitPrologue(EmitContext& ctx) {
if (ctx.stage == Stage::Fragment) {
ctx.DefineInterpolatedAttribs();
}
ctx.DefineBufferOffsets();
if (ctx.info.loads.Get(IR::Attribute::WorkgroupIndex)) {
ctx.DefineWorkgroupIndex();
}
ctx.DefineBufferProperties();
}
void ConvertDepthMode(EmitContext& ctx) {

View File

@ -5,7 +5,6 @@
#include "common/div_ceil.h"
#include "shader_recompiler/backend/spirv/spirv_emit_context.h"
#include "shader_recompiler/frontend/fetch_shader.h"
#include "shader_recompiler/ir/passes/srt.h"
#include "shader_recompiler/runtime_info.h"
#include "video_core/amdgpu/types.h"
@ -107,6 +106,8 @@ Id EmitContext::Def(const IR::Value& value) {
void EmitContext::DefineArithmeticTypes() {
void_id = Name(TypeVoid(), "void_id");
U1[1] = Name(TypeBool(), "bool_id");
U8 = Name(TypeUInt(8), "u8_id");
U16 = Name(TypeUInt(16), "u16_id");
if (info.uses_fp16) {
F16[1] = Name(TypeFloat(16), "f16_id");
U16 = Name(TypeUInt(16), "u16_id");
@ -191,8 +192,30 @@ EmitContext::SpirvAttribute EmitContext::GetAttributeInfo(AmdGpu::NumberFormat f
UNREACHABLE_MSG("Invalid attribute type {}", fmt);
}
void EmitContext::DefineBufferOffsets() {
for (BufferDefinition& buffer : buffers) {
Id EmitContext::GetBufferSize(const u32 sharp_idx) {
const auto& srt_flatbuf = buffers.back();
ASSERT(srt_flatbuf.buffer_type == BufferType::ReadConstUbo);
const auto [id, pointer_type] = srt_flatbuf[BufferAlias::U32];
const auto rsrc1{
OpLoad(U32[1], OpAccessChain(pointer_type, id, u32_zero_value, ConstU32(sharp_idx + 1)))};
const auto rsrc2{
OpLoad(U32[1], OpAccessChain(pointer_type, id, u32_zero_value, ConstU32(sharp_idx + 2)))};
const auto stride{OpBitFieldUExtract(U32[1], rsrc1, ConstU32(16u), ConstU32(14u))};
const auto num_records{rsrc2};
const auto stride_zero{OpIEqual(U1[1], stride, u32_zero_value)};
const auto stride_size{OpIMul(U32[1], num_records, stride)};
return OpSelect(U32[1], stride_zero, num_records, stride_size);
}
void EmitContext::DefineBufferProperties() {
for (u32 i = 0; i < buffers.size(); i++) {
BufferDefinition& buffer = buffers[i];
if (buffer.buffer_type != BufferType::Guest) {
continue;
}
const u32 binding = buffer.binding;
const u32 half = PushData::BufOffsetIndex + (binding >> 4);
const u32 comp = (binding & 0xf) >> 2;
@ -204,6 +227,22 @@ void EmitContext::DefineBufferOffsets() {
Name(buffer.offset, fmt::format("buf{}_off", binding));
buffer.offset_dwords = OpShiftRightLogical(U32[1], buffer.offset, ConstU32(2U));
Name(buffer.offset_dwords, fmt::format("buf{}_dword_off", binding));
// Only need to load size if performing bounds checks and the buffer is both guest and not
// inline.
if (!profile.supports_robust_buffer_access && buffer.buffer_type == BufferType::Guest) {
const BufferResource& desc = info.buffers[i];
if (desc.sharp_idx == std::numeric_limits<u32>::max()) {
buffer.size = ConstU32(desc.inline_cbuf.GetSize());
} else {
buffer.size = GetBufferSize(desc.sharp_idx);
}
Name(buffer.size, fmt::format("buf{}_size", binding));
buffer.size_shorts = OpShiftRightLogical(U32[1], buffer.size, ConstU32(1U));
Name(buffer.size_shorts, fmt::format("buf{}_short_size", binding));
buffer.size_dwords = OpShiftRightLogical(U32[1], buffer.size, ConstU32(2U));
Name(buffer.size_dwords, fmt::format("buf{}_dword_size", binding));
}
}
}
@ -211,8 +250,7 @@ void EmitContext::DefineInterpolatedAttribs() {
if (!profile.needs_manual_interpolation) {
return;
}
// Iterate all input attributes, load them and manually interpolate with barycentric
// coordinates.
// Iterate all input attributes, load them and manually interpolate.
for (s32 i = 0; i < runtime_info.fs_info.num_inputs; i++) {
const auto& input = runtime_info.fs_info.inputs[i];
const u32 semantic = input.param_index;
@ -237,6 +275,20 @@ void EmitContext::DefineInterpolatedAttribs() {
}
}
void EmitContext::DefineWorkgroupIndex() {
const Id workgroup_id_val{OpLoad(U32[3], workgroup_id)};
const Id workgroup_x{OpCompositeExtract(U32[1], workgroup_id_val, 0)};
const Id workgroup_y{OpCompositeExtract(U32[1], workgroup_id_val, 1)};
const Id workgroup_z{OpCompositeExtract(U32[1], workgroup_id_val, 2)};
const Id num_workgroups{OpLoad(U32[3], num_workgroups_id)};
const Id num_workgroups_x{OpCompositeExtract(U32[1], num_workgroups, 0)};
const Id num_workgroups_y{OpCompositeExtract(U32[1], num_workgroups, 1)};
workgroup_index_id =
OpIAdd(U32[1], OpIAdd(U32[1], workgroup_x, OpIMul(U32[1], workgroup_y, num_workgroups_x)),
OpIMul(U32[1], workgroup_z, OpIMul(U32[1], num_workgroups_x, num_workgroups_y)));
Name(workgroup_index_id, "workgroup_index");
}
Id MakeDefaultValue(EmitContext& ctx, u32 default_value) {
switch (default_value) {
case 0:
@ -305,9 +357,16 @@ void EmitContext::DefineInputs() {
break;
}
case LogicalStage::Fragment:
if (info.loads.GetAny(IR::Attribute::FragCoord)) {
frag_coord = DefineVariable(F32[4], spv::BuiltIn::FragCoord, spv::StorageClass::Input);
}
if (info.stores.Get(IR::Attribute::Depth)) {
frag_depth = DefineVariable(F32[1], spv::BuiltIn::FragDepth, spv::StorageClass::Output);
front_facing = DefineVariable(U1[1], spv::BuiltIn::FrontFacing, spv::StorageClass::Input);
}
if (info.loads.Get(IR::Attribute::IsFrontFace)) {
front_facing =
DefineVariable(U1[1], spv::BuiltIn::FrontFacing, spv::StorageClass::Input);
}
if (profile.needs_manual_interpolation) {
gl_bary_coord_id =
DefineVariable(F32[3], spv::BuiltIn::BaryCoordKHR, spv::StorageClass::Input);
@ -342,9 +401,19 @@ void EmitContext::DefineInputs() {
}
break;
case LogicalStage::Compute:
workgroup_id = DefineVariable(U32[3], spv::BuiltIn::WorkgroupId, spv::StorageClass::Input);
if (info.loads.GetAny(IR::Attribute::WorkgroupIndex) ||
info.loads.GetAny(IR::Attribute::WorkgroupId)) {
workgroup_id =
DefineVariable(U32[3], spv::BuiltIn::WorkgroupId, spv::StorageClass::Input);
}
if (info.loads.GetAny(IR::Attribute::WorkgroupIndex)) {
num_workgroups_id =
DefineVariable(U32[3], spv::BuiltIn::NumWorkgroups, spv::StorageClass::Input);
}
if (info.loads.GetAny(IR::Attribute::LocalInvocationId)) {
local_invocation_id =
DefineVariable(U32[3], spv::BuiltIn::LocalInvocationId, spv::StorageClass::Input);
}
break;
case LogicalStage::Geometry: {
primitive_id = DefineVariable(U32[1], spv::BuiltIn::PrimitiveId, spv::StorageClass::Input);
@ -555,111 +624,117 @@ void EmitContext::DefineOutputs() {
void EmitContext::DefinePushDataBlock() {
// Create push constants block for instance steps rates
const Id struct_type{Name(TypeStruct(U32[1], U32[1], U32[4], U32[4], U32[4], U32[4], U32[4],
U32[4], F32[1], F32[1], F32[1], F32[1]),
const Id struct_type{Name(TypeStruct(U32[1], U32[1], F32[1], F32[1], F32[1], F32[1], U32[4],
U32[4], U32[4], U32[4], U32[4], U32[4]),
"AuxData")};
Decorate(struct_type, spv::Decoration::Block);
MemberName(struct_type, 0, "sr0");
MemberName(struct_type, 1, "sr1");
MemberName(struct_type, Shader::PushData::BufOffsetIndex + 0, "buf_offsets0");
MemberName(struct_type, Shader::PushData::BufOffsetIndex + 1, "buf_offsets1");
MemberName(struct_type, Shader::PushData::UdRegsIndex + 0, "ud_regs0");
MemberName(struct_type, Shader::PushData::UdRegsIndex + 1, "ud_regs1");
MemberName(struct_type, Shader::PushData::UdRegsIndex + 2, "ud_regs2");
MemberName(struct_type, Shader::PushData::UdRegsIndex + 3, "ud_regs3");
MemberName(struct_type, Shader::PushData::XOffsetIndex, "xoffset");
MemberName(struct_type, Shader::PushData::YOffsetIndex, "yoffset");
MemberName(struct_type, Shader::PushData::XScaleIndex, "xscale");
MemberName(struct_type, Shader::PushData::YScaleIndex, "yscale");
MemberDecorate(struct_type, 0, spv::Decoration::Offset, 0U);
MemberDecorate(struct_type, 1, spv::Decoration::Offset, 4U);
MemberDecorate(struct_type, Shader::PushData::BufOffsetIndex + 0, spv::Decoration::Offset, 8U);
MemberDecorate(struct_type, Shader::PushData::BufOffsetIndex + 1, spv::Decoration::Offset, 24U);
MemberDecorate(struct_type, Shader::PushData::UdRegsIndex + 0, spv::Decoration::Offset, 40U);
MemberDecorate(struct_type, Shader::PushData::UdRegsIndex + 1, spv::Decoration::Offset, 56U);
MemberDecorate(struct_type, Shader::PushData::UdRegsIndex + 2, spv::Decoration::Offset, 72U);
MemberDecorate(struct_type, Shader::PushData::UdRegsIndex + 3, spv::Decoration::Offset, 88U);
MemberDecorate(struct_type, Shader::PushData::XOffsetIndex, spv::Decoration::Offset, 104U);
MemberDecorate(struct_type, Shader::PushData::YOffsetIndex, spv::Decoration::Offset, 108U);
MemberDecorate(struct_type, Shader::PushData::XScaleIndex, spv::Decoration::Offset, 112U);
MemberDecorate(struct_type, Shader::PushData::YScaleIndex, spv::Decoration::Offset, 116U);
MemberName(struct_type, PushData::Step0Index, "sr0");
MemberName(struct_type, PushData::Step1Index, "sr1");
MemberName(struct_type, PushData::XOffsetIndex, "xoffset");
MemberName(struct_type, PushData::YOffsetIndex, "yoffset");
MemberName(struct_type, PushData::XScaleIndex, "xscale");
MemberName(struct_type, PushData::YScaleIndex, "yscale");
MemberName(struct_type, PushData::UdRegsIndex + 0, "ud_regs0");
MemberName(struct_type, PushData::UdRegsIndex + 1, "ud_regs1");
MemberName(struct_type, PushData::UdRegsIndex + 2, "ud_regs2");
MemberName(struct_type, PushData::UdRegsIndex + 3, "ud_regs3");
MemberName(struct_type, PushData::BufOffsetIndex + 0, "buf_offsets0");
MemberName(struct_type, PushData::BufOffsetIndex + 1, "buf_offsets1");
MemberDecorate(struct_type, PushData::Step0Index, spv::Decoration::Offset, 0U);
MemberDecorate(struct_type, PushData::Step1Index, spv::Decoration::Offset, 4U);
MemberDecorate(struct_type, PushData::XOffsetIndex, spv::Decoration::Offset, 8U);
MemberDecorate(struct_type, PushData::YOffsetIndex, spv::Decoration::Offset, 12U);
MemberDecorate(struct_type, PushData::XScaleIndex, spv::Decoration::Offset, 16U);
MemberDecorate(struct_type, PushData::YScaleIndex, spv::Decoration::Offset, 20U);
MemberDecorate(struct_type, PushData::UdRegsIndex + 0, spv::Decoration::Offset, 24U);
MemberDecorate(struct_type, PushData::UdRegsIndex + 1, spv::Decoration::Offset, 40U);
MemberDecorate(struct_type, PushData::UdRegsIndex + 2, spv::Decoration::Offset, 56U);
MemberDecorate(struct_type, PushData::UdRegsIndex + 3, spv::Decoration::Offset, 72U);
MemberDecorate(struct_type, PushData::BufOffsetIndex + 0, spv::Decoration::Offset, 88U);
MemberDecorate(struct_type, PushData::BufOffsetIndex + 1, spv::Decoration::Offset, 104U);
push_data_block = DefineVar(struct_type, spv::StorageClass::PushConstant);
Name(push_data_block, "push_data");
interfaces.push_back(push_data_block);
}
void EmitContext::DefineBuffers() {
boost::container::small_vector<Id, 8> type_ids;
const auto define_struct = [&](Id record_array_type, bool is_instance_data,
std::optional<std::string_view> explicit_name = {}) {
EmitContext::BufferSpv EmitContext::DefineBuffer(bool is_storage, bool is_written, u32 elem_shift,
BufferType buffer_type, Id data_type) {
// Define array type.
const Id max_num_items = ConstU32(u32(profile.max_ubo_size) >> elem_shift);
const Id record_array_type{is_storage ? TypeRuntimeArray(data_type)
: TypeArray(data_type, max_num_items)};
// Define block struct type. Don't perform decorations twice on the same Id.
const Id struct_type{TypeStruct(record_array_type)};
if (std::ranges::find(type_ids, record_array_type.value, &Id::value) != type_ids.end()) {
return struct_type;
}
Decorate(record_array_type, spv::Decoration::ArrayStride, 4);
auto name = is_instance_data ? fmt::format("{}_instance_data_f32", stage)
: fmt::format("{}_cbuf_block_f32", stage);
name = explicit_name.value_or(name);
Name(struct_type, name);
if (std::ranges::find(buf_type_ids, record_array_type.value, &Id::value) ==
buf_type_ids.end()) {
Decorate(record_array_type, spv::Decoration::ArrayStride, 1 << elem_shift);
Decorate(struct_type, spv::Decoration::Block);
MemberName(struct_type, 0, "data");
MemberDecorate(struct_type, 0, spv::Decoration::Offset, 0U);
type_ids.push_back(record_array_type);
return struct_type;
};
if (info.has_readconst) {
const Id data_type = U32[1];
const auto storage_class = spv::StorageClass::Uniform;
const Id pointer_type = TypePointer(storage_class, data_type);
const Id record_array_type{
TypeArray(U32[1], ConstU32(static_cast<u32>(info.flattened_ud_buf.size())))};
const Id struct_type{define_struct(record_array_type, false, "srt_flatbuf_ty")};
const Id struct_pointer_type{TypePointer(storage_class, struct_type)};
const Id id{AddGlobalVariable(struct_pointer_type, storage_class)};
Decorate(id, spv::Decoration::Binding, binding.unified++);
Decorate(id, spv::Decoration::DescriptorSet, 0U);
Name(id, "srt_flatbuf_ubo");
srt_flatbuf = {
.id = id,
.binding = binding.buffer++,
.pointer_type = pointer_type,
};
interfaces.push_back(id);
buf_type_ids.push_back(record_array_type);
}
for (const auto& desc : info.buffers) {
const auto sharp = desc.GetSharp(info);
const bool is_storage = desc.IsStorage(sharp, profile);
const u32 array_size = profile.max_ubo_size >> 2;
const auto* data_types = True(desc.used_types & IR::Type::F32) ? &F32 : &U32;
const Id data_type = (*data_types)[1];
const Id record_array_type{is_storage ? TypeRuntimeArray(data_type)
: TypeArray(data_type, ConstU32(array_size))};
const Id struct_type{define_struct(record_array_type, desc.is_instance_data)};
// Define buffer binding interface.
const auto storage_class =
is_storage ? spv::StorageClass::StorageBuffer : spv::StorageClass::Uniform;
const Id struct_pointer_type{TypePointer(storage_class, struct_type)};
const Id pointer_type = TypePointer(storage_class, data_type);
const Id id{AddGlobalVariable(struct_pointer_type, storage_class)};
Decorate(id, spv::Decoration::Binding, binding.unified++);
Decorate(id, spv::Decoration::Binding, binding.unified);
Decorate(id, spv::Decoration::DescriptorSet, 0U);
if (is_storage && !desc.is_written) {
if (is_storage && !is_written) {
Decorate(id, spv::Decoration::NonWritable);
}
Name(id, fmt::format("{}_{}", is_storage ? "ssbo" : "cbuf", desc.sharp_idx));
buffers.push_back({
.id = id,
.binding = binding.buffer++,
.data_types = data_types,
.pointer_type = pointer_type,
});
switch (buffer_type) {
case Shader::BufferType::GdsBuffer:
Name(id, "gds_buffer");
break;
case Shader::BufferType::ReadConstUbo:
Name(id, "srt_flatbuf_ubo");
break;
case Shader::BufferType::SharedMemory:
Name(id, "ssbo_shmem");
break;
default:
Name(id, fmt::format("{}_{}", is_storage ? "ssbo" : "ubo", binding.buffer));
break;
}
interfaces.push_back(id);
return {id, pointer_type};
};
void EmitContext::DefineBuffers() {
if (!profile.supports_robust_buffer_access && !info.has_readconst) {
// In case ReadConstUbo has not already been bound by IR and is needed
// to query buffer sizes, bind it now.
info.buffers.push_back({
.used_types = IR::Type::U32,
.inline_cbuf = AmdGpu::Buffer::Null(),
.buffer_type = BufferType::ReadConstUbo,
});
}
for (const auto& desc : info.buffers) {
const auto buf_sharp = desc.GetSharp(info);
const bool is_storage = desc.IsStorage(buf_sharp, profile);
// Define aliases depending on the shader usage.
auto& spv_buffer = buffers.emplace_back(binding.buffer++, desc.buffer_type);
if (True(desc.used_types & IR::Type::U32)) {
spv_buffer[BufferAlias::U32] =
DefineBuffer(is_storage, desc.is_written, 2, desc.buffer_type, U32[1]);
}
if (True(desc.used_types & IR::Type::F32)) {
spv_buffer[BufferAlias::F32] =
DefineBuffer(is_storage, desc.is_written, 2, desc.buffer_type, F32[1]);
}
if (True(desc.used_types & IR::Type::U16)) {
spv_buffer[BufferAlias::U16] =
DefineBuffer(is_storage, desc.is_written, 1, desc.buffer_type, U16);
}
if (True(desc.used_types & IR::Type::U8)) {
spv_buffer[BufferAlias::U8] =
DefineBuffer(is_storage, desc.is_written, 0, desc.buffer_type, U8);
}
++binding.unified;
}
}
@ -809,51 +884,18 @@ void EmitContext::DefineImagesAndSamplers() {
}
void EmitContext::DefineSharedMemory() {
static constexpr size_t DefaultSharedMemSize = 2_KB;
if (!info.uses_shared) {
return;
}
ASSERT(info.stage == Stage::Compute);
const u32 max_shared_memory_size = profile.max_shared_memory_size;
u32 shared_memory_size = runtime_info.cs_info.shared_memory_size;
if (shared_memory_size == 0) {
shared_memory_size = DefaultSharedMemSize;
}
const u32 shared_memory_size = runtime_info.cs_info.shared_memory_size;
const u32 num_elements{Common::DivCeil(shared_memory_size, 4U)};
const Id type{TypeArray(U32[1], ConstU32(num_elements))};
if (shared_memory_size <= max_shared_memory_size) {
shared_memory_u32_type = TypePointer(spv::StorageClass::Workgroup, type);
shared_u32 = TypePointer(spv::StorageClass::Workgroup, U32[1]);
shared_memory_u32 = AddGlobalVariable(shared_memory_u32_type, spv::StorageClass::Workgroup);
Name(shared_memory_u32, "shared_mem");
interfaces.push_back(shared_memory_u32);
} else {
shared_memory_u32_type = TypePointer(spv::StorageClass::StorageBuffer, type);
shared_u32 = TypePointer(spv::StorageClass::StorageBuffer, U32[1]);
Decorate(type, spv::Decoration::ArrayStride, 4);
const Id struct_type{TypeStruct(type)};
Name(struct_type, "shared_memory_buf");
Decorate(struct_type, spv::Decoration::Block);
MemberName(struct_type, 0, "data");
MemberDecorate(struct_type, 0, spv::Decoration::Offset, 0U);
const Id struct_pointer_type{TypePointer(spv::StorageClass::StorageBuffer, struct_type)};
const Id ssbo_id{AddGlobalVariable(struct_pointer_type, spv::StorageClass::StorageBuffer)};
Decorate(ssbo_id, spv::Decoration::Binding, binding.unified++);
Decorate(ssbo_id, spv::Decoration::DescriptorSet, 0U);
Name(ssbo_id, "shared_mem_ssbo");
shared_memory_u32 = ssbo_id;
info.has_emulated_shared_memory = true;
info.shared_memory_size = shared_memory_size;
interfaces.push_back(ssbo_id);
}
}
Id EmitContext::DefineFloat32ToUfloatM5(u32 mantissa_bits, const std::string_view name) {

View File

@ -8,7 +8,7 @@
#include "shader_recompiler/backend/bindings.h"
#include "shader_recompiler/info.h"
#include "shader_recompiler/ir/program.h"
#include "shader_recompiler/ir/value.h"
#include "shader_recompiler/profile.h"
namespace Shader::Backend::SPIRV {
@ -43,8 +43,9 @@ public:
Id Def(const IR::Value& value);
void DefineBufferOffsets();
void DefineBufferProperties();
void DefineInterpolatedAttribs();
void DefineWorkgroupIndex();
[[nodiscard]] Id DefineInput(Id type, std::optional<u32> location = std::nullopt,
std::optional<spv::BuiltIn> builtin = std::nullopt) {
@ -200,8 +201,10 @@ public:
std::array<Id, 30> patches{};
Id workgroup_id{};
Id num_workgroups_id{};
Id workgroup_index_id{};
Id local_invocation_id{};
Id invocation_id{}; // for instanced geoshaders or output vertices within TCS patch
Id invocation_id{};
Id subgroup_local_invocation_id{};
Id image_u32{};
@ -227,18 +230,41 @@ public:
bool is_storage = false;
};
struct BufferDefinition {
enum class BufferAlias : u32 {
U8,
U16,
U32,
F32,
NumAlias,
};
struct BufferSpv {
Id id;
Id offset;
Id offset_dwords;
u32 binding;
const VectorIds* data_types;
Id pointer_type;
};
struct BufferDefinition {
u32 binding;
BufferType buffer_type;
Id offset;
Id offset_dwords;
Id size;
Id size_shorts;
Id size_dwords;
std::array<BufferSpv, u32(BufferAlias::NumAlias)> aliases;
const BufferSpv& operator[](BufferAlias alias) const {
return aliases[u32(alias)];
}
BufferSpv& operator[](BufferAlias alias) {
return aliases[u32(alias)];
}
};
Bindings& binding;
boost::container::small_vector<Id, 16> buf_type_ids;
boost::container::small_vector<BufferDefinition, 16> buffers;
BufferDefinition srt_flatbuf;
boost::container::small_vector<TextureDefinition, 8> images;
boost::container::small_vector<Id, 4> samplers;
@ -279,8 +305,13 @@ private:
SpirvAttribute GetAttributeInfo(AmdGpu::NumberFormat fmt, Id id, u32 num_components,
bool output);
BufferSpv DefineBuffer(bool is_storage, bool is_written, u32 elem_shift, BufferType buffer_type,
Id data_type);
Id DefineFloat32ToUfloatM5(u32 mantissa_bits, std::string_view name);
Id DefineUfloatM5ToFloat32(u32 mantissa_bits, std::string_view name);
Id GetBufferSize(u32 sharp_idx);
};
} // namespace Shader::Backend::SPIRV

View File

@ -9,6 +9,12 @@
namespace Shader::Gcn {
const u32* GetFetchShaderCode(const Info& info, u32 sgpr_base) {
const u32* code;
std::memcpy(&code, &info.user_data[sgpr_base], sizeof(code));
return code;
}
/**
* s_load_dwordx4 s[8:11], s[2:3], 0x00
* s_load_dwordx4 s[12:15], s[2:3], 0x04
@ -38,9 +44,8 @@ std::optional<FetchShaderData> ParseFetchShader(const Shader::Info& info) {
if (!info.has_fetch_shader) {
return std::nullopt;
}
const u32* code;
std::memcpy(&code, &info.user_data[info.fetch_shader_sgpr_base], sizeof(code));
const auto* code = GetFetchShaderCode(info, info.fetch_shader_sgpr_base);
FetchShaderData data{.code = code};
GcnCodeSlice code_slice(code, code + std::numeric_limits<u32>::max());
GcnDecodeContext decoder;

View File

@ -64,6 +64,8 @@ struct FetchShaderData {
}
};
const u32* GetFetchShaderCode(const Info& info, u32 sgpr_base);
std::optional<FetchShaderData> ParseFetchShader(const Shader::Info& info);
} // namespace Shader::Gcn

View File

@ -176,6 +176,13 @@ void Translator::DS_WRITE(int bit_size, bool is_signed, bool is_pair, bool strid
const IR::U32 addr{ir.GetVectorReg(IR::VectorReg(inst.src[0].code))};
const IR::VectorReg data0{inst.src[1].code};
const IR::VectorReg data1{inst.src[2].code};
const u32 offset = (inst.control.ds.offset1 << 8u) + inst.control.ds.offset0;
if (info.stage == Stage::Fragment) {
ASSERT_MSG(!is_pair && bit_size == 32 && offset % 256 == 0,
"Unexpected shared memory offset alignment: {}", offset);
ir.SetVectorReg(GetScratchVgpr(offset), ir.GetVectorReg(data0));
return;
}
if (is_pair) {
const u32 adj = (bit_size == 32 ? 4 : 8) * (stride64 ? 64 : 1);
const IR::U32 addr0 = ir.IAdd(addr, ir.Imm32(u32(inst.control.ds.offset0 * adj)));
@ -195,14 +202,12 @@ void Translator::DS_WRITE(int bit_size, bool is_signed, bool is_pair, bool strid
addr1);
}
} else if (bit_size == 64) {
const IR::U32 addr0 = ir.IAdd(
addr, ir.Imm32((u32(inst.control.ds.offset1) << 8u) + u32(inst.control.ds.offset0)));
const IR::U32 addr0 = ir.IAdd(addr, ir.Imm32(offset));
const IR::Value data =
ir.CompositeConstruct(ir.GetVectorReg(data0), ir.GetVectorReg(data0 + 1));
ir.WriteShared(bit_size, data, addr0);
} else {
const IR::U32 addr0 = ir.IAdd(
addr, ir.Imm32((u32(inst.control.ds.offset1) << 8u) + u32(inst.control.ds.offset0)));
const IR::U32 addr0 = ir.IAdd(addr, ir.Imm32(offset));
ir.WriteShared(bit_size, ir.GetVectorReg(data0), addr0);
}
}
@ -223,6 +228,13 @@ void Translator::DS_READ(int bit_size, bool is_signed, bool is_pair, bool stride
const GcnInst& inst) {
const IR::U32 addr{ir.GetVectorReg(IR::VectorReg(inst.src[0].code))};
IR::VectorReg dst_reg{inst.dst[0].code};
const u32 offset = (inst.control.ds.offset1 << 8u) + inst.control.ds.offset0;
if (info.stage == Stage::Fragment) {
ASSERT_MSG(!is_pair && bit_size == 32 && offset % 256 == 0,
"Unexpected shared memory offset alignment: {}", offset);
ir.SetVectorReg(dst_reg, ir.GetVectorReg(GetScratchVgpr(offset)));
return;
}
if (is_pair) {
// Pair loads are either 32 or 64-bit
const u32 adj = (bit_size == 32 ? 4 : 8) * (stride64 ? 64 : 1);
@ -243,14 +255,12 @@ void Translator::DS_READ(int bit_size, bool is_signed, bool is_pair, bool stride
ir.SetVectorReg(dst_reg++, IR::U32{ir.CompositeExtract(data1, 1)});
}
} else if (bit_size == 64) {
const IR::U32 addr0 = ir.IAdd(
addr, ir.Imm32((u32(inst.control.ds.offset1) << 8u) + u32(inst.control.ds.offset0)));
const IR::U32 addr0 = ir.IAdd(addr, ir.Imm32(offset));
const IR::Value data = ir.LoadShared(bit_size, is_signed, addr0);
ir.SetVectorReg(dst_reg, IR::U32{ir.CompositeExtract(data, 0)});
ir.SetVectorReg(dst_reg + 1, IR::U32{ir.CompositeExtract(data, 1)});
} else {
const IR::U32 addr0 = ir.IAdd(
addr, ir.Imm32((u32(inst.control.ds.offset1) << 8u) + u32(inst.control.ds.offset0)));
const IR::U32 addr0 = ir.IAdd(addr, ir.Imm32(offset));
const IR::U32 data = IR::U32{ir.LoadShared(bit_size, is_signed, addr0)};
ir.SetVectorReg(dst_reg, data);
}

View File

@ -7,7 +7,7 @@
namespace Shader::Gcn {
u32 SwizzleMrtComponent(const FragmentRuntimeInfo::PsColorBuffer& color_buffer, u32 comp) {
u32 SwizzleMrtComponent(const PsColorBuffer& color_buffer, u32 comp) {
const auto [r, g, b, a] = color_buffer.swizzle;
const std::array swizzle_array = {r, g, b, a};
const auto swizzled_comp_type = static_cast<u32>(swizzle_array[comp]);
@ -16,7 +16,7 @@ u32 SwizzleMrtComponent(const FragmentRuntimeInfo::PsColorBuffer& color_buffer,
}
void Translator::ExportMrtValue(IR::Attribute attribute, u32 comp, const IR::F32& value,
const FragmentRuntimeInfo::PsColorBuffer& color_buffer) {
const PsColorBuffer& color_buffer) {
auto converted = ApplyWriteNumberConversion(ir, value, color_buffer.num_conversion);
if (color_buffer.needs_unorm_fixup) {
// FIXME: Fix-up for GPUs where float-to-unorm rounding is off from expected.

View File

@ -4,7 +4,7 @@
#include "common/config.h"
#include "common/io_file.h"
#include "common/path_util.h"
#include "shader_recompiler/exception.h"
#include "shader_recompiler/frontend/decode.h"
#include "shader_recompiler/frontend/fetch_shader.h"
#include "shader_recompiler/frontend/translate/translate.h"
#include "shader_recompiler/info.h"
@ -21,9 +21,14 @@
namespace Shader::Gcn {
static u32 next_vgpr_num;
static std::unordered_map<u32, IR::VectorReg> vgpr_map;
Translator::Translator(IR::Block* block_, Info& info_, const RuntimeInfo& runtime_info_,
const Profile& profile_)
: ir{*block_, block_->begin()}, info{info_}, runtime_info{runtime_info_}, profile{profile_} {}
: ir{*block_, block_->begin()}, info{info_}, runtime_info{runtime_info_}, profile{profile_} {
next_vgpr_num = vgpr_map.empty() ? runtime_info.num_allocated_vgprs : next_vgpr_num;
}
void Translator::EmitPrologue() {
ir.Prologue();
@ -179,8 +184,21 @@ void Translator::EmitPrologue() {
default:
UNREACHABLE_MSG("Unknown shader stage");
}
// Clear any scratch vgpr mappings for next shader.
vgpr_map.clear();
}
IR::VectorReg Translator::GetScratchVgpr(u32 offset) {
const auto [it, is_new] = vgpr_map.try_emplace(offset);
if (is_new) {
ASSERT_MSG(next_vgpr_num < 256, "Out of VGPRs");
const auto new_vgpr = static_cast<IR::VectorReg>(next_vgpr_num++);
it->second = new_vgpr;
}
return it->second;
};
template <typename T>
T Translator::GetSrc(const InstOperand& operand) {
constexpr bool is_float = std::is_same_v<T, IR::F32>;
@ -453,8 +471,29 @@ void Translator::SetDst64(const InstOperand& operand, const IR::U64F64& value_ra
void Translator::EmitFetch(const GcnInst& inst) {
// Read the pointer to the fetch shader assembly.
const auto code_sgpr_base = inst.src[0].code;
if (!profile.supports_robust_buffer_access) {
// The fetch shader must be inlined to access as regular buffers, so that
// bounds checks can be emitted to emulate robust buffer access.
const auto* code = GetFetchShaderCode(info, code_sgpr_base);
GcnCodeSlice slice(code, code + std::numeric_limits<u32>::max());
GcnDecodeContext decoder;
// Decode and save instructions
u32 sub_pc = 0;
while (!slice.atEnd()) {
const auto sub_inst = decoder.decodeInstruction(slice);
if (sub_inst.opcode == Opcode::S_SETPC_B64) {
// Assume we're swapping back to the main shader.
break;
}
TranslateInstruction(sub_inst, sub_pc++);
}
return;
}
info.has_fetch_shader = true;
info.fetch_shader_sgpr_base = inst.src[0].code;
info.fetch_shader_sgpr_base = code_sgpr_base;
const auto fetch_data = ParseFetchShader(info);
ASSERT(fetch_data.has_value());
@ -490,7 +529,6 @@ void Translator::EmitFetch(const GcnInst& inst) {
info.buffers.push_back({
.sharp_idx = info.srt_info.ReserveSharp(attrib.sgpr_base, attrib.dword_offset, 4),
.used_types = IR::Type::F32,
.is_instance_data = true,
.instance_attrib = attrib.semantic,
});
}
@ -504,6 +542,40 @@ void Translator::LogMissingOpcode(const GcnInst& inst) {
info.translation_failed = true;
}
void Translator::TranslateInstruction(const GcnInst& inst, const u32 pc) {
// Emit instructions for each category.
switch (inst.category) {
case InstCategory::DataShare:
EmitDataShare(inst);
break;
case InstCategory::VectorInterpolation:
EmitVectorInterpolation(inst);
break;
case InstCategory::ScalarMemory:
EmitScalarMemory(inst);
break;
case InstCategory::VectorMemory:
EmitVectorMemory(inst);
break;
case InstCategory::Export:
EmitExport(inst);
break;
case InstCategory::FlowControl:
EmitFlowControl(pc, inst);
break;
case InstCategory::ScalarALU:
EmitScalarAlu(inst);
break;
case InstCategory::VectorALU:
EmitVectorAlu(inst);
break;
case InstCategory::DebugProfile:
break;
default:
UNREACHABLE();
}
}
void Translate(IR::Block* block, u32 pc, std::span<const GcnInst> inst_list, Info& info,
const RuntimeInfo& runtime_info, const Profile& profile) {
if (inst_list.empty()) {
@ -521,37 +593,7 @@ void Translate(IR::Block* block, u32 pc, std::span<const GcnInst> inst_list, Inf
continue;
}
// Emit instructions for each category.
switch (inst.category) {
case InstCategory::DataShare:
translator.EmitDataShare(inst);
break;
case InstCategory::VectorInterpolation:
translator.EmitVectorInterpolation(inst);
break;
case InstCategory::ScalarMemory:
translator.EmitScalarMemory(inst);
break;
case InstCategory::VectorMemory:
translator.EmitVectorMemory(inst);
break;
case InstCategory::Export:
translator.EmitExport(inst);
break;
case InstCategory::FlowControl:
translator.EmitFlowControl(pc, inst);
break;
case InstCategory::ScalarALU:
translator.EmitScalarAlu(inst);
break;
case InstCategory::VectorALU:
translator.EmitVectorAlu(inst);
break;
case InstCategory::DebugProfile:
break;
default:
UNREACHABLE();
}
translator.TranslateInstruction(inst, pc);
}
}

View File

@ -58,6 +58,8 @@ public:
explicit Translator(IR::Block* block_, Info& info, const RuntimeInfo& runtime_info,
const Profile& profile);
void TranslateInstruction(const GcnInst& inst, u32 pc);
// Instruction categories
void EmitPrologue();
void EmitFetch(const GcnInst& inst);
@ -309,7 +311,7 @@ private:
const IR::F32& x_res, const IR::F32& y_res, const IR::F32& z_res);
void ExportMrtValue(IR::Attribute attribute, u32 comp, const IR::F32& value,
const FragmentRuntimeInfo::PsColorBuffer& color_buffer);
const PsColorBuffer& color_buffer);
void ExportMrtCompressed(IR::Attribute attribute, u32 idx, const IR::U32& value);
void ExportMrtUncompressed(IR::Attribute attribute, u32 comp, const IR::F32& value);
void ExportCompressed(IR::Attribute attribute, u32 idx, const IR::U32& value);
@ -317,6 +319,8 @@ private:
void LogMissingOpcode(const GcnInst& inst);
IR::VectorReg GetScratchVgpr(u32 offset);
private:
IR::IREmitter ir;
Info& info;

View File

@ -195,6 +195,7 @@ void Translator::BUFFER_LOAD(u32 num_dwords, bool is_typed, const GcnInst& inst)
buffer_info.inst_offset.Assign(mubuf.offset);
buffer_info.globally_coherent.Assign(mubuf.glc);
buffer_info.system_coherent.Assign(mubuf.slc);
buffer_info.typed.Assign(is_typed);
if (is_typed) {
const auto& mtbuf = inst.control.mtbuf;
const auto dmft = static_cast<AmdGpu::DataFormat>(mtbuf.dfmt);
@ -241,6 +242,7 @@ void Translator::BUFFER_LOAD_FORMAT(u32 num_dwords, const GcnInst& inst) {
buffer_info.inst_offset.Assign(mubuf.offset);
buffer_info.globally_coherent.Assign(mubuf.glc);
buffer_info.system_coherent.Assign(mubuf.slc);
buffer_info.typed.Assign(true);
const IR::Value handle =
ir.CompositeConstruct(ir.GetScalarReg(sharp), ir.GetScalarReg(sharp + 1),
@ -283,6 +285,7 @@ void Translator::BUFFER_STORE(u32 num_dwords, bool is_typed, const GcnInst& inst
buffer_info.inst_offset.Assign(mubuf.offset);
buffer_info.globally_coherent.Assign(mubuf.glc);
buffer_info.system_coherent.Assign(mubuf.slc);
buffer_info.typed.Assign(is_typed);
if (is_typed) {
const auto& mtbuf = inst.control.mtbuf;
const auto dmft = static_cast<AmdGpu::DataFormat>(mtbuf.dfmt);
@ -339,6 +342,7 @@ void Translator::BUFFER_STORE_FORMAT(u32 num_dwords, const GcnInst& inst) {
buffer_info.inst_offset.Assign(mubuf.offset);
buffer_info.globally_coherent.Assign(mubuf.glc);
buffer_info.system_coherent.Assign(mubuf.slc);
buffer_info.typed.Assign(true);
const IR::VectorReg src_reg{inst.src[1].code};

View File

@ -2,7 +2,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <algorithm>
#include <span>
#include <vector>
#include <boost/container/small_vector.hpp>
@ -19,12 +18,15 @@
#include "shader_recompiler/params.h"
#include "shader_recompiler/profile.h"
#include "shader_recompiler/runtime_info.h"
#include "video_core/amdgpu/liverpool.h"
#include "video_core/amdgpu/resource.h"
namespace Shader {
static constexpr size_t NumUserDataRegs = 16;
static constexpr size_t NumImages = 64;
static constexpr size_t NumBuffers = 32;
static constexpr size_t NumSamplers = 16;
static constexpr size_t NumFMasks = 8;
enum class TextureType : u32 {
Color1D,
@ -37,26 +39,35 @@ enum class TextureType : u32 {
};
constexpr u32 NUM_TEXTURE_TYPES = 7;
enum class BufferType : u32 {
Guest,
ReadConstUbo,
GdsBuffer,
SharedMemory,
};
struct Info;
struct BufferResource {
u32 sharp_idx;
IR::Type used_types;
AmdGpu::Buffer inline_cbuf;
bool is_gds_buffer{};
bool is_instance_data{};
BufferType buffer_type;
u8 instance_attrib{};
bool is_written{};
bool is_formatted{};
[[nodiscard]] bool IsStorage(const AmdGpu::Buffer& buffer,
const Profile& profile) const noexcept {
return buffer.GetSize() > profile.max_ubo_size || is_written || is_gds_buffer;
bool IsSpecial() const noexcept {
return buffer_type != BufferType::Guest;
}
bool IsStorage(const AmdGpu::Buffer& buffer, const Profile& profile) const noexcept {
return buffer.GetSize() > profile.max_ubo_size || is_written;
}
[[nodiscard]] constexpr AmdGpu::Buffer GetSharp(const Info& info) const noexcept;
};
using BufferResourceList = boost::container::small_vector<BufferResource, 16>;
using BufferResourceList = boost::container::small_vector<BufferResource, NumBuffers>;
struct ImageResource {
u32 sharp_idx;
@ -67,7 +78,7 @@ struct ImageResource {
[[nodiscard]] constexpr AmdGpu::Image GetSharp(const Info& info) const noexcept;
};
using ImageResourceList = boost::container::small_vector<ImageResource, 16>;
using ImageResourceList = boost::container::small_vector<ImageResource, NumImages>;
struct SamplerResource {
u32 sharp_idx;
@ -77,31 +88,33 @@ struct SamplerResource {
constexpr AmdGpu::Sampler GetSharp(const Info& info) const noexcept;
};
using SamplerResourceList = boost::container::small_vector<SamplerResource, 16>;
using SamplerResourceList = boost::container::small_vector<SamplerResource, NumSamplers>;
struct FMaskResource {
u32 sharp_idx;
constexpr AmdGpu::Image GetSharp(const Info& info) const noexcept;
};
using FMaskResourceList = boost::container::small_vector<FMaskResource, 16>;
using FMaskResourceList = boost::container::small_vector<FMaskResource, NumFMasks>;
struct PushData {
static constexpr u32 BufOffsetIndex = 2;
static constexpr u32 UdRegsIndex = 4;
static constexpr u32 XOffsetIndex = 8;
static constexpr u32 YOffsetIndex = 9;
static constexpr u32 XScaleIndex = 10;
static constexpr u32 YScaleIndex = 11;
static constexpr u32 Step0Index = 0;
static constexpr u32 Step1Index = 1;
static constexpr u32 XOffsetIndex = 2;
static constexpr u32 YOffsetIndex = 3;
static constexpr u32 XScaleIndex = 4;
static constexpr u32 YScaleIndex = 5;
static constexpr u32 UdRegsIndex = 6;
static constexpr u32 BufOffsetIndex = UdRegsIndex + NumUserDataRegs / 4;
u32 step0;
u32 step1;
std::array<u8, 32> buf_offsets;
std::array<u32, NumUserDataRegs> ud_regs;
float xoffset;
float yoffset;
float xscale;
float yscale;
std::array<u32, NumUserDataRegs> ud_regs;
std::array<u8, NumBuffers> buf_offsets;
void AddOffset(u32 binding, u32 offset) {
ASSERT(offset < 256 && binding < buf_offsets.size());
@ -193,10 +206,8 @@ struct Info {
bool uses_unpack_10_11_11{};
bool stores_tess_level_outer{};
bool stores_tess_level_inner{};
bool translation_failed{}; // indicates that shader has unsupported instructions
bool has_emulated_shared_memory{};
bool translation_failed{};
bool has_readconst{};
u32 shared_memory_size{};
u8 mrt_mask{0u};
bool has_fetch_shader{false};
u32 fetch_shader_sgpr_base{0u};
@ -233,10 +244,8 @@ struct Info {
}
void AddBindings(Backend::Bindings& bnd) const {
const auto total_buffers =
buffers.size() + (has_readconst ? 1 : 0) + (has_emulated_shared_memory ? 1 : 0);
bnd.buffer += total_buffers;
bnd.unified += total_buffers + images.size() + samplers.size();
bnd.buffer += buffers.size();
bnd.unified += buffers.size() + images.size() + samplers.size();
bnd.user_data += ud_mask.NumRegs();
}
@ -283,14 +292,3 @@ constexpr AmdGpu::Image FMaskResource::GetSharp(const Info& info) const noexcept
}
} // namespace Shader
template <>
struct fmt::formatter<Shader::Stage> {
constexpr auto parse(format_parse_context& ctx) {
return ctx.begin();
}
auto format(const Shader::Stage stage, format_context& ctx) const {
constexpr static std::array names = {"fs", "vs", "gs", "es", "hs", "ls", "cs"};
return fmt::format_to(ctx.out(), "{}", names[static_cast<size_t>(stage)]);
}
};

View File

@ -69,16 +69,17 @@ enum class Attribute : u64 {
SampleIndex = 72,
GlobalInvocationId = 73,
WorkgroupId = 74,
LocalInvocationId = 75,
LocalInvocationIndex = 76,
FragCoord = 77,
InstanceId0 = 78, // step rate 0
InstanceId1 = 79, // step rate 1
InvocationId = 80, // TCS id in output patch and instanced geometry shader id
PatchVertices = 81,
TessellationEvaluationPointU = 82,
TessellationEvaluationPointV = 83,
PackedHullInvocationInfo = 84, // contains patch id within the VGT and invocation ID
WorkgroupIndex = 75,
LocalInvocationId = 76,
LocalInvocationIndex = 77,
FragCoord = 78,
InstanceId0 = 79, // step rate 0
InstanceId1 = 80, // step rate 1
InvocationId = 81, // TCS id in output patch and instanced geometry shader id
PatchVertices = 82,
TessellationEvaluationPointU = 83,
TessellationEvaluationPointV = 84,
PackedHullInvocationInfo = 85, // contains patch id within the VGT and invocation ID
Max,
};

View File

@ -14,8 +14,8 @@ namespace Shader::IR {
// Use typename Instruction so the function can be used to return either const or mutable
// Insts depending on the context.
template <typename Instruction, typename Pred>
auto BreadthFirstSearch(Instruction* inst,
Pred&& pred) -> std::invoke_result_t<Pred, Instruction*> {
auto BreadthFirstSearch(Instruction* inst, Pred&& pred)
-> std::invoke_result_t<Pred, Instruction*> {
// Most often case the instruction is the desired already.
if (std::optional result = pred(inst)) {
return result;
@ -53,8 +53,8 @@ auto BreadthFirstSearch(Instruction* inst,
}
template <typename Pred>
auto BreadthFirstSearch(const Value& value,
Pred&& pred) -> std::invoke_result_t<Pred, const Inst*> {
auto BreadthFirstSearch(const Value& value, Pred&& pred)
-> std::invoke_result_t<Pred, const Inst*> {
if (value.IsImmediate()) {
// Nothing to do with immediates
return std::nullopt;

View File

@ -20,12 +20,14 @@ void FlattenExtendedUserdataPass(IR::Program& program);
void ResourceTrackingPass(IR::Program& program);
void CollectShaderInfoPass(IR::Program& program);
void LowerBufferFormatToRaw(IR::Program& program);
void LowerSharedMemToRegisters(IR::Program& program, const RuntimeInfo& runtime_info);
void RingAccessElimination(const IR::Program& program, const RuntimeInfo& runtime_info,
Stage stage);
void TessellationPreprocess(IR::Program& program, RuntimeInfo& runtime_info);
void HullShaderTransform(IR::Program& program, RuntimeInfo& runtime_info);
void DomainShaderTransform(IR::Program& program, RuntimeInfo& runtime_info);
void SharedMemoryBarrierPass(IR::Program& program, const Profile& profile);
void SharedMemoryBarrierPass(IR::Program& program, const RuntimeInfo& runtime_info,
const Profile& profile);
void SharedMemoryToStoragePass(IR::Program& program, const RuntimeInfo& runtime_info,
const Profile& profile);
} // namespace Shader::Optimization

View File

@ -1,81 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <unordered_map>
#include "shader_recompiler/ir/ir_emitter.h"
#include "shader_recompiler/ir/program.h"
namespace Shader::Optimization {
static bool IsSharedMemoryInst(const IR::Inst& inst) {
const auto opcode = inst.GetOpcode();
return opcode == IR::Opcode::LoadSharedU32 || opcode == IR::Opcode::LoadSharedU64 ||
opcode == IR::Opcode::WriteSharedU32 || opcode == IR::Opcode::WriteSharedU64;
}
static u32 GetSharedMemImmOffset(const IR::Inst& inst) {
const auto* address = inst.Arg(0).InstRecursive();
ASSERT(address->GetOpcode() == IR::Opcode::IAdd32);
const auto ir_offset = address->Arg(1);
ASSERT_MSG(ir_offset.IsImmediate());
const auto offset = ir_offset.U32();
// Typical usage is the compiler spilling registers into shared memory, with 256 bytes between
// each register to account for 4 bytes per register times 64 threads per group. Ensure that
// this assumption holds, as if it does not this approach may need to be revised.
ASSERT_MSG(offset % 256 == 0, "Unexpected shared memory offset alignment: {}", offset);
return offset;
}
static void ConvertSharedMemToVgpr(IR::IREmitter& ir, IR::Inst& inst, const IR::VectorReg vgpr) {
switch (inst.GetOpcode()) {
case IR::Opcode::LoadSharedU32:
inst.ReplaceUsesWithAndRemove(ir.GetVectorReg(vgpr));
break;
case IR::Opcode::LoadSharedU64:
inst.ReplaceUsesWithAndRemove(
ir.CompositeConstruct(ir.GetVectorReg(vgpr), ir.GetVectorReg(vgpr + 1)));
break;
case IR::Opcode::WriteSharedU32:
ir.SetVectorReg(vgpr, IR::U32{inst.Arg(1)});
inst.Invalidate();
break;
case IR::Opcode::WriteSharedU64: {
const auto value = inst.Arg(1);
ir.SetVectorReg(vgpr, IR::U32{ir.CompositeExtract(value, 0)});
ir.SetVectorReg(vgpr, IR::U32{ir.CompositeExtract(value, 1)});
inst.Invalidate();
break;
}
default:
UNREACHABLE_MSG("Unknown shared memory opcode: {}", inst.GetOpcode());
}
}
void LowerSharedMemToRegisters(IR::Program& program, const RuntimeInfo& runtime_info) {
u32 next_vgpr_num = runtime_info.num_allocated_vgprs;
std::unordered_map<u32, IR::VectorReg> vgpr_map;
const auto get_vgpr = [&next_vgpr_num, &vgpr_map](const u32 offset) {
const auto [it, is_new] = vgpr_map.try_emplace(offset);
if (is_new) {
ASSERT_MSG(next_vgpr_num < 256, "Out of VGPRs");
const auto new_vgpr = static_cast<IR::VectorReg>(next_vgpr_num++);
it->second = new_vgpr;
}
return it->second;
};
for (IR::Block* const block : program.blocks) {
for (IR::Inst& inst : block->Instructions()) {
if (!IsSharedMemoryInst(inst)) {
continue;
}
const auto offset = GetSharedMemImmOffset(inst);
const auto vgpr = get_vgpr(offset);
IR::IREmitter ir{*block, IR::Block::InstructionList::s_iterator_to(inst)};
ConvertSharedMemToVgpr(ir, inst, vgpr);
}
}
}
} // namespace Shader::Optimization

View File

@ -78,8 +78,21 @@ bool IsDataRingInstruction(const IR::Inst& inst) {
}
IR::Type BufferDataType(const IR::Inst& inst, AmdGpu::NumberFormat num_format) {
switch (inst.GetOpcode()) {
case IR::Opcode::LoadBufferU8:
case IR::Opcode::StoreBufferU8:
return IR::Type::U8;
case IR::Opcode::LoadBufferU16:
case IR::Opcode::StoreBufferU16:
return IR::Type::U16;
case IR::Opcode::LoadBufferFormatF32:
case IR::Opcode::StoreBufferFormatF32:
// Formatted buffer loads can use a variety of types.
return IR::Type::U32 | IR::Type::F32 | IR::Type::U16 | IR::Type::U8;
default:
return IR::Type::U32;
}
}
bool IsImageAtomicInstruction(const IR::Inst& inst) {
switch (inst.GetOpcode()) {
@ -121,11 +134,9 @@ public:
u32 Add(const BufferResource& desc) {
const u32 index{Add(buffer_resources, desc, [&desc](const auto& existing) {
// Only one GDS binding can exist.
if (desc.is_gds_buffer && existing.is_gds_buffer) {
return true;
}
return desc.sharp_idx == existing.sharp_idx && desc.inline_cbuf == existing.inline_cbuf;
return desc.sharp_idx == existing.sharp_idx &&
desc.inline_cbuf == existing.inline_cbuf &&
desc.buffer_type == existing.buffer_type;
})};
auto& buffer = buffer_resources[index];
buffer.used_types |= desc.used_types;
@ -272,6 +283,7 @@ s32 TryHandleInlineCbuf(IR::Inst& inst, Info& info, Descriptors& descriptors,
.sharp_idx = std::numeric_limits<u32>::max(),
.used_types = BufferDataType(inst, cbuf.GetNumberFmt()),
.inline_cbuf = cbuf,
.buffer_type = BufferType::Guest,
});
}
@ -286,6 +298,7 @@ void PatchBufferSharp(IR::Block& block, IR::Inst& inst, Info& info, Descriptors&
binding = descriptors.Add(BufferResource{
.sharp_idx = sharp,
.used_types = BufferDataType(inst, buffer.GetNumberFmt()),
.buffer_type = BufferType::Guest,
.is_written = IsBufferStore(inst),
.is_formatted = inst.GetOpcode() == IR::Opcode::LoadBufferFormatF32 ||
inst.GetOpcode() == IR::Opcode::StoreBufferFormatF32,
@ -402,13 +415,10 @@ void PatchImageSharp(IR::Block& block, IR::Inst& inst, Info& info, Descriptors&
}
void PatchDataRingAccess(IR::Block& block, IR::Inst& inst, Info& info, Descriptors& descriptors) {
// Insert gds binding in the shader if it doesn't exist already.
// The buffer is used for append/consume counters.
constexpr static AmdGpu::Buffer GdsSharp{.base_address = 1};
const u32 binding = descriptors.Add(BufferResource{
.used_types = IR::Type::U32,
.inline_cbuf = GdsSharp,
.is_gds_buffer = true,
.inline_cbuf = AmdGpu::Buffer::Null(),
.buffer_type = BufferType::GdsBuffer,
.is_written = true,
});
@ -420,12 +430,12 @@ void PatchDataRingAccess(IR::Block& block, IR::Inst& inst, Info& info, Descripto
};
// Attempt to deduce the GDS address of counter at compile time.
const u32 gds_addr = [&] {
u32 gds_addr = 0;
const IR::Value& gds_offset = inst.Arg(0);
if (gds_offset.IsImmediate()) {
// Nothing to do, offset is known.
return gds_offset.U32() & 0xFFFF;
}
gds_addr = gds_offset.U32() & 0xFFFF;
} else {
const auto result = IR::BreadthFirstSearch(&inst, pred);
ASSERT_MSG(result, "Unable to track M0 source");
@ -436,8 +446,8 @@ void PatchDataRingAccess(IR::Block& block, IR::Inst& inst, Info& info, Descripto
if (prod->GetOpcode() == IR::Opcode::IAdd32) {
m0_val += prod->Arg(1).U32();
}
return m0_val & 0xFFFF;
}();
gds_addr = m0_val & 0xFFFF;
}
// Patch instruction.
IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)};

View File

@ -74,7 +74,14 @@ void Visit(Info& info, const IR::Inst& inst) {
info.uses_lane_id = true;
break;
case IR::Opcode::ReadConst:
if (!info.has_readconst) {
info.buffers.push_back({
.used_types = IR::Type::U32,
.inline_cbuf = AmdGpu::Buffer::Null(),
.buffer_type = BufferType::ReadConstUbo,
});
info.has_readconst = true;
}
break;
case IR::Opcode::PackUfloat10_11_11:
info.uses_pack_10_11_11 = true;
@ -88,10 +95,9 @@ void Visit(Info& info, const IR::Inst& inst) {
}
void CollectShaderInfoPass(IR::Program& program) {
Info& info{program.info};
for (IR::Block* const block : program.post_order_blocks) {
for (IR::Inst& inst : block->Instructions()) {
Visit(info, inst);
Visit(program.info, inst);
}
}
}

View File

@ -8,37 +8,46 @@
namespace Shader::Optimization {
static bool IsLoadShared(const IR::Inst& inst) {
return inst.GetOpcode() == IR::Opcode::LoadSharedU32 ||
inst.GetOpcode() == IR::Opcode::LoadSharedU64;
}
static bool IsWriteShared(const IR::Inst& inst) {
return inst.GetOpcode() == IR::Opcode::WriteSharedU32 ||
inst.GetOpcode() == IR::Opcode::WriteSharedU64;
}
// Inserts barriers when a shared memory write and read occur in the same basic block.
static void EmitBarrierInBlock(IR::Block* block) {
// This is inteded to insert a barrier when shared memory write and read
// occur in the same basic block. Also checks if branch depth is zero as
// we don't want to insert barrier in potentially divergent code.
bool emit_barrier_on_write = false;
bool emit_barrier_on_read = false;
const auto emit_barrier = [block](bool& emit_cond, IR::Inst& inst) {
if (emit_cond) {
enum class BarrierAction : u32 {
None,
BarrierOnWrite,
BarrierOnRead,
};
BarrierAction action{};
for (IR::Inst& inst : block->Instructions()) {
if (IsLoadShared(inst)) {
if (action == BarrierAction::BarrierOnRead) {
IR::IREmitter ir{*block, IR::Block::InstructionList::s_iterator_to(inst)};
ir.Barrier();
emit_cond = false;
}
};
for (IR::Inst& inst : block->Instructions()) {
if (inst.GetOpcode() == IR::Opcode::LoadSharedU32 ||
inst.GetOpcode() == IR::Opcode::LoadSharedU64) {
emit_barrier(emit_barrier_on_read, inst);
emit_barrier_on_write = true;
action = BarrierAction::BarrierOnWrite;
continue;
}
if (inst.GetOpcode() == IR::Opcode::WriteSharedU32 ||
inst.GetOpcode() == IR::Opcode::WriteSharedU64) {
emit_barrier(emit_barrier_on_write, inst);
emit_barrier_on_read = true;
if (IsWriteShared(inst)) {
if (action == BarrierAction::BarrierOnWrite) {
IR::IREmitter ir{*block, IR::Block::InstructionList::s_iterator_to(inst)};
ir.Barrier();
}
action = BarrierAction::BarrierOnRead;
}
}
}
// Inserts a barrier after divergent conditional blocks to avoid undefined
// behavior when some threads write and others read from shared memory.
static void EmitBarrierInMergeBlock(const IR::AbstractSyntaxNode::Data& data) {
// Insert a barrier after divergent conditional blocks.
// This avoids potential softlocks and crashes when some threads
// initialize shared memory and others read from it.
const IR::U1 cond = data.if_node.cond;
const auto insert_barrier =
IR::BreadthFirstSearch(cond, [](IR::Inst* inst) -> std::optional<bool> {
@ -56,8 +65,21 @@ static void EmitBarrierInMergeBlock(const IR::AbstractSyntaxNode::Data& data) {
}
}
void SharedMemoryBarrierPass(IR::Program& program, const Profile& profile) {
if (!program.info.uses_shared || !profile.needs_lds_barriers) {
static constexpr u32 GcnSubgroupSize = 64;
void SharedMemoryBarrierPass(IR::Program& program, const RuntimeInfo& runtime_info,
const Profile& profile) {
if (program.info.stage != Stage::Compute) {
return;
}
const auto& cs_info = runtime_info.cs_info;
const u32 shared_memory_size = cs_info.shared_memory_size;
const u32 threadgroup_size =
cs_info.workgroup_size[0] * cs_info.workgroup_size[1] * cs_info.workgroup_size[2];
// The compiler can only omit barriers when the local workgroup size is the same as the HW
// subgroup.
if (shared_memory_size == 0 || threadgroup_size != GcnSubgroupSize ||
!profile.needs_lds_barriers) {
return;
}
using Type = IR::AbstractSyntaxNode::Type;
@ -67,6 +89,8 @@ void SharedMemoryBarrierPass(IR::Program& program, const Profile& profile) {
--branch_depth;
continue;
}
// Check if branch depth is zero, we don't want to insert barrier in potentially divergent
// code.
if (node.type == Type::If && branch_depth++ == 0) {
EmitBarrierInMergeBlock(node.data);
continue;

View File

@ -0,0 +1,117 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "shader_recompiler/ir/ir_emitter.h"
#include "shader_recompiler/ir/program.h"
#include "shader_recompiler/profile.h"
namespace Shader::Optimization {
static bool IsSharedAccess(const IR::Inst& inst) {
const auto opcode = inst.GetOpcode();
switch (opcode) {
case IR::Opcode::LoadSharedU32:
case IR::Opcode::LoadSharedU64:
case IR::Opcode::WriteSharedU32:
case IR::Opcode::WriteSharedU64:
case IR::Opcode::SharedAtomicAnd32:
case IR::Opcode::SharedAtomicIAdd32:
case IR::Opcode::SharedAtomicOr32:
case IR::Opcode::SharedAtomicSMax32:
case IR::Opcode::SharedAtomicUMax32:
case IR::Opcode::SharedAtomicSMin32:
case IR::Opcode::SharedAtomicUMin32:
case IR::Opcode::SharedAtomicXor32:
return true;
default:
return false;
}
}
void SharedMemoryToStoragePass(IR::Program& program, const RuntimeInfo& runtime_info,
const Profile& profile) {
if (program.info.stage != Stage::Compute) {
return;
}
// Only perform the transform if the host shared memory is insufficient.
const u32 shared_memory_size = runtime_info.cs_info.shared_memory_size;
if (shared_memory_size <= profile.max_shared_memory_size) {
return;
}
// Add buffer binding for shared memory storage buffer.
const u32 binding = static_cast<u32>(program.info.buffers.size());
program.info.buffers.push_back({
.used_types = IR::Type::U32,
.inline_cbuf = AmdGpu::Buffer::Null(),
.buffer_type = BufferType::SharedMemory,
.is_written = true,
});
for (IR::Block* const block : program.blocks) {
for (IR::Inst& inst : block->Instructions()) {
if (!IsSharedAccess(inst)) {
continue;
}
IR::IREmitter ir{*block, IR::Block::InstructionList::s_iterator_to(inst)};
const IR::U32 handle = ir.Imm32(binding);
// Replace shared atomics first
switch (inst.GetOpcode()) {
case IR::Opcode::SharedAtomicAnd32:
inst.ReplaceUsesWithAndRemove(
ir.BufferAtomicAnd(handle, inst.Arg(0), inst.Arg(1), {}));
continue;
case IR::Opcode::SharedAtomicIAdd32:
inst.ReplaceUsesWithAndRemove(
ir.BufferAtomicIAdd(handle, inst.Arg(0), inst.Arg(1), {}));
continue;
case IR::Opcode::SharedAtomicOr32:
inst.ReplaceUsesWithAndRemove(
ir.BufferAtomicOr(handle, inst.Arg(0), inst.Arg(1), {}));
continue;
case IR::Opcode::SharedAtomicSMax32:
case IR::Opcode::SharedAtomicUMax32: {
const bool is_signed = inst.GetOpcode() == IR::Opcode::SharedAtomicSMax32;
inst.ReplaceUsesWithAndRemove(
ir.BufferAtomicIMax(handle, inst.Arg(0), inst.Arg(1), is_signed, {}));
continue;
}
case IR::Opcode::SharedAtomicSMin32:
case IR::Opcode::SharedAtomicUMin32: {
const bool is_signed = inst.GetOpcode() == IR::Opcode::SharedAtomicSMin32;
inst.ReplaceUsesWithAndRemove(
ir.BufferAtomicIMin(handle, inst.Arg(0), inst.Arg(1), is_signed, {}));
continue;
}
case IR::Opcode::SharedAtomicXor32:
inst.ReplaceUsesWithAndRemove(
ir.BufferAtomicXor(handle, inst.Arg(0), inst.Arg(1), {}));
continue;
default:
break;
}
// Replace shared operations.
const IR::U32 offset = ir.IMul(ir.GetAttributeU32(IR::Attribute::WorkgroupIndex),
ir.Imm32(shared_memory_size));
const IR::U32 address = ir.IAdd(IR::U32{inst.Arg(0)}, offset);
switch (inst.GetOpcode()) {
case IR::Opcode::LoadSharedU32:
inst.ReplaceUsesWithAndRemove(ir.LoadBufferU32(1, handle, address, {}));
break;
case IR::Opcode::LoadSharedU64:
inst.ReplaceUsesWithAndRemove(ir.LoadBufferU32(2, handle, address, {}));
break;
case IR::Opcode::WriteSharedU32:
ir.StoreBufferU32(1, handle, address, inst.Arg(1), {});
inst.Invalidate();
break;
case IR::Opcode::WriteSharedU64:
ir.StoreBufferU32(2, handle, address, inst.Arg(1), {});
inst.Invalidate();
break;
default:
break;
}
}
}
}
} // namespace Shader::Optimization

View File

@ -51,6 +51,7 @@ union BufferInstInfo {
BitField<2, 12, u32> inst_offset;
BitField<14, 1, u32> system_coherent;
BitField<15, 1, u32> globally_coherent;
BitField<16, 1, u32> typed;
};
enum class ScalarReg : u32 {

View File

@ -25,6 +25,7 @@ struct Profile {
bool support_legacy_vertex_attributes{};
bool supports_image_load_store_lod{};
bool supports_native_cube_calc{};
bool supports_robust_buffer_access{};
bool has_broken_spirv_clamp{};
bool lower_left_origin_mode{};
bool needs_manual_interpolation{};

View File

@ -65,10 +65,6 @@ IR::Program TranslateProgram(std::span<const u32> code, Pools& pools, Info& info
// Run optimization passes
const auto stage = program.info.stage;
if (stage == Stage::Fragment) {
// Before SSA pass, as it will rewrite to VGPR load/store.
Shader::Optimization::LowerSharedMemToRegisters(program, runtime_info);
}
Shader::Optimization::SsaRewritePass(program.post_order_blocks);
Shader::Optimization::IdentityRemovalPass(program.blocks);
if (info.l_stage == LogicalStage::TessellationControl) {
@ -90,11 +86,12 @@ IR::Program TranslateProgram(std::span<const u32> code, Pools& pools, Info& info
Shader::Optimization::FlattenExtendedUserdataPass(program);
Shader::Optimization::ResourceTrackingPass(program);
Shader::Optimization::LowerBufferFormatToRaw(program);
Shader::Optimization::SharedMemoryToStoragePass(program, runtime_info, profile);
Shader::Optimization::SharedMemoryBarrierPass(program, runtime_info, profile);
Shader::Optimization::IdentityRemovalPass(program.blocks);
Shader::Optimization::DeadCodeEliminationPass(program);
Shader::Optimization::ConstantPropagationPass(program.post_order_blocks);
Shader::Optimization::CollectShaderInfoPass(program);
Shader::Optimization::SharedMemoryBarrierPass(program, profile);
return program;
}

View File

@ -167,6 +167,17 @@ enum class MrtSwizzle : u8 {
};
static constexpr u32 MaxColorBuffers = 8;
struct PsColorBuffer {
AmdGpu::NumberFormat num_format : 4;
AmdGpu::NumberConversion num_conversion : 2;
AmdGpu::Liverpool::ShaderExportFormat export_format : 4;
u32 needs_unorm_fixup : 1;
u32 pad : 21;
AmdGpu::CompMapping swizzle;
auto operator<=>(const PsColorBuffer&) const noexcept = default;
};
struct FragmentRuntimeInfo {
struct PsInput {
u8 param_index;
@ -184,15 +195,6 @@ struct FragmentRuntimeInfo {
AmdGpu::Liverpool::PsInput addr_flags;
u32 num_inputs;
std::array<PsInput, 32> inputs;
struct PsColorBuffer {
AmdGpu::NumberFormat num_format;
AmdGpu::NumberConversion num_conversion;
AmdGpu::CompMapping swizzle;
AmdGpu::Liverpool::ShaderExportFormat export_format;
bool needs_unorm_fixup;
auto operator<=>(const PsColorBuffer&) const noexcept = default;
};
std::array<PsColorBuffer, MaxColorBuffers> color_buffers;
bool operator==(const FragmentRuntimeInfo& other) const noexcept {
@ -264,3 +266,14 @@ struct RuntimeInfo {
};
} // namespace Shader
template <>
struct fmt::formatter<Shader::Stage> {
constexpr auto parse(format_parse_context& ctx) {
return ctx.begin();
}
auto format(const Shader::Stage stage, format_context& ctx) const {
constexpr static std::array names = {"fs", "vs", "gs", "es", "hs", "ls", "cs"};
return fmt::format_to(ctx.out(), "{}", names[static_cast<size_t>(stage)]);
}
};

View File

@ -98,12 +98,6 @@ struct StageSpecialization {
});
}
u32 binding{};
if (info->has_emulated_shared_memory) {
binding++;
}
if (info->has_readconst) {
binding++;
}
ForEachSharp(binding, buffers, info->buffers,
[profile_](auto& spec, const auto& desc, AmdGpu::Buffer sharp) {
spec.stride = sharp.GetStride();
@ -195,18 +189,6 @@ struct StageSpecialization {
}
}
u32 binding{};
if (info->has_emulated_shared_memory != other.info->has_emulated_shared_memory) {
return false;
}
if (info->has_readconst != other.info->has_readconst) {
return false;
}
if (info->has_emulated_shared_memory) {
binding++;
}
if (info->has_readconst) {
binding++;
}
for (u32 i = 0; i < buffers.size(); i++) {
if (other.bitset[binding++] && buffers[i] != other.buffers[i]) {
return false;

View File

@ -197,6 +197,10 @@ struct Liverpool {
return settings.lds_dwords.Value() * 128 * 4;
}
u32 NumWorkgroups() const noexcept {
return dim_x * dim_y * dim_z;
}
bool IsTgidEnabled(u32 i) const noexcept {
return (settings.tgid_enable.Value() >> i) & 1;
}

View File

@ -31,6 +31,12 @@ struct Buffer {
u32 _padding1 : 6;
u32 type : 2; // overlaps with T# type, so should be 0 for buffer
static constexpr Buffer Null() {
Buffer buffer{};
buffer.base_address = 1;
return buffer;
}
bool Valid() const {
return type == 0u;
}

View File

@ -183,7 +183,7 @@ enum class NumberFormat : u32 {
Ubscaled = 13,
};
enum class CompSwizzle : u32 {
enum class CompSwizzle : u8 {
Zero = 0,
One = 1,
Red = 4,
@ -193,10 +193,10 @@ enum class CompSwizzle : u32 {
};
enum class NumberConversion : u32 {
None,
UintToUscaled,
SintToSscaled,
UnormToUbnorm,
None = 0,
UintToUscaled = 1,
SintToSscaled = 2,
UnormToUbnorm = 3,
};
struct CompMapping {

View File

@ -168,7 +168,7 @@ public:
void Commit();
/// Maps and commits a memory region with user provided data
u64 Copy(VAddr src, size_t size, size_t alignment = 0) {
u64 Copy(auto src, size_t size, size_t alignment = 0) {
const auto [data, offset] = Map(size, alignment);
std::memcpy(data, reinterpret_cast<const void*>(src), size);
Commit();

View File

@ -5,11 +5,8 @@
#include "common/alignment.h"
#include "common/scope_exit.h"
#include "common/types.h"
#include "shader_recompiler/frontend/fetch_shader.h"
#include "shader_recompiler/info.h"
#include "video_core/amdgpu/liverpool.h"
#include "video_core/buffer_cache/buffer_cache.h"
#include "video_core/renderer_vulkan/liverpool_to_vk.h"
#include "video_core/renderer_vulkan/vk_graphics_pipeline.h"
#include "video_core/renderer_vulkan/vk_instance.h"
#include "video_core/renderer_vulkan/vk_scheduler.h"
@ -18,8 +15,8 @@
namespace VideoCore {
static constexpr size_t DataShareBufferSize = 64_KB;
static constexpr size_t StagingBufferSize = 1_GB;
static constexpr size_t UboStreamBufferSize = 64_MB;
static constexpr size_t StagingBufferSize = 512_MB;
static constexpr size_t UboStreamBufferSize = 128_MB;
BufferCache::BufferCache(const Vulkan::Instance& instance_, Vulkan::Scheduler& scheduler_,
AmdGpu::Liverpool* liverpool_, TextureCache& texture_cache_,
@ -29,10 +26,8 @@ BufferCache::BufferCache(const Vulkan::Instance& instance_, Vulkan::Scheduler& s
staging_buffer{instance, scheduler, MemoryUsage::Upload, StagingBufferSize},
stream_buffer{instance, scheduler, MemoryUsage::Stream, UboStreamBufferSize},
gds_buffer{instance, scheduler, MemoryUsage::Stream, 0, AllFlags, DataShareBufferSize},
lds_buffer{instance, scheduler, MemoryUsage::DeviceLocal, 0, AllFlags, DataShareBufferSize},
memory_tracker{&tracker} {
Vulkan::SetObjectName(instance.GetDevice(), gds_buffer.Handle(), "GDS Buffer");
Vulkan::SetObjectName(instance.GetDevice(), lds_buffer.Handle(), "LDS Buffer");
// Ensure the first slot is used for the null buffer
const auto null_id =
@ -251,14 +246,6 @@ void BufferCache::InlineData(VAddr address, const void* value, u32 num_bytes, bo
});
}
std::pair<Buffer*, u32> BufferCache::ObtainHostUBO(std::span<const u32> data) {
static constexpr u64 StreamThreshold = CACHING_PAGESIZE;
ASSERT(data.size_bytes() <= StreamThreshold);
const u64 offset = stream_buffer.Copy(reinterpret_cast<VAddr>(data.data()), data.size_bytes(),
instance.UniformMinAlignment());
return {&stream_buffer, offset};
}
std::pair<Buffer*, u32> BufferCache::ObtainBuffer(VAddr device_addr, u32 size, bool is_written,
bool is_texel_buffer, BufferId buffer_id) {
// For small uniform buffers that have not been modified by gpu
@ -621,7 +608,11 @@ bool BufferCache::SynchronizeBufferFromImage(Buffer& buffer, VAddr device_addr,
return false;
}
Image& image = texture_cache.GetImage(image_id);
if (False(image.flags & ImageFlagBits::GpuModified)) {
// Only perform sync if image is:
// - GPU modified; otherwise there are no changes to synchronize.
// - Not CPU modified; otherwise we could overwrite CPU changes with stale GPU changes.
if (False(image.flags & ImageFlagBits::GpuModified) ||
True(image.flags & ImageFlagBits::CpuDirty)) {
return false;
}
ASSERT_MSG(device_addr == image.info.guest_address,

View File

@ -68,9 +68,9 @@ public:
return &gds_buffer;
}
/// Returns a pointer to LDS device local buffer.
[[nodiscard]] const Buffer* GetLdsBuffer() const noexcept {
return &lds_buffer;
/// Retrieves the host visible device local stream buffer.
[[nodiscard]] StreamBuffer& GetStreamBuffer() noexcept {
return stream_buffer;
}
/// Retrieves the buffer with the specified id.
@ -90,8 +90,6 @@ public:
/// Writes a value to GPU buffer.
void InlineData(VAddr address, const void* value, u32 num_bytes, bool is_gds);
[[nodiscard]] std::pair<Buffer*, u32> ObtainHostUBO(std::span<const u32> data);
/// Obtains a buffer for the specified region.
[[nodiscard]] std::pair<Buffer*, u32> ObtainBuffer(VAddr gpu_addr, u32 size, bool is_written,
bool is_texel_buffer = false,
@ -159,7 +157,6 @@ private:
StreamBuffer staging_buffer;
StreamBuffer stream_buffer;
Buffer gds_buffer;
Buffer lds_buffer;
std::shared_mutex mutex;
Common::SlotVector<Buffer> slot_buffers;
RangeSet gpu_modified_ranges;

View File

@ -3,11 +3,9 @@
#include <boost/container/small_vector.hpp>
#include "video_core/buffer_cache/buffer_cache.h"
#include "video_core/renderer_vulkan/vk_compute_pipeline.h"
#include "video_core/renderer_vulkan/vk_instance.h"
#include "video_core/renderer_vulkan/vk_scheduler.h"
#include "video_core/texture_cache/texture_cache.h"
namespace Vulkan {
@ -29,23 +27,6 @@ ComputePipeline::ComputePipeline(const Instance& instance, Scheduler& scheduler,
u32 binding{};
boost::container::small_vector<vk::DescriptorSetLayoutBinding, 32> bindings;
if (info->has_emulated_shared_memory) {
bindings.push_back({
.binding = binding++,
.descriptorType = vk::DescriptorType::eStorageBuffer,
.descriptorCount = 1,
.stageFlags = vk::ShaderStageFlagBits::eCompute,
});
}
if (info->has_readconst) {
bindings.push_back({
.binding = binding++,
.descriptorType = vk::DescriptorType::eUniformBuffer,
.descriptorCount = 1,
.stageFlags = vk::ShaderStageFlagBits::eCompute,
});
}
for (const auto& buffer : info->buffers) {
const auto sharp = buffer.GetSharp(*info);
bindings.push_back({

View File

@ -7,23 +7,27 @@
#include <boost/container/static_vector.hpp>
#include "common/assert.h"
#include "common/io_file.h"
#include "shader_recompiler/backend/spirv/emit_spirv_quad_rect.h"
#include "shader_recompiler/frontend/fetch_shader.h"
#include "shader_recompiler/runtime_info.h"
#include "video_core/amdgpu/resource.h"
#include "video_core/buffer_cache/buffer_cache.h"
#include "video_core/renderer_vulkan/vk_graphics_pipeline.h"
#include "video_core/renderer_vulkan/vk_instance.h"
#include "video_core/renderer_vulkan/vk_pipeline_cache.h"
#include "video_core/renderer_vulkan/vk_scheduler.h"
#include "video_core/renderer_vulkan/vk_shader_util.h"
#include "video_core/texture_cache/texture_cache.h"
namespace Vulkan {
using Shader::Backend::SPIRV::AuxShaderType;
static constexpr std::array LogicalStageToStageBit = {
vk::ShaderStageFlagBits::eFragment,
vk::ShaderStageFlagBits::eTessellationControl,
vk::ShaderStageFlagBits::eTessellationEvaluation,
vk::ShaderStageFlagBits::eVertex,
vk::ShaderStageFlagBits::eGeometry,
vk::ShaderStageFlagBits::eCompute,
};
GraphicsPipeline::GraphicsPipeline(
const Instance& instance, Scheduler& scheduler, DescriptorHeap& desc_heap,
const Shader::Profile& profile, const GraphicsPipelineKey& key_,
@ -39,7 +43,7 @@ GraphicsPipeline::GraphicsPipeline(
const auto debug_str = GetDebugString();
const vk::PushConstantRange push_constants = {
.stageFlags = gp_stage_flags,
.stageFlags = AllGraphicsStageBits,
.offset = 0,
.size = sizeof(Shader::PushData),
};
@ -357,14 +361,7 @@ void GraphicsPipeline::BuildDescSetLayout() {
if (!stage) {
continue;
}
if (stage->has_readconst) {
bindings.push_back({
.binding = binding++,
.descriptorType = vk::DescriptorType::eUniformBuffer,
.descriptorCount = 1,
.stageFlags = gp_stage_flags,
});
}
const auto stage_bit = LogicalStageToStageBit[u32(stage->l_stage)];
for (const auto& buffer : stage->buffers) {
const auto sharp = buffer.GetSharp(*stage);
bindings.push_back({
@ -373,7 +370,7 @@ void GraphicsPipeline::BuildDescSetLayout() {
? vk::DescriptorType::eStorageBuffer
: vk::DescriptorType::eUniformBuffer,
.descriptorCount = 1,
.stageFlags = gp_stage_flags,
.stageFlags = stage_bit,
});
}
for (const auto& image : stage->images) {
@ -382,7 +379,7 @@ void GraphicsPipeline::BuildDescSetLayout() {
.descriptorType = image.is_written ? vk::DescriptorType::eStorageImage
: vk::DescriptorType::eSampledImage,
.descriptorCount = 1,
.stageFlags = gp_stage_flags,
.stageFlags = stage_bit,
});
}
for (const auto& sampler : stage->samplers) {
@ -390,7 +387,7 @@ void GraphicsPipeline::BuildDescSetLayout() {
.binding = binding++,
.descriptorType = vk::DescriptorType::eSampler,
.descriptorCount = 1,
.stageFlags = gp_stage_flags,
.stageFlags = stage_bit,
});
}
}

View File

@ -35,8 +35,7 @@ struct GraphicsPipelineKey {
std::array<size_t, MaxShaderStages> stage_hashes;
u32 num_color_attachments;
std::array<vk::Format, Liverpool::NumColorBuffers> color_formats;
std::array<Shader::FragmentRuntimeInfo::PsColorBuffer, Liverpool::NumColorBuffers>
color_buffers;
std::array<Shader::PsColorBuffer, Liverpool::NumColorBuffers> color_buffers;
vk::Format depth_format;
vk::Format stencil_format;

View File

@ -1,14 +1,11 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <ranges>
#include <span>
#include <boost/container/static_vector.hpp>
#include <fmt/format.h>
#include <fmt/ranges.h>
#include "common/assert.h"
#include "common/config.h"
#include "common/debug.h"
#include "sdl_window.h"
#include "video_core/renderer_vulkan/liverpool_to_vk.h"
@ -206,17 +203,13 @@ std::string Instance::GetDriverVersionName() {
}
bool Instance::CreateDevice() {
const vk::StructureChain feature_chain =
physical_device
.getFeatures2<vk::PhysicalDeviceFeatures2, vk::PhysicalDeviceVulkan12Features,
vk::PhysicalDeviceRobustness2FeaturesEXT,
const vk::StructureChain feature_chain = physical_device.getFeatures2<
vk::PhysicalDeviceFeatures2, vk::PhysicalDeviceVulkan11Features,
vk::PhysicalDeviceVulkan12Features, vk::PhysicalDeviceRobustness2FeaturesEXT,
vk::PhysicalDeviceExtendedDynamicState3FeaturesEXT,
vk::PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT,
vk::PhysicalDevicePortabilitySubsetFeaturesKHR>();
features = feature_chain.get().features;
#ifdef __APPLE__
portability_features = feature_chain.get<vk::PhysicalDevicePortabilitySubsetFeaturesKHR>();
#endif
const vk::StructureChain properties_chain = physical_device.getProperties2<
vk::PhysicalDeviceProperties2, vk::PhysicalDeviceVulkan11Properties,
@ -262,16 +255,19 @@ bool Instance::CreateDevice() {
add_extension(VK_KHR_SWAPCHAIN_EXTENSION_NAME);
add_extension(VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME);
add_extension(VK_EXT_DEPTH_RANGE_UNRESTRICTED_EXTENSION_NAME);
dynamic_color_write_mask = add_extension(VK_EXT_EXTENDED_DYNAMIC_STATE_3_EXTENSION_NAME);
if (dynamic_color_write_mask) {
dynamic_color_write_mask =
feature_chain.get<vk::PhysicalDeviceExtendedDynamicState3FeaturesEXT>()
.extendedDynamicState3ColorWriteMask;
dynamic_state_3 = add_extension(VK_EXT_EXTENDED_DYNAMIC_STATE_3_EXTENSION_NAME);
if (dynamic_state_3) {
dynamic_state_3_features =
feature_chain.get<vk::PhysicalDeviceExtendedDynamicState3FeaturesEXT>();
LOG_INFO(Render_Vulkan, "- extendedDynamicState3ColorWriteMask: {}",
dynamic_state_3_features.extendedDynamicState3ColorWriteMask);
}
null_descriptor = add_extension(VK_EXT_ROBUSTNESS_2_EXTENSION_NAME);
if (null_descriptor) {
null_descriptor =
feature_chain.get<vk::PhysicalDeviceRobustness2FeaturesEXT>().nullDescriptor;
robustness2 = add_extension(VK_EXT_ROBUSTNESS_2_EXTENSION_NAME);
if (robustness2) {
robustness2_features = feature_chain.get<vk::PhysicalDeviceRobustness2FeaturesEXT>();
LOG_INFO(Render_Vulkan, "- robustBufferAccess2: {}",
robustness2_features.robustBufferAccess2);
LOG_INFO(Render_Vulkan, "- nullDescriptor: {}", robustness2_features.nullDescriptor);
}
custom_border_color = add_extension(VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME);
depth_clip_control = add_extension(VK_EXT_DEPTH_CLIP_CONTROL_EXTENSION_NAME);
@ -288,6 +284,9 @@ bool Instance::CreateDevice() {
#ifdef __APPLE__
// Required by Vulkan spec if supported.
portability_subset = add_extension(VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME);
if (portability_subset) {
portability_features = feature_chain.get<vk::PhysicalDevicePortabilitySubsetFeaturesKHR>();
}
#endif
const auto family_properties = physical_device.getQueueFamilyProperties();
@ -319,6 +318,7 @@ bool Instance::CreateDevice() {
const auto topology_list_restart_features =
feature_chain.get<vk::PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT>();
const auto vk11_features = feature_chain.get<vk::PhysicalDeviceVulkan11Features>();
const auto vk12_features = feature_chain.get<vk::PhysicalDeviceVulkan12Features>();
vk::StructureChain device_chain = {
vk::DeviceCreateInfo{
@ -351,12 +351,17 @@ bool Instance::CreateDevice() {
},
},
vk::PhysicalDeviceVulkan11Features{
.shaderDrawParameters = true,
.storageBuffer16BitAccess = vk11_features.storageBuffer16BitAccess,
.uniformAndStorageBuffer16BitAccess = vk11_features.uniformAndStorageBuffer16BitAccess,
.shaderDrawParameters = vk11_features.shaderDrawParameters,
},
vk::PhysicalDeviceVulkan12Features{
.samplerMirrorClampToEdge = vk12_features.samplerMirrorClampToEdge,
.drawIndirectCount = vk12_features.drawIndirectCount,
.storageBuffer8BitAccess = vk12_features.storageBuffer8BitAccess,
.uniformAndStorageBuffer8BitAccess = vk12_features.uniformAndStorageBuffer8BitAccess,
.shaderFloat16 = vk12_features.shaderFloat16,
.shaderInt8 = vk12_features.shaderInt8,
.scalarBlockLayout = vk12_features.scalarBlockLayout,
.uniformBufferStandardLayout = vk12_features.uniformBufferStandardLayout,
.separateDepthStencilLayouts = vk12_features.separateDepthStencilLayouts,
@ -385,13 +390,15 @@ bool Instance::CreateDevice() {
.customBorderColorWithoutFormat = true,
},
vk::PhysicalDeviceExtendedDynamicState3FeaturesEXT{
.extendedDynamicState3ColorWriteMask = true,
.extendedDynamicState3ColorWriteMask =
dynamic_state_3_features.extendedDynamicState3ColorWriteMask,
},
vk::PhysicalDeviceDepthClipControlFeaturesEXT{
.depthClipControl = true,
},
vk::PhysicalDeviceRobustness2FeaturesEXT{
.nullDescriptor = true,
.robustBufferAccess2 = robustness2_features.robustBufferAccess2,
.nullDescriptor = robustness2_features.nullDescriptor,
},
vk::PhysicalDeviceVertexInputDynamicStateFeaturesEXT{
.vertexInputDynamicState = true,
@ -418,13 +425,13 @@ bool Instance::CreateDevice() {
if (!custom_border_color) {
device_chain.unlink<vk::PhysicalDeviceCustomBorderColorFeaturesEXT>();
}
if (!dynamic_color_write_mask) {
if (!dynamic_state_3) {
device_chain.unlink<vk::PhysicalDeviceExtendedDynamicState3FeaturesEXT>();
}
if (!depth_clip_control) {
device_chain.unlink<vk::PhysicalDeviceDepthClipControlFeaturesEXT>();
}
if (!null_descriptor) {
if (!robustness2) {
device_chain.unlink<vk::PhysicalDeviceRobustness2FeaturesEXT>();
}
if (!vertex_input_dynamic_state) {

View File

@ -99,9 +99,10 @@ public:
return depth_clip_control;
}
/// Returns true when dynamic color write mask state is supported
/// Returns true when the extendedDynamicState3ColorWriteMask feature of
/// VK_EXT_extended_dynamic_state3 is supported.
bool IsDynamicColorWriteMaskSupported() const {
return dynamic_color_write_mask;
return dynamic_state_3 && dynamic_state_3_features.extendedDynamicState3ColorWriteMask;
}
/// Returns true when VK_EXT_vertex_input_dynamic_state is supported.
@ -109,9 +110,14 @@ public:
return vertex_input_dynamic_state;
}
/// Returns true when the robustBufferAccess2 feature of VK_EXT_robustness2 is supported.
bool IsRobustBufferAccess2Supported() const {
return robustness2 && robustness2_features.robustBufferAccess2;
}
/// Returns true when the nullDescriptor feature of VK_EXT_robustness2 is supported.
bool IsNullDescriptorSupported() const {
return null_descriptor;
return robustness2 && robustness2_features.nullDescriptor;
}
/// Returns true when VK_KHR_fragment_shader_barycentric is supported.
@ -303,6 +309,8 @@ private:
vk::PhysicalDevicePushDescriptorPropertiesKHR push_descriptor_props;
vk::PhysicalDeviceFeatures features;
vk::PhysicalDevicePortabilitySubsetFeaturesKHR portability_features;
vk::PhysicalDeviceExtendedDynamicState3FeaturesEXT dynamic_state_3_features;
vk::PhysicalDeviceRobustness2FeaturesEXT robustness2_features;
vk::DriverIdKHR driver_id;
vk::UniqueDebugUtilsMessengerEXT debug_callback{};
std::string vendor_name;
@ -317,9 +325,9 @@ private:
bool custom_border_color{};
bool fragment_shader_barycentric{};
bool depth_clip_control{};
bool dynamic_color_write_mask{};
bool dynamic_state_3{};
bool vertex_input_dynamic_state{};
bool null_descriptor{};
bool robustness2{};
bool list_restart{};
bool legacy_vertex_attributes{};
bool shader_stencil_export{};

View File

@ -200,6 +200,7 @@ PipelineCache::PipelineCache(const Instance& instance_, Scheduler& scheduler_,
.support_legacy_vertex_attributes = instance_.IsLegacyVertexAttributesSupported(),
.supports_image_load_store_lod = instance_.IsImageLoadStoreLodSupported(),
.supports_native_cube_calc = instance_.IsAmdGcnShaderSupported(),
.supports_robust_buffer_access = instance_.IsRobustBufferAccess2Supported(),
.needs_manual_interpolation = instance.IsFragmentShaderBarycentricSupported() &&
instance.GetDriverID() == vk::DriverId::eNvidiaProprietary,
.needs_lds_barriers = instance.GetDriverID() == vk::DriverId::eNvidiaProprietary ||
@ -345,12 +346,12 @@ bool PipelineCache::RefreshGraphicsKey() {
key.color_formats[remapped_cb] =
LiverpoolToVK::SurfaceFormat(col_buf.GetDataFmt(), col_buf.GetNumberFmt());
key.color_buffers[remapped_cb] = {
key.color_buffers[remapped_cb] = Shader::PsColorBuffer{
.num_format = col_buf.GetNumberFmt(),
.num_conversion = col_buf.GetNumberConversion(),
.swizzle = col_buf.Swizzle(),
.export_format = regs.color_export_format.GetFormat(cb),
.needs_unorm_fixup = needs_unorm_fixup,
.swizzle = col_buf.Swizzle(),
};
}

View File

@ -37,7 +37,7 @@ void Pipeline::BindResources(DescriptorWrites& set_writes, const BufferBarriers&
cmdbuf.pipelineBarrier2(dependencies);
}
const auto stage_flags = IsCompute() ? vk::ShaderStageFlagBits::eCompute : gp_stage_flags;
const auto stage_flags = IsCompute() ? vk::ShaderStageFlagBits::eCompute : AllGraphicsStageBits;
cmdbuf.pushConstants(*pipeline_layout, stage_flags, 0u, sizeof(push_data), &push_data);
// Bind descriptor set.

View File

@ -15,7 +15,7 @@ class BufferCache;
namespace Vulkan {
static constexpr auto gp_stage_flags =
static constexpr auto AllGraphicsStageBits =
vk::ShaderStageFlagBits::eVertex | vk::ShaderStageFlagBits::eTessellationControl |
vk::ShaderStageFlagBits::eTessellationEvaluation | vk::ShaderStageFlagBits::eGeometry |
vk::ShaderStageFlagBits::eFragment;

Some files were not shown because too many files have changed in this diff Show More