From 7bf467c65304fb66bf96ee3e660032bfee8b4725 Mon Sep 17 00:00:00 2001 From: Daniel Nylander Date: Tue, 7 Jan 2025 08:55:53 +0100 Subject: [PATCH 01/10] Updated Swedish translation with additional strings (#2081) * Adding Swedish translation * Updated Swedish translation with additional strings Updated the Swedish translations using lupdate to found additional strings cd src/qt_gui/treanslations lupdate ../../../../shadPS4/ -tr-function-alias QT_TRANSLATE_NOOP+=TRANSLATE,QT_TRANSLATE_NOOP+=TRANSLATE_SV,QT_TRANSLATE_NOOP+=TRANSLATE_STR,QT_TRANSLATE_NOOP+=TRANSLATE_FS,QT_TRANSLATE_N_NOOP3+=TRANSLATE_FMT,QT_TRANSLATE_NOOP+=TRANSLATE_NOOP,translate+=TRANSLATE_PLURAL_STR,translate+=TRANSLATE_PLURAL_FS -no-obsolete -locations none -source-language en -ts sv.ts * Update sv.ts --- src/qt_gui/translations/sv.ts | 2739 +++++++++++++++++---------------- 1 file changed, 1409 insertions(+), 1330 deletions(-) diff --git a/src/qt_gui/translations/sv.ts b/src/qt_gui/translations/sv.ts index 756119ba4..c1c1204f8 100644 --- a/src/qt_gui/translations/sv.ts +++ b/src/qt_gui/translations/sv.ts @@ -4,1333 +4,1412 @@ - AboutDialog - - About shadPS4 - Om shadPS4 - - - shadPS4 - shadPS4 - - - shadPS4 is an experimental open-source emulator for the PlayStation 4. - shadPS4 är en experimentell emulator för PlayStation 4 baserad på öppen källkod. - - - This software should not be used to play games you have not legally obtained. - Denna programvara bör inte användas för att spela spel som du inte legalt äger. - - - - ElfViewer - - Open Folder - Öppna mapp - - - - GameInfoClass - - Loading game list, please wait :3 - Läser in spellistan, vänta :3 - - - Cancel - Avbryt - - - Loading... - Läser in... - - - - InstallDirSelect - - shadPS4 - Choose directory - shadPS4 - Välj katalog - - - Select which directory you want to install to. - Välj vilken katalog som du vill installera till. - - - - GameInstallDialog - - shadPS4 - Choose directory - shadPS4 - Välj katalog - - - Directory to install games - Katalog att installera spel till - - - Browse - Bläddra - - - Error - Fel - - - The value for location to install games is not valid. - Värdet för platsen att installera spel till är inte giltig. - - - - GuiContextMenus - - Create Shortcut - Skapa genväg - - - Cheats / Patches - Fusk / Patchar - - - SFO Viewer - SFO-visare - - - Trophy Viewer - Trofé-visare - - - Open Folder... - Öppna mapp... - - - Open Game Folder - Öppna spelmapp - - - Open Save Data Folder - Öppna mapp för sparat data - - - Open Log Folder - Öppna loggmapp - - - Copy info... - Kopiera till... - - - Copy Name - Kopiera namn - - - Copy Serial - Kopiera serienummer - - - Copy All - Kopiera alla - - - Delete... - Ta bort... - - - Delete Game - Ta bort spel - - - Delete Update - Ta bort uppdatering - - - Delete DLC - Ta bort DLC - - - Compatibility... - Kompatibilitet... - - - Update database - Uppdatera databasen - - - View report - Visa rapport - - - Submit a report - Skicka en rapport - - - Shortcut creation - Skapa genväg - - - Shortcut created successfully! - Genvägen skapades! - - - Error - Fel - - - Error creating shortcut! - Fel vid skapandet av genväg! - - - Install PKG - Installera PKG - - - Game - Spel - - - requiresEnableSeparateUpdateFolder_MSG - Denna funktion kräver konfigurationsalternativet 'Aktivera separat uppdateringsmapp' för att fungera. Om du vill använda denna funktion, aktivera den - - - This game has no update to delete! - Detta spel har ingen uppdatering att ta bort! - - - Update - Uppdatera - - - This game has no DLC to delete! - Detta spel har inga DLC att ta bort! - - - DLC - DLC - - - Delete %1 - Ta bort %1 - - - Are you sure you want to delete %1's %2 directory? - Är du säker på att du vill ta bort %1s %2-katalog? - - - - MainWindow - - Open/Add Elf Folder - Öppna/Lägg till Elf-mapp - - - Install Packages (PKG) - Installera paket (PKG) - - - Boot Game - Starta spel - - - Check for Updates - Leta efter uppdateringar - - - About shadPS4 - Om shadPS4 - - - Configure... - Konfigurera... - - - Install application from a .pkg file - Installera program från en .pkg-fil - - - Recent Games - Senaste spel - - - Exit - Avsluta - - - Exit shadPS4 - Avsluta shadPS4 - - - Exit the application. - Avsluta programmet. - - - Show Game List - Visa spellista - - - Game List Refresh - Uppdatera spellista - - - Tiny - Mycket små - - - Small - Små - - - Medium - Medel - - - Large - Stora - - - List View - Listvy - - - Grid View - Rutnätsvy - - - Elf Viewer - Elf-visare - - - Game Install Directory - Installationskatalog för spel - - - Download Cheats/Patches - Hämta fusk/patchar - - - Dump Game List - Dumpa spellista - - - PKG Viewer - PKG-visare - - - Search... - Sök... - - - File - Arkiv - - - View - Visa - - - Game List Icons - Ikoner för spellista - - - Game List Mode - Läge för spellista - - - Settings - Inställningar - - - Utils - Verktyg - - - Themes - Teman - - - Help - Hjälp - - - Dark - Mörk - - - Light - Ljus - - - Green - Grön - - - Blue - Blå - - - Violet - Lila - - - toolBar - toolBar - - - Game List - Spellista - - - * Unsupported Vulkan Version - * Vulkan-versionen stöds inte - - - Download Cheats For All Installed Games - Hämta fusk för alla installerade spel - - - Download Patches For All Games - Hämta patchar för alla spel - - - Download Complete - Hämtning färdig - - - You have downloaded cheats for all the games you have installed. - Du har hämtat fusk till alla spelen som du har installerade. - - - Patches Downloaded Successfully! - Patchar hämtades ner! - - - All Patches available for all games have been downloaded. - Alla patchar tillgängliga för alla spel har hämtats ner. - - - Games: - Spel: - - - PKG File (*.PKG) - PKG-fil (*.PKG) - - - ELF files (*.bin *.elf *.oelf) - ELF-filer (*.bin *.elf *.oelf) - - - Game Boot - Starta spel - - - Only one file can be selected! - Endast en fil kan väljas! - - - PKG Extraction - PKG-extrahering - - - Patch detected! - Patch upptäcktes! - - - PKG and Game versions match: - PKG och spelversioner matchar: - - - Would you like to overwrite? - Vill du skriva över? - - - PKG Version %1 is older than installed version: - PKG-versionen %1 är äldre än installerad version: - - - Game is installed: - Spelet är installerat: - - - Would you like to install Patch: - Vill du installera patch: - - - DLC Installation - DLC-installation - - - Would you like to install DLC: %1? - Vill du installera DLC: %1? - - - DLC already installed: - DLC redan installerat: - - - Game already installed - Spelet redan installerat - - - PKG is a patch, please install the game first! - PKH är en patch. Installera spelet först! - - - PKG ERROR - PKG-FEL - - - Extracting PKG %1/%2 - Extraherar PKG %1/%2 - - - Extraction Finished - Extrahering färdig - - - Game successfully installed at %1 - Spelet installerades i %1 - - - File doesn't appear to be a valid PKG file - Filen verkar inte vara en giltig PKG-fil - - - - PKGViewer - - Open Folder - Öppna mapp - - - - TrophyViewer - - Trophy Viewer - Trofé-visare - - - - SettingsDialog - - Settings - Inställningar - - - General - Allmänt - - - System - System - - - Console Language - Konsollspråk - - - Emulator Language - Emulatorspråk - - - Emulator - Emulator - - - Enable Fullscreen - Aktivera helskärm - - - Enable Separate Update Folder - Aktivera separat uppdateringsmapp - - - Show Splash - Visa startskärm - - - Is PS4 Pro - Är PS4 Pro - - - Enable Discord Rich Presence - Aktivera Discord Rich Presence - - - Username - Användarnamn - - - Trophy Key - Trofényckel - - - Trophy - Trofé - - - Logger - Loggning - - - Log Type - Loggtyp - - - Log Filter - Loggfilter - - - Input - Inmatning - - - Cursor - Pekare - - - Hide Cursor - Dölj pekare - - - Hide Cursor Idle Timeout - Dölj pekare vid overksam - - - s - s - - - Controller - Handkontroller - - - Back Button Behavior - Beteende för bakåtknapp - - - Graphics - Grafik - - - Graphics Device - Grafikenhet - - - Width - Bredd - - - Height - Höjd - - - Vblank Divider - Vblank Divider - - - Advanced - Avancerat - - - Enable Shaders Dumping - Aktivera Shaders Dumping - - - Enable NULL GPU - Aktivera NULL GPU - - - Paths - Sökvägar - - - Game Folders - Spelmappar - - - Add... - Lägg till... - - - Remove - Ta bort - - - Debug - Felsök - - - Enable Debug Dumping - Aktivera felsökningsdumpning - - - Enable Vulkan Validation Layers - Aktivera Vulkan Validation Layers - - - Enable Vulkan Synchronization Validation - Aktivera Vulkan Synchronization Validation - - - Enable RenderDoc Debugging - Aktivera RenderDoc-felsökning - - - Update - Uppdatera - - - Check for Updates at Startup - Leta efter uppdateringar vid uppstart - - - Update Channel - Uppdateringskanal - - - Check for Updates - Leta efter uppdateringar - - - GUI Settings - Gränssnittsinställningar - - - Disable Trophy Pop-ups - Inaktivera popup för troféer - - - Play title music - Spela titelmusik - - - Update Compatibility Database On Startup - Uppdatera databas vid uppstart - - - Game Compatibility - Spelkompatibilitet - - - Display Compatibility Data - Visa kompatibilitetsdata - - - Update Compatibility Database - Uppdatera kompatibilitetsdatabasen - - - Volume - Volym - - - Audio Backend - Ljudbakände - - - Save - Spara - - - Apply - Verkställ - - - Restore Defaults - Återställ till standard - - - Close - Stäng - - - Point your mouse at an option to display its description. - Peka din mus på ett alternativ för att visa dess beskrivning. - - - consoleLanguageGroupBox - Konsollspråk:\nStäller in språket som PS4-spelet använder.\nDet rekommenderas att ställa in detta till ett språk som spelet har stöd för, vilket kan skilja sig mellan regioner - - - emulatorLanguageGroupBox - Emulatorspråk:\nStäller in språket för emulatorns användargränssnitt - - - fullscreenCheckBox - Aktivera helskärm:\nStäller automatiskt in spelfönstret till helskämsläget.\nDetta kan växlas genom att trycka på F11-tangenten - - - separateUpdatesCheckBox - Aktivera separat uppdateringsmapp:\nAktiverar installation av speluppdateringar i en separat mapp för enkel hantering.\nDetta kan skapas manuellt genom att lägga till uppackad uppdatering till spelmappen med namnet "CUSA00000-UPDATE" där CUSA ID matchar spelets id - - - showSplashCheckBox - Visa startskärm:\nVisar spelets startskärm (en speciell bild) när spelet startas - - - ps4proCheckBox - Är PS4 Pro:\nGör att emulatorn fungerar som en PS4 PRO, som kan aktivera speciella funktioner i spel som har stöds för det - - - discordRPCCheckbox - Aktivera Discord Rich Presence:\nVisar emulatorikonen och relevant information på din Discord-profil - - - userName - Användarnamn:\nStäller in PS4ans användarkonto, som kan visas av vissa spel - - - TrophyKey - Trofényckel:\nNyckel som används för att avkryptera troféer. Måste hämtas från din konsoll (jailbroken).\nMåste innehålla endast hex-tecken - - - logTypeGroupBox - Loggtyp:\nStäller in huruvida synkronisering av utdata för loggfönstret för prestanda. Kan ha inverkan på emulationen - - - logFilter - Loggfilter:\nFiltrera loggen till att endast skriva ut specifik information.\nExempel: "Core:Trace" "Lib.Pad:Debug Common.Filesystem:Error" "*:Critical"\nNivåer: Trace, Debug, Info, Warning, Error, Critical - i den ordningen, en specifik nivå som tystar alla nivåer före den i listan och loggar allting efter den - - - updaterGroupBox - updaterGroupBox - - - GUIgroupBox - Spela upp titelmusik:\nOm ett spel har stöd för det kan speciell musik spelas upp från spelet i gränssnittet - - - disableTrophycheckBox - Inaktivera popup för troféer:\nInaktivera troféeaviseringar i spel. Troféförlopp kan fortfarande följas med Troféevisaren (högerklicka på spelet i huvudfönstret) - - - hideCursorGroupBox - Dölj pekare:\nVälj när muspekaren ska försvinna:\nAldrig: Du kommer alltid se muspekaren.\nOverksam: Ställ in en tid för när den ska försvinna efter den inte använts.\nAlltid: du kommer aldrig se muspekaren - - - idleTimeoutGroupBox - Dölj pekare vid overksam:\nLängden (sekunder) efter vilken som muspekaren som har varit overksam döljer sig själv - - - backButtonBehaviorGroupBox - Beteende för bakåtknapp:\nStäller in handkontrollerns bakåtknapp för att emulera ett tryck på angivna positionen på PS4ns touchpad - - - enableCompatibilityCheckBox - Visa kompatibilitetsdata:\nVisar information om spelkompatibilitet i tabellvyn. Aktivera "Uppdatera kompatibilitet vid uppstart" för att få uppdaterad information - - - checkCompatibilityOnStartupCheckBox - Uppdatera kompatibilitet vid uppstart:\nUppdatera automatiskt kompatibilitetsdatabasen när shadPS4 startar - - - updateCompatibilityButton - Uppdatera kompatibilitetsdatabasen:\nUppdaterar kompatibilitetsdatabasen direkt - - - Never - Aldrig - - - Idle - Overksam - - - Always - Alltid - - - Touchpad Left - Touchpad vänster - - - Touchpad Right - Touchpad höger - - - Touchpad Center - Touchpad mitten - - - None - Ingen - - - graphicsAdapterGroupBox - Grafikenhet:\nFör system med flera GPUer kan du välja den GPU som emulatorn ska använda från rullgardinsmenyn,\neller välja "Auto Select" för att automatiskt bestämma det - - - resolutionLayout - Bredd/Höjd:\nStäller in storleken för emulatorfönstret vid uppstart, som kan storleksändras under spelning.\nDetta är inte det samma som spelupplösningen - - - heightDivider - Vblank Divider:\nBildfrekvensen som emulatorn uppdaterar vid multipliceras med detta tal. Ändra detta kan ha inverkan på saker, såsom ökad spelhastighet eller göra sönder kritisk spelfunktionalitet, som inte förväntar sig denna ändring - - - dumpShadersCheckBox - Aktivera Shaders Dumping:\nFör teknisk felsökning, sparar spelets shaders till en mapp när de renderas - - - nullGpuCheckBox - Aktivera Null GPU:\nFör teknisk felsökning, inaktiverar spelrenderingen som om det inte fanns något grafikkort - - - gameFoldersBox - Spelmappar:\nListan över mappar att leta i efter installerade spel - - - addFolderButton - Aktivera separat uppdateringsmapp:\nAktiverar installation av speluppdateringar till en separat mapp för enkel hantering.\nDetta kan manuellt skapas genom att lägga till den uppackade uppdateringen till spelmappen med namnet "CUSA00000-UPDATE" där CUSA ID matchar spelets id - - - removeFolderButton - Ta bort:\nTa bort en mapp från listan - - - debugDump - Aktivera felsökningsdumpning:\nSparar import och export av symboler och fil-header-information för aktuellt körande PS4-program till en katalog - - - vkValidationCheckBox - Aktivera Vulkan Validation Layers:\nAktiverar ett system som validerar tillståndet för Vulkan renderer och loggar information om dess interna tillstånd.\nDetta kommer minska prestandan och antagligen ändra beteendet för emuleringen - - - vkSyncValidationCheckBox - Aktivera Vulkan Synchronization Validation:\nAktiverar ett system som validerar timing för Vulkan rendering tasks.\nDetta kommer minska prestandan och antagligen ändra beteendet för emuleringen - - - rdocCheckBox - Aktivera RenderDoc-felsökning:\nOm aktiverad kommer emulatorn att tillhandahålla kompatibilitet med Renderdoc för att tillåta fångst och analys för aktuell renderad bildruta - - - - CheatsPatches - - Cheats / Patches for - Fusk / Patchar för - - - defaultTextEdit_MSG - Fusk/Patchar är experimentella.\nAnvänd med försiktighet.\n\nHämta fusk individuellt genom att välja förrådet och klicka på hämtningsknappen.\nUnder Patchar-fliken kan du hämta alla patchar på en gång, välj vilken du vill använda och spara ditt val.\n\nEftersom vi inte utvecklar fusk eller patchar,\nrapportera gärna problem till fuskets upphovsperson.\n\nSkapat ett nytt fusk? Besök:\nhttps://github.com/shadps4-emu/ps4_cheats - - - No Image Available - Ingen bild tillgänglig - - - Serial: - Serienummer: - - - Version: - Version: - - - Size: - Storlek: - - - Select Cheat File: - Välj fuskfil: - - - Repository: - Förråd: - - - Download Cheats - Hämta fusk - - - Delete File - Ta bort fil - - - No files selected. - Inga filer valda. - - - You can delete the cheats you don't want after downloading them. - Du kan ta bort fusk som du inte vill ha efter de hämtats ner. - - - Do you want to delete the selected file?\n%1 - Vill du ta bort markerade filen?\n%1 - - - Select Patch File: - Välj patchfil: - - - Download Patches - Hämta patchar - - - Save - Spara - - - Cheats - Fusk - - - Patches - Patchar - - - Error - Fel - - - No patch selected. - Ingen patch vald. - - - Unable to open files.json for reading. - Kunde inte öppna files.json för läsning. - - - No patch file found for the current serial. - Ingen patchfil hittades för aktuella serienumret. - - - Unable to open the file for reading. - Kunde inte öppna filen för läsning. - - - Unable to open the file for writing. - Kunde inte öppna filen för skrivning. - - - Failed to parse XML: - Misslyckades med att tolka XML: - - - Success - Lyckades - - - Options saved successfully. - Inställningarna sparades. - - - Invalid Source - Ogiltig källa - - - The selected source is invalid. - Vald källa är ogiltig. - - - File Exists - Filen finns - - - File already exists. Do you want to replace it? - Filen finns redan. Vill du ersätta den? - - - Failed to save file: - Misslyckades med att spara fil: - - - Failed to download file: - Misslyckades med att hämta filen: - - - Cheats Not Found - Fusk hittades inte - - - CheatsNotFound_MSG - Inga fusk hittades för detta spel i denna version av det valda förrådet. Prova ett annat förråd eller en annan version av spelet - - - Cheats Downloaded Successfully - Fusk hämtades ner - - - CheatsDownloadedSuccessfully_MSG - Du har hämtat ner fusken för denna version av spelet från valt förråd. Du kan försöka att hämta från andra förråd, om de är tillgängliga så kan det vara möjligt att använda det genom att välja det genom att välja filen från listan - - - Failed to save: - Misslyckades med att spara: - - - Failed to download: - Misslyckades med att hämta: - - - Download Complete - Hämtning färdig - - - DownloadComplete_MSG - Patchhämtningen är färdig! Alla patchar tillgängliga för alla spel har hämtats och de behövs inte hämtas individuellt för varje spel som med fusk. Om patchen inte dyker upp kan det bero på att den inte finns för det specifika serienumret och versionen av spelet - - - Failed to parse JSON data from HTML. - Misslyckades med att tolka JSON-data från HTML. - - - Failed to retrieve HTML page. - Misslyckades med att hämta HTML-sida. - - - The game is in version: %1 - Spelet är i version: %1 - - - The downloaded patch only works on version: %1 - Hämtad patch fungerar endast på version: %1 - - - You may need to update your game. - Du kan behöva uppdatera ditt spel. - - - Incompatibility Notice - Inkompatibilitetsmeddelande - - - Failed to open file: - Misslyckades med att öppna filen: - - - XML ERROR: - XML-FEL: - - - Failed to open files.json for writing - Misslyckades med att öppna files.json för skrivning - - - Author: - Upphovsperson: - - - Directory does not exist: - Katalogen finns inte: - - - Failed to open files.json for reading. - Misslyckades med att öppna files.json för läsning. - - - Name: - Namn: - - - Can't apply cheats before the game is started - Kan inte tillämpa fusk innan spelet är startat - - - - GameListFrame - - Icon - Ikon - - - Name - Namn - - - Serial - Serienummer - - - Compatibility - Kompatibilitet - - - Region - Region - - - Firmware - Firmware - - - Size - Storlek - - - Version - Version - - - Path - Sökväg - - - Play Time - Speltid - - - Never Played - Aldrig spelat - - - h - h - - - m - m - - - s - s - - - Compatibility is untested - Kompatibilitet är otestat - - - Game does not initialize properly / crashes the emulator - Spelet initierar inte korrekt / kraschar emulatorn - - - Game boots, but only displays a blank screen - Spelet startar men visar endast en blank skärm - - - Game displays an image but does not go past the menu - Spelet visar en bild men kommer inte förbi menyn - - - Game has game-breaking glitches or unplayable performance - Spelet har allvarliga problem eller ospelbar prestanda - - - Game can be completed with playable performance and no major glitches - Spelet kan spelas klart med spelbar prestanda och utan större problem - - - - CheckUpdate - - Auto Updater - Automatisk uppdatering - - - Error - Fel - - - Network error: - Nätverksfel: - - - Failed to parse update information. - Misslyckades med att tolka uppdateringsinformationen. - - - No pre-releases found. - Inga förutgåva hittades. - - - Invalid release data. - Ogiltig release-data. - - - No download URL found for the specified asset. - Ingen hämtnings-URL hittades för angiven tillgång. - - - Your version is already up to date! - Din version är redan den senaste! - - - Update Available - Uppdatering tillgänglig - - - Update Channel - Uppdateringskanal - - - Current Version - Aktuell version - - - Latest Version - Senaste version - - - Do you want to update? - Vill du uppdatera? - - - Show Changelog - Visa ändringslogg - - - Check for Updates at Startup - Leta efter uppdateringar vid uppstart - - - Update - Uppdatera - - - No - Nej - - - Hide Changelog - Dölj ändringslogg - - - Changes - Ändringar - - - Network error occurred while trying to access the URL - Nätverksfel inträffade vid försök att komma åt URL:en - - - Download Complete - Hämtning färdig - - - The update has been downloaded, press OK to install. - Uppdateringen har hämtats. Tryck på Ok för att installera. - - - Failed to save the update file at - Misslyckades med att spara uppdateringsfilen i - - - Starting Update... - Startar uppdatering... - - - Failed to create the update script file - Misslyckades med att skapa uppdateringsskriptfil - - - - GameListUtils - - B - B - - - KB - KB - - - MB - MB - - - GB - GB - - - TB - TB - - - \ No newline at end of file + AboutDialog + + About shadPS4 + Om shadPS4 + + + shadPS4 + shadPS4 + + + shadPS4 is an experimental open-source emulator for the PlayStation 4. + shadPS4 är en experimentell emulator för PlayStation 4 baserad på öppen källkod. + + + This software should not be used to play games you have not legally obtained. + Denna programvara bör inte användas för att spela spel som du inte legalt äger. + + + + CheatsPatches + + Cheats / Patches for + Fusk / Patchar för + + + defaultTextEdit_MSG + Fusk/Patchar är experimentella.\nAnvänd med försiktighet.\n\nHämta fusk individuellt genom att välja förrådet och klicka på hämtningsknappen.\nUnder Patchar-fliken kan du hämta alla patchar på en gång, välj vilken du vill använda och spara ditt val.\n\nEftersom vi inte utvecklar fusk eller patchar,\nrapportera gärna problem till fuskets upphovsperson.\n\nSkapat ett nytt fusk? Besök:\nhttps://github.com/shadps4-emu/ps4_cheats + + + No Image Available + Ingen bild tillgänglig + + + Serial: + Serienummer: + + + Version: + Version: + + + Size: + Storlek: + + + Select Cheat File: + Välj fuskfil: + + + Repository: + Förråd: + + + Download Cheats + Hämta fusk + + + Delete File + Ta bort fil + + + No files selected. + Inga filer valda. + + + You can delete the cheats you don't want after downloading them. + Du kan ta bort fusk som du inte vill ha efter de hämtats ner. + + + Do you want to delete the selected file?\n%1 + Vill du ta bort markerade filen?\n%1 + + + Select Patch File: + Välj patchfil: + + + Download Patches + Hämta patchar + + + Save + Spara + + + Cheats + Fusk + + + Patches + Patchar + + + Error + Fel + + + No patch selected. + Ingen patch vald. + + + Unable to open files.json for reading. + Kunde inte öppna files.json för läsning. + + + No patch file found for the current serial. + Ingen patchfil hittades för aktuella serienumret. + + + Unable to open the file for reading. + Kunde inte öppna filen för läsning. + + + Unable to open the file for writing. + Kunde inte öppna filen för skrivning. + + + Failed to parse XML: + Misslyckades med att tolka XML: + + + Success + Lyckades + + + Options saved successfully. + Inställningarna sparades. + + + Invalid Source + Ogiltig källa + + + The selected source is invalid. + Vald källa är ogiltig. + + + File Exists + Filen finns + + + File already exists. Do you want to replace it? + Filen finns redan. Vill du ersätta den? + + + Failed to save file: + Misslyckades med att spara fil: + + + Failed to download file: + Misslyckades med att hämta filen: + + + Cheats Not Found + Fusk hittades inte + + + CheatsNotFound_MSG + Inga fusk hittades för detta spel i denna version av det valda förrådet. Prova ett annat förråd eller en annan version av spelet + + + Cheats Downloaded Successfully + Fusk hämtades ner + + + CheatsDownloadedSuccessfully_MSG + Du har hämtat ner fusken för denna version av spelet från valt förråd. Du kan försöka att hämta från andra förråd, om de är tillgängliga så kan det vara möjligt att använda det genom att välja det genom att välja filen från listan + + + Failed to save: + Misslyckades med att spara: + + + Failed to download: + Misslyckades med att hämta: + + + Download Complete + Hämtning färdig + + + DownloadComplete_MSG + Patchhämtningen är färdig! Alla patchar tillgängliga för alla spel har hämtats och de behövs inte hämtas individuellt för varje spel som med fusk. Om patchen inte dyker upp kan det bero på att den inte finns för det specifika serienumret och versionen av spelet + + + Failed to parse JSON data from HTML. + Misslyckades med att tolka JSON-data från HTML. + + + Failed to retrieve HTML page. + Misslyckades med att hämta HTML-sida. + + + The game is in version: %1 + Spelet är i version: %1 + + + The downloaded patch only works on version: %1 + Hämtad patch fungerar endast på version: %1 + + + You may need to update your game. + Du kan behöva uppdatera ditt spel. + + + Incompatibility Notice + Inkompatibilitetsmeddelande + + + Failed to open file: + Misslyckades med att öppna filen: + + + XML ERROR: + XML-FEL: + + + Failed to open files.json for writing + Misslyckades med att öppna files.json för skrivning + + + Author: + Upphovsperson: + + + Directory does not exist: + Katalogen finns inte: + + + Failed to open files.json for reading. + Misslyckades med att öppna files.json för läsning. + + + Name: + Namn: + + + Can't apply cheats before the game is started + Kan inte tillämpa fusk innan spelet är startat + + + Error: + Fel: + + + ERROR + FEL + + + + CheckUpdate + + Auto Updater + Automatisk uppdatering + + + Error + Fel + + + Network error: + Nätverksfel: + + + Failed to parse update information. + Misslyckades med att tolka uppdateringsinformationen. + + + No pre-releases found. + Inga förutgåva hittades. + + + Invalid release data. + Ogiltig release-data. + + + No download URL found for the specified asset. + Ingen hämtnings-URL hittades för angiven tillgång. + + + Your version is already up to date! + Din version är redan den senaste! + + + Update Available + Uppdatering tillgänglig + + + Update Channel + Uppdateringskanal + + + Current Version + Aktuell version + + + Latest Version + Senaste version + + + Do you want to update? + Vill du uppdatera? + + + Show Changelog + Visa ändringslogg + + + Check for Updates at Startup + Leta efter uppdateringar vid uppstart + + + Update + Uppdatera + + + No + Nej + + + Hide Changelog + Dölj ändringslogg + + + Changes + Ändringar + + + Network error occurred while trying to access the URL + Nätverksfel inträffade vid försök att komma åt URL:en + + + Download Complete + Hämtning färdig + + + The update has been downloaded, press OK to install. + Uppdateringen har hämtats. Tryck på Ok för att installera. + + + Failed to save the update file at + Misslyckades med att spara uppdateringsfilen i + + + Starting Update... + Startar uppdatering... + + + Failed to create the update script file + Misslyckades med att skapa uppdateringsskriptfil + + + + CompatibilityInfoClass + + Fetching compatibility data, please wait + Hämtar kompatibilitetsdata, vänta + + + Cancel + Avbryt + + + Loading... + Läser in... + + + Error + Fel + + + Unable to update compatibility data! Try again later. + Kunde inte uppdatera kompatibilitetsdata! Försök igen senare. + + + Unable to open compatibility.json for writing. + Kunde inte öppna compatibility.json för skrivning. + + + + ElfViewer + + Open Folder + Öppna mapp + + + + GameInfoClass + + Loading game list, please wait :3 + Läser in spellistan, vänta :3 + + + Cancel + Avbryt + + + Loading... + Läser in... + + + + GameInstallDialog + + shadPS4 - Choose directory + shadPS4 - Välj katalog + + + Directory to install games + Katalog att installera spel till + + + Browse + Bläddra + + + Error + Fel + + + Directory to install DLC + Katalog för att installera DLC + + + + GameListFrame + + Icon + Ikon + + + Name + Namn + + + Serial + Serienummer + + + Compatibility + Kompatibilitet + + + Region + Region + + + Firmware + Firmware + + + Size + Storlek + + + Version + Version + + + Path + Sökväg + + + Play Time + Speltid + + + Never Played + Aldrig spelat + + + h + h + + + m + m + + + s + s + + + Compatibility is untested + Kompatibilitet är otestat + + + Game does not initialize properly / crashes the emulator + Spelet initierar inte korrekt / kraschar emulatorn + + + Game boots, but only displays a blank screen + Spelet startar men visar endast en blank skärm + + + Game displays an image but does not go past the menu + Spelet visar en bild men kommer inte förbi menyn + + + Game has game-breaking glitches or unplayable performance + Spelet har allvarliga problem eller ospelbar prestanda + + + Game can be completed with playable performance and no major glitches + Spelet kan spelas klart med spelbar prestanda och utan större problem + + + Click to go to issue + Klicka för att gå till problem + + + Last updated + Senast uppdaterad + + + + GameListUtils + + B + B + + + KB + KB + + + MB + MB + + + GB + GB + + + TB + TB + + + + GuiContextMenus + + Create Shortcut + Skapa genväg + + + Cheats / Patches + Fusk / Patchar + + + SFO Viewer + SFO-visare + + + Trophy Viewer + Trofé-visare + + + Open Folder... + Öppna mapp... + + + Open Game Folder + Öppna spelmapp + + + Open Save Data Folder + Öppna mapp för sparat data + + + Open Log Folder + Öppna loggmapp + + + Copy info... + Kopiera till... + + + Copy Name + Kopiera namn + + + Copy Serial + Kopiera serienummer + + + Copy All + Kopiera alla + + + Delete... + Ta bort... + + + Delete Game + Ta bort spel + + + Delete Update + Ta bort uppdatering + + + Delete DLC + Ta bort DLC + + + Compatibility... + Kompatibilitet... + + + Update database + Uppdatera databasen + + + View report + Visa rapport + + + Submit a report + Skicka en rapport + + + Shortcut creation + Skapa genväg + + + Shortcut created successfully! + Genvägen skapades! + + + Error + Fel + + + Error creating shortcut! + Fel vid skapandet av genväg! + + + Install PKG + Installera PKG + + + Game + Spel + + + This game has no update to delete! + Detta spel har ingen uppdatering att ta bort! + + + Update + Uppdatera + + + This game has no DLC to delete! + Detta spel har inga DLC att ta bort! + + + DLC + DLC + + + Delete %1 + Ta bort %1 + + + Are you sure you want to delete %1's %2 directory? + Är du säker på att du vill ta bort %1s %2-katalog? + + + Failed to convert icon. + Misslyckades med att konvertera ikon. + + + + InstallDirSelect + + shadPS4 - Choose directory + shadPS4 - Välj katalog + + + Select which directory you want to install to. + Välj vilken katalog som du vill installera till. + + + + MainWindow + + Open/Add Elf Folder + Öppna/Lägg till Elf-mapp + + + Install Packages (PKG) + Installera paket (PKG) + + + Boot Game + Starta spel + + + Check for Updates + Leta efter uppdateringar + + + About shadPS4 + Om shadPS4 + + + Configure... + Konfigurera... + + + Install application from a .pkg file + Installera program från en .pkg-fil + + + Recent Games + Senaste spel + + + Exit + Avsluta + + + Exit shadPS4 + Avsluta shadPS4 + + + Exit the application. + Avsluta programmet. + + + Show Game List + Visa spellista + + + Game List Refresh + Uppdatera spellista + + + Tiny + Mycket små + + + Small + Små + + + Medium + Medel + + + Large + Stora + + + List View + Listvy + + + Grid View + Rutnätsvy + + + Elf Viewer + Elf-visare + + + Game Install Directory + Installationskatalog för spel + + + Download Cheats/Patches + Hämta fusk/patchar + + + Dump Game List + Dumpa spellista + + + PKG Viewer + PKG-visare + + + Search... + Sök... + + + File + Arkiv + + + View + Visa + + + Game List Icons + Ikoner för spellista + + + Game List Mode + Läge för spellista + + + Settings + Inställningar + + + Utils + Verktyg + + + Themes + Teman + + + Help + Hjälp + + + Dark + Mörk + + + Light + Ljus + + + Green + Grön + + + Blue + Blå + + + Violet + Lila + + + toolBar + toolBar + + + Game List + Spellista + + + * Unsupported Vulkan Version + * Vulkan-versionen stöds inte + + + Download Cheats For All Installed Games + Hämta fusk för alla installerade spel + + + Download Patches For All Games + Hämta patchar för alla spel + + + Download Complete + Hämtning färdig + + + You have downloaded cheats for all the games you have installed. + Du har hämtat fusk till alla spelen som du har installerade. + + + Patches Downloaded Successfully! + Patchar hämtades ner! + + + All Patches available for all games have been downloaded. + Alla patchar tillgängliga för alla spel har hämtats ner. + + + Games: + Spel: + + + ELF files (*.bin *.elf *.oelf) + ELF-filer (*.bin *.elf *.oelf) + + + Game Boot + Starta spel + + + Only one file can be selected! + Endast en fil kan väljas! + + + PKG Extraction + PKG-extrahering + + + Patch detected! + Patch upptäcktes! + + + PKG and Game versions match: + PKG och spelversioner matchar: + + + Would you like to overwrite? + Vill du skriva över? + + + PKG Version %1 is older than installed version: + PKG-versionen %1 är äldre än installerad version: + + + Game is installed: + Spelet är installerat: + + + Would you like to install Patch: + Vill du installera patch: + + + DLC Installation + DLC-installation + + + Would you like to install DLC: %1? + Vill du installera DLC: %1? + + + DLC already installed: + DLC redan installerat: + + + Game already installed + Spelet redan installerat + + + PKG ERROR + PKG-FEL + + + Extracting PKG %1/%2 + Extraherar PKG %1/%2 + + + Extraction Finished + Extrahering färdig + + + Game successfully installed at %1 + Spelet installerades i %1 + + + File doesn't appear to be a valid PKG file + Filen verkar inte vara en giltig PKG-fil + + + Run Game + Kör spel + + + Eboot.bin file not found + Filen eboot.bin hittades inte + + + PKG File (*.PKG *.pkg) + PKG-fil (*.PKG *.pkg) + + + PKG is a patch or DLC, please install the game first! + PKG är en patch eller DLC. Installera spelet först! + + + Game is already running! + Spelet är redan igång! + + + shadPS4 + shadPS4 + + + + PKGViewer + + Open Folder + Öppna mapp + + + &File + &Arkiv + + + PKG ERROR + PKG-FEL + + + + SettingsDialog + + Settings + Inställningar + + + General + Allmänt + + + System + System + + + Console Language + Konsollspråk + + + Emulator Language + Emulatorspråk + + + Emulator + Emulator + + + Enable Fullscreen + Aktivera helskärm + + + Enable Separate Update Folder + Aktivera separat uppdateringsmapp + + + Show Splash + Visa startskärm + + + Enable Discord Rich Presence + Aktivera Discord Rich Presence + + + Username + Användarnamn + + + Trophy Key + Trofényckel + + + Trophy + Trofé + + + Logger + Loggning + + + Log Type + Loggtyp + + + Log Filter + Loggfilter + + + Input + Inmatning + + + Cursor + Pekare + + + Hide Cursor + Dölj pekare + + + Hide Cursor Idle Timeout + Dölj pekare vid overksam + + + s + s + + + Controller + Handkontroller + + + Back Button Behavior + Beteende för bakåtknapp + + + Graphics + Grafik + + + Graphics Device + Grafikenhet + + + Width + Bredd + + + Height + Höjd + + + Vblank Divider + Vblank Divider + + + Advanced + Avancerat + + + Enable Shaders Dumping + Aktivera Shaders Dumping + + + Enable NULL GPU + Aktivera NULL GPU + + + Paths + Sökvägar + + + Game Folders + Spelmappar + + + Add... + Lägg till... + + + Remove + Ta bort + + + Debug + Felsök + + + Enable Debug Dumping + Aktivera felsökningsdumpning + + + Enable Vulkan Validation Layers + Aktivera Vulkan Validation Layers + + + Enable Vulkan Synchronization Validation + Aktivera Vulkan Synchronization Validation + + + Enable RenderDoc Debugging + Aktivera RenderDoc-felsökning + + + Update + Uppdatera + + + Check for Updates at Startup + Leta efter uppdateringar vid uppstart + + + Update Channel + Uppdateringskanal + + + Check for Updates + Leta efter uppdateringar + + + GUI Settings + Gränssnittsinställningar + + + Disable Trophy Pop-ups + Inaktivera popup för troféer + + + Play title music + Spela titelmusik + + + Update Compatibility Database On Startup + Uppdatera databas vid uppstart + + + Game Compatibility + Spelkompatibilitet + + + Display Compatibility Data + Visa kompatibilitetsdata + + + Update Compatibility Database + Uppdatera kompatibilitetsdatabasen + + + Volume + Volym + + + Save + Spara + + + Apply + Verkställ + + + Restore Defaults + Återställ till standard + + + Close + Stäng + + + Point your mouse at an option to display its description. + Peka din mus på ett alternativ för att visa dess beskrivning. + + + consoleLanguageGroupBox + Konsollspråk:\nStäller in språket som PS4-spelet använder.\nDet rekommenderas att ställa in detta till ett språk som spelet har stöd för, vilket kan skilja sig mellan regioner + + + emulatorLanguageGroupBox + Emulatorspråk:\nStäller in språket för emulatorns användargränssnitt + + + fullscreenCheckBox + Aktivera helskärm:\nStäller automatiskt in spelfönstret till helskämsläget.\nDetta kan växlas genom att trycka på F11-tangenten + + + separateUpdatesCheckBox + Aktivera separat uppdateringsmapp:\nAktiverar installation av speluppdateringar i en separat mapp för enkel hantering.\nDetta kan skapas manuellt genom att lägga till uppackad uppdatering till spelmappen med namnet "CUSA00000-UPDATE" där CUSA ID matchar spelets id + + + showSplashCheckBox + Visa startskärm:\nVisar spelets startskärm (en speciell bild) när spelet startas + + + discordRPCCheckbox + Aktivera Discord Rich Presence:\nVisar emulatorikonen och relevant information på din Discord-profil + + + userName + Användarnamn:\nStäller in PS4ans användarkonto, som kan visas av vissa spel + + + TrophyKey + Trofényckel:\nNyckel som används för att avkryptera troféer. Måste hämtas från din konsoll (jailbroken).\nMåste innehålla endast hex-tecken + + + logTypeGroupBox + Loggtyp:\nStäller in huruvida synkronisering av utdata för loggfönstret för prestanda. Kan ha inverkan på emulationen + + + logFilter + Loggfilter:\nFiltrera loggen till att endast skriva ut specifik information.\nExempel: "Core:Trace" "Lib.Pad:Debug Common.Filesystem:Error" "*:Critical"\nNivåer: Trace, Debug, Info, Warning, Error, Critical - i den ordningen, en specifik nivå som tystar alla nivåer före den i listan och loggar allting efter den + + + updaterGroupBox + updaterGroupBox + + + GUIgroupBox + Spela upp titelmusik:\nOm ett spel har stöd för det kan speciell musik spelas upp från spelet i gränssnittet + + + disableTrophycheckBox + Inaktivera popup för troféer:\nInaktivera troféeaviseringar i spel. Troféförlopp kan fortfarande följas med Troféevisaren (högerklicka på spelet i huvudfönstret) + + + hideCursorGroupBox + Dölj pekare:\nVälj när muspekaren ska försvinna:\nAldrig: Du kommer alltid se muspekaren.\nOverksam: Ställ in en tid för när den ska försvinna efter den inte använts.\nAlltid: du kommer aldrig se muspekaren + + + idleTimeoutGroupBox + Dölj pekare vid overksam:\nLängden (sekunder) efter vilken som muspekaren som har varit overksam döljer sig själv + + + backButtonBehaviorGroupBox + Beteende för bakåtknapp:\nStäller in handkontrollerns bakåtknapp för att emulera ett tryck på angivna positionen på PS4ns touchpad + + + enableCompatibilityCheckBox + Visa kompatibilitetsdata:\nVisar information om spelkompatibilitet i tabellvyn. Aktivera "Uppdatera kompatibilitet vid uppstart" för att få uppdaterad information + + + checkCompatibilityOnStartupCheckBox + Uppdatera kompatibilitet vid uppstart:\nUppdatera automatiskt kompatibilitetsdatabasen när shadPS4 startar + + + updateCompatibilityButton + Uppdatera kompatibilitetsdatabasen:\nUppdaterar kompatibilitetsdatabasen direkt + + + Never + Aldrig + + + Idle + Overksam + + + Always + Alltid + + + Touchpad Left + Touchpad vänster + + + Touchpad Right + Touchpad höger + + + Touchpad Center + Touchpad mitten + + + None + Ingen + + + graphicsAdapterGroupBox + Grafikenhet:\nFör system med flera GPUer kan du välja den GPU som emulatorn ska använda från rullgardinsmenyn,\neller välja "Auto Select" för att automatiskt bestämma det + + + resolutionLayout + Bredd/Höjd:\nStäller in storleken för emulatorfönstret vid uppstart, som kan storleksändras under spelning.\nDetta är inte det samma som spelupplösningen + + + heightDivider + Vblank Divider:\nBildfrekvensen som emulatorn uppdaterar vid multipliceras med detta tal. Ändra detta kan ha inverkan på saker, såsom ökad spelhastighet eller göra sönder kritisk spelfunktionalitet, som inte förväntar sig denna ändring + + + dumpShadersCheckBox + Aktivera Shaders Dumping:\nFör teknisk felsökning, sparar spelets shaders till en mapp när de renderas + + + nullGpuCheckBox + Aktivera Null GPU:\nFör teknisk felsökning, inaktiverar spelrenderingen som om det inte fanns något grafikkort + + + gameFoldersBox + Spelmappar:\nListan över mappar att leta i efter installerade spel + + + addFolderButton + Aktivera separat uppdateringsmapp:\nAktiverar installation av speluppdateringar till en separat mapp för enkel hantering.\nDetta kan manuellt skapas genom att lägga till den uppackade uppdateringen till spelmappen med namnet "CUSA00000-UPDATE" där CUSA ID matchar spelets id + + + removeFolderButton + Ta bort:\nTa bort en mapp från listan + + + debugDump + Aktivera felsökningsdumpning:\nSparar import och export av symboler och fil-header-information för aktuellt körande PS4-program till en katalog + + + vkValidationCheckBox + Aktivera Vulkan Validation Layers:\nAktiverar ett system som validerar tillståndet för Vulkan renderer och loggar information om dess interna tillstånd.\nDetta kommer minska prestandan och antagligen ändra beteendet för emuleringen + + + vkSyncValidationCheckBox + Aktivera Vulkan Synchronization Validation:\nAktiverar ett system som validerar timing för Vulkan rendering tasks.\nDetta kommer minska prestandan och antagligen ändra beteendet för emuleringen + + + rdocCheckBox + Aktivera RenderDoc-felsökning:\nOm aktiverad kommer emulatorn att tillhandahålla kompatibilitet med Renderdoc för att tillåta fångst och analys för aktuell renderad bildruta + + + Release + Release + + + Nightly + Nightly + + + Set the volume of the background music. + Ställ in volymen för bakgrundsmusiken. + + + async + asynk + + + sync + synk + + + Directory to install games + Katalog att installera spel till + + + + TrophyViewer + + Trophy Viewer + Trofé-visare + + + From 86038e6a71258e9a2f34c61911a1c48b4c627950 Mon Sep 17 00:00:00 2001 From: squidbus <175574877+squidbus@users.noreply.github.com> Date: Tue, 7 Jan 2025 01:36:14 -0800 Subject: [PATCH 02/10] shader_recompiler: Fix V_CMP_U_F32 (#2082) --- src/shader_recompiler/frontend/translate/vector_alu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shader_recompiler/frontend/translate/vector_alu.cpp b/src/shader_recompiler/frontend/translate/vector_alu.cpp index 2b32ca2ce..7fa83eebb 100644 --- a/src/shader_recompiler/frontend/translate/vector_alu.cpp +++ b/src/shader_recompiler/frontend/translate/vector_alu.cpp @@ -904,7 +904,7 @@ void Translator::V_CMP_F32(ConditionOp op, bool set_exec, const GcnInst& inst) { case ConditionOp::GE: return ir.FPGreaterThanEqual(src0, src1); case ConditionOp::U: - return ir.LogicalNot(ir.LogicalAnd(ir.FPIsNan(src0), ir.FPIsNan(src1))); + return ir.LogicalOr(ir.FPIsNan(src0), ir.FPIsNan(src1)); default: UNREACHABLE(); } From c3ecf599ad779361a44d2dd6b6823a8c1a6f93da Mon Sep 17 00:00:00 2001 From: kalaposfos13 <153381648+kalaposfos13@users.noreply.github.com> Date: Tue, 7 Jan 2025 10:50:54 +0100 Subject: [PATCH 03/10] Add motion controls toggle (#2029) * Add motion controls toggle * clang --- src/common/config.cpp | 11 +++++++++++ src/common/config.h | 4 +++- src/input/controller.cpp | 31 +++++++++++++++---------------- src/qt_gui/settings_dialog.cpp | 3 +++ src/qt_gui/settings_dialog.ui | 7 +++++++ 5 files changed, 39 insertions(+), 17 deletions(-) diff --git a/src/common/config.cpp b/src/common/config.cpp index 9e2cc0020..1838f35fc 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -47,6 +47,7 @@ static std::string updateChannel; static std::string backButtonBehavior = "left"; static bool useSpecialPad = false; static int specialPadClass = 1; +static bool isMotionControlsEnabled = true; static bool isDebugDump = false; static bool isShaderDebug = false; static bool isShowSplash = false; @@ -172,6 +173,10 @@ int getSpecialPadClass() { return specialPadClass; } +bool getIsMotionControlsEnabled() { + return isMotionControlsEnabled; +} + bool debugDump() { return isDebugDump; } @@ -368,6 +373,10 @@ void setSpecialPadClass(int type) { specialPadClass = type; } +void setIsMotionControlsEnabled(bool use) { + isMotionControlsEnabled = use; +} + void setSeparateUpdateEnabled(bool use) { separateupdatefolder = use; } @@ -594,6 +603,7 @@ void load(const std::filesystem::path& path) { backButtonBehavior = toml::find_or(input, "backButtonBehavior", "left"); useSpecialPad = toml::find_or(input, "useSpecialPad", false); specialPadClass = toml::find_or(input, "specialPadClass", 1); + isMotionControlsEnabled = toml::find_or(input, "isMotionControlsEnabled", true); } if (data.contains("GPU")) { @@ -709,6 +719,7 @@ void save(const std::filesystem::path& path) { data["Input"]["backButtonBehavior"] = backButtonBehavior; data["Input"]["useSpecialPad"] = useSpecialPad; data["Input"]["specialPadClass"] = specialPadClass; + data["Input"]["isMotionControlsEnabled"] = isMotionControlsEnabled; data["GPU"]["screenWidth"] = screenWidth; data["GPU"]["screenHeight"] = screenHeight; data["GPU"]["nullGpu"] = isNullGpu; diff --git a/src/common/config.h b/src/common/config.h index 2b9a35449..d2860bec5 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -38,6 +38,7 @@ int getCursorHideTimeout(); std::string getBackButtonBehavior(); bool getUseSpecialPad(); int getSpecialPadClass(); +bool getIsMotionControlsEnabled(); u32 getScreenWidth(); u32 getScreenHeight(); @@ -84,6 +85,7 @@ void setCursorHideTimeout(int newcursorHideTimeout); void setBackButtonBehavior(const std::string& type); void setUseSpecialPad(bool use); void setSpecialPadClass(int type); +void setIsMotionControlsEnabled(bool use); void setLogType(const std::string& type); void setLogFilter(const std::string& type); @@ -139,4 +141,4 @@ void setDefaultValues(); // settings u32 GetLanguage(); -}; // namespace Config \ No newline at end of file +}; // namespace Config diff --git a/src/input/controller.cpp b/src/input/controller.cpp index 366d80f8f..eb43e6adf 100644 --- a/src/input/controller.cpp +++ b/src/input/controller.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include +#include "common/config.h" #include "common/logging/log.h" #include "core/libraries/kernel/time.h" #include "core/libraries/pad/pad.h" @@ -189,11 +190,6 @@ void GameController::CalculateOrientation(Libraries::Pad::OrbisFVector3& acceler gz += Kp * ez + Ki * eInt[2]; //// Integrate rate of change of quaternion - // float pa = q2, pb = q3, pc = q4; - // q1 += (-q2 * gx - q3 * gy - q4 * gz) * (0.5f * deltaTime); - // q2 += (pa * gx + pb * gz - pc * gy) * (0.5f * deltaTime); - // q3 += (pb * gy - pa * gz + pc * gx) * (0.5f * deltaTime); - // q4 += (pc * gz + pa * gy - pb * gx) * (0.5f * deltaTime); q1 += (-q2 * gx - q3 * gy - q4 * gz) * (0.5f * deltaTime); q2 += (q1 * gx + q3 * gz - q4 * gy) * (0.5f * deltaTime); q3 += (q1 * gy - q2 * gz + q4 * gx) * (0.5f * deltaTime); @@ -247,18 +243,21 @@ void GameController::TryOpenSDLController() { int gamepad_count; SDL_JoystickID* gamepads = SDL_GetGamepads(&gamepad_count); m_sdl_gamepad = gamepad_count > 0 ? SDL_OpenGamepad(gamepads[0]) : nullptr; - if (SDL_SetGamepadSensorEnabled(m_sdl_gamepad, SDL_SENSOR_GYRO, true)) { - gyro_poll_rate = SDL_GetGamepadSensorDataRate(m_sdl_gamepad, SDL_SENSOR_GYRO); - LOG_INFO(Input, "Gyro initialized, poll rate: {}", gyro_poll_rate); - } else { - LOG_ERROR(Input, "Failed to initialize gyro controls for gamepad"); - } - if (SDL_SetGamepadSensorEnabled(m_sdl_gamepad, SDL_SENSOR_ACCEL, true)) { - accel_poll_rate = SDL_GetGamepadSensorDataRate(m_sdl_gamepad, SDL_SENSOR_ACCEL); - LOG_INFO(Input, "Accel initialized, poll rate: {}", accel_poll_rate); - } else { - LOG_ERROR(Input, "Failed to initialize accel controls for gamepad"); + if (Config::getIsMotionControlsEnabled()) { + if (SDL_SetGamepadSensorEnabled(m_sdl_gamepad, SDL_SENSOR_GYRO, true)) { + gyro_poll_rate = SDL_GetGamepadSensorDataRate(m_sdl_gamepad, SDL_SENSOR_GYRO); + LOG_INFO(Input, "Gyro initialized, poll rate: {}", gyro_poll_rate); + } else { + LOG_ERROR(Input, "Failed to initialize gyro controls for gamepad"); + } + if (SDL_SetGamepadSensorEnabled(m_sdl_gamepad, SDL_SENSOR_ACCEL, true)) { + accel_poll_rate = SDL_GetGamepadSensorDataRate(m_sdl_gamepad, SDL_SENSOR_ACCEL); + LOG_INFO(Input, "Accel initialized, poll rate: {}", accel_poll_rate); + } else { + LOG_ERROR(Input, "Failed to initialize accel controls for gamepad"); + } } + SDL_free(gamepads); SetLightBarRGB(0, 0, 255); diff --git a/src/qt_gui/settings_dialog.cpp b/src/qt_gui/settings_dialog.cpp index 6d76a5318..1a03345e4 100644 --- a/src/qt_gui/settings_dialog.cpp +++ b/src/qt_gui/settings_dialog.cpp @@ -339,6 +339,8 @@ void SettingsDialog::LoadValuesFromConfig() { toml::find_or(data, "Input", "backButtonBehavior", "left")); int index = ui->backButtonBehaviorComboBox->findData(backButtonBehavior); ui->backButtonBehaviorComboBox->setCurrentIndex(index != -1 ? index : 0); + ui->motionControlsCheckBox->setChecked( + toml::find_or(data, "Input", "isMotionControlsEnabled", true)); ui->removeFolderButton->setEnabled(!ui->gameFoldersListWidget->selectedItems().isEmpty()); ResetInstallFolders(); @@ -532,6 +534,7 @@ void SettingsDialog::UpdateSettings() { const QVector TouchPadIndex = {"left", "center", "right", "none"}; Config::setBackButtonBehavior(TouchPadIndex[ui->backButtonBehaviorComboBox->currentIndex()]); + Config::setIsMotionControlsEnabled(ui->motionControlsCheckBox->isChecked()); Config::setFullscreenMode(ui->fullscreenCheckBox->isChecked()); Config::setisTrophyPopupDisabled(ui->disableTrophycheckBox->isChecked()); Config::setPlayBGM(ui->playBGMCheckBox->isChecked()); diff --git a/src/qt_gui/settings_dialog.ui b/src/qt_gui/settings_dialog.ui index 2e7e3db37..cefe1f7c7 100644 --- a/src/qt_gui/settings_dialog.ui +++ b/src/qt_gui/settings_dialog.ui @@ -815,6 +815,13 @@ + + + + Enable Motion Controls + + + From b0d7feb2929a03b7bccd2adb799009487b4fd59b Mon Sep 17 00:00:00 2001 From: squidbus <175574877+squidbus@users.noreply.github.com> Date: Tue, 7 Jan 2025 02:21:49 -0800 Subject: [PATCH 04/10] video_core: Implement conversion for uncommon/unsupported number formats. (#2047) * video_core: Implement conversion for uncommon/unsupported number formats. * shader_recompiler: Reinterpret image sample output as well. * liverpool_to_vk: Remove mappings for remapped number formats. These were poorly supported by drivers anyway. * resource_tracking_pass: Fix image write swizzle mistake. * amdgpu: Add missing specialization and move format mapping data to types * reinterpret: Fix U/SToF input type. --- .../frontend/translate/export.cpp | 9 +- .../ir/passes/resource_tracking_pass.cpp | 522 +++++++++--------- src/shader_recompiler/ir/reinterpret.h | 64 ++- src/shader_recompiler/runtime_info.h | 1 + src/shader_recompiler/specialization.h | 4 + src/video_core/amdgpu/liverpool.h | 8 +- src/video_core/amdgpu/pixel_format.cpp | 2 +- src/video_core/amdgpu/resource.h | 102 +--- src/video_core/amdgpu/types.h | 122 +++- .../renderer_vulkan/liverpool_to_vk.cpp | 33 +- .../renderer_vulkan/vk_graphics_pipeline.h | 1 + .../renderer_vulkan/vk_pipeline_cache.cpp | 3 + 12 files changed, 486 insertions(+), 385 deletions(-) diff --git a/src/shader_recompiler/frontend/translate/export.cpp b/src/shader_recompiler/frontend/translate/export.cpp index 83240e17f..38ff9ae14 100644 --- a/src/shader_recompiler/frontend/translate/export.cpp +++ b/src/shader_recompiler/frontend/translate/export.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "shader_recompiler/frontend/translate/translate.h" +#include "shader_recompiler/ir/reinterpret.h" #include "shader_recompiler/runtime_info.h" namespace Shader::Gcn { @@ -31,14 +32,16 @@ void Translator::EmitExport(const GcnInst& inst) { return; } const u32 index = u32(attrib) - u32(IR::Attribute::RenderTarget0); - const auto [r, g, b, a] = runtime_info.fs_info.color_buffers[index].swizzle; + const auto col_buf = runtime_info.fs_info.color_buffers[index]; + const auto converted = IR::ApplyWriteNumberConversion(ir, value, col_buf.num_conversion); + const auto [r, g, b, a] = col_buf.swizzle; const std::array swizzle_array = {r, g, b, a}; const auto swizzled_comp = swizzle_array[comp]; if (u32(swizzled_comp) < u32(AmdGpu::CompSwizzle::Red)) { - ir.SetAttribute(attrib, value, comp); + ir.SetAttribute(attrib, converted, comp); return; } - ir.SetAttribute(attrib, value, u32(swizzled_comp) - u32(AmdGpu::CompSwizzle::Red)); + ir.SetAttribute(attrib, converted, u32(swizzled_comp) - u32(AmdGpu::CompSwizzle::Red)); }; const auto unpack = [&](u32 idx) { diff --git a/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp b/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp index 636752912..f7040ad75 100644 --- a/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp +++ b/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp @@ -301,8 +301,7 @@ s32 TryHandleInlineCbuf(IR::Inst& inst, Info& info, Descriptors& descriptors, }); } -void PatchBufferInstruction(IR::Block& block, IR::Inst& inst, Info& info, - Descriptors& descriptors) { +void PatchBufferSharp(IR::Block& block, IR::Inst& inst, Info& info, Descriptors& descriptors) { s32 binding{}; AmdGpu::Buffer buffer; if (binding = TryHandleInlineCbuf(inst, info, descriptors, buffer); binding == -1) { @@ -317,19 +316,191 @@ void PatchBufferInstruction(IR::Block& block, IR::Inst& inst, Info& info, }); } - // Update buffer descriptor format. - const auto inst_info = inst.Flags(); - // Replace handle with binding index in buffer resource list. IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)}; inst.SetArg(0, ir.Imm32(binding)); +} + +void PatchTextureBufferSharp(IR::Block& block, IR::Inst& inst, Info& info, + Descriptors& descriptors) { + const IR::Inst* handle = inst.Arg(0).InstRecursive(); + const IR::Inst* producer = handle->Arg(0).InstRecursive(); + const auto sharp = TrackSharp(producer, info); + const s32 binding = descriptors.Add(TextureBufferResource{ + .sharp_idx = sharp, + .is_written = inst.GetOpcode() == IR::Opcode::StoreBufferFormatF32, + }); + + // Replace handle with binding index in texture buffer resource list. + IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)}; + inst.SetArg(0, ir.Imm32(binding)); +} + +void PatchImageSharp(IR::Block& block, IR::Inst& inst, Info& info, Descriptors& descriptors) { + const auto pred = [](const IR::Inst* inst) -> std::optional { + const auto opcode = inst->GetOpcode(); + if (opcode == IR::Opcode::CompositeConstructU32x2 || // IMAGE_SAMPLE (image+sampler) + opcode == IR::Opcode::ReadConst || // IMAGE_LOAD (image only) + opcode == IR::Opcode::GetUserData) { + return inst; + } + return std::nullopt; + }; + const auto result = IR::BreadthFirstSearch(&inst, pred); + ASSERT_MSG(result, "Unable to find image sharp source"); + const IR::Inst* producer = result.value(); + const bool has_sampler = producer->GetOpcode() == IR::Opcode::CompositeConstructU32x2; + const auto tsharp_handle = has_sampler ? producer->Arg(0).InstRecursive() : producer; + + // Read image sharp. + const auto tsharp = TrackSharp(tsharp_handle, info); + const auto inst_info = inst.Flags(); + auto image = info.ReadUdSharp(tsharp); + if (!image.Valid()) { + LOG_ERROR(Render_Vulkan, "Shader compiled with unbound image!"); + image = AmdGpu::Image::Null(); + } + ASSERT(image.GetType() != AmdGpu::ImageType::Invalid); + const bool is_read = inst.GetOpcode() == IR::Opcode::ImageRead; + const bool is_written = inst.GetOpcode() == IR::Opcode::ImageWrite; + + // Patch image instruction if image is FMask. + if (image.IsFmask()) { + ASSERT_MSG(!is_written, "FMask storage instructions are not supported"); + + IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)}; + switch (inst.GetOpcode()) { + case IR::Opcode::ImageRead: + case IR::Opcode::ImageSampleRaw: { + IR::F32 fmaskx = ir.BitCast(ir.Imm32(0x76543210)); + IR::F32 fmasky = ir.BitCast(ir.Imm32(0xfedcba98)); + inst.ReplaceUsesWith(ir.CompositeConstruct(fmaskx, fmasky)); + return; + } + case IR::Opcode::ImageQueryLod: + inst.ReplaceUsesWith(ir.Imm32(1)); + return; + case IR::Opcode::ImageQueryDimensions: { + IR::Value dims = ir.CompositeConstruct(ir.Imm32(static_cast(image.width)), // x + ir.Imm32(static_cast(image.width)), // y + ir.Imm32(1), ir.Imm32(1)); // depth, mip + inst.ReplaceUsesWith(dims); + + // Track FMask resource to do specialization. + descriptors.Add(FMaskResource{ + .sharp_idx = tsharp, + }); + return; + } + default: + UNREACHABLE_MSG("Can't patch fmask instruction {}", inst.GetOpcode()); + } + } + + u32 image_binding = descriptors.Add(ImageResource{ + .sharp_idx = tsharp, + .is_depth = bool(inst_info.is_depth), + .is_atomic = IsImageAtomicInstruction(inst), + .is_array = bool(inst_info.is_array), + .is_read = is_read, + .is_written = is_written, + }); + + IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)}; + + if (inst.GetOpcode() == IR::Opcode::ImageSampleRaw) { + // Read sampler sharp. + const auto [sampler_binding, sampler] = [&] -> std::pair { + ASSERT(producer->GetOpcode() == IR::Opcode::CompositeConstructU32x2); + const IR::Value& handle = producer->Arg(1); + // Inline sampler resource. + if (handle.IsImmediate()) { + LOG_WARNING(Render_Vulkan, "Inline sampler detected"); + const auto inline_sampler = AmdGpu::Sampler{.raw0 = handle.U32()}; + const auto binding = descriptors.Add(SamplerResource{ + .sharp_idx = std::numeric_limits::max(), + .inline_sampler = inline_sampler, + }); + return {binding, inline_sampler}; + } + // Normal sampler resource. + const auto ssharp_handle = handle.InstRecursive(); + const auto& [ssharp_ud, disable_aniso] = TryDisableAnisoLod0(ssharp_handle); + const auto ssharp = TrackSharp(ssharp_ud, info); + const auto binding = descriptors.Add(SamplerResource{ + .sharp_idx = ssharp, + .associated_image = image_binding, + .disable_aniso = disable_aniso, + }); + return {binding, info.ReadUdSharp(ssharp)}; + }(); + // Patch image and sampler handle. + inst.SetArg(0, ir.Imm32(image_binding | sampler_binding << 16)); + } else { + // Patch image handle. + inst.SetArg(0, ir.Imm32(image_binding)); + } +} + +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, + .is_written = true, + }); + + const auto pred = [](const IR::Inst* inst) -> std::optional { + if (inst->GetOpcode() == IR::Opcode::GetUserData) { + return inst; + } + return std::nullopt; + }; + + // Attempt to deduce the GDS address of counter at compile time. + const u32 gds_addr = [&] { + const IR::Value& gds_offset = inst.Arg(0); + if (gds_offset.IsImmediate()) { + // Nothing to do, offset is known. + return gds_offset.U32() & 0xFFFF; + } + const auto result = IR::BreadthFirstSearch(&inst, pred); + ASSERT_MSG(result, "Unable to track M0 source"); + + // M0 must be set by some user data register. + const IR::Inst* prod = gds_offset.InstRecursive(); + const u32 ud_reg = u32(result.value()->Arg(0).ScalarReg()); + u32 m0_val = info.user_data[ud_reg] >> 16; + if (prod->GetOpcode() == IR::Opcode::IAdd32) { + m0_val += prod->Arg(1).U32(); + } + return m0_val & 0xFFFF; + }(); + + // Patch instruction. + IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)}; + inst.SetArg(0, ir.Imm32(gds_addr >> 2)); + inst.SetArg(1, ir.Imm32(binding)); +} + +void PatchBufferArgs(IR::Block& block, IR::Inst& inst, Info& info) { + const auto handle = inst.Arg(0); + const auto buffer_res = info.buffers[handle.U32()]; + const auto buffer = buffer_res.GetSharp(info); + ASSERT(!buffer.add_tid_enable); - // Address of constant buffer reads can be calculated at IR emittion time. + // Address of constant buffer reads can be calculated at IR emission time. if (inst.GetOpcode() == IR::Opcode::ReadConstBuffer) { return; } + IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)}; + const auto inst_info = inst.Flags(); + const IR::U32 index_stride = ir.Imm32(buffer.index_stride); const IR::U32 element_size = ir.Imm32(buffer.element_size); @@ -366,21 +537,27 @@ void PatchBufferInstruction(IR::Block& block, IR::Inst& inst, Info& info, inst.SetArg(1, address); } -void PatchTextureBufferInstruction(IR::Block& block, IR::Inst& inst, Info& info, - Descriptors& descriptors) { - const IR::Inst* handle = inst.Arg(0).InstRecursive(); - const IR::Inst* producer = handle->Arg(0).InstRecursive(); - const auto sharp = TrackSharp(producer, info); - const auto buffer = info.ReadUdSharp(sharp); - const s32 binding = descriptors.Add(TextureBufferResource{ - .sharp_idx = sharp, - .is_written = inst.GetOpcode() == IR::Opcode::StoreBufferFormatF32, - }); +void PatchTextureBufferArgs(IR::Block& block, IR::Inst& inst, Info& info) { + const auto handle = inst.Arg(0); + const auto buffer_res = info.texture_buffers[handle.U32()]; + const auto buffer = buffer_res.GetSharp(info); - // Replace handle with binding index in texture buffer resource list. - IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)}; - inst.SetArg(0, ir.Imm32(binding)); ASSERT(!buffer.swizzle_enable && !buffer.add_tid_enable); + IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)}; + + if (inst.GetOpcode() == IR::Opcode::StoreBufferFormatF32) { + const auto swizzled = ApplySwizzle(ir, inst.Arg(2), buffer.DstSelect()); + const auto converted = + ApplyWriteNumberConversionVec4(ir, swizzled, buffer.GetNumberConversion()); + inst.SetArg(2, converted); + } else if (inst.GetOpcode() == IR::Opcode::LoadBufferFormatF32) { + const auto inst_info = inst.Flags(); + const auto texel = ir.LoadBufferFormat(inst.Arg(0), inst.Arg(1), inst_info); + const auto swizzled = ApplySwizzle(ir, texel, buffer.DstSelect()); + const auto converted = + ApplyReadNumberConversionVec4(ir, swizzled, buffer.GetNumberConversion()); + inst.ReplaceUsesWith(converted); + } } IR::Value PatchCubeCoord(IR::IREmitter& ir, const IR::Value& s, const IR::Value& t, @@ -409,39 +586,14 @@ IR::Value PatchCubeCoord(IR::IREmitter& ir, const IR::Value& s, const IR::Value& } } -void PatchImageSampleInstruction(IR::Block& block, IR::Inst& inst, Info& info, - Descriptors& descriptors, const IR::Inst* producer, - const u32 image_binding, const AmdGpu::Image& image) { - // Read sampler sharp. This doesn't exist for IMAGE_LOAD/IMAGE_STORE instructions - const auto [sampler_binding, sampler] = [&] -> std::pair { - ASSERT(producer->GetOpcode() == IR::Opcode::CompositeConstructU32x2); - const IR::Value& handle = producer->Arg(1); - // Inline sampler resource. - if (handle.IsImmediate()) { - LOG_WARNING(Render_Vulkan, "Inline sampler detected"); - const auto inline_sampler = AmdGpu::Sampler{.raw0 = handle.U32()}; - const auto binding = descriptors.Add(SamplerResource{ - .sharp_idx = std::numeric_limits::max(), - .inline_sampler = inline_sampler, - }); - return {binding, inline_sampler}; - } - // Normal sampler resource. - const auto ssharp_handle = handle.InstRecursive(); - const auto& [ssharp_ud, disable_aniso] = TryDisableAnisoLod0(ssharp_handle); - const auto ssharp = TrackSharp(ssharp_ud, info); - const auto binding = descriptors.Add(SamplerResource{ - .sharp_idx = ssharp, - .associated_image = image_binding, - .disable_aniso = disable_aniso, - }); - return {binding, info.ReadUdSharp(ssharp)}; - }(); +void PatchImageSampleArgs(IR::Block& block, IR::Inst& inst, Info& info, + const AmdGpu::Image& image) { + const auto handle = inst.Arg(0); + const auto sampler_res = info.samplers[(handle.U32() >> 16) & 0xFFFF]; + auto sampler = sampler_res.GetSharp(info); IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)}; - const auto inst_info = inst.Flags(); - const IR::U32 handle = ir.Imm32(image_binding | sampler_binding << 16); IR::Inst* body1 = inst.Arg(1).InstRecursive(); IR::Inst* body2 = inst.Arg(2).InstRecursive(); @@ -539,8 +691,7 @@ void PatchImageSampleInstruction(IR::Block& block, IR::Inst& inst, Info& info, // Query dimensions of image if needed for normalization. // We can't use the image sharp because it could be bound to a different image later. const auto dimensions = - unnormalized ? ir.ImageQueryDimension(ir.Imm32(image_binding), ir.Imm32(0u), ir.Imm1(false)) - : IR::Value{}; + unnormalized ? ir.ImageQueryDimension(handle, ir.Imm32(0u), ir.Imm1(false)) : IR::Value{}; const auto get_coord = [&](u32 coord_idx, u32 dim_idx) -> IR::Value { const auto coord = get_addr_reg(coord_idx); if (unnormalized) { @@ -589,7 +740,7 @@ void PatchImageSampleInstruction(IR::Block& block, IR::Inst& inst, Info& info, : IR::F32{}; const IR::F32 lod_clamp = inst_info.has_lod_clamp ? get_addr_reg(addr_reg++) : IR::F32{}; - auto new_inst = [&] -> IR::Value { + auto texel = [&] -> IR::Value { if (inst_info.is_gather) { if (inst_info.is_depth) { return ir.ImageGatherDref(handle, coords, offset, dref, inst_info); @@ -611,94 +762,30 @@ void PatchImageSampleInstruction(IR::Block& block, IR::Inst& inst, Info& info, } return ir.ImageSampleImplicitLod(handle, coords, bias, offset, inst_info); }(); - inst.ReplaceUsesWithAndRemove(new_inst); + + const auto converted = ApplyReadNumberConversionVec4(ir, texel, image.GetNumberConversion()); + inst.ReplaceUsesWith(converted); } -void PatchImageInstruction(IR::Block& block, IR::Inst& inst, Info& info, Descriptors& descriptors) { - const auto pred = [](const IR::Inst* inst) -> std::optional { - const auto opcode = inst->GetOpcode(); - if (opcode == IR::Opcode::CompositeConstructU32x2 || // IMAGE_SAMPLE (image+sampler) - opcode == IR::Opcode::ReadConst || // IMAGE_LOAD (image only) - opcode == IR::Opcode::GetUserData) { - return inst; - } - return std::nullopt; - }; - const auto result = IR::BreadthFirstSearch(&inst, pred); - ASSERT_MSG(result, "Unable to find image sharp source"); - const IR::Inst* producer = result.value(); - const bool has_sampler = producer->GetOpcode() == IR::Opcode::CompositeConstructU32x2; - const auto tsharp_handle = has_sampler ? producer->Arg(0).InstRecursive() : producer; - - // Read image sharp. - const auto tsharp = TrackSharp(tsharp_handle, info); - const auto inst_info = inst.Flags(); - auto image = info.ReadUdSharp(tsharp); - if (!image.Valid()) { - LOG_ERROR(Render_Vulkan, "Shader compiled with unbound image!"); - image = AmdGpu::Image::Null(); - } - ASSERT(image.GetType() != AmdGpu::ImageType::Invalid); - const bool is_read = inst.GetOpcode() == IR::Opcode::ImageRead; - const bool is_written = inst.GetOpcode() == IR::Opcode::ImageWrite; - - // Patch image instruction if image is FMask. - if (image.IsFmask()) { - ASSERT_MSG(!is_written, "FMask storage instructions are not supported"); - - IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)}; - switch (inst.GetOpcode()) { - case IR::Opcode::ImageRead: - case IR::Opcode::ImageSampleRaw: { - IR::F32 fmaskx = ir.BitCast(ir.Imm32(0x76543210)); - IR::F32 fmasky = ir.BitCast(ir.Imm32(0xfedcba98)); - inst.ReplaceUsesWith(ir.CompositeConstruct(fmaskx, fmasky)); - return; - } - case IR::Opcode::ImageQueryLod: - inst.ReplaceUsesWith(ir.Imm32(1)); - return; - case IR::Opcode::ImageQueryDimensions: { - IR::Value dims = ir.CompositeConstruct(ir.Imm32(static_cast(image.width)), // x - ir.Imm32(static_cast(image.width)), // y - ir.Imm32(1), ir.Imm32(1)); // depth, mip - inst.ReplaceUsesWith(dims); - - // Track FMask resource to do specialization. - descriptors.Add(FMaskResource{ - .sharp_idx = tsharp, - }); - return; - } - default: - UNREACHABLE_MSG("Can't patch fmask instruction {}", inst.GetOpcode()); - } - } - - u32 image_binding = descriptors.Add(ImageResource{ - .sharp_idx = tsharp, - .is_depth = bool(inst_info.is_depth), - .is_atomic = IsImageAtomicInstruction(inst), - .is_array = bool(inst_info.is_array), - .is_read = is_read, - .is_written = is_written, - }); - - // Sample instructions must be resolved into a new instruction using address register data. - if (inst.GetOpcode() == IR::Opcode::ImageSampleRaw) { - PatchImageSampleInstruction(block, inst, info, descriptors, producer, image_binding, image); - return; - } - - // Patch image handle - IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)}; - inst.SetArg(0, ir.Imm32(image_binding)); - - // No need to patch coordinates if we are just querying. +void PatchImageArgs(IR::Block& block, IR::Inst& inst, Info& info) { + // Nothing to patch for dimension query. if (inst.GetOpcode() == IR::Opcode::ImageQueryDimensions) { return; } + const auto handle = inst.Arg(0); + const auto image_res = info.images[handle.U32() & 0xFFFF]; + auto image = image_res.GetSharp(info); + + // Sample instructions must be handled separately using address register data. + if (inst.GetOpcode() == IR::Opcode::ImageSampleRaw) { + PatchImageSampleArgs(block, inst, info, image); + return; + } + + IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)}; + const auto inst_info = inst.Flags(); + // Now that we know the image type, adjust texture coordinate vector. IR::Inst* body = inst.Arg(1).InstRecursive(); const auto [coords, arg] = [&] -> std::pair { @@ -719,152 +806,77 @@ void PatchImageInstruction(IR::Block& block, IR::Inst& inst, Info& info, Descrip case AmdGpu::ImageType::Color3D: // x, y, z, [lod] return {ir.CompositeConstruct(body->Arg(0), body->Arg(1), body->Arg(2)), body->Arg(3)}; case AmdGpu::ImageType::Cube: // x, y, face, [lod] - return {PatchCubeCoord(ir, body->Arg(0), body->Arg(1), body->Arg(2), is_written, - inst_info.is_array), + return {PatchCubeCoord(ir, body->Arg(0), body->Arg(1), body->Arg(2), + inst.GetOpcode() == IR::Opcode::ImageWrite, inst_info.is_array), body->Arg(3)}; default: UNREACHABLE_MSG("Unknown image type {}", image.GetType()); } }(); - inst.SetArg(1, coords); - if (inst_info.has_lod) { - ASSERT(inst.GetOpcode() == IR::Opcode::ImageRead || - inst.GetOpcode() == IR::Opcode::ImageWrite); - ASSERT(image.GetType() != AmdGpu::ImageType::Color2DMsaa && - image.GetType() != AmdGpu::ImageType::Color2DMsaaArray); - inst.SetArg(2, arg); - } else if ((image.GetType() == AmdGpu::ImageType::Color2DMsaa || - image.GetType() == AmdGpu::ImageType::Color2DMsaaArray) && - (inst.GetOpcode() == IR::Opcode::ImageRead || - inst.GetOpcode() == IR::Opcode::ImageWrite)) { - inst.SetArg(3, arg); - } -} + const auto has_ms = image.GetType() == AmdGpu::ImageType::Color2DMsaa || + image.GetType() == AmdGpu::ImageType::Color2DMsaaArray; + ASSERT(!inst_info.has_lod || !has_ms); + const auto lod = inst_info.has_lod ? IR::U32{arg} : IR::U32{}; + const auto ms = has_ms ? IR::U32{arg} : IR::U32{}; -void PatchTextureBufferInterpretation(IR::Block& block, IR::Inst& inst, Info& info) { - const auto binding = inst.Arg(0).U32(); - const auto buffer_res = info.texture_buffers[binding]; - const auto buffer = buffer_res.GetSharp(info); - if (!buffer.Valid()) { - // Don't need to swizzle invalid buffer. - return; - } - - IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)}; - if (inst.GetOpcode() == IR::Opcode::StoreBufferFormatF32) { - inst.SetArg(2, ApplySwizzle(ir, inst.Arg(2), buffer.DstSelect())); - } else if (inst.GetOpcode() == IR::Opcode::LoadBufferFormatF32) { - const auto inst_info = inst.Flags(); - const auto texel = ir.LoadBufferFormat(inst.Arg(0), inst.Arg(1), inst_info); - const auto swizzled = ApplySwizzle(ir, texel, buffer.DstSelect()); - inst.ReplaceUsesWith(swizzled); - } -} - -void PatchImageInterpretation(IR::Block& block, IR::Inst& inst, Info& info) { - const auto binding = inst.Arg(0).U32(); - const auto image_res = info.images[binding & 0xFFFF]; - const auto image = image_res.GetSharp(info); - if (!image.Valid() || !image_res.IsStorage(image)) { - // Don't need to swizzle invalid or non-storage image. - return; - } - - IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)}; - if (inst.GetOpcode() == IR::Opcode::ImageWrite) { - inst.SetArg(4, ApplySwizzle(ir, inst.Arg(4), image.DstSelect())); - } else if (inst.GetOpcode() == IR::Opcode::ImageRead) { - const auto inst_info = inst.Flags(); - const auto lod = inst.Arg(2); - const auto ms = inst.Arg(3); - const auto texel = - ir.ImageRead(inst.Arg(0), inst.Arg(1), lod.IsEmpty() ? IR::U32{} : IR::U32{lod}, - ms.IsEmpty() ? IR::U32{} : IR::U32{ms}, inst_info); - const auto swizzled = ApplySwizzle(ir, texel, image.DstSelect()); - inst.ReplaceUsesWith(swizzled); - } -} - -void PatchDataRingInstruction(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, - .is_written = true, - }); - - const auto pred = [](const IR::Inst* inst) -> std::optional { - if (inst->GetOpcode() == IR::Opcode::GetUserData) { - return inst; + const auto is_storage = image_res.IsStorage(image); + if (inst.GetOpcode() == IR::Opcode::ImageRead) { + auto texel = ir.ImageRead(handle, coords, lod, ms, inst_info); + if (is_storage) { + // Storage image requires shader swizzle. + texel = ApplySwizzle(ir, texel, image.DstSelect()); } - return std::nullopt; - }; + const auto converted = + ApplyReadNumberConversionVec4(ir, texel, image.GetNumberConversion()); + inst.ReplaceUsesWith(converted); + } else { + inst.SetArg(1, coords); + if (inst.GetOpcode() == IR::Opcode::ImageWrite) { + inst.SetArg(2, lod); + inst.SetArg(3, ms); - // Attempt to deduce the GDS address of counter at compile time. - const u32 gds_addr = [&] { - const IR::Value& gds_offset = inst.Arg(0); - if (gds_offset.IsImmediate()) { - // Nothing to do, offset is known. - return gds_offset.U32() & 0xFFFF; + auto texel = inst.Arg(4); + if (is_storage) { + // Storage image requires shader swizzle. + texel = ApplySwizzle(ir, texel, image.DstSelect()); + } + const auto converted = + ApplyWriteNumberConversionVec4(ir, texel, image.GetNumberConversion()); + inst.SetArg(4, converted); } - const auto result = IR::BreadthFirstSearch(&inst, pred); - ASSERT_MSG(result, "Unable to track M0 source"); - - // M0 must be set by some user data register. - const IR::Inst* prod = gds_offset.InstRecursive(); - const u32 ud_reg = u32(result.value()->Arg(0).ScalarReg()); - u32 m0_val = info.user_data[ud_reg] >> 16; - if (prod->GetOpcode() == IR::Opcode::IAdd32) { - m0_val += prod->Arg(1).U32(); - } - return m0_val & 0xFFFF; - }(); - - // Patch instruction. - IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)}; - inst.SetArg(0, ir.Imm32(gds_addr >> 2)); - inst.SetArg(1, ir.Imm32(binding)); + } } void ResourceTrackingPass(IR::Program& program) { // Iterate resource instructions and patch them after finding the sharp. auto& info = program.info; + // Pass 1: Track resource sharps Descriptors descriptors{info}; for (IR::Block* const block : program.blocks) { for (IR::Inst& inst : block->Instructions()) { if (IsBufferInstruction(inst)) { - PatchBufferInstruction(*block, inst, info, descriptors); - continue; - } - if (IsTextureBufferInstruction(inst)) { - PatchTextureBufferInstruction(*block, inst, info, descriptors); - continue; - } - if (IsImageInstruction(inst)) { - PatchImageInstruction(*block, inst, info, descriptors); - continue; - } - if (IsDataRingInstruction(inst)) { - PatchDataRingInstruction(*block, inst, info, descriptors); + PatchBufferSharp(*block, inst, info, descriptors); + } else if (IsTextureBufferInstruction(inst)) { + PatchTextureBufferSharp(*block, inst, info, descriptors); + } else if (IsImageInstruction(inst)) { + PatchImageSharp(*block, inst, info, descriptors); + } else if (IsDataRingInstruction(inst)) { + PatchDataRingAccess(*block, inst, info, descriptors); } } } - // Second pass to reinterpret format read/write where needed, since we now know - // the bindings and their properties. + + // Pass 2: Patch instruction args for (IR::Block* const block : program.blocks) { for (IR::Inst& inst : block->Instructions()) { - if (IsTextureBufferInstruction(inst)) { - PatchTextureBufferInterpretation(*block, inst, info); - continue; - } - if (IsImageInstruction(inst)) { - PatchImageInterpretation(*block, inst, info); + if (IsBufferInstruction(inst)) { + PatchBufferArgs(*block, inst, info); + } else if (IsTextureBufferInstruction(inst)) { + PatchTextureBufferArgs(*block, inst, info); + } else if (IsImageInstruction(inst)) { + PatchImageArgs(*block, inst, info); } } } diff --git a/src/shader_recompiler/ir/reinterpret.h b/src/shader_recompiler/ir/reinterpret.h index 73d587a56..b65b19928 100644 --- a/src/shader_recompiler/ir/reinterpret.h +++ b/src/shader_recompiler/ir/reinterpret.h @@ -4,7 +4,7 @@ #pragma once #include "shader_recompiler/ir/ir_emitter.h" -#include "video_core/amdgpu/resource.h" +#include "video_core/amdgpu/types.h" namespace Shader::IR { @@ -21,4 +21,66 @@ inline Value ApplySwizzle(IREmitter& ir, const Value& vector, const AmdGpu::Comp return swizzled; } +/// Applies a number conversion in the read direction. +inline F32 ApplyReadNumberConversion(IREmitter& ir, const F32& value, + const AmdGpu::NumberConversion& conversion) { + switch (conversion) { + case AmdGpu::NumberConversion::None: + return value; + case AmdGpu::NumberConversion::UintToUscaled: + return ir.ConvertUToF(32, 32, ir.BitCast(value)); + case AmdGpu::NumberConversion::SintToSscaled: + return ir.ConvertSToF(32, 32, ir.BitCast(value)); + case AmdGpu::NumberConversion::UnormToUbnorm: + // Convert 0...1 to -1...1 + return ir.FPSub(ir.FPMul(value, ir.Imm32(2.f)), ir.Imm32(1.f)); + default: + UNREACHABLE(); + } +} + +inline Value ApplyReadNumberConversionVec4(IREmitter& ir, const Value& value, + const AmdGpu::NumberConversion& conversion) { + if (conversion == AmdGpu::NumberConversion::None) { + return value; + } + const auto x = ApplyReadNumberConversion(ir, F32{ir.CompositeExtract(value, 0)}, conversion); + const auto y = ApplyReadNumberConversion(ir, F32{ir.CompositeExtract(value, 1)}, conversion); + const auto z = ApplyReadNumberConversion(ir, F32{ir.CompositeExtract(value, 2)}, conversion); + const auto w = ApplyReadNumberConversion(ir, F32{ir.CompositeExtract(value, 3)}, conversion); + return ir.CompositeConstruct(x, y, z, w); +} + +/// Applies a number conversion in the write direction. +inline F32 ApplyWriteNumberConversion(IREmitter& ir, const F32& value, + const AmdGpu::NumberConversion& conversion) { + switch (conversion) { + case AmdGpu::NumberConversion::None: + return value; + case AmdGpu::NumberConversion::UintToUscaled: + // Need to return float type to maintain IR semantics. + return ir.BitCast(U32{ir.ConvertFToU(32, value)}); + case AmdGpu::NumberConversion::SintToSscaled: + // Need to return float type to maintain IR semantics. + return ir.BitCast(U32{ir.ConvertFToS(32, value)}); + case AmdGpu::NumberConversion::UnormToUbnorm: + // Convert -1...1 to 0...1 + return ir.FPDiv(ir.FPAdd(value, ir.Imm32(1.f)), ir.Imm32(2.f)); + default: + UNREACHABLE(); + } +} + +inline Value ApplyWriteNumberConversionVec4(IREmitter& ir, const Value& value, + const AmdGpu::NumberConversion& conversion) { + if (conversion == AmdGpu::NumberConversion::None) { + return value; + } + const auto x = ApplyWriteNumberConversion(ir, F32{ir.CompositeExtract(value, 0)}, conversion); + const auto y = ApplyWriteNumberConversion(ir, F32{ir.CompositeExtract(value, 1)}, conversion); + const auto z = ApplyWriteNumberConversion(ir, F32{ir.CompositeExtract(value, 2)}, conversion); + const auto w = ApplyWriteNumberConversion(ir, F32{ir.CompositeExtract(value, 3)}, conversion); + return ir.CompositeConstruct(x, y, z, w); +} + } // namespace Shader::IR diff --git a/src/shader_recompiler/runtime_info.h b/src/shader_recompiler/runtime_info.h index 781a0b14a..cf49b0879 100644 --- a/src/shader_recompiler/runtime_info.h +++ b/src/shader_recompiler/runtime_info.h @@ -180,6 +180,7 @@ struct FragmentRuntimeInfo { std::array inputs; struct PsColorBuffer { AmdGpu::NumberFormat num_format; + AmdGpu::NumberConversion num_conversion; AmdGpu::CompMapping swizzle; auto operator<=>(const PsColorBuffer&) const noexcept = default; diff --git a/src/shader_recompiler/specialization.h b/src/shader_recompiler/specialization.h index f8a86c63b..f58d2e2d3 100644 --- a/src/shader_recompiler/specialization.h +++ b/src/shader_recompiler/specialization.h @@ -32,6 +32,7 @@ struct BufferSpecialization { struct TextureBufferSpecialization { bool is_integer = false; AmdGpu::CompMapping dst_select{}; + AmdGpu::NumberConversion num_conversion{}; auto operator<=>(const TextureBufferSpecialization&) const = default; }; @@ -41,6 +42,7 @@ struct ImageSpecialization { bool is_integer = false; bool is_storage = false; AmdGpu::CompMapping dst_select{}; + AmdGpu::NumberConversion num_conversion{}; auto operator<=>(const ImageSpecialization&) const = default; }; @@ -107,6 +109,7 @@ struct StageSpecialization { [](auto& spec, const auto& desc, AmdGpu::Buffer sharp) { spec.is_integer = AmdGpu::IsInteger(sharp.GetNumberFmt()); spec.dst_select = sharp.DstSelect(); + spec.num_conversion = sharp.GetNumberConversion(); }); ForEachSharp(binding, images, info->images, [](auto& spec, const auto& desc, AmdGpu::Image sharp) { @@ -116,6 +119,7 @@ struct StageSpecialization { if (spec.is_storage) { spec.dst_select = sharp.DstSelect(); } + spec.num_conversion = sharp.GetNumberConversion(); }); ForEachSharp(binding, fmasks, info->fmasks, [](auto& spec, const auto& desc, AmdGpu::Image sharp) { diff --git a/src/video_core/amdgpu/liverpool.h b/src/video_core/amdgpu/liverpool.h index 0f1783057..837b73d89 100644 --- a/src/video_core/amdgpu/liverpool.h +++ b/src/video_core/amdgpu/liverpool.h @@ -20,9 +20,9 @@ #include "common/types.h" #include "common/unique_function.h" #include "shader_recompiler/params.h" -#include "types.h" #include "video_core/amdgpu/pixel_format.h" #include "video_core/amdgpu/resource.h" +#include "video_core/amdgpu/types.h" namespace Vulkan { class Rasterizer; @@ -902,6 +902,10 @@ struct Liverpool { : info.number_type.Value()); } + [[nodiscard]] NumberConversion GetNumberConversion() const { + return MapNumberConversion(info.number_type); + } + [[nodiscard]] CompMapping Swizzle() const { // clang-format off static constexpr std::array, 4> mrt_swizzles{{ @@ -938,7 +942,7 @@ struct Liverpool { const auto swap_idx = static_cast(info.comp_swap.Value()); const auto components_idx = NumComponents(info.format) - 1; const auto mrt_swizzle = mrt_swizzles[swap_idx][components_idx]; - return RemapComponents(info.format, mrt_swizzle); + return RemapSwizzle(info.format, mrt_swizzle); } }; diff --git a/src/video_core/amdgpu/pixel_format.cpp b/src/video_core/amdgpu/pixel_format.cpp index b13fc2d11..881c33e44 100644 --- a/src/video_core/amdgpu/pixel_format.cpp +++ b/src/video_core/amdgpu/pixel_format.cpp @@ -100,7 +100,7 @@ std::string_view NameOf(NumberFormat fmt) { return "Srgb"; case NumberFormat::Ubnorm: return "Ubnorm"; - case NumberFormat::UbnromNz: + case NumberFormat::UbnormNz: return "UbnormNz"; case NumberFormat::Ubint: return "Ubint"; diff --git a/src/video_core/amdgpu/resource.h b/src/video_core/amdgpu/resource.h index 1d9673850..ffee7964a 100644 --- a/src/video_core/amdgpu/resource.h +++ b/src/video_core/amdgpu/resource.h @@ -11,96 +11,6 @@ namespace AmdGpu { -enum class CompSwizzle : u32 { - Zero = 0, - One = 1, - Red = 4, - Green = 5, - Blue = 6, - Alpha = 7, -}; - -struct CompMapping { - CompSwizzle r : 3; - CompSwizzle g : 3; - CompSwizzle b : 3; - CompSwizzle a : 3; - - auto operator<=>(const CompMapping& other) const = default; - - template - [[nodiscard]] std::array Apply(const std::array& data) const { - return { - ApplySingle(data, r), - ApplySingle(data, g), - ApplySingle(data, b), - ApplySingle(data, a), - }; - } - -private: - template - T ApplySingle(const std::array& data, const CompSwizzle swizzle) const { - switch (swizzle) { - case CompSwizzle::Zero: - return T(0); - case CompSwizzle::One: - return T(1); - case CompSwizzle::Red: - return data[0]; - case CompSwizzle::Green: - return data[1]; - case CompSwizzle::Blue: - return data[2]; - case CompSwizzle::Alpha: - return data[3]; - default: - UNREACHABLE(); - } - } -}; - -inline DataFormat RemapDataFormat(const DataFormat format) { - switch (format) { - case DataFormat::Format11_11_10: - return DataFormat::Format10_11_11; - case DataFormat::Format10_10_10_2: - return DataFormat::Format2_10_10_10; - case DataFormat::Format5_5_5_1: - return DataFormat::Format1_5_5_5; - default: - return format; - } -} - -inline NumberFormat RemapNumberFormat(const NumberFormat format) { - return format; -} - -inline CompMapping RemapComponents(const DataFormat format, const CompMapping components) { - switch (format) { - case DataFormat::Format11_11_10: { - CompMapping result; - result.r = components.b; - result.g = components.g; - result.b = components.r; - result.a = components.a; - return result; - } - case DataFormat::Format10_10_10_2: - case DataFormat::Format5_5_5_1: { - CompMapping result; - result.r = components.a; - result.g = components.b; - result.b = components.g; - result.a = components.r; - return result; - } - default: - return components; - } -} - // Table 8.5 Buffer Resource Descriptor [Sea Islands Series Instruction Set Architecture] struct Buffer { u64 base_address : 44; @@ -140,7 +50,7 @@ struct Buffer { .b = CompSwizzle(dst_sel_z), .a = CompSwizzle(dst_sel_w), }; - return RemapComponents(DataFormat(data_format), dst_sel); + return RemapSwizzle(DataFormat(data_format), dst_sel); } NumberFormat GetNumberFmt() const noexcept { @@ -151,6 +61,10 @@ struct Buffer { return RemapDataFormat(DataFormat(data_format)); } + NumberConversion GetNumberConversion() const noexcept { + return MapNumberConversion(NumberFormat(num_format)); + } + u32 GetStride() const noexcept { return stride; } @@ -305,7 +219,7 @@ struct Image { .b = CompSwizzle(dst_sel_z), .a = CompSwizzle(dst_sel_w), }; - return RemapComponents(DataFormat(data_format), dst_sel); + return RemapSwizzle(DataFormat(data_format), dst_sel); } u32 Pitch() const { @@ -354,6 +268,10 @@ struct Image { return RemapNumberFormat(NumberFormat(num_format)); } + NumberConversion GetNumberConversion() const noexcept { + return MapNumberConversion(NumberFormat(num_format)); + } + TilingMode GetTilingMode() const { if (tiling_index >= 0 && tiling_index <= 7) { return tiling_index == 5 ? TilingMode::Texture_MicroTiled diff --git a/src/video_core/amdgpu/types.h b/src/video_core/amdgpu/types.h index fa8491665..a19e53256 100644 --- a/src/video_core/amdgpu/types.h +++ b/src/video_core/amdgpu/types.h @@ -5,6 +5,7 @@ #include #include +#include "common/assert.h" #include "common/types.h" namespace AmdGpu { @@ -177,11 +178,130 @@ enum class NumberFormat : u32 { Float = 7, Srgb = 9, Ubnorm = 10, - UbnromNz = 11, + UbnormNz = 11, Ubint = 12, Ubscaled = 13, }; +enum class CompSwizzle : u32 { + Zero = 0, + One = 1, + Red = 4, + Green = 5, + Blue = 6, + Alpha = 7, +}; + +enum class NumberConversion : u32 { + None, + UintToUscaled, + SintToSscaled, + UnormToUbnorm, +}; + +struct CompMapping { + CompSwizzle r : 3; + CompSwizzle g : 3; + CompSwizzle b : 3; + CompSwizzle a : 3; + + auto operator<=>(const CompMapping& other) const = default; + + template + [[nodiscard]] std::array Apply(const std::array& data) const { + return { + ApplySingle(data, r), + ApplySingle(data, g), + ApplySingle(data, b), + ApplySingle(data, a), + }; + } + +private: + template + T ApplySingle(const std::array& data, const CompSwizzle swizzle) const { + switch (swizzle) { + case CompSwizzle::Zero: + return T(0); + case CompSwizzle::One: + return T(1); + case CompSwizzle::Red: + return data[0]; + case CompSwizzle::Green: + return data[1]; + case CompSwizzle::Blue: + return data[2]; + case CompSwizzle::Alpha: + return data[3]; + default: + UNREACHABLE(); + } + } +}; + +inline DataFormat RemapDataFormat(const DataFormat format) { + switch (format) { + case DataFormat::Format11_11_10: + return DataFormat::Format10_11_11; + case DataFormat::Format10_10_10_2: + return DataFormat::Format2_10_10_10; + case DataFormat::Format5_5_5_1: + return DataFormat::Format1_5_5_5; + default: + return format; + } +} + +inline NumberFormat RemapNumberFormat(const NumberFormat format) { + switch (format) { + case NumberFormat::Uscaled: + return NumberFormat::Uint; + case NumberFormat::Sscaled: + return NumberFormat::Sint; + case NumberFormat::Ubnorm: + return NumberFormat::Unorm; + default: + return format; + } +} + +inline CompMapping RemapSwizzle(const DataFormat format, const CompMapping swizzle) { + switch (format) { + case DataFormat::Format11_11_10: { + CompMapping result; + result.r = swizzle.b; + result.g = swizzle.g; + result.b = swizzle.r; + result.a = swizzle.a; + return result; + } + case DataFormat::Format10_10_10_2: + case DataFormat::Format5_5_5_1: { + CompMapping result; + result.r = swizzle.a; + result.g = swizzle.b; + result.b = swizzle.g; + result.a = swizzle.r; + return result; + } + default: + return swizzle; + } +} + +inline NumberConversion MapNumberConversion(const NumberFormat format) { + switch (format) { + case NumberFormat::Uscaled: + return NumberConversion::UintToUscaled; + case NumberFormat::Sscaled: + return NumberConversion::SintToSscaled; + case NumberFormat::Ubnorm: + return NumberConversion::UnormToUbnorm; + default: + return NumberConversion::None; + } +} + } // namespace AmdGpu template <> diff --git a/src/video_core/renderer_vulkan/liverpool_to_vk.cpp b/src/video_core/renderer_vulkan/liverpool_to_vk.cpp index 690d26cfc..9695e127f 100644 --- a/src/video_core/renderer_vulkan/liverpool_to_vk.cpp +++ b/src/video_core/renderer_vulkan/liverpool_to_vk.cpp @@ -447,7 +447,7 @@ static constexpr vk::FormatFeatureFlags2 GetNumberFormatFeatureFlags( case AmdGpu::NumberFormat::Srgb: return ImageRead | Mrt; case AmdGpu::NumberFormat::Ubnorm: - case AmdGpu::NumberFormat::UbnromNz: + case AmdGpu::NumberFormat::UbnormNz: case AmdGpu::NumberFormat::Ubint: case AmdGpu::NumberFormat::Ubscaled: return ImageRead; @@ -468,6 +468,7 @@ static constexpr SurfaceFormatInfo CreateSurfaceFormatInfo(const AmdGpu::DataFor } std::span SurfaceFormats() { + // Uscaled, Sscaled, and Ubnorm formats are automatically remapped and handled in shader. static constexpr std::array formats{ // Invalid CreateSurfaceFormatInfo(AmdGpu::DataFormat::FormatInvalid, AmdGpu::NumberFormat::Unorm, @@ -490,7 +491,7 @@ std::span SurfaceFormats() { vk::Format::eUndefined), CreateSurfaceFormatInfo(AmdGpu::DataFormat::FormatInvalid, AmdGpu::NumberFormat::Ubnorm, vk::Format::eUndefined), - CreateSurfaceFormatInfo(AmdGpu::DataFormat::FormatInvalid, AmdGpu::NumberFormat::UbnromNz, + CreateSurfaceFormatInfo(AmdGpu::DataFormat::FormatInvalid, AmdGpu::NumberFormat::UbnormNz, vk::Format::eUndefined), CreateSurfaceFormatInfo(AmdGpu::DataFormat::FormatInvalid, AmdGpu::NumberFormat::Ubint, vk::Format::eUndefined), @@ -501,10 +502,6 @@ std::span SurfaceFormats() { vk::Format::eR8Unorm), CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format8, AmdGpu::NumberFormat::Snorm, vk::Format::eR8Snorm), - CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format8, AmdGpu::NumberFormat::Uscaled, - vk::Format::eR8Uscaled), - CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format8, AmdGpu::NumberFormat::Sscaled, - vk::Format::eR8Sscaled), CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format8, AmdGpu::NumberFormat::Uint, vk::Format::eR8Uint), CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format8, AmdGpu::NumberFormat::Sint, @@ -516,10 +513,6 @@ std::span SurfaceFormats() { vk::Format::eR16Unorm), CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format16, AmdGpu::NumberFormat::Snorm, vk::Format::eR16Snorm), - CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format16, AmdGpu::NumberFormat::Uscaled, - vk::Format::eR16Uscaled), - CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format16, AmdGpu::NumberFormat::Sscaled, - vk::Format::eR16Sscaled), CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format16, AmdGpu::NumberFormat::Uint, vk::Format::eR16Uint), CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format16, AmdGpu::NumberFormat::Sint, @@ -531,10 +524,6 @@ std::span SurfaceFormats() { vk::Format::eR8G8Unorm), CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format8_8, AmdGpu::NumberFormat::Snorm, vk::Format::eR8G8Snorm), - CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format8_8, AmdGpu::NumberFormat::Uscaled, - vk::Format::eR8G8Uscaled), - CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format8_8, AmdGpu::NumberFormat::Sscaled, - vk::Format::eR8G8Sscaled), CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format8_8, AmdGpu::NumberFormat::Uint, vk::Format::eR8G8Uint), CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format8_8, AmdGpu::NumberFormat::Sint, @@ -553,10 +542,6 @@ std::span SurfaceFormats() { vk::Format::eR16G16Unorm), CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format16_16, AmdGpu::NumberFormat::Snorm, vk::Format::eR16G16Snorm), - CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format16_16, AmdGpu::NumberFormat::Uscaled, - vk::Format::eR16G16Uscaled), - CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format16_16, AmdGpu::NumberFormat::Sscaled, - vk::Format::eR16G16Sscaled), CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format16_16, AmdGpu::NumberFormat::Uint, vk::Format::eR16G16Uint), CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format16_16, AmdGpu::NumberFormat::Sint, @@ -573,10 +558,6 @@ std::span SurfaceFormats() { vk::Format::eA2B10G10R10UnormPack32), CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format2_10_10_10, AmdGpu::NumberFormat::Snorm, vk::Format::eA2B10G10R10SnormPack32), - CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format2_10_10_10, AmdGpu::NumberFormat::Uscaled, - vk::Format::eA2B10G10R10UscaledPack32), - CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format2_10_10_10, AmdGpu::NumberFormat::Sscaled, - vk::Format::eA2B10G10R10SscaledPack32), CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format2_10_10_10, AmdGpu::NumberFormat::Uint, vk::Format::eA2B10G10R10UintPack32), CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format2_10_10_10, AmdGpu::NumberFormat::Sint, @@ -586,10 +567,6 @@ std::span SurfaceFormats() { vk::Format::eR8G8B8A8Unorm), CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format8_8_8_8, AmdGpu::NumberFormat::Snorm, vk::Format::eR8G8B8A8Snorm), - CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format8_8_8_8, AmdGpu::NumberFormat::Uscaled, - vk::Format::eR8G8B8A8Uscaled), - CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format8_8_8_8, AmdGpu::NumberFormat::Sscaled, - vk::Format::eR8G8B8A8Sscaled), CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format8_8_8_8, AmdGpu::NumberFormat::Uint, vk::Format::eR8G8B8A8Uint), CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format8_8_8_8, AmdGpu::NumberFormat::Sint, @@ -608,10 +585,6 @@ std::span SurfaceFormats() { vk::Format::eR16G16B16A16Unorm), CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format16_16_16_16, AmdGpu::NumberFormat::Snorm, vk::Format::eR16G16B16A16Snorm), - CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format16_16_16_16, - AmdGpu::NumberFormat::Uscaled, vk::Format::eR16G16B16A16Uscaled), - CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format16_16_16_16, - AmdGpu::NumberFormat::Sscaled, vk::Format::eR16G16B16A16Sscaled), CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format16_16_16_16, AmdGpu::NumberFormat::Uint, vk::Format::eR16G16B16A16Uint), CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format16_16_16_16, AmdGpu::NumberFormat::Sint, diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h index c8f4999b1..fa10831a0 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h @@ -32,6 +32,7 @@ struct GraphicsPipelineKey { u32 num_color_attachments; std::array color_formats; std::array color_num_formats; + std::array color_num_conversions; std::array color_swizzles; vk::Format depth_format; vk::Format stencil_format; diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index ba069dae1..9cfc7c277 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -168,6 +168,7 @@ const Shader::RuntimeInfo& PipelineCache::BuildRuntimeInfo(Stage stage, LogicalS for (u32 i = 0; i < Shader::MaxColorBuffers; i++) { info.fs_info.color_buffers[i] = { .num_format = graphics_key.color_num_formats[i], + .num_conversion = graphics_key.color_num_conversions[i], .swizzle = graphics_key.color_swizzles[i], }; } @@ -302,6 +303,7 @@ bool PipelineCache::RefreshGraphicsKey() { key.num_color_attachments = 0; key.color_formats.fill(vk::Format::eUndefined); key.color_num_formats.fill(AmdGpu::NumberFormat::Unorm); + key.color_num_conversions.fill(AmdGpu::NumberConversion::None); key.blend_controls.fill({}); key.write_masks.fill({}); key.color_swizzles.fill({}); @@ -330,6 +332,7 @@ bool PipelineCache::RefreshGraphicsKey() { key.color_formats[remapped_cb] = LiverpoolToVK::SurfaceFormat(col_buf.GetDataFmt(), col_buf.GetNumberFmt()); key.color_num_formats[remapped_cb] = col_buf.GetNumberFmt(); + key.color_num_conversions[remapped_cb] = col_buf.GetNumberConversion(); key.color_swizzles[remapped_cb] = col_buf.Swizzle(); } From 32fc983ef86b7c0b1bbff973a0130f4582a79b04 Mon Sep 17 00:00:00 2001 From: F1219R <109141852+F1219R@users.noreply.github.com> Date: Tue, 7 Jan 2025 12:58:33 +0100 Subject: [PATCH 05/10] Update sq translation (#2084) * Update sq translation * Update sq translation --- src/qt_gui/translations/sq.ts | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/qt_gui/translations/sq.ts b/src/qt_gui/translations/sq.ts index 80f3876d4..d4936170b 100644 --- a/src/qt_gui/translations/sq.ts +++ b/src/qt_gui/translations/sq.ts @@ -146,19 +146,19 @@ Compatibility... - Compatibility... + Përputhshmëria... Update database - Update database + Përditëso bazën e të dhënave View report - View report + Shiko raportin Submit a report - Submit a report + Paraqit një raport Shortcut creation @@ -285,15 +285,15 @@ List View - Pamja e Listës + Pamja me List Grid View - Pamja e Rrjetës + Pamja me Rrjetë Elf Viewer - Shikuesi i Elf + Shikuesi i ELF Game Install Directory @@ -381,15 +381,15 @@ Download Cheats For All Installed Games - Shkarko Mashtrime Për Të Gjitha Lojërat e Instaluara + Shkarko mashtrime për të gjitha lojërat e instaluara Download Patches For All Games - Shkarko Arna Për Të Gjitha Lojërat e Instaluara + Shkarko arna për të gjitha lojërat e instaluara Download Complete - Shkarkimi Përfundoi + Shkarkimi përfundoi You have downloaded cheats for all the games you have installed. @@ -558,11 +558,11 @@ Trophy Key - Trophy Key + Çelësi i Trofeve Trophy - Trophy + Trofeu Logger @@ -690,7 +690,7 @@ GUI Settings - Cilësimet e GUI + Cilësimet e GUI-së Disable Trophy Pop-ups @@ -778,7 +778,7 @@ TrophyKey - Trophy Key:\nKey used to decrypt trophies. Must be obtained from your jailbroken console.\nMust contain only hex characters. + Çelësi i Trofeve:\nÇelësi përdoret për të deshifruar trofetë. Duhet të merret nga konsola jote me jailbreak.\nDuhet të përmbajë vetëm karaktere hex. logTypeGroupBox @@ -802,7 +802,7 @@ hideCursorGroupBox - Fsheh kursorin:\nZgjidh kur do të fshihet kursori:\nKurrë: Do ta shohësh gjithmonë miun.\nInaktiv: Vendos një kohë për ta fshehur pas mosveprimit.\nGjithmonë: nuk do ta shohësh kurrë miun. + Fsheh kursorin:\nZgjidh kur do të fshihet kursori:\nKurrë: Do ta shohësh gjithmonë miun.\nJoaktiv: Vendos një kohë për ta fshehur pas mosveprimit.\nGjithmonë: nuk do ta shohësh kurrë miun. idleTimeoutGroupBox @@ -1172,7 +1172,7 @@ h - h + o m @@ -1333,4 +1333,4 @@ TB - \ No newline at end of file + From 4df0d9c035f957e91f4615bbc3cff7e4a554e4e0 Mon Sep 17 00:00:00 2001 From: kalaposfos13 <153381648+kalaposfos13@users.noreply.github.com> Date: Tue, 7 Jan 2025 14:30:05 +0100 Subject: [PATCH 06/10] Add support for true fullscreen (#2016) * Support for true fullscreen * clang * Re-add mistakenly deleted line * Size I adjusted the size of the entire screen. trophies font size and added a margin so it wouldn't be so spaced out. --------- Co-authored-by: DanielSvoboda --- src/common/config.cpp | 15 +++++++++++-- src/common/config.h | 7 +++--- src/main.cpp | 2 +- src/qt_gui/main.cpp | 4 ++-- src/qt_gui/settings_dialog.cpp | 5 ++++- src/qt_gui/settings_dialog.ui | 40 +++++++++++++++++++++++++++++++++- src/sdl_window.cpp | 18 ++++++++++++++- 7 files changed, 80 insertions(+), 11 deletions(-) diff --git a/src/common/config.cpp b/src/common/config.cpp index 1838f35fc..b46ab8d6e 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -33,6 +33,7 @@ namespace Config { static bool isNeo = false; static bool isFullscreen = false; +static std::string fullscreenMode = "borderless"; static bool playBGM = false; static bool isTrophyPopupDisabled = false; static int BGMvolume = 50; @@ -105,10 +106,14 @@ bool isNeoModeConsole() { return isNeo; } -bool isFullscreenMode() { +bool getIsFullscreen() { return isFullscreen; } +std::string getFullscreenMode() { + return fullscreenMode; +} + bool getisTrophyPopupDisabled() { return isTrophyPopupDisabled; } @@ -309,10 +314,14 @@ void setVblankDiv(u32 value) { vblankDivider = value; } -void setFullscreenMode(bool enable) { +void setIsFullscreen(bool enable) { isFullscreen = enable; } +void setFullscreenMode(std::string mode) { + fullscreenMode = mode; +} + void setisTrophyPopupDisabled(bool disable) { isTrophyPopupDisabled = disable; } @@ -575,6 +584,7 @@ void load(const std::filesystem::path& path) { isNeo = toml::find_or(general, "isPS4Pro", false); isFullscreen = toml::find_or(general, "Fullscreen", false); + fullscreenMode = toml::find_or(general, "FullscreenMode", "borderless"); playBGM = toml::find_or(general, "playBGM", false); isTrophyPopupDisabled = toml::find_or(general, "isTrophyPopupDisabled", false); BGMvolume = toml::find_or(general, "BGMvolume", 50); @@ -701,6 +711,7 @@ void save(const std::filesystem::path& path) { data["General"]["isPS4Pro"] = isNeo; data["General"]["Fullscreen"] = isFullscreen; + data["General"]["FullscreenMode"] = fullscreenMode; data["General"]["isTrophyPopupDisabled"] = isTrophyPopupDisabled; data["General"]["playBGM"] = playBGM; data["General"]["BGMvolume"] = BGMvolume; diff --git a/src/common/config.h b/src/common/config.h index d2860bec5..6e6a5d960 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -17,9 +17,9 @@ void saveMainWindow(const std::filesystem::path& path); std::string getTrophyKey(); void setTrophyKey(std::string key); - +bool getIsFullscreen(); +std::string getFullscreenMode(); bool isNeoModeConsole(); -bool isFullscreenMode(); bool getPlayBGM(); int getBGMvolume(); bool getisTrophyPopupDisabled(); @@ -66,7 +66,8 @@ void setVblankDiv(u32 value); void setGpuId(s32 selectedGpuId); void setScreenWidth(u32 width); void setScreenHeight(u32 height); -void setFullscreenMode(bool enable); +void setIsFullscreen(bool enable); +void setFullscreenMode(std::string mode); void setisTrophyPopupDisabled(bool disable); void setPlayBGM(bool enable); void setBGMvolume(int volume); diff --git a/src/main.cpp b/src/main.cpp index bdbab89c9..54772870c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -86,7 +86,7 @@ int main(int argc, char* argv[]) { exit(1); } // Set fullscreen mode without saving it to config file - Config::setFullscreenMode(is_fullscreen); + Config::setIsFullscreen(is_fullscreen); }}, {"--fullscreen", [&](int& i) { arg_map["-f"](i); }}, {"--add-game-folder", diff --git a/src/qt_gui/main.cpp b/src/qt_gui/main.cpp index ac731fdce..2d524e199 100644 --- a/src/qt_gui/main.cpp +++ b/src/qt_gui/main.cpp @@ -97,7 +97,7 @@ int main(int argc, char* argv[]) { exit(1); } // Set fullscreen mode without saving it to config file - Config::setFullscreenMode(is_fullscreen); + Config::setIsFullscreen(is_fullscreen); }}, {"--fullscreen", [&](int& i) { arg_map["-f"](i); }}, {"--add-game-folder", @@ -190,4 +190,4 @@ int main(int argc, char* argv[]) { // Show the main window and run the Qt application m_main_window->show(); return a.exec(); -} \ No newline at end of file +} diff --git a/src/qt_gui/settings_dialog.cpp b/src/qt_gui/settings_dialog.cpp index 1a03345e4..193ce5cd8 100644 --- a/src/qt_gui/settings_dialog.cpp +++ b/src/qt_gui/settings_dialog.cpp @@ -300,6 +300,8 @@ void SettingsDialog::LoadValuesFromConfig() { ui->discordRPCCheckbox->setChecked( toml::find_or(data, "General", "enableDiscordRPC", true)); ui->fullscreenCheckBox->setChecked(toml::find_or(data, "General", "Fullscreen", false)); + ui->fullscreenModeComboBox->setCurrentText(QString::fromStdString( + toml::find_or(data, "General", "FullscreenMode", "Borderless"))); ui->separateUpdatesCheckBox->setChecked( toml::find_or(data, "General", "separateUpdateEnabled", false)); ui->showSplashCheckBox->setChecked(toml::find_or(data, "General", "showSplash", false)); @@ -534,8 +536,9 @@ void SettingsDialog::UpdateSettings() { const QVector TouchPadIndex = {"left", "center", "right", "none"}; Config::setBackButtonBehavior(TouchPadIndex[ui->backButtonBehaviorComboBox->currentIndex()]); + Config::setIsFullscreen(ui->fullscreenCheckBox->isChecked()); + Config::setFullscreenMode(ui->fullscreenModeComboBox->currentText().toStdString()); Config::setIsMotionControlsEnabled(ui->motionControlsCheckBox->isChecked()); - Config::setFullscreenMode(ui->fullscreenCheckBox->isChecked()); Config::setisTrophyPopupDisabled(ui->disableTrophycheckBox->isChecked()); Config::setPlayBGM(ui->playBGMCheckBox->isChecked()); Config::setLogType(ui->logTypeComboBox->currentText().toStdString()); diff --git a/src/qt_gui/settings_dialog.ui b/src/qt_gui/settings_dialog.ui index cefe1f7c7..fbfee5a99 100644 --- a/src/qt_gui/settings_dialog.ui +++ b/src/qt_gui/settings_dialog.ui @@ -12,7 +12,7 @@ 0 0 970 - 670 + 750 @@ -133,6 +133,35 @@ Enable Fullscreen + + + + + Fullscreen Mode + + + + + + + 0 + 0 + + + + + Borderless + + + + + True + + + + + + @@ -536,6 +565,9 @@ 0 + + 80 + @@ -566,6 +598,12 @@ 0 + + + 10 + false + + diff --git a/src/sdl_window.cpp b/src/sdl_window.cpp index d694b0939..318b3349b 100644 --- a/src/sdl_window.cpp +++ b/src/sdl_window.cpp @@ -93,7 +93,23 @@ WindowSDL::WindowSDL(s32 width_, s32 height_, Input::GameController* controller_ } SDL_SetWindowMinimumSize(window, 640, 360); - SDL_SetWindowFullscreen(window, Config::isFullscreenMode()); + + bool error = false; + const SDL_DisplayID displayIndex = SDL_GetDisplayForWindow(window); + if (displayIndex < 0) { + LOG_ERROR(Frontend, "Error getting display index: {}", SDL_GetError()); + error = true; + } + const SDL_DisplayMode* displayMode; + if ((displayMode = SDL_GetCurrentDisplayMode(displayIndex)) == 0) { + LOG_ERROR(Frontend, "Error getting display mode: {}", SDL_GetError()); + error = true; + } + if (!error) { + SDL_SetWindowFullscreenMode(window, + Config::getFullscreenMode() == "True" ? displayMode : NULL); + } + SDL_SetWindowFullscreen(window, Config::getIsFullscreen()); SDL_InitSubSystem(SDL_INIT_GAMEPAD); controller->TryOpenSDLController(); From a4c18b14344d678334471410f2aadeea29184a47 Mon Sep 17 00:00:00 2001 From: Florian Piesche Date: Tue, 7 Jan 2025 14:05:15 +0000 Subject: [PATCH 07/10] Move release info into metainfo.xml (#2085) --- dist/net.shadps4.shadPS4.metainfo.xml | 28 ++++++++++++++++++++++++--- dist/net.shadps4.shadPS4.releases.xml | 23 ---------------------- 2 files changed, 25 insertions(+), 26 deletions(-) delete mode 100644 dist/net.shadps4.shadPS4.releases.xml diff --git a/dist/net.shadps4.shadPS4.metainfo.xml b/dist/net.shadps4.shadPS4.metainfo.xml index bef0bec4c..d5ad992e3 100644 --- a/dist/net.shadps4.shadPS4.metainfo.xml +++ b/dist/net.shadps4.shadPS4.metainfo.xml @@ -36,10 +36,32 @@ Game - - - + + + https://github.com/shadps4-emu/shadPS4/releases/tag/v.0.5.0 + + https://github.com/shadps4-emu/shadPS4/releases/tag/v.0.4.0 + + + https://github.com/shadps4-emu/shadPS4/releases/tag/v.0.3.0 + + + https://github.com/shadps4-emu/shadPS4/releases/tag/v.0.2.0 + + + https://github.com/shadps4-emu/shadPS4/releases/tag/0.1.0 + + + https://github.com/shadps4-emu/shadPS4/releases/tag/v0.0.3 + + + https://github.com/shadps4-emu/shadPS4/releases/tag/v0.0.2 + + + https://github.com/shadps4-emu/shadPS4/releases/tag/v0.0.1 + + diff --git a/dist/net.shadps4.shadPS4.releases.xml b/dist/net.shadps4.shadPS4.releases.xml deleted file mode 100644 index 8da203fe4..000000000 --- a/dist/net.shadps4.shadPS4.releases.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - https://github.com/shadps4-emu/shadPS4/releases/tag/v.0.4.0 - - - https://github.com/shadps4-emu/shadPS4/releases/tag/v.0.3.0 - - - https://github.com/shadps4-emu/shadPS4/releases/tag/v.0.2.0 - - - https://github.com/shadps4-emu/shadPS4/releases/tag/0.1.0 - - - https://github.com/shadps4-emu/shadPS4/releases/tag/v0.0.3 - - - https://github.com/shadps4-emu/shadPS4/releases/tag/v0.0.2 - - - https://github.com/shadps4-emu/shadPS4/releases/tag/v0.0.1 - - From c055c80c6fb23cb29042cd38f3f1ae4c82fe3a55 Mon Sep 17 00:00:00 2001 From: jarred wilson <20207921+jardon@users.noreply.github.com> Date: Tue, 7 Jan 2025 09:11:01 -0600 Subject: [PATCH 08/10] Remove releases.xml references (#2087) --- CMakeLists.txt | 1 - REUSE.toml | 1 - 2 files changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 886824934..8ec04dad5 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1042,7 +1042,6 @@ install(TARGETS shadps4 BUNDLE DESTINATION .) if (ENABLE_QT_GUI AND CMAKE_SYSTEM_NAME STREQUAL "Linux") install(FILES "dist/net.shadps4.shadPS4.desktop" DESTINATION "share/applications") - install(FILES "dist/net.shadps4.shadPS4.releases.xml" DESTINATION "share/metainfo/releases") install(FILES "dist/net.shadps4.shadPS4.metainfo.xml" DESTINATION "share/metainfo") install(FILES ".github/shadps4.png" DESTINATION "share/icons/hicolor/512x512/apps" RENAME "net.shadps4.shadPS4.png") install(FILES "src/images/net.shadps4.shadPS4.svg" DESTINATION "share/icons/hicolor/scalable/apps") diff --git a/REUSE.toml b/REUSE.toml index cba63adf1..55d76673d 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -11,7 +11,6 @@ path = [ "dist/net.shadps4.shadPS4.desktop", "dist/net.shadps4.shadPS4_metadata.pot", "dist/net.shadps4.shadPS4.metainfo.xml", - "dist/net.shadps4.shadPS4.releases.xml", "documents/changelog.md", "documents/Quickstart/2.png", "documents/Screenshots/*", From 3e5d4bb69c84486e9e2cd57c56b3b1a2e743b3fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Quang=20Ng=C3=B4?= Date: Tue, 7 Jan 2025 22:36:56 +0700 Subject: [PATCH 09/10] Fix double closing tag in metainfo.xml (#2090) --- dist/net.shadps4.shadPS4.metainfo.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/dist/net.shadps4.shadPS4.metainfo.xml b/dist/net.shadps4.shadPS4.metainfo.xml index d5ad992e3..384cf75e8 100644 --- a/dist/net.shadps4.shadPS4.metainfo.xml +++ b/dist/net.shadps4.shadPS4.metainfo.xml @@ -62,7 +62,6 @@ https://github.com/shadps4-emu/shadPS4/releases/tag/v0.0.1 - keyboard From af8c748e9cb3edc78a3f0e189fbba41bfdba0786 Mon Sep 17 00:00:00 2001 From: squidbus <175574877+squidbus@users.noreply.github.com> Date: Tue, 7 Jan 2025 07:37:08 -0800 Subject: [PATCH 10/10] elf_info: Fix GCC build. (#2089) --- src/common/elf_info.h | 2 +- src/core/libraries/kernel/process.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/elf_info.h b/src/common/elf_info.h index 02eefbb7a..cb32679bb 100644 --- a/src/common/elf_info.h +++ b/src/common/elf_info.h @@ -111,7 +111,7 @@ public: return raw_firmware_ver; } - [[nodiscard]] const PSFAttributes& PSFAttributes() const { + [[nodiscard]] const PSFAttributes& GetPSFAttributes() const { ASSERT(initialized); return psf_attributes; } diff --git a/src/core/libraries/kernel/process.cpp b/src/core/libraries/kernel/process.cpp index 791a98a36..c21257c50 100644 --- a/src/core/libraries/kernel/process.cpp +++ b/src/core/libraries/kernel/process.cpp @@ -15,7 +15,7 @@ namespace Libraries::Kernel { int PS4_SYSV_ABI sceKernelIsNeoMode() { LOG_DEBUG(Kernel_Sce, "called"); return Config::isNeoModeConsole() && - Common::ElfInfo::Instance().PSFAttributes().support_neo_mode; + Common::ElfInfo::Instance().GetPSFAttributes().support_neo_mode; } int PS4_SYSV_ABI sceKernelGetCompiledSdkVersion(int* ver) {