Merge remote-tracking branch 'origin/main' into fork-detection

This commit is contained in:
kalaposfos13 2025-01-24 14:01:19 +01:00
commit 54b191054f
20 changed files with 112 additions and 239 deletions

View File

@ -769,8 +769,6 @@ set(VIDEO_CORE src/video_core/amdgpu/liverpool.cpp
src/video_core/renderer_vulkan/vk_common.h src/video_core/renderer_vulkan/vk_common.h
src/video_core/renderer_vulkan/vk_compute_pipeline.cpp src/video_core/renderer_vulkan/vk_compute_pipeline.cpp
src/video_core/renderer_vulkan/vk_compute_pipeline.h src/video_core/renderer_vulkan/vk_compute_pipeline.h
src/video_core/renderer_vulkan/vk_descriptor_update_queue.cpp
src/video_core/renderer_vulkan/vk_descriptor_update_queue.h
src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
src/video_core/renderer_vulkan/vk_graphics_pipeline.h src/video_core/renderer_vulkan/vk_graphics_pipeline.h
src/video_core/renderer_vulkan/vk_instance.cpp src/video_core/renderer_vulkan/vk_instance.cpp

View File

@ -22,7 +22,10 @@ SPDX-License-Identifier: GPL-2.0-or-later
- A processor with at least 4 cores and 6 threads - A processor with at least 4 cores and 6 threads
- Above 2.5 GHz frequency - Above 2.5 GHz frequency
- required support AVX2 extension or Rosetta 2 on ARM - A CPU supporting the following instruction sets: MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, F16C, CLMUL, AES, BMI1, MOVBE, XSAVE, ABM
- **Intel**: Haswell generation or newer
- **AMD**: Jaguar generation or newer
- **Apple**: Rosetta 2 on macOS 15 or newer
### GPU ### GPU

View File

@ -29,7 +29,8 @@ sudo dnf install clang git cmake libatomic alsa-lib-devel pipewire-jack-audio-co
sudo pacman -S base-devel clang git cmake sndio jack2 openal qt6-base qt6-declarative qt6-multimedia sdl2 vulkan-validation-layers sudo pacman -S base-devel clang git cmake sndio jack2 openal qt6-base qt6-declarative qt6-multimedia sdl2 vulkan-validation-layers
``` ```
**Note**: The `shadps4-git` AUR package is not maintained by any of the developers, and it uses GCC as the compiler as opposed to Clang. Use at your own discretion. **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 #### OpenSUSE
``` ```
@ -49,6 +50,7 @@ distrobox create --name archlinux --init --image archlinux:latest
and install the dependencies on that container as cited above. and install the dependencies on that container as cited above.
This option is **highly recommended** for NixOS and distributions with immutable/atomic filesystems (example: Fedora Kinoite, SteamOS). This option is **highly recommended** for NixOS and distributions with immutable/atomic filesystems (example: Fedora Kinoite, SteamOS).
### Cloning ### Cloning
``` ```

@ -1 +1 @@
Subproject commit 9f0b616d9e2c39464d2a859b79dbc655c4a30e7e Subproject commit 2473ce6f0ab7d5d8a49aa91b2e37f3447a939f18

2
externals/sdl3 vendored

@ -1 +1 @@
Subproject commit 22422f7748d5128135995ed34c8f8012861c7332 Subproject commit a336b62d8b0b97b09214e053203e442e2b6e2be5

View File

@ -146,14 +146,14 @@ void CheckUpdate::CheckForUpdates(const bool showMessage) {
} }
QString currentRev = (updateChannel == "Nightly") QString currentRev = (updateChannel == "Nightly")
? QString::fromStdString(Common::g_scm_rev).left(7) ? QString::fromStdString(Common::g_scm_rev)
: "v." + QString::fromStdString(Common::VERSION); : "v." + QString::fromStdString(Common::VERSION);
QString currentDate = Common::g_scm_date; QString currentDate = Common::g_scm_date;
QDateTime dateTime = QDateTime::fromString(latestDate, Qt::ISODate); QDateTime dateTime = QDateTime::fromString(latestDate, Qt::ISODate);
latestDate = dateTime.isValid() ? dateTime.toString("yyyy-MM-dd HH:mm:ss") : "Unknown date"; latestDate = dateTime.isValid() ? dateTime.toString("yyyy-MM-dd HH:mm:ss") : "Unknown date";
if (latestRev == currentRev) { if (latestRev == currentRev.left(7)) {
if (showMessage) { if (showMessage) {
QMessageBox::information(this, tr("Auto Updater"), QMessageBox::information(this, tr("Auto Updater"),
tr("Your version is already up to date!")); tr("Your version is already up to date!"));
@ -190,7 +190,7 @@ void CheckUpdate::setupUI(const QString& downloadUrl, const QString& latestDate,
QString("<p><b><br>" + tr("Update Channel") + ": </b>" + updateChannel + "<br><b>" + QString("<p><b><br>" + tr("Update Channel") + ": </b>" + updateChannel + "<br><b>" +
tr("Current Version") + ":</b> %1 (%2)<br><b>" + tr("Latest Version") + tr("Current Version") + ":</b> %1 (%2)<br><b>" + tr("Latest Version") +
":</b> %3 (%4)</p><p>" + tr("Do you want to update?") + "</p>") ":</b> %3 (%4)</p><p>" + tr("Do you want to update?") + "</p>")
.arg(currentRev, currentDate, latestRev, latestDate); .arg(currentRev.left(7), currentDate, latestRev, latestDate);
QLabel* updateLabel = new QLabel(updateText, this); QLabel* updateLabel = new QLabel(updateText, this);
layout->addWidget(updateLabel); layout->addWidget(updateLabel);

View File

@ -52,7 +52,7 @@
</message> </message>
<message> <message>
<source>Select which directory you want to install to.</source> <source>Select which directory you want to install to.</source>
<translation>Select which directory you want to install to.</translation> <translation>Wybierz katalog, do którego chcesz zainstalować.</translation>
</message> </message>
</context> </context>
<context> <context>
@ -130,35 +130,35 @@
</message> </message>
<message> <message>
<source>Delete...</source> <source>Delete...</source>
<translation>Delete...</translation> <translation>Usuń...</translation>
</message> </message>
<message> <message>
<source>Delete Game</source> <source>Delete Game</source>
<translation>Delete Game</translation> <translation>Usuń Grę</translation>
</message> </message>
<message> <message>
<source>Delete Update</source> <source>Delete Update</source>
<translation>Delete Update</translation> <translation>Usuń Aktualizację</translation>
</message> </message>
<message> <message>
<source>Delete DLC</source> <source>Delete DLC</source>
<translation>Delete DLC</translation> <translation>Usuń DLC</translation>
</message> </message>
<message> <message>
<source>Compatibility...</source> <source>Compatibility...</source>
<translation>Compatibility...</translation> <translation>kompatybilność...</translation>
</message> </message>
<message> <message>
<source>Update database</source> <source>Update database</source>
<translation>Update database</translation> <translation>Zaktualizuj bazę danych</translation>
</message> </message>
<message> <message>
<source>View report</source> <source>View report</source>
<translation>View report</translation> <translation>Wyświetl zgłoszenie</translation>
</message> </message>
<message> <message>
<source>Submit a report</source> <source>Submit a report</source>
<translation>Submit a report</translation> <translation>Wyślij zgłoszenie</translation>
</message> </message>
<message> <message>
<source>Shortcut creation</source> <source>Shortcut creation</source>
@ -182,23 +182,23 @@
</message> </message>
<message> <message>
<source>Game</source> <source>Game</source>
<translation>Game</translation> <translation>Gra</translation>
</message> </message>
<message> <message>
<source>requiresEnableSeparateUpdateFolder_MSG</source> <source>requiresEnableSeparateUpdateFolder_MSG</source>
<translation>This feature requires the 'Enable Separate Update Folder' config option to work. If you want to use this feature, please enable it.</translation> <translation>Ta funkcja wymaga do działania opcji Włącz oddzielny folder aktualizacji. Jeśli chcesz korzystać z tej funkcji, włącz .</translation>
</message> </message>
<message> <message>
<source>This game has no update to delete!</source> <source>This game has no update to delete!</source>
<translation>This game has no update to delete!</translation> <translation>Ta gra nie ma aktualizacji do usunięcia!</translation>
</message> </message>
<message> <message>
<source>Update</source> <source>Update</source>
<translation>Update</translation> <translation>Aktualizacja</translation>
</message> </message>
<message> <message>
<source>This game has no DLC to delete!</source> <source>This game has no DLC to delete!</source>
<translation>This game has no DLC to delete!</translation> <translation>Ta gra nie ma DLC do usunięcia!</translation>
</message> </message>
<message> <message>
<source>DLC</source> <source>DLC</source>
@ -206,11 +206,11 @@
</message> </message>
<message> <message>
<source>Delete %1</source> <source>Delete %1</source>
<translation>Delete %1</translation> <translation>Usuń %1</translation>
</message> </message>
<message> <message>
<source>Are you sure you want to delete %1's %2 directory?</source> <source>Are you sure you want to delete %1's %2 directory?</source>
<translation>Are you sure you want to delete %1's %2 directory?</translation> <translation>Czy na pewno chcesz usunąć katalog %1 z %2?</translation>
</message> </message>
</context> </context>
<context> <context>
@ -249,7 +249,7 @@
</message> </message>
<message> <message>
<source>Open shadPS4 Folder</source> <source>Open shadPS4 Folder</source>
<translation>Open shadPS4 Folder</translation> <translation>Otwórz folder shadPS4</translation>
</message> </message>
<message> <message>
<source>Exit</source> <source>Exit</source>
@ -546,7 +546,7 @@
</message> </message>
<message> <message>
<source>Enable Separate Update Folder</source> <source>Enable Separate Update Folder</source>
<translation>Enable Separate Update Folder</translation> <translation>Włącz oddzielny folder aktualizacji</translation>
</message> </message>
<message> <message>
<source>Default tab when opening settings</source> <source>Default tab when opening settings</source>
@ -574,11 +574,11 @@
</message> </message>
<message> <message>
<source>Trophy Key</source> <source>Trophy Key</source>
<translation>Trophy Key</translation> <translation>Klucz trofeów</translation>
</message> </message>
<message> <message>
<source>Trophy</source> <source>Trophy</source>
<translation>Trophy</translation> <translation>Trofeum</translation>
</message> </message>
<message> <message>
<source>Logger</source> <source>Logger</source>
@ -722,7 +722,7 @@
</message> </message>
<message> <message>
<source>Disable Trophy Pop-ups</source> <source>Disable Trophy Pop-ups</source>
<translation>Disable Trophy Pop-ups</translation> <translation>Wyłącz wyskakujące okienka trofeów</translation>
</message> </message>
<message> <message>
<source>Play title music</source> <source>Play title music</source>
@ -730,19 +730,19 @@
</message> </message>
<message> <message>
<source>Update Compatibility Database On Startup</source> <source>Update Compatibility Database On Startup</source>
<translation>Update Compatibility Database On Startup</translation> <translation>Aktualizuj bazę danych zgodności podczas uruchamiania</translation>
</message> </message>
<message> <message>
<source>Game Compatibility</source> <source>Game Compatibility</source>
<translation>Game Compatibility</translation> <translation>Kompatybilność gier</translation>
</message> </message>
<message> <message>
<source>Display Compatibility Data</source> <source>Display Compatibility Data</source>
<translation>Display Compatibility Data</translation> <translation>Wyświetl dane zgodności</translation>
</message> </message>
<message> <message>
<source>Update Compatibility Database</source> <source>Update Compatibility Database</source>
<translation>Update Compatibility Database</translation> <translation>Aktualizuj bazę danych zgodności</translation>
</message> </message>
<message> <message>
<source>Volume</source> <source>Volume</source>
@ -750,7 +750,7 @@
</message> </message>
<message> <message>
<source>Audio Backend</source> <source>Audio Backend</source>
<translation>Audio Backend</translation> <translation>Zaplecze audio</translation>
</message> </message>
<message> <message>
<source>Save</source> <source>Save</source>
@ -786,7 +786,7 @@
</message> </message>
<message> <message>
<source>separateUpdatesCheckBox</source> <source>separateUpdatesCheckBox</source>
<translation>Enable Separate Update Folder:\nEnables installing game updates into a separate folder for easy management.</translation> <translation>Włącz oddzielny folder aktualizacji:\nUmożliwia instalowanie aktualizacji gier w oddzielnym folderze w celu łatwego zarządzania.</translation>
</message> </message>
<message> <message>
<source>showSplashCheckBox</source> <source>showSplashCheckBox</source>
@ -798,7 +798,7 @@
</message> </message>
<message> <message>
<source>discordRPCCheckbox</source> <source>discordRPCCheckbox</source>
<translation>Włącz Discord Rich Presence:\nWyświetla ikonę emuladora i odpowiednie informacje na twoim profilu Discord.</translation> <translation>Włącz Discord Rich Presence:\nWyświetla ikonę emulatora i odpowiednie informacje na twoim profilu Discord.</translation>
</message> </message>
<message> <message>
<source>userName</source> <source>userName</source>
@ -806,7 +806,7 @@
</message> </message>
<message> <message>
<source>TrophyKey</source> <source>TrophyKey</source>
<translation>Trophy Key:\nKey used to decrypt trophies. Must be obtained from your jailbroken console.\nMust contain only hex characters.</translation> <translation>Klucz trofeów:\nKlucz używany do odszyfrowywania trofeów. Musi być uzyskany z konsoli po jailbreaku. Musi zawierać tylko znaki w kodzie szesnastkowym.</translation>
</message> </message>
<message> <message>
<source>logTypeGroupBox</source> <source>logTypeGroupBox</source>
@ -826,7 +826,7 @@
</message> </message>
<message> <message>
<source>disableTrophycheckBox</source> <source>disableTrophycheckBox</source>
<translation>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>Wyłącz wyskakujące okienka trofeów:\nWyłącz powiadomienia o trofeach w grze. Postępy w zdobywaniu trofeów można nadal śledzić za pomocą przeglądarki trofeów (kliknij prawym przyciskiem myszy grę w oknie głównym).</translation>
</message> </message>
<message> <message>
<source>hideCursorGroupBox</source> <source>hideCursorGroupBox</source>
@ -842,15 +842,15 @@
</message> </message>
<message> <message>
<source>enableCompatibilityCheckBox</source> <source>enableCompatibilityCheckBox</source>
<translation>Display Compatibility Data:\nDisplays game compatibility information in table view. Enable "Update Compatibility On Startup" to get up-to-date information.</translation> <translation>Wyświetl dane zgodności:\nWyświetla informacje o kompatybilności gry w widoku tabeli. Włącz opcję Aktualizuj zgodność przy uruchomieniu, aby uzyskać aktualne informacje.</translation>
</message> </message>
<message> <message>
<source>checkCompatibilityOnStartupCheckBox</source> <source>checkCompatibilityOnStartupCheckBox</source>
<translation>Update Compatibility On Startup:\nAutomatically update the compatibility database when shadPS4 starts.</translation> <translation>Aktualizuj zgodność przy uruchomieniu:\nAutomatycznie aktualizuj bazę danych kompatybilności podczas uruchamiania shadPS4.</translation>
</message> </message>
<message> <message>
<source>updateCompatibilityButton</source> <source>updateCompatibilityButton</source>
<translation>Update Compatibility Database:\nImmediately update the compatibility database.</translation> <translation>Zaktualizuj bazę danych zgodności:\nNatychmiast zaktualizuj bazę danych zgodności.</translation>
</message> </message>
<message> <message>
<source>Never</source> <source>Never</source>
@ -933,7 +933,7 @@
<name>CheatsPatches</name> <name>CheatsPatches</name>
<message> <message>
<source>Cheats / Patches for </source> <source>Cheats / Patches for </source>
<translation>Cheats / Patches for </translation> <translation>Kody / Łatki dla </translation>
</message> </message>
<message> <message>
<source>defaultTextEdit_MSG</source> <source>defaultTextEdit_MSG</source>
@ -1145,7 +1145,7 @@
</message> </message>
<message> <message>
<source>Failed to parse JSON:</source> <source>Failed to parse JSON:</source>
<translation>Nie udało się przeanlizować JSON:</translation> <translation>Nie udało się przeanalizować JSON:</translation>
</message> </message>
<message> <message>
<source>Can't apply cheats before the game is started</source> <source>Can't apply cheats before the game is started</source>
@ -1168,7 +1168,7 @@
</message> </message>
<message> <message>
<source>Compatibility</source> <source>Compatibility</source>
<translation>Compatibility</translation> <translation>Zgodność</translation>
</message> </message>
<message> <message>
<source>Region</source> <source>Region</source>
@ -1196,7 +1196,7 @@
</message> </message>
<message> <message>
<source>Never Played</source> <source>Never Played</source>
<translation>Never Played</translation> <translation>Nigdy nie grane</translation>
</message> </message>
<message> <message>
<source>h</source> <source>h</source>
@ -1212,27 +1212,27 @@
</message> </message>
<message> <message>
<source>Compatibility is untested</source> <source>Compatibility is untested</source>
<translation>Compatibility is untested</translation> <translation>Kompatybilność nie została przetestowana</translation>
</message> </message>
<message> <message>
<source>Game does not initialize properly / crashes the emulator</source> <source>Game does not initialize properly / crashes the emulator</source>
<translation>Game does not initialize properly / crashes the emulator</translation> <translation>Gra nie inicjuje się poprawnie / zawiesza się emulator</translation>
</message> </message>
<message> <message>
<source>Game boots, but only displays a blank screen</source> <source>Game boots, but only displays a blank screen</source>
<translation>Game boots, but only displays a blank screen</translation> <translation>Gra uruchamia się, ale wyświetla tylko pusty ekran</translation>
</message> </message>
<message> <message>
<source>Game displays an image but does not go past the menu</source> <source>Game displays an image but does not go past the menu</source>
<translation>Game displays an image but does not go past the menu</translation> <translation>Gra wyświetla obraz, ale nie przechodzi do menu</translation>
</message> </message>
<message> <message>
<source>Game has game-breaking glitches or unplayable performance</source> <source>Game has game-breaking glitches or unplayable performance</source>
<translation>Game has game-breaking glitches or unplayable performance</translation> <translation>Gra ma usterki przerywające rozgrywkę lub niegrywalną wydajność</translation>
</message> </message>
<message> <message>
<source>Game can be completed with playable performance and no major glitches</source> <source>Game can be completed with playable performance and no major glitches</source>
<translation>Game can be completed with playable performance and no major glitches</translation> <translation>Gmożna ukończyć z grywalną wydajnością i bez większych usterek</translation>
</message> </message>
</context> </context>
<context> <context>

View File

@ -348,7 +348,8 @@ Id EmitSLessThanEqual(EmitContext& ctx, Id lhs, Id rhs);
Id EmitULessThanEqual(EmitContext& ctx, Id lhs, Id rhs); Id EmitULessThanEqual(EmitContext& ctx, Id lhs, Id rhs);
Id EmitSGreaterThan(EmitContext& ctx, Id lhs, Id rhs); Id EmitSGreaterThan(EmitContext& ctx, Id lhs, Id rhs);
Id EmitUGreaterThan(EmitContext& ctx, Id lhs, Id rhs); Id EmitUGreaterThan(EmitContext& ctx, Id lhs, Id rhs);
Id EmitINotEqual(EmitContext& ctx, Id lhs, Id rhs); Id EmitINotEqual32(EmitContext& ctx, Id lhs, Id rhs);
Id EmitINotEqual64(EmitContext& ctx, Id lhs, Id rhs);
Id EmitSGreaterThanEqual(EmitContext& ctx, Id lhs, Id rhs); Id EmitSGreaterThanEqual(EmitContext& ctx, Id lhs, Id rhs);
Id EmitUGreaterThanEqual(EmitContext& ctx, Id lhs, Id rhs); Id EmitUGreaterThanEqual(EmitContext& ctx, Id lhs, Id rhs);
Id EmitLogicalOr(EmitContext& ctx, Id a, Id b); Id EmitLogicalOr(EmitContext& ctx, Id a, Id b);

View File

@ -324,7 +324,11 @@ Id EmitUGreaterThan(EmitContext& ctx, Id lhs, Id rhs) {
return ctx.OpUGreaterThan(ctx.U1[1], lhs, rhs); return ctx.OpUGreaterThan(ctx.U1[1], lhs, rhs);
} }
Id EmitINotEqual(EmitContext& ctx, Id lhs, Id rhs) { Id EmitINotEqual32(EmitContext& ctx, Id lhs, Id rhs) {
return ctx.OpINotEqual(ctx.U1[1], lhs, rhs);
}
Id EmitINotEqual64(EmitContext& ctx, Id lhs, Id rhs) {
return ctx.OpINotEqual(ctx.U1[1], lhs, rhs); return ctx.OpINotEqual(ctx.U1[1], lhs, rhs);
} }

View File

@ -72,10 +72,14 @@ void Translator::EmitScalarAlu(const GcnInst& inst) {
return S_OR_B64(NegateMode::Result, true, inst); return S_OR_B64(NegateMode::Result, true, inst);
case Opcode::S_LSHL_B32: case Opcode::S_LSHL_B32:
return S_LSHL_B32(inst); return S_LSHL_B32(inst);
case Opcode::S_LSHL_B64:
return S_LSHL_B64(inst);
case Opcode::S_LSHR_B32: case Opcode::S_LSHR_B32:
return S_LSHR_B32(inst); return S_LSHR_B32(inst);
case Opcode::S_ASHR_I32: case Opcode::S_ASHR_I32:
return S_ASHR_I32(inst); return S_ASHR_I32(inst);
case Opcode::S_ASHR_I64:
return S_ASHR_I64(inst);
case Opcode::S_BFM_B32: case Opcode::S_BFM_B32:
return S_BFM_B32(inst); return S_BFM_B32(inst);
case Opcode::S_MUL_I32: case Opcode::S_MUL_I32:
@ -420,6 +424,14 @@ void Translator::S_LSHL_B32(const GcnInst& inst) {
ir.SetScc(ir.INotEqual(result, ir.Imm32(0))); ir.SetScc(ir.INotEqual(result, ir.Imm32(0)));
} }
void Translator::S_LSHL_B64(const GcnInst& inst) {
const IR::U64 src0{GetSrc64(inst.src[0])};
const IR::U64 src1{GetSrc64(inst.src[1])};
const IR::U64 result = ir.ShiftLeftLogical(src0, ir.BitwiseAnd(src1, ir.Imm64(u64(0x3F))));
SetDst64(inst.dst[0], result);
ir.SetScc(ir.INotEqual(result, ir.Imm64(u64(0))));
}
void Translator::S_LSHR_B32(const GcnInst& inst) { void Translator::S_LSHR_B32(const GcnInst& inst) {
const IR::U32 src0{GetSrc(inst.src[0])}; const IR::U32 src0{GetSrc(inst.src[0])};
const IR::U32 src1{GetSrc(inst.src[1])}; const IR::U32 src1{GetSrc(inst.src[1])};
@ -431,11 +443,19 @@ void Translator::S_LSHR_B32(const GcnInst& inst) {
void Translator::S_ASHR_I32(const GcnInst& inst) { void Translator::S_ASHR_I32(const GcnInst& inst) {
const IR::U32 src0{GetSrc(inst.src[0])}; const IR::U32 src0{GetSrc(inst.src[0])};
const IR::U32 src1{GetSrc(inst.src[1])}; const IR::U32 src1{GetSrc(inst.src[1])};
const IR::U32 result{ir.ShiftRightArithmetic(src0, src1)}; const IR::U32 result{ir.ShiftRightArithmetic(src0, ir.BitwiseAnd(src1, ir.Imm32(0x1F)))};
SetDst(inst.dst[0], result); SetDst(inst.dst[0], result);
ir.SetScc(ir.INotEqual(result, ir.Imm32(0))); ir.SetScc(ir.INotEqual(result, ir.Imm32(0)));
} }
void Translator::S_ASHR_I64(const GcnInst& inst) {
const IR::U64 src0{GetSrc64(inst.src[0])};
const IR::U64 src1{GetSrc64(inst.src[1])};
const IR::U64 result{ir.ShiftRightArithmetic(src0, ir.BitwiseAnd(src1, ir.Imm64(u64(0x3F))))};
SetDst64(inst.dst[0], result);
ir.SetScc(ir.INotEqual(result, ir.Imm64(u64(0))));
}
void Translator::S_BFM_B32(const GcnInst& inst) { void Translator::S_BFM_B32(const GcnInst& inst) {
const IR::U32 src0{ir.BitwiseAnd(GetSrc(inst.src[0]), ir.Imm32(0x1F))}; const IR::U32 src0{ir.BitwiseAnd(GetSrc(inst.src[0]), ir.Imm32(0x1F))};
const IR::U32 src1{ir.BitwiseAnd(GetSrc(inst.src[1]), ir.Imm32(0x1F))}; const IR::U32 src1{ir.BitwiseAnd(GetSrc(inst.src[1]), ir.Imm32(0x1F))};

View File

@ -90,8 +90,10 @@ public:
void S_OR_B64(NegateMode negate, bool is_xor, const GcnInst& inst); void S_OR_B64(NegateMode negate, bool is_xor, const GcnInst& inst);
void S_XOR_B32(const GcnInst& inst); void S_XOR_B32(const GcnInst& inst);
void S_LSHL_B32(const GcnInst& inst); void S_LSHL_B32(const GcnInst& inst);
void S_LSHL_B64(const GcnInst& inst);
void S_LSHR_B32(const GcnInst& inst); void S_LSHR_B32(const GcnInst& inst);
void S_ASHR_I32(const GcnInst& inst); void S_ASHR_I32(const GcnInst& inst);
void S_ASHR_I64(const GcnInst& inst);
void S_BFM_B32(const GcnInst& inst); void S_BFM_B32(const GcnInst& inst);
void S_MUL_I32(const GcnInst& inst); void S_MUL_I32(const GcnInst& inst);
void S_BFE(const GcnInst& inst, bool is_signed); void S_BFE(const GcnInst& inst, bool is_signed);

View File

@ -1257,24 +1257,7 @@ void Translator::V_CVT_PK_U8_F32(const GcnInst& inst) {
void Translator::V_LSHL_B64(const GcnInst& inst) { void Translator::V_LSHL_B64(const GcnInst& inst) {
const IR::U64 src0{GetSrc64(inst.src[0])}; const IR::U64 src0{GetSrc64(inst.src[0])};
const IR::U64 src1{GetSrc64(inst.src[1])}; const IR::U64 src1{GetSrc64(inst.src[1])};
const IR::VectorReg dst_reg{inst.dst[0].code}; SetDst64(inst.dst[0], ir.ShiftLeftLogical(src0, ir.BitwiseAnd(src1, ir.Imm64(u64(0x3F)))));
if (src0.IsImmediate()) {
if (src0.U64() == -1) {
// If src0 is a fixed -1, the result will always be -1.
ir.SetVectorReg(dst_reg, ir.Imm32(0xFFFFFFFF));
ir.SetVectorReg(dst_reg + 1, ir.Imm32(0xFFFFFFFF));
return;
}
if (src1.IsImmediate()) {
// If both src0 and src1 are immediates, we can calculate the result now.
// Note that according to the manual, only bits 4:0 are used from src1.
const u64 result = src0.U64() << (src1.U64() & 0x1F);
ir.SetVectorReg(dst_reg, ir.Imm32(static_cast<u32>(result)));
ir.SetVectorReg(dst_reg + 1, ir.Imm32(static_cast<u32>(result >> 32)));
return;
}
}
UNREACHABLE_MSG("Unimplemented V_LSHL_B64 arguments");
} }
void Translator::V_MUL_F64(const GcnInst& inst) { void Translator::V_MUL_F64(const GcnInst& inst) {

View File

@ -1461,8 +1461,18 @@ U1 IREmitter::IGreaterThan(const U32& lhs, const U32& rhs, bool is_signed) {
return Inst<U1>(is_signed ? Opcode::SGreaterThan : Opcode::UGreaterThan, lhs, rhs); return Inst<U1>(is_signed ? Opcode::SGreaterThan : Opcode::UGreaterThan, lhs, rhs);
} }
U1 IREmitter::INotEqual(const U32& lhs, const U32& rhs) { U1 IREmitter::INotEqual(const U32U64& lhs, const U32U64& rhs) {
return Inst<U1>(Opcode::INotEqual, lhs, rhs); if (lhs.Type() != rhs.Type()) {
UNREACHABLE_MSG("Mismatching types {} and {}", lhs.Type(), rhs.Type());
}
switch (lhs.Type()) {
case Type::U32:
return Inst<U1>(Opcode::INotEqual32, lhs, rhs);
case Type::U64:
return Inst<U1>(Opcode::INotEqual64, lhs, rhs);
default:
ThrowInvalidType(lhs.Type());
}
} }
U1 IREmitter::IGreaterThanEqual(const U32& lhs, const U32& rhs, bool is_signed) { U1 IREmitter::IGreaterThanEqual(const U32& lhs, const U32& rhs, bool is_signed) {

View File

@ -258,7 +258,7 @@ public:
[[nodiscard]] U1 IEqual(const U32U64& lhs, const U32U64& rhs); [[nodiscard]] U1 IEqual(const U32U64& lhs, const U32U64& rhs);
[[nodiscard]] U1 ILessThanEqual(const U32& lhs, const U32& rhs, bool is_signed); [[nodiscard]] U1 ILessThanEqual(const U32& lhs, const U32& rhs, bool is_signed);
[[nodiscard]] U1 IGreaterThan(const U32& lhs, const U32& rhs, bool is_signed); [[nodiscard]] U1 IGreaterThan(const U32& lhs, const U32& rhs, bool is_signed);
[[nodiscard]] U1 INotEqual(const U32& lhs, const U32& rhs); [[nodiscard]] U1 INotEqual(const U32U64& lhs, const U32U64& rhs);
[[nodiscard]] U1 IGreaterThanEqual(const U32& lhs, const U32& rhs, bool is_signed); [[nodiscard]] U1 IGreaterThanEqual(const U32& lhs, const U32& rhs, bool is_signed);
[[nodiscard]] U1 LogicalOr(const U1& a, const U1& b); [[nodiscard]] U1 LogicalOr(const U1& a, const U1& b);

View File

@ -321,7 +321,8 @@ OPCODE(SLessThanEqual, U1, U32,
OPCODE(ULessThanEqual, U1, U32, U32, ) OPCODE(ULessThanEqual, U1, U32, U32, )
OPCODE(SGreaterThan, U1, U32, U32, ) OPCODE(SGreaterThan, U1, U32, U32, )
OPCODE(UGreaterThan, U1, U32, U32, ) OPCODE(UGreaterThan, U1, U32, U32, )
OPCODE(INotEqual, U1, U32, U32, ) OPCODE(INotEqual32, U1, U32, U32, )
OPCODE(INotEqual64, U1, U64, U64, )
OPCODE(SGreaterThanEqual, U1, U32, U32, ) OPCODE(SGreaterThanEqual, U1, U32, U32, )
OPCODE(UGreaterThanEqual, U1, U32, U32, ) OPCODE(UGreaterThanEqual, U1, U32, U32, )

View File

@ -403,9 +403,12 @@ void ConstantPropagation(IR::Block& block, IR::Inst& inst) {
case IR::Opcode::IEqual64: case IR::Opcode::IEqual64:
FoldWhenAllImmediates(inst, [](u64 a, u64 b) { return a == b; }); FoldWhenAllImmediates(inst, [](u64 a, u64 b) { return a == b; });
return; return;
case IR::Opcode::INotEqual: case IR::Opcode::INotEqual32:
FoldWhenAllImmediates(inst, [](u32 a, u32 b) { return a != b; }); FoldWhenAllImmediates(inst, [](u32 a, u32 b) { return a != b; });
return; return;
case IR::Opcode::INotEqual64:
FoldWhenAllImmediates(inst, [](u64 a, u64 b) { return a != b; });
return;
case IR::Opcode::BitwiseAnd32: case IR::Opcode::BitwiseAnd32:
FoldWhenAllImmediates(inst, [](u32 a, u32 b) { return a & b; }); FoldWhenAllImmediates(inst, [](u32 a, u32 b) { return a & b; });
return; return;

View File

@ -904,7 +904,7 @@ struct Liverpool {
} }
bool IsTiled() const { bool IsTiled() const {
return !info.linear_general; return GetTilingMode() != TilingMode::Display_Linear;
} }
[[nodiscard]] DataFormat GetDataFmt() const { [[nodiscard]] DataFormat GetDataFmt() const {

View File

@ -1,108 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "video_core/renderer_vulkan/vk_descriptor_update_queue.h"
#include "video_core/renderer_vulkan/vk_instance.h"
namespace Vulkan {
DescriptorUpdateQueue::DescriptorUpdateQueue(const Instance& instance, u32 descriptor_write_max_)
: device{instance.GetDevice()}, descriptor_write_max{descriptor_write_max_} {
descriptor_infos = std::make_unique<DescriptorInfoUnion[]>(descriptor_write_max);
descriptor_writes = std::make_unique<vk::WriteDescriptorSet[]>(descriptor_write_max);
}
void DescriptorUpdateQueue::Flush() {
if (descriptor_write_end == 0) {
return;
}
device.updateDescriptorSets({std::span(descriptor_writes.get(), descriptor_write_end)}, {});
descriptor_write_end = 0;
}
void DescriptorUpdateQueue::AddStorageImage(vk::DescriptorSet target, u8 binding,
vk::ImageView image_view,
vk::ImageLayout image_layout) {
if (descriptor_write_end >= descriptor_write_max) [[unlikely]] {
Flush();
}
auto& image_info = descriptor_infos[descriptor_write_end].image_info;
image_info.sampler = VK_NULL_HANDLE;
image_info.imageView = image_view;
image_info.imageLayout = image_layout;
descriptor_writes[descriptor_write_end++] = vk::WriteDescriptorSet{
.dstSet = target,
.dstBinding = binding,
.dstArrayElement = 0,
.descriptorCount = 1,
.descriptorType = vk::DescriptorType::eStorageImage,
.pImageInfo = &image_info,
};
}
void DescriptorUpdateQueue::AddImageSampler(vk::DescriptorSet target, u8 binding, u8 array_index,
vk::ImageView image_view, vk::Sampler sampler,
vk::ImageLayout image_layout) {
if (descriptor_write_end >= descriptor_write_max) [[unlikely]] {
Flush();
}
auto& image_info = descriptor_infos[descriptor_write_end].image_info;
image_info.sampler = sampler;
image_info.imageView = image_view;
image_info.imageLayout = image_layout;
descriptor_writes[descriptor_write_end++] = vk::WriteDescriptorSet{
.dstSet = target,
.dstBinding = binding,
.dstArrayElement = array_index,
.descriptorCount = 1,
.descriptorType =
sampler ? vk::DescriptorType::eCombinedImageSampler : vk::DescriptorType::eSampledImage,
.pImageInfo = &image_info,
};
}
void DescriptorUpdateQueue::AddBuffer(vk::DescriptorSet target, u8 binding, vk::Buffer buffer,
vk::DeviceSize offset, vk::DeviceSize size,
vk::DescriptorType type) {
if (descriptor_write_end >= descriptor_write_max) [[unlikely]] {
Flush();
}
auto& buffer_info = descriptor_infos[descriptor_write_end].buffer_info;
buffer_info.buffer = buffer;
buffer_info.offset = offset;
buffer_info.range = size;
descriptor_writes[descriptor_write_end++] = vk::WriteDescriptorSet{
.dstSet = target,
.dstBinding = binding,
.dstArrayElement = 0,
.descriptorCount = 1,
.descriptorType = type,
.pBufferInfo = &buffer_info,
};
}
void DescriptorUpdateQueue::AddTexelBuffer(vk::DescriptorSet target, u8 binding,
vk::BufferView buffer_view) {
if (descriptor_write_end >= descriptor_write_max) [[unlikely]] {
Flush();
}
auto& buffer_info = descriptor_infos[descriptor_write_end].buffer_view;
buffer_info = buffer_view;
descriptor_writes[descriptor_write_end++] = vk::WriteDescriptorSet{
.dstSet = target,
.dstBinding = binding,
.dstArrayElement = 0,
.descriptorCount = 1,
.descriptorType = vk::DescriptorType::eUniformTexelBuffer,
.pTexelBufferView = &buffer_info,
};
}
} // namespace Vulkan

View File

@ -1,51 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <memory>
#include "common/types.h"
#include "video_core/renderer_vulkan/vk_common.h"
namespace Vulkan {
class Instance;
struct DescriptorInfoUnion {
DescriptorInfoUnion() {}
union {
vk::DescriptorImageInfo image_info;
vk::DescriptorBufferInfo buffer_info;
vk::BufferView buffer_view;
};
};
class DescriptorUpdateQueue {
public:
explicit DescriptorUpdateQueue(const Instance& instance, u32 descriptor_write_max = 2048);
~DescriptorUpdateQueue() = default;
void Flush();
void AddStorageImage(vk::DescriptorSet target, u8 binding, vk::ImageView image_view,
vk::ImageLayout image_layout = vk::ImageLayout::eGeneral);
void AddImageSampler(vk::DescriptorSet target, u8 binding, u8 array_index,
vk::ImageView image_view, vk::Sampler sampler,
vk::ImageLayout imageLayout = vk::ImageLayout::eGeneral);
void AddBuffer(vk::DescriptorSet target, u8 binding, vk::Buffer buffer, vk::DeviceSize offset,
vk::DeviceSize size = VK_WHOLE_SIZE,
vk::DescriptorType type = vk::DescriptorType::eUniformBufferDynamic);
void AddTexelBuffer(vk::DescriptorSet target, u8 binding, vk::BufferView buffer_view);
private:
const vk::Device device;
const u32 descriptor_write_max;
std::unique_ptr<DescriptorInfoUnion[]> descriptor_infos;
std::unique_ptr<vk::WriteDescriptorSet[]> descriptor_writes;
u32 descriptor_write_end = 0;
};
} // namespace Vulkan

View File

@ -345,8 +345,13 @@ ImageId TextureCache::FindImage(BaseDesc& desc, FindFlags flags) {
view_slice = -1; view_slice = -1;
const auto& merged_info = image_id ? slot_images[image_id].info : info; const auto& merged_info = image_id ? slot_images[image_id].info : info;
std::tie(image_id, view_mip, view_slice) = auto [overlap_image_id, overlap_view_mip, overlap_view_slice] =
ResolveOverlap(merged_info, desc.type, cache_id, image_id); ResolveOverlap(merged_info, desc.type, cache_id, image_id);
if (overlap_image_id) {
image_id = overlap_image_id;
view_mip = overlap_view_mip;
view_slice = overlap_view_slice;
}
} }
} }