mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-22 04:24:44 +00:00
Merge remote-tracking branch 'upstream/main' into touchpad-back-button
This commit is contained in:
commit
e33852a127
53 changed files with 139 additions and 295 deletions
2
externals/date
vendored
2
externals/date
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 51ce7e131079c061533d741be5fe7cca57f2faac
|
||||
Subproject commit dd8affc6de5755e07638bf0a14382d29549d6ee9
|
2
externals/sdl3
vendored
2
externals/sdl3
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 0548050fc5a4edf1f47c3633c2cd06d8762b5532
|
||||
Subproject commit 54e622c2e6af456bfef382fae44c17682d5ac88a
|
2
externals/sirit
vendored
2
externals/sirit
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 37090c74cc6e680f2bc334cac8fd182f7634a1f6
|
||||
Subproject commit 6cecb95d679c82c413d1f989e0b7ad9af130600d
|
|
@ -103,7 +103,7 @@ s32 SDLAudio::AudioOutOutput(s32 handle, const void* ptr) {
|
|||
|
||||
const size_t data_size = port.samples_num * port.sample_size * port.channels_num;
|
||||
|
||||
SDL_bool result = SDL_PutAudioStreamData(port.stream, ptr, data_size);
|
||||
bool result = SDL_PutAudioStreamData(port.stream, ptr, data_size);
|
||||
|
||||
lock.unlock(); // Unlock only after necessary operations
|
||||
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
|
||||
namespace Libraries::Net {
|
||||
|
||||
static thread_local int32_t net_errno = 0;
|
||||
|
||||
int PS4_SYSV_ABI in6addr_any() {
|
||||
LOG_ERROR(Lib_Net, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
|
@ -563,9 +565,9 @@ int PS4_SYSV_ABI sceNetEpollWait() {
|
|||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceNetErrnoLoc() {
|
||||
int* PS4_SYSV_ABI sceNetErrnoLoc() {
|
||||
LOG_ERROR(Lib_Net, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
return &net_errno;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI sceNetEtherNtostr() {
|
||||
|
|
|
@ -136,7 +136,7 @@ int PS4_SYSV_ABI sceNetEpollControl();
|
|||
int PS4_SYSV_ABI sceNetEpollCreate();
|
||||
int PS4_SYSV_ABI sceNetEpollDestroy();
|
||||
int PS4_SYSV_ABI sceNetEpollWait();
|
||||
int PS4_SYSV_ABI sceNetErrnoLoc();
|
||||
int* PS4_SYSV_ABI sceNetErrnoLoc();
|
||||
int PS4_SYSV_ABI sceNetEtherNtostr();
|
||||
int PS4_SYSV_ABI sceNetEtherStrton();
|
||||
int PS4_SYSV_ABI sceNetEventCallbackCreate();
|
||||
|
|
|
@ -58,6 +58,7 @@ Emulator::Emulator() {
|
|||
LOG_INFO(Loader, "Branch {}", Common::g_scm_branch);
|
||||
LOG_INFO(Loader, "Description {}", Common::g_scm_desc);
|
||||
|
||||
LOG_INFO(Config, "General Logtype: {}", Config::getLogType());
|
||||
LOG_INFO(Config, "General isNeo: {}", Config::isNeoMode());
|
||||
LOG_INFO(Config, "GPU isNullGpu: {}", Config::nullGpu());
|
||||
LOG_INFO(Config, "GPU shouldDumpShaders: {}", Config::dumpShaders());
|
||||
|
|
|
@ -581,7 +581,7 @@ static void UpdateMouseData() {
|
|||
// (below)
|
||||
// SDL_CaptureMouse() let the OS know e.g. that our imgui drag outside the SDL window boundaries
|
||||
// shouldn't e.g. trigger other operations outside
|
||||
SDL_CaptureMouse((bd->mouse_buttons_down != 0) ? SDL_TRUE : SDL_FALSE);
|
||||
SDL_CaptureMouse((bd->mouse_buttons_down != 0) ? true : false);
|
||||
SDL_Window* focused_window = SDL_GetKeyboardFocus();
|
||||
const bool is_app_focused = (bd->window == focused_window);
|
||||
|
||||
|
|
|
@ -454,6 +454,10 @@ void CheckUpdate::Install() {
|
|||
" sleep 2\n"
|
||||
" extract_file\n"
|
||||
" sleep 2\n"
|
||||
" if pgrep -f \"Shadps4-qt.AppImage\" > /dev/null; then\n"
|
||||
" pkill -f \"Shadps4-qt.AppImage\"\n"
|
||||
" sleep 2\n"
|
||||
" fi\n"
|
||||
" cp -r \"%2/\"* \"%3/\"\n"
|
||||
" sleep 2\n"
|
||||
" rm \"%3/update.sh\"\n"
|
||||
|
@ -525,4 +529,4 @@ void CheckUpdate::Install() {
|
|||
this, tr("Error"),
|
||||
QString(tr("Failed to create the update script file") + ":\n" + scriptFileName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -358,8 +358,6 @@ void SettingsDialog::updateNoteTextEdit(const QString& elementName) {
|
|||
text = tr("dumpShadersCheckBox");
|
||||
} else if (elementName == "nullGpuCheckBox") {
|
||||
text = tr("nullGpuCheckBox");
|
||||
} else if (elementName == "dumpPM4CheckBox") {
|
||||
text = tr("dumpPM4CheckBox");
|
||||
}
|
||||
|
||||
// Debug
|
||||
|
@ -376,7 +374,7 @@ void SettingsDialog::updateNoteTextEdit(const QString& elementName) {
|
|||
ui->descriptionText->setText(text.replace("\\n", "\n"));
|
||||
}
|
||||
|
||||
bool SettingsDialog::override(QObject* obj, QEvent* event) {
|
||||
bool SettingsDialog::eventFilter(QObject* obj, QEvent* event) {
|
||||
if (event->type() == QEvent::Enter || event->type() == QEvent::Leave) {
|
||||
if (qobject_cast<QWidget*>(obj)) {
|
||||
bool hovered = (event->type() == QEvent::Enter);
|
||||
|
|
|
@ -21,7 +21,7 @@ public:
|
|||
explicit SettingsDialog(std::span<const QString> physical_devices, QWidget* parent = nullptr);
|
||||
~SettingsDialog();
|
||||
|
||||
bool override(QObject* obj, QEvent* event);
|
||||
bool eventFilter(QObject* obj, QEvent* event) override;
|
||||
void updateNoteTextEdit(const QString& groupName);
|
||||
|
||||
int exec() override;
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>تمكين وحدة معالجة الرسومات الفارغة</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>PM4 تمكين تفريغ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1053,11 +1048,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>تمكين GPU الافتراضية:\nلأغراض تصحيح الأخطاء التقنية، يقوم بتعطيل عرض اللعبة كما لو لم يكن هناك بطاقة رسومات.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>تمكين تفريغ PM4:\nلأغراض تصحيح الأخطاء التقنية، يحفظ بيانات تعليمات GPU الأولية في مجلد أثناء معالجتها.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>Enable NULL GPU</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>Enable PM4 Dumping</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1053,11 +1048,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>Aktiver virtuel GPU:\nTil teknisk fejlfinding deaktiverer det spilvisning, som om der ikke var et grafikkort.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>Aktiver dumping af PM4:\nTil teknisk fejlfinding gemmer det rå GPU-kommandoer i en mappe under behandling.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>NULL GPU aktivieren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>PM4-Dumping aktivieren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1053,11 +1048,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>Virtuelle GPU aktivieren:\nFür das technische Debugging deaktiviert es die Spielanzeige, als ob keine Grafikkarte vorhanden wäre.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>PM4-Dumping aktivieren:\nZum technischen Debuggen speichert es rohe GPU-Befehlsdaten in einem Ordner während der Verarbeitung.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>Enable NULL GPU</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>Enable PM4 Dumping</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1053,11 +1048,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>Ενεργοποίηση Εικονικής GPU:\nΓια τεχνικό εντοπισμό σφαλμάτων, απενεργοποιεί την εμφάνιση του παιχνιδιού σαν να μην υπάρχει κάρτα γραφικών.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>Ενεργοποίηση Καταγραφής PM4:\nΓια τεχνικό εντοπισμό σφαλμάτων, αποθηκεύει τις ακατέργαστες εντολές της GPU σε φάκελο κατά την επεξεργασία.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>Enable NULL GPU</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>Enable PM4 Dumping</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1088,11 +1083,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>Enable Null GPU:\nFor the sake of technical debugging, disables game rendering as if there were no graphics card.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>Enable PM4 Dumping:\nFor the sake of technical debugging, saves raw GPU instruction data to a folder as the emulator processes it.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>Habilitar GPU NULL</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>Habilitar volcado de PM4</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1053,11 +1048,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>Habilitar GPU Nula:\nPor el bien de la depuración técnica, desactiva el renderizado del juego como si no hubiera tarjeta gráfica.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>Habilitar la Volcadura de PM4:\nPor el bien de la depuración técnica, guarda los datos de instrucciones crudas de GPU en una carpeta a medida que el emulador los procesa.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>NULL GPU فعال کردن</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>PM4 Dumping فعال کردن</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1053,11 +1048,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>Enable Null GPU:\nFor the sake of technical debugging, disables game rendering as if there were no graphics card.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>Enable PM4 Dumping:\nFor the sake of technical debugging, saves raw GPU instruction data to a folder as the emulator processes it.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>Enable NULL GPU</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>Enable PM4 Dumping</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1053,11 +1048,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>Ota Null GPU käyttöön:\nTeknistä vianetsintää varten pelin renderöinti estetään niin, että ikään kuin grafiikkakorttia ei olisi.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>Ota PM4 dumpaus käyttöön:\nTeknistä vianetsintää varten raakoja GPU-ohjeita tallennetaan kansioon emulaattorin käsitellessä sitä.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>NULL GPU</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>Dumper le PM4</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1053,11 +1048,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>Activer le GPU nul :\nPour le débogage technique, désactive le rendu du jeu comme s'il n'y avait pas de carte graphique.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>Activer l'exportation PM4 :\nPour le débogage technique, enregistre les données brutes des instructions GPU dans un dossier pendant que l'émulateur les traite.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>NULL GPU Engedélyezése</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>PM4 Dumpolás Engedélyezése</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1053,11 +1048,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>Null GPU engedélyezése:\nMűszaki hibaelhárítás céljából letiltja a játék renderelését, mintha nem lenne grafikus kártya.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>PM4 dumpolás engedélyezése:\nMűszaki hibaelhárítás céljából a nyers GPU utasítási adatokat elmenti egy mappába, ahogy az emulátor feldolgozza őket.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>Enable NULL GPU</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>Enable PM4 Dumping</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1053,11 +1048,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>Aktifkan GPU Null:\nUntuk tujuan debugging teknis, menonaktifkan rendering permainan seolah-olah tidak ada kartu grafis.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>Aktifkan Pembuangan PM4:\nUntuk tujuan debugging teknis, menyimpan data instruksi GPU mentah ke folder saat emulator memprosesnya.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>Abilita NULL GPU</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>Abilita Dump PM4</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1053,11 +1048,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>Abilita GPU Null:\nPer scopi di debug tecnico, disabilita il rendering del gioco come se non ci fosse alcuna scheda grafica.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>Abilita Pompaggio PM4:\nPer scopi di debug tecnico, salva i dati delle istruzioni GPU grezze in una cartella mentre l'emulatore li elabora.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>NULL GPUを有効にする</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>PM4ダンプを有効にする</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1053,11 +1048,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>Null GPUを有効にする:\n技術的なデバッグの目的で、グラフィックスカードがないかのようにゲームのレンダリングを無効にします。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>PM4ダンプを有効にする:\n技術的なデバッグの目的で、エミュレーターが処理している間に生のGPU命令データをフォルダーに保存します。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>Enable NULL GPU</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>Enable PM4 Dumping</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1053,11 +1048,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>Enable Null GPU:\nFor the sake of technical debugging, disables game rendering as if there were no graphics card.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>Enable PM4 Dumping:\nFor the sake of technical debugging, saves raw GPU instruction data to a folder as the emulator processes it.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>Enable NULL GPU</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>Enable PM4 Dumping</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1053,11 +1048,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>Įjungti tuščią GPU:\nTechninio derinimo tikslais išjungia žaidimo renderiavimą, tarsi nebūtų grafikos plokštės.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>Įjungti PM4 išmetimą:\nTechninio derinimo tikslais saugo žalius GPU nurodymų duomenis į aplanką, kai emuliatorius juos apdoroja.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>Enable NULL GPU</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>Enable PM4 Dumping</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1053,11 +1048,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>Aktiver Null GPU:\nFor teknisk feilsøking deaktiverer spillrendering som om det ikke var noe grafikkort.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>Aktiver PM4 dumping:\nFor teknisk feilsøking lagrer rå GPU-instruksjonsdata i en mappe mens emulatoren behandler dem.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>Enable NULL GPU</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>Enable PM4 Dumping</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1053,11 +1048,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>Null GPU inschakelen:\nVoor technische foutopsporing schakelt de game-rendering uit alsof er geen grafische kaart is.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>PM4 dumpen inschakelen:\nVoor technische foutopsporing slaat het ruwe GPU-instructiegegevens op in een map terwijl de emulator ze verwerkt.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>Wyłącz kartę graficzną</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>Włącz zgrywanie PM4</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1053,11 +1048,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>Włącz Null GPU:\nDla technicznego debugowania dezaktywuje renderowanie gry tak, jakby nie było karty graficznej.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>Włącz zrzucanie PM4:\nDla technicznego debugowania zapisuje surowe dane instrukcji GPU w folderze, gdy emulator je przetwarza.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>Ativar GPU NULA</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>Ativar Dumping de PM4</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1053,11 +1048,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>Ativar GPU NULA:\nDesativa a renderização do jogo para fins de depuração técnica, como se não houvesse nenhuma placa gráfica.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>Ativar Dumping de PM4:\nArmazena os dados de instrução bruta da GPU em uma pasta enquanto o emulador os processa, para fins de depuração técnica. Recomendado deixar desativado.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>Enable NULL GPU</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>Enable PM4 Dumping</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1053,11 +1048,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>Activează GPU Null:\nÎn scopuri de depanare tehnică, dezactivează redarea jocului ca și cum nu ar exista o placă grafică.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>Activează salvarea PM4:\nÎn scopuri de depanare tehnică, salvează datele brute ale instrucțiunilor GPU într-un folder pe măsură ce emulatorul le procesează.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>Включить NULL GPU</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>Включить дамп PM4</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1053,11 +1048,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>Включить NULL GPU:\nДля технической отладки отключает рендеринг игры так, как будто графической карты нет.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>Включить дамп PM4:\nДля технической отладки сохраняет необработанные данные инструкций GPU в папку, пока эмулятор их обрабатывает.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>Aktivizo GPU-në NULL</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>Aktivizo Zbrazjen PM4</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1053,11 +1048,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>Aktivizo GPU Null:\nPër qëllime të debugimit teknik, deaktivizon renditjen e lojës sikur nuk do të kishte një kartë grafike.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>Aktivizo dump-in e PM4:\nPër qëllime të debugimit teknik, ruan të dhënat e instruksioneve të GPU-së në një folder ndërsa emulatori i përpunon ato.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>NULL GPU'yu Etkinleştir</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>PM4 Kaydını Etkinleştir</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1053,11 +1048,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>Null GPU'yu Etkinleştir:\nTeknik hata ayıklama amacıyla, oyunun render edilmesini grafik kartı yokmuş gibi devre dışı bırakır.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>PM4 Dışa Aktarmayı Etkinleştir:\nTeknik hata ayıklama amacıyla, emülatör bunları işlerken GPU komut verilerini bir klasöre kaydeder.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>Enable NULL GPU</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>Enable PM4 Dumping</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1053,11 +1048,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>Bật GPU Null:\nĐể mục đích gỡ lỗi kỹ thuật, vô hiệu hóa việc kết xuất trò chơi như thể không có card đồ họa.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>Bật xuất PM4:\nĐể mục đích gỡ lỗi kỹ thuật, lưu dữ liệu lệnh GPU vào một thư mục khi trình giả lập xử lý chúng.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>启用 NULL GPU</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>启用 PM4 转储</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1053,11 +1048,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>启用空 GPU:\n为了技术调试,将游戏渲染禁用,仿佛没有图形卡。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>启用 PM4 转储:\n为了技术调试,在模拟器处理时将原始 GPU 指令数据保存到文件夹中。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -474,11 +474,6 @@
|
|||
<source>Enable NULL GPU</source>
|
||||
<translation>Enable NULL GPU</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="476"/>
|
||||
<source>Enable PM4 Dumping</source>
|
||||
<translation>Enable PM4 Dumping</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.ui" line="517"/>
|
||||
<source>Debug</source>
|
||||
|
@ -1053,11 +1048,6 @@
|
|||
<source>nullGpuCheckBox</source>
|
||||
<translation>啟用空GPU:\n為了技術調試,禁用遊戲渲染,彷彿沒有顯示卡。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="323"/>
|
||||
<source>dumpPM4CheckBox</source>
|
||||
<translation>啟用PM4轉儲:\n為了技術調試,將原始GPU指令數據在模擬器處理時保存到文件夾中。</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings_dialog.cpp" line="329"/>
|
||||
<source>debugDump</source>
|
||||
|
|
|
@ -27,8 +27,10 @@ static constexpr spv::ExecutionMode GetInputPrimitiveType(AmdGpu::PrimitiveType
|
|||
case AmdGpu::PrimitiveType::TriangleList:
|
||||
case AmdGpu::PrimitiveType::TriangleStrip:
|
||||
return spv::ExecutionMode::Triangles;
|
||||
case AmdGpu::PrimitiveType::AdjTriangleList:
|
||||
return spv::ExecutionMode::InputTrianglesAdjacency;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
UNREACHABLE_MSG("Unknown input primitive type {}", u32(type));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,7 +43,7 @@ static constexpr spv::ExecutionMode GetOutputPrimitiveType(AmdGpu::GsOutputPrimi
|
|||
case AmdGpu::GsOutputPrimitiveType::TriangleStrip:
|
||||
return spv::ExecutionMode::OutputTriangleStrip;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
UNREACHABLE_MSG("Unknown output primitive type {}", u32(type));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,6 +70,8 @@ ArgType Arg(EmitContext& ctx, const IR::Value& arg) {
|
|||
return arg.ScalarReg();
|
||||
} else if constexpr (std::is_same_v<ArgType, IR::VectorReg>) {
|
||||
return arg.VectorReg();
|
||||
} else if constexpr (std::is_same_v<ArgType, const char*>) {
|
||||
return arg.StringLiteral();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ void EmitPrologue(EmitContext& ctx);
|
|||
void EmitEpilogue(EmitContext& ctx);
|
||||
void EmitDiscard(EmitContext& ctx);
|
||||
void EmitDiscardCond(EmitContext& ctx, Id condition);
|
||||
void EmitDebugPrint(EmitContext& ctx, IR::Inst* inst, Id arg0, Id arg1, Id arg2, Id arg3, Id arg4);
|
||||
void EmitBarrier(EmitContext& ctx);
|
||||
void EmitWorkgroupMemoryBarrier(EmitContext& ctx);
|
||||
void EmitDeviceMemoryBarrier(EmitContext& ctx);
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include "shader_recompiler/backend/spirv/emit_spirv_instructions.h"
|
||||
#include "shader_recompiler/backend/spirv/spirv_emit_context.h"
|
||||
#include "shader_recompiler/ir/debug_print.h"
|
||||
|
||||
namespace Shader::Backend::SPIRV {
|
||||
|
||||
|
@ -57,4 +58,11 @@ void EmitEndPrimitive(EmitContext& ctx, const IR::Value& stream) {
|
|||
throw NotImplementedException("Geometry streams");
|
||||
}
|
||||
|
||||
void EmitDebugPrint(EmitContext& ctx, IR::Inst* inst, Id fmt, Id arg0, Id arg1, Id arg2, Id arg3) {
|
||||
IR::DebugPrintFlags flags = inst->Flags<IR::DebugPrintFlags>();
|
||||
std::array<Id, IR::DEBUGPRINT_NUM_FORMAT_ARGS> fmt_args = {arg0, arg1, arg2, arg3};
|
||||
auto fmt_args_span = std::span<Id>(fmt_args.begin(), fmt_args.begin() + flags.num_args);
|
||||
ctx.OpDebugPrintf(fmt, fmt_args_span);
|
||||
}
|
||||
|
||||
} // namespace Shader::Backend::SPIRV
|
||||
|
|
|
@ -34,14 +34,17 @@ std::string_view StageName(Stage stage) {
|
|||
throw InvalidArgument("Invalid stage {}", u32(stage));
|
||||
}
|
||||
|
||||
static constexpr u32 NumVertices(AmdGpu::GsOutputPrimitiveType type) {
|
||||
static constexpr u32 NumVertices(AmdGpu::PrimitiveType type) {
|
||||
switch (type) {
|
||||
case AmdGpu::GsOutputPrimitiveType::PointList:
|
||||
case AmdGpu::PrimitiveType::PointList:
|
||||
return 1u;
|
||||
case AmdGpu::GsOutputPrimitiveType::LineStrip:
|
||||
case AmdGpu::PrimitiveType::LineList:
|
||||
return 2u;
|
||||
case AmdGpu::GsOutputPrimitiveType::TriangleStrip:
|
||||
case AmdGpu::PrimitiveType::TriangleList:
|
||||
case AmdGpu::PrimitiveType::TriangleStrip:
|
||||
return 3u;
|
||||
case AmdGpu::PrimitiveType::AdjTriangleList:
|
||||
return 6u;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
@ -88,6 +91,8 @@ Id EmitContext::Def(const IR::Value& value) {
|
|||
return ConstF32(value.F32());
|
||||
case IR::Type::F64:
|
||||
return Constant(F64[1], value.F64());
|
||||
case IR::Type::StringLiteral:
|
||||
return String(value.StringLiteral());
|
||||
default:
|
||||
throw NotImplementedException("Immediate type {}", value.Type());
|
||||
}
|
||||
|
@ -321,16 +326,15 @@ void EmitContext::DefineInputs() {
|
|||
MemberDecorate(gl_per_vertex, 2, spv::Decoration::BuiltIn,
|
||||
static_cast<std::uint32_t>(spv::BuiltIn::ClipDistance));
|
||||
Decorate(gl_per_vertex, spv::Decoration::Block);
|
||||
const auto vertices_in =
|
||||
TypeArray(gl_per_vertex, ConstU32(NumVertices(runtime_info.gs_info.out_primitive[0])));
|
||||
const auto num_verts_in = NumVertices(runtime_info.gs_info.in_primitive);
|
||||
const auto vertices_in = TypeArray(gl_per_vertex, ConstU32(num_verts_in));
|
||||
gl_in = Name(DefineVar(vertices_in, spv::StorageClass::Input), "gl_in");
|
||||
interfaces.push_back(gl_in);
|
||||
|
||||
const auto num_params = runtime_info.gs_info.in_vertex_data_size / 4 - 1u;
|
||||
for (int param_id = 0; param_id < num_params; ++param_id) {
|
||||
const IR::Attribute param{IR::Attribute::Param0 + param_id};
|
||||
const Id type{
|
||||
TypeArray(F32[4], ConstU32(NumVertices(runtime_info.gs_info.out_primitive[0])))};
|
||||
const Id type{TypeArray(F32[4], ConstU32(num_verts_in))};
|
||||
const Id id{DefineInput(type, param_id)};
|
||||
Name(id, fmt::format("in_attr{}", param_id));
|
||||
input_params[param_id] = {id, input_f32, F32[1], 4};
|
||||
|
|
|
@ -15,18 +15,18 @@ CopyShaderData ParseCopyShader(const std::span<const u32>& code) {
|
|||
ASSERT_MSG(code[0] == token_mov_vcchi, "First instruction is not s_mov_b32 vcc_hi, #imm");
|
||||
|
||||
std::array<s32, 32> offsets{};
|
||||
std::fill(offsets.begin(), offsets.end(), -1);
|
||||
offsets.fill(-1);
|
||||
|
||||
std::array<s32, 256> sources{};
|
||||
sources.fill(-1);
|
||||
|
||||
CopyShaderData data{};
|
||||
Gcn::OperandField sgpr{};
|
||||
auto last_attr{IR::Attribute::Position0};
|
||||
s32 soffset{0};
|
||||
while (!code_slice.atEnd()) {
|
||||
auto inst = decoder.decodeInstruction(code_slice);
|
||||
switch (inst.opcode) {
|
||||
case Gcn::Opcode::S_MOVK_I32: {
|
||||
sgpr = inst.dst[0].field;
|
||||
soffset = inst.control.sopk.simm;
|
||||
sources[inst.dst[0].code] = inst.control.sopk.simm;
|
||||
break;
|
||||
}
|
||||
case Gcn::Opcode::EXP: {
|
||||
|
@ -46,8 +46,9 @@ CopyShaderData ParseCopyShader(const std::span<const u32>& code) {
|
|||
case Gcn::Opcode::BUFFER_LOAD_DWORD: {
|
||||
offsets[inst.src[1].code] = inst.control.mubuf.offset;
|
||||
if (inst.src[3].field != Gcn::OperandField::ConstZero) {
|
||||
ASSERT(inst.src[3].field == sgpr);
|
||||
offsets[inst.src[1].code] += soffset;
|
||||
const u32 index = inst.src[3].code;
|
||||
ASSERT(sources[index] != -1);
|
||||
offsets[inst.src[1].code] += sources[index];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -59,6 +60,7 @@ CopyShaderData ParseCopyShader(const std::span<const u32>& code) {
|
|||
if (last_attr != IR::Attribute::Position0) {
|
||||
data.num_attrs = static_cast<u32>(last_attr) - static_cast<u32>(IR::Attribute::Param0) + 1;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <span>
|
||||
#include <vector>
|
||||
#include <boost/container/small_vector.hpp>
|
||||
#include <boost/container/static_vector.hpp>
|
||||
#include "common/assert.h"
|
||||
|
|
21
src/shader_recompiler/ir/debug_print.h
Normal file
21
src/shader_recompiler/ir/debug_print.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/bit_field.h"
|
||||
#include "shader_recompiler/ir/opcodes.h"
|
||||
#include "src/common/types.h"
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace Shader::IR {
|
||||
|
||||
constexpr size_t DEBUGPRINT_NUM_FORMAT_ARGS = NumArgsOf(IR::Opcode::DebugPrint) - 1;
|
||||
|
||||
union DebugPrintFlags {
|
||||
u32 raw;
|
||||
// For now, only flag is the number of variadic format args actually used
|
||||
// So bitfield not really needed
|
||||
BitField<0, 32, u32> num_args;
|
||||
};
|
||||
|
||||
} // namespace Shader::IR
|
|
@ -1,10 +1,15 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <array>
|
||||
#include <bit>
|
||||
#include <source_location>
|
||||
#include <boost/container/small_vector.hpp>
|
||||
#include "common/assert.h"
|
||||
#include "shader_recompiler/exception.h"
|
||||
#include "shader_recompiler/ir/debug_print.h"
|
||||
#include "shader_recompiler/ir/ir_emitter.h"
|
||||
#include "shader_recompiler/ir/opcodes.h"
|
||||
#include "shader_recompiler/ir/value.h"
|
||||
|
||||
namespace Shader::IR {
|
||||
|
@ -1553,6 +1558,38 @@ void IREmitter::ImageWrite(const Value& handle, const Value& coords, const Value
|
|||
Inst(Opcode::ImageWrite, Flags{info}, handle, coords, color);
|
||||
}
|
||||
|
||||
// Debug print maps to SPIRV's NonSemantic DebugPrintf instruction
|
||||
// Renderdoc will hook in its own implementation of the SPIRV instruction
|
||||
// Renderdoc accepts format specifiers, e.g. %u, listed here:
|
||||
// https://github.com/KhronosGroup/Vulkan-ValidationLayers/blob/main/docs/debug_printf.md
|
||||
//
|
||||
// fmt must be a string literal (pointer is shallow copied into a Value)
|
||||
// Example usage:
|
||||
// ir.DebugPrint("invocation xyz: (%u, %u, %u)",
|
||||
// {ir.GetVectorReg(IR::VectorReg::V0),
|
||||
// ir.GetVectorReg(IR::VectorReg::V1),
|
||||
// ir.GetVectorReg(IR::VectorReg::V2)});
|
||||
void IREmitter::DebugPrint(const char* fmt, boost::container::small_vector<Value, 5> format_args) {
|
||||
std::array<Value, DEBUGPRINT_NUM_FORMAT_ARGS> args;
|
||||
|
||||
ASSERT_MSG(format_args.size() < DEBUGPRINT_NUM_FORMAT_ARGS,
|
||||
"DebugPrint only supports up to {} format args", DEBUGPRINT_NUM_FORMAT_ARGS);
|
||||
|
||||
for (int i = 0; i < format_args.size(); i++) {
|
||||
args[i] = format_args[i];
|
||||
}
|
||||
|
||||
for (int i = format_args.size(); i < DEBUGPRINT_NUM_FORMAT_ARGS; i++) {
|
||||
args[i] = Inst(Opcode::Void);
|
||||
}
|
||||
|
||||
IR::Value fmt_val{fmt};
|
||||
|
||||
DebugPrintFlags flags;
|
||||
flags.num_args.Assign(format_args.size());
|
||||
Inst(Opcode::DebugPrint, Flags{flags}, fmt_val, args[0], args[1], args[2], args[3]);
|
||||
}
|
||||
|
||||
void IREmitter::EmitVertex() {
|
||||
Inst(Opcode::EmitVertex);
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include <cstring>
|
||||
#include <type_traits>
|
||||
|
||||
#include "shader_recompiler/info.h"
|
||||
#include "shader_recompiler/ir/attribute.h"
|
||||
#include "shader_recompiler/ir/basic_block.h"
|
||||
#include "shader_recompiler/ir/condition.h"
|
||||
|
@ -43,6 +44,7 @@ public:
|
|||
void Epilogue();
|
||||
void Discard();
|
||||
void Discard(const U1& cond);
|
||||
void DebugPrint(const char* fmt, boost::container::small_vector<Value, 5> args);
|
||||
|
||||
void Barrier();
|
||||
void WorkgroupMemoryBarrier();
|
||||
|
|
|
@ -89,6 +89,7 @@ bool Inst::MayHaveSideEffects() const noexcept {
|
|||
case Opcode::ImageAtomicOr32:
|
||||
case Opcode::ImageAtomicXor32:
|
||||
case Opcode::ImageAtomicExchange32:
|
||||
case Opcode::DebugPrint:
|
||||
case Opcode::EmitVertex:
|
||||
case Opcode::EmitPrimitive:
|
||||
return true;
|
||||
|
|
|
@ -51,6 +51,7 @@ constexpr Type F32x4{Type::F32x4};
|
|||
constexpr Type F64x2{Type::F64x2};
|
||||
constexpr Type F64x3{Type::F64x3};
|
||||
constexpr Type F64x4{Type::F64x4};
|
||||
constexpr Type StringLiteral{Type::StringLiteral};
|
||||
|
||||
constexpr OpcodeMeta META_TABLE[]{
|
||||
#define OPCODE(name_token, type_token, ...) \
|
||||
|
@ -81,7 +82,7 @@ constexpr u8 NUM_ARGS[]{
|
|||
}
|
||||
|
||||
/// Get the number of arguments an opcode accepts
|
||||
[[nodiscard]] inline size_t NumArgsOf(Opcode op) noexcept {
|
||||
[[nodiscard]] constexpr inline size_t NumArgsOf(Opcode op) noexcept {
|
||||
return static_cast<size_t>(Detail::NUM_ARGS[static_cast<size_t>(op)]);
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ OPCODE(Prologue, Void,
|
|||
OPCODE(Epilogue, Void, )
|
||||
OPCODE(Discard, Void, )
|
||||
OPCODE(DiscardCond, Void, U1, )
|
||||
OPCODE(DebugPrint, Void, StringLiteral, Opaque, Opaque, Opaque, Opaque, )
|
||||
|
||||
// Constant memory operations
|
||||
OPCODE(ReadConst, U32, U32x2, U32, )
|
||||
|
|
|
@ -9,10 +9,9 @@ namespace Shader::IR {
|
|||
|
||||
std::string NameOf(Type type) {
|
||||
static constexpr std::array names{
|
||||
"Opaque", "Label", "Reg", "Pred", "Attribute", "U1", "U8", "U16", "U32",
|
||||
"U64", "F16", "F32", "F64", "U32x2", "U32x3", "U32x4", "F16x2", "F16x3",
|
||||
"F16x4", "F32x2", "F32x3", "F32x4", "F64x2", "F64x3", "F64x4",
|
||||
};
|
||||
"Opaque", "Label", "Reg", "Pred", "Attribute", "U1", "U8", "U16", "U32",
|
||||
"U64", "F16", "F32", "F64", "U32x2", "U32x3", "U32x4", "F16x2", "F16x3",
|
||||
"F16x4", "F32x2", "F32x3", "F32x4", "F64x2", "F64x3", "F64x4", "StringLiteral"};
|
||||
const size_t bits{static_cast<size_t>(type)};
|
||||
if (bits == 0) {
|
||||
return "Void";
|
||||
|
|
|
@ -36,6 +36,7 @@ enum class Type {
|
|||
F64x2 = 1 << 22,
|
||||
F64x3 = 1 << 23,
|
||||
F64x4 = 1 << 24,
|
||||
StringLiteral = 1 << 25,
|
||||
};
|
||||
DECLARE_ENUM_FLAG_OPERATORS(Type)
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <string>
|
||||
#include "shader_recompiler/ir/value.h"
|
||||
|
||||
namespace Shader::IR {
|
||||
|
@ -27,6 +28,8 @@ Value::Value(u64 value) noexcept : type{Type::U64}, imm_u64{value} {}
|
|||
|
||||
Value::Value(f64 value) noexcept : type{Type::F64}, imm_f64{value} {}
|
||||
|
||||
Value::Value(const char* value) noexcept : type{Type::StringLiteral}, string_literal{value} {}
|
||||
|
||||
IR::Type Value::Type() const noexcept {
|
||||
if (IsPhi()) {
|
||||
// The type of a phi node is stored in its flags
|
||||
|
@ -69,6 +72,8 @@ bool Value::operator==(const Value& other) const {
|
|||
case Type::U64:
|
||||
case Type::F64:
|
||||
return imm_u64 == other.imm_u64;
|
||||
case Type::StringLiteral:
|
||||
return std::string_view(string_literal) == other.string_literal;
|
||||
case Type::U32x2:
|
||||
case Type::U32x3:
|
||||
case Type::U32x4:
|
||||
|
|
|
@ -39,6 +39,7 @@ public:
|
|||
explicit Value(f32 value) noexcept;
|
||||
explicit Value(u64 value) noexcept;
|
||||
explicit Value(f64 value) noexcept;
|
||||
explicit Value(const char* value) noexcept;
|
||||
|
||||
[[nodiscard]] bool IsIdentity() const noexcept;
|
||||
[[nodiscard]] bool IsPhi() const noexcept;
|
||||
|
@ -60,6 +61,7 @@ public:
|
|||
[[nodiscard]] f32 F32() const;
|
||||
[[nodiscard]] u64 U64() const;
|
||||
[[nodiscard]] f64 F64() const;
|
||||
[[nodiscard]] const char* StringLiteral() const;
|
||||
|
||||
[[nodiscard]] bool operator==(const Value& other) const;
|
||||
[[nodiscard]] bool operator!=(const Value& other) const;
|
||||
|
@ -78,6 +80,7 @@ private:
|
|||
f32 imm_f32;
|
||||
u64 imm_u64;
|
||||
f64 imm_f64;
|
||||
const char* string_literal;
|
||||
};
|
||||
};
|
||||
static_assert(static_cast<u32>(IR::Type::Void) == 0, "memset relies on IR::Type being zero");
|
||||
|
@ -348,6 +351,14 @@ inline f64 Value::F64() const {
|
|||
return imm_f64;
|
||||
}
|
||||
|
||||
inline const char* Value::StringLiteral() const {
|
||||
if (IsIdentity()) {
|
||||
return inst->Arg(0).StringLiteral();
|
||||
}
|
||||
DEBUG_ASSERT(type == Type::StringLiteral);
|
||||
return string_literal;
|
||||
}
|
||||
|
||||
[[nodiscard]] inline bool IsPhi(const Inst& inst) {
|
||||
return inst.GetOpcode() == Opcode::Phi;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue