diff --git a/.github/workflows/linux-qt.yml b/.github/workflows/linux-qt.yml index 31f8df01..5611ae50 100644 --- a/.github/workflows/linux-qt.yml +++ b/.github/workflows/linux-qt.yml @@ -10,7 +10,6 @@ on: branches: [ "main" ] env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Release jobs: @@ -19,8 +18,8 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Fetch submodules - run: git submodule update --init --recursive + with: + submodules: recursive - name: Install misc packages run: > diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 7ebb3365..ef77a16c 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -8,10 +8,8 @@ on: branches: [ "main" ] pull_request: branches: [ "main" ] - workflow_dispatch: env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Release jobs: diff --git a/.github/workflows/macos-qt.yml b/.github/workflows/macos-qt.yml index e9a9aa4f..4b3672df 100644 --- a/.github/workflows/macos-qt.yml +++ b/.github/workflows/macos-qt.yml @@ -8,10 +8,8 @@ on: branches: [ "main" ] pull_request: branches: [ "main" ] - workflow_dispatch: env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Release jobs: @@ -36,10 +34,11 @@ jobs: - name: Setup Qt uses: jurplel/install-qt-action@v4 with: + version: 6.7.2 host: mac target: desktop arch: clang_64 - version: 6.7.2 + archives: qtbase - name: Configure CMake run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_OSX_ARCHITECTURES=x86_64 -DENABLE_QT_GUI=ON diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 910f0484..e46401cb 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -8,10 +8,8 @@ on: branches: [ "main" ] pull_request: branches: [ "main" ] - workflow_dispatch: env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Release jobs: diff --git a/.github/workflows/windows-qt.yml b/.github/workflows/windows-qt.yml index 019a8ab2..06a16eb5 100644 --- a/.github/workflows/windows-qt.yml +++ b/.github/workflows/windows-qt.yml @@ -10,12 +10,8 @@ on: branches: [ "main" ] env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Release -permissions: - contents: read - jobs: build: runs-on: windows-latest @@ -35,12 +31,9 @@ jobs: archives: qtbase - name: Configure CMake - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -T ClangCL -DENABLE_QT_GUI=ON - name: Build - # Build your program with the given configuration run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel - name: Deploy diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 01ae3f9c..46dc13a8 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -10,12 +10,8 @@ on: branches: [ "main" ] env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Release -permissions: - contents: read - jobs: build: runs-on: windows-latest @@ -25,16 +21,14 @@ jobs: submodules: recursive - name: Configure CMake - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -T ClangCL + - name: Build - # Build your program with the given configuration run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel - - name: Upload a Build Artifact + + - name: Upload executable uses: actions/upload-artifact@v4 with: name: shadps4-win64 - # A file, directory or wildcard pattern that describes what to upload path: | ${{github.workspace}}/build/Release/shadPS4.exe diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 9ebdd878..6426ef16 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -59,7 +59,14 @@ endif() # SDL3 if (NOT TARGET SDL3::SDL3) + set(SDL_DIRECTX OFF) + set(SDL_MMX OFF) + set(SDL_OPENGL OFF) + set(SDL_OPENGLES OFF) set(SDL_PIPEWIRE OFF) + set(SDL_RENDER_D3D OFF) + set(SDL_WASAPI OFF) + set(SDL_XINPUT OFF) add_subdirectory(sdl3) endif() diff --git a/src/qt_gui/main_window.cpp b/src/qt_gui/main_window.cpp index db60c644..c92264df 100644 --- a/src/qt_gui/main_window.cpp +++ b/src/qt_gui/main_window.cpp @@ -51,8 +51,8 @@ bool MainWindow::Init() { this->setStatusBar(statusBar.data()); // Update status bar int numGames = m_game_info->m_games.size(); - QString statusMessage = "Games: " + QString::number(numGames) + " (" + - QString::number(duration.count()) + "ms). Ready."; + QString statusMessage = + "Games: " + QString::number(numGames) + " (" + QString::number(duration.count()) + "ms)"; statusBar->showMessage(statusMessage); return true; } @@ -72,8 +72,8 @@ void MainWindow::CreateActions() { // create action group for themes m_theme_act_group = new QActionGroup(this); - m_theme_act_group->addAction(ui->setThemeLight); m_theme_act_group->addAction(ui->setThemeDark); + m_theme_act_group->addAction(ui->setThemeLight); m_theme_act_group->addAction(ui->setThemeGreen); m_theme_act_group->addAction(ui->setThemeBlue); m_theme_act_group->addAction(ui->setThemeViolet); @@ -322,14 +322,6 @@ void MainWindow::CreateConnects() { }); // Themes - connect(ui->setThemeLight, &QAction::triggered, &m_window_themes, [this]() { - m_window_themes.SetWindowTheme(Theme::Light, ui->mw_searchbar); - Config::setMainWindowTheme(static_cast(Theme::Light)); - if (!isIconBlack) { - SetUiIcons(true); - isIconBlack = true; - } - }); connect(ui->setThemeDark, &QAction::triggered, &m_window_themes, [this]() { m_window_themes.SetWindowTheme(Theme::Dark, ui->mw_searchbar); Config::setMainWindowTheme(static_cast(Theme::Dark)); @@ -338,6 +330,14 @@ void MainWindow::CreateConnects() { isIconBlack = false; } }); + connect(ui->setThemeLight, &QAction::triggered, &m_window_themes, [this]() { + m_window_themes.SetWindowTheme(Theme::Light, ui->mw_searchbar); + Config::setMainWindowTheme(static_cast(Theme::Light)); + if (!isIconBlack) { + SetUiIcons(true); + isIconBlack = true; + } + }); connect(ui->setThemeGreen, &QAction::triggered, &m_window_themes, [this]() { m_window_themes.SetWindowTheme(Theme::Green, ui->mw_searchbar); Config::setMainWindowTheme(static_cast(Theme::Green)); @@ -420,7 +420,7 @@ void MainWindow::RefreshGameTable() { m_game_grid_frame->PopulateGameGrid(m_game_info->m_games, false); statusBar->clearMessage(); int numGames = m_game_info->m_games.size(); - QString statusMessage = "Games: " + QString::number(numGames) + ". Ready."; + QString statusMessage = "Games: " + QString::number(numGames); statusBar->showMessage(statusMessage); } diff --git a/src/qt_gui/main_window_ui.h b/src/qt_gui/main_window_ui.h index 69d71847..06e5cf7f 100644 --- a/src/qt_gui/main_window_ui.h +++ b/src/qt_gui/main_window_ui.h @@ -297,7 +297,7 @@ public: menuRecent->setTitle(QCoreApplication::translate("MainWindow", "Recent Games", nullptr)); exitAct->setText(QCoreApplication::translate("MainWindow", "Exit", nullptr)); #if QT_CONFIG(tooltip) - exitAct->setToolTip(QCoreApplication::translate("MainWindow", "Exit Shadps4", nullptr)); + exitAct->setToolTip(QCoreApplication::translate("MainWindow", "Exit shadPS4", nullptr)); #endif // QT_CONFIG(tooltip) #if QT_CONFIG(statustip) exitAct->setStatusTip( diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp index 40d6cdb7..e85272e9 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp @@ -129,7 +129,7 @@ Id EmitReadConst(EmitContext& ctx) { Id EmitReadConstBuffer(EmitContext& ctx, u32 handle, Id index) { auto& buffer = ctx.buffers[handle]; if (!Sirit::ValidId(buffer.offset)) { - buffer.offset = ctx.GetBufferOffset(handle); + buffer.offset = ctx.GetBufferOffset(buffer.global_binding); } const Id offset_dwords{ctx.OpShiftRightLogical(ctx.U32[1], buffer.offset, ctx.ConstU32(2U))}; index = ctx.OpIAdd(ctx.U32[1], index, offset_dwords); @@ -230,7 +230,7 @@ template static Id EmitLoadBufferF32xN(EmitContext& ctx, u32 handle, Id address) { auto& buffer = ctx.buffers[handle]; if (!Sirit::ValidId(buffer.offset)) { - buffer.offset = ctx.GetBufferOffset(handle); + buffer.offset = ctx.GetBufferOffset(buffer.global_binding); } address = ctx.OpIAdd(ctx.U32[1], address, buffer.offset); const Id index = ctx.OpShiftRightLogical(ctx.U32[1], address, ctx.ConstU32(2u)); @@ -412,7 +412,7 @@ template static Id EmitLoadBufferFormatF32xN(EmitContext& ctx, IR::Inst* inst, u32 handle, Id address) { auto& buffer = ctx.buffers[handle]; if (!Sirit::ValidId(buffer.offset)) { - buffer.offset = ctx.GetBufferOffset(handle); + buffer.offset = ctx.GetBufferOffset(buffer.global_binding); } address = ctx.OpIAdd(ctx.U32[1], address, buffer.offset); if constexpr (N == 1) { @@ -446,7 +446,7 @@ template static void EmitStoreBufferF32xN(EmitContext& ctx, u32 handle, Id address, Id value) { auto& buffer = ctx.buffers[handle]; if (!Sirit::ValidId(buffer.offset)) { - buffer.offset = ctx.GetBufferOffset(handle); + buffer.offset = ctx.GetBufferOffset(buffer.global_binding); } address = ctx.OpIAdd(ctx.U32[1], address, buffer.offset); const Id index = ctx.OpShiftRightLogical(ctx.U32[1], address, ctx.ConstU32(2u)); diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp index cdf417fc..61b55437 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp @@ -352,9 +352,9 @@ void EmitContext::DefineBuffers() { Decorate(id, spv::Decoration::DescriptorSet, 0U); Name(id, fmt::format("{}_{}", buffer.is_storage ? "ssbo" : "cbuf", buffer.sgpr_base)); - binding++; buffers.push_back({ .id = id, + .global_binding = binding++, .data_types = data_types, .pointer_type = pointer_type, .buffer = buffer.GetVsharp(info), diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.h b/src/shader_recompiler/backend/spirv/spirv_emit_context.h index ff9ec4b7..0d090eb3 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.h +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.h @@ -203,6 +203,7 @@ public: struct BufferDefinition { Id id; Id offset; + u32 global_binding; const VectorIds* data_types; Id pointer_type; AmdGpu::Buffer buffer; diff --git a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp index 8a98e968..21710a76 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp @@ -125,7 +125,7 @@ bool ComputePipeline::BindResources(VideoCore::BufferCache& buffer_cache, const u32 adjust = offset - offset_aligned; if (adjust != 0) { ASSERT(adjust % 4 == 0); - push_data.AddOffset(i, adjust); + push_data.AddOffset(binding, adjust); } buffer_infos.emplace_back(vk_buffer->Handle(), offset_aligned, size + adjust); set_writes.push_back({ diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 91ff999e..5d87a1ca 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -343,7 +343,7 @@ void GraphicsPipeline::BindResources(const Liverpool::Regs& regs, push_data.step0 = regs.vgt_instance_step_rate_0; push_data.step1 = regs.vgt_instance_step_rate_1; } - for (u32 i = 0; const auto& buffer : stage.buffers) { + for (const auto& buffer : stage.buffers) { const auto vsharp = buffer.GetVsharp(stage); if (vsharp) { const VAddr address = vsharp.base_address; @@ -359,7 +359,7 @@ void GraphicsPipeline::BindResources(const Liverpool::Regs& regs, const u32 adjust = offset - offset_aligned; if (adjust != 0) { ASSERT(adjust % 4 == 0); - push_data.AddOffset(i, adjust); + push_data.AddOffset(binding, adjust); } buffer_infos.emplace_back(vk_buffer->Handle(), offset_aligned, size + adjust); } else { @@ -374,7 +374,6 @@ void GraphicsPipeline::BindResources(const Liverpool::Regs& regs, : vk::DescriptorType::eUniformBuffer, .pBufferInfo = &buffer_infos.back(), }); - i++; } boost::container::static_vector tsharps;