mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-06 16:45:32 -06:00
more vk* settings
This commit is contained in:
parent
343288f340
commit
fbd6dd8215
@ -159,9 +159,6 @@ static ConfigEntry<bool> shouldPatchShaders(false);
|
||||
static ConfigEntry<u32> vblankFrequency(60);
|
||||
|
||||
// Vulkan
|
||||
static ConfigEntry<bool> vkCrashDiagnostic(false);
|
||||
static ConfigEntry<bool> vkHostMarkers(false);
|
||||
static ConfigEntry<bool> vkGuestMarkers(false);
|
||||
static ConfigEntry<bool> rdocEnable(false);
|
||||
static ConfigEntry<bool> pipelineCacheEnable(false);
|
||||
static ConfigEntry<bool> pipelineCacheArchive(false);
|
||||
@ -302,29 +299,6 @@ u32 vblankFreq() {
|
||||
return vblankFrequency.get();
|
||||
}
|
||||
|
||||
bool getVkCrashDiagnosticEnabled() {
|
||||
return vkCrashDiagnostic.get();
|
||||
}
|
||||
|
||||
bool getVkHostMarkersEnabled() {
|
||||
return vkHostMarkers.get();
|
||||
}
|
||||
|
||||
bool getVkGuestMarkersEnabled() {
|
||||
return vkGuestMarkers.get();
|
||||
}
|
||||
|
||||
void setVkCrashDiagnosticEnabled(bool enable, bool is_game_specific) {
|
||||
vkCrashDiagnostic.set(enable, is_game_specific);
|
||||
}
|
||||
|
||||
void setVkHostMarkersEnabled(bool enable, bool is_game_specific) {
|
||||
vkHostMarkers.set(enable, is_game_specific);
|
||||
}
|
||||
|
||||
void setVkGuestMarkersEnabled(bool enable, bool is_game_specific) {
|
||||
vkGuestMarkers.set(enable, is_game_specific);
|
||||
}
|
||||
|
||||
void setDumpShaders(bool enable, bool is_game_specific) {
|
||||
shouldDumpShaders.set(enable, is_game_specific);
|
||||
@ -457,10 +431,6 @@ void load(const std::filesystem::path& path, bool is_game_specific) {
|
||||
|
||||
if (data.contains("Vulkan")) {
|
||||
const toml::value& vk = data.at("Vulkan");
|
||||
|
||||
vkCrashDiagnostic.setFromToml(vk, "crashDiagnostic", is_game_specific);
|
||||
vkHostMarkers.setFromToml(vk, "hostMarkers", is_game_specific);
|
||||
vkGuestMarkers.setFromToml(vk, "guestMarkers", is_game_specific);
|
||||
rdocEnable.setFromToml(vk, "rdocEnable", is_game_specific);
|
||||
pipelineCacheEnable.setFromToml(vk, "pipelineCacheEnable", is_game_specific);
|
||||
pipelineCacheArchive.setFromToml(vk, "pipelineCacheArchive", is_game_specific);
|
||||
@ -556,10 +526,6 @@ void save(const std::filesystem::path& path, bool is_game_specific) {
|
||||
|
||||
shouldDumpShaders.setTomlValue(data, "GPU", "dumpShaders", is_game_specific);
|
||||
vblankFrequency.setTomlValue(data, "GPU", "vblankFrequency", is_game_specific);
|
||||
|
||||
vkCrashDiagnostic.setTomlValue(data, "Vulkan", "crashDiagnostic", is_game_specific);
|
||||
vkHostMarkers.setTomlValue(data, "Vulkan", "hostMarkers", is_game_specific);
|
||||
vkGuestMarkers.setTomlValue(data, "Vulkan", "guestMarkers", is_game_specific);
|
||||
rdocEnable.setTomlValue(data, "Vulkan", "rdocEnable", is_game_specific);
|
||||
pipelineCacheEnable.setTomlValue(data, "Vulkan", "pipelineCacheEnable", is_game_specific);
|
||||
pipelineCacheArchive.setTomlValue(data, "Vulkan", "pipelineCacheArchive", is_game_specific);
|
||||
@ -611,9 +577,6 @@ void setDefaultValues(bool is_game_specific) {
|
||||
vblankFrequency.setDefault(is_game_specific);
|
||||
|
||||
// GS - Vulkan
|
||||
vkCrashDiagnostic.set(false, is_game_specific);
|
||||
vkHostMarkers.set(false, is_game_specific);
|
||||
vkGuestMarkers.set(false, is_game_specific);
|
||||
rdocEnable.set(false, is_game_specific);
|
||||
pipelineCacheEnable.set(false, is_game_specific);
|
||||
pipelineCacheArchive.set(false, is_game_specific);
|
||||
|
||||
@ -37,12 +37,6 @@ u32 vblankFreq();
|
||||
void setVblankFreq(u32 value, bool is_game_specific = false);
|
||||
s16 getCursorState();
|
||||
void setCursorState(s16 cursorState, bool is_game_specific = false);
|
||||
bool getVkCrashDiagnosticEnabled();
|
||||
void setVkCrashDiagnosticEnabled(bool enable, bool is_game_specific = false);
|
||||
bool getVkHostMarkersEnabled();
|
||||
void setVkHostMarkersEnabled(bool enable, bool is_game_specific = false);
|
||||
bool getVkGuestMarkersEnabled();
|
||||
void setVkGuestMarkersEnabled(bool enable, bool is_game_specific = false);
|
||||
bool isRdocEnabled();
|
||||
bool isPipelineCacheEnabled();
|
||||
bool isPipelineCacheArchived();
|
||||
|
||||
@ -262,11 +262,11 @@ struct VulkanSettings {
|
||||
Setting<bool> vkvalidation_core_enabled{true};
|
||||
Setting<bool> vkvalidation_sync_enabled{false};
|
||||
Setting<bool> vkvalidation_gpu_enabled{false};
|
||||
Setting<bool> crash_diagnostic_enabled{false};
|
||||
Setting<bool> host_markers{false};
|
||||
Setting<bool> guest_markers{false};
|
||||
Setting<bool> pipeline_cache_enabled{false};
|
||||
Setting<bool> pipeline_cache_archive{false};
|
||||
Setting<bool> vkcrash_diagnostic_enabled{false};
|
||||
Setting<bool> vkhost_markers{false};
|
||||
Setting<bool> vkguest_markers{false};
|
||||
Setting<bool> vkpipeline_cache_enabled{false};
|
||||
Setting<bool> vkpipeline_cache_archive{false};
|
||||
std::vector<OverrideItem> GetOverrideableFields() const {
|
||||
return std::vector<OverrideItem>{
|
||||
make_override<VulkanSettings>("gpu_id", &VulkanSettings::gpu_id),
|
||||
@ -280,21 +280,21 @@ struct VulkanSettings {
|
||||
&VulkanSettings::vkvalidation_sync_enabled),
|
||||
make_override<VulkanSettings>("vkvalidation_gpu_enabled",
|
||||
&VulkanSettings::vkvalidation_gpu_enabled),
|
||||
make_override<VulkanSettings>("crash_diagnostic_enabled",
|
||||
&VulkanSettings::crash_diagnostic_enabled),
|
||||
make_override<VulkanSettings>("host_markers", &VulkanSettings::host_markers),
|
||||
make_override<VulkanSettings>("guest_markers", &VulkanSettings::guest_markers),
|
||||
make_override<VulkanSettings>("pipeline_cache_enabled",
|
||||
&VulkanSettings::pipeline_cache_enabled),
|
||||
make_override<VulkanSettings>("pipeline_cache_archive",
|
||||
&VulkanSettings::pipeline_cache_archive),
|
||||
make_override<VulkanSettings>("vkcrash_diagnostic_enabled",
|
||||
&VulkanSettings::vkcrash_diagnostic_enabled),
|
||||
make_override<VulkanSettings>("host_markers", &VulkanSettings::vkhost_markers),
|
||||
make_override<VulkanSettings>("guest_markers", &VulkanSettings::vkguest_markers),
|
||||
make_override<VulkanSettings>("vkpipeline_cache_enabled",
|
||||
&VulkanSettings::vkpipeline_cache_enabled),
|
||||
make_override<VulkanSettings>("vkpipeline_cache_archive",
|
||||
&VulkanSettings::vkpipeline_cache_archive),
|
||||
};
|
||||
}
|
||||
};
|
||||
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(VulkanSettings, gpu_id, full_screen, renderdoc_enabled,
|
||||
vkvalidation_enabled, vkvalidation_core_enabled,
|
||||
vkvalidation_sync_enabled, vkvalidation_gpu_enabled,
|
||||
crash_diagnostic_enabled, host_markers, guest_markers)
|
||||
vkcrash_diagnostic_enabled, vkhost_markers, vkguest_markers)
|
||||
// -------------------------------
|
||||
// User settings
|
||||
// -------------------------------
|
||||
@ -437,11 +437,11 @@ public:
|
||||
SETTING_FORWARD_BOOL(m_vulkan, VkValidationCoreEnabled, vkvalidation_core_enabled)
|
||||
SETTING_FORWARD_BOOL(m_vulkan, VkValidationSyncEnabled, vkvalidation_sync_enabled)
|
||||
SETTING_FORWARD_BOOL(m_vulkan, VkValidationGpuEnabled, vkvalidation_gpu_enabled)
|
||||
SETTING_FORWARD_BOOL(m_vulkan, CrashDiagnosticEnabled, crash_diagnostic_enabled)
|
||||
SETTING_FORWARD_BOOL(m_vulkan, HostMarkers, host_markers)
|
||||
SETTING_FORWARD_BOOL(m_vulkan, GuestMarkers, guest_markers)
|
||||
SETTING_FORWARD_BOOL(m_vulkan, PipelineCacheEnabled, pipeline_cache_enabled)
|
||||
SETTING_FORWARD_BOOL(m_vulkan, PipelineCacheArchive, pipeline_cache_archive)
|
||||
SETTING_FORWARD_BOOL(m_vulkan, VkCrashDiagnosticEnabled, vkcrash_diagnostic_enabled)
|
||||
SETTING_FORWARD_BOOL(m_vulkan, VkHostMarkersEnabled, vkhost_markers)
|
||||
SETTING_FORWARD_BOOL(m_vulkan, VkGuestMarkersEnabled, vkguest_markers)
|
||||
SETTING_FORWARD_BOOL(m_vulkan, VkPipelineCacheEnabled, vkpipeline_cache_enabled)
|
||||
SETTING_FORWARD_BOOL(m_vulkan, VkPipelineCacheArchive, vkpipeline_cache_archive)
|
||||
|
||||
#undef SETTING_FORWARD
|
||||
#undef SETTING_FORWARD_BOOL
|
||||
|
||||
@ -230,9 +230,11 @@ void Emulator::Run(std::filesystem::path file, std::vector<std::string> args,
|
||||
LOG_INFO(Config, "Vulkan vkValidationSync: {}", EmulatorSettings::GetInstance()->IsVkValidationSyncEnabled());
|
||||
LOG_INFO(Config, "Vulkan vkValidationGpu: {}",
|
||||
EmulatorSettings::GetInstance()->IsVkValidationGpuEnabled());
|
||||
LOG_INFO(Config, "Vulkan crashDiagnostics: {}", Config::getVkCrashDiagnosticEnabled());
|
||||
LOG_INFO(Config, "Vulkan hostMarkers: {}", Config::getVkHostMarkersEnabled());
|
||||
LOG_INFO(Config, "Vulkan guestMarkers: {}", Config::getVkGuestMarkersEnabled());
|
||||
LOG_INFO(Config, "Vulkan crashDiagnostics: {}", EmulatorSettings::GetInstance()->IsVkCrashDiagnosticEnabled());
|
||||
LOG_INFO(Config, "Vulkan hostMarkers: {}",
|
||||
EmulatorSettings::GetInstance()->IsVkHostMarkersEnabled());
|
||||
LOG_INFO(Config, "Vulkan guestMarkers: {}",
|
||||
EmulatorSettings::GetInstance()->IsVkGuestMarkersEnabled());
|
||||
LOG_INFO(Config, "Vulkan rdocEnable: {}", Config::isRdocEnabled());
|
||||
|
||||
hwinfo::Memory ram;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <SDL3/SDL_events.h>
|
||||
@ -8,6 +8,7 @@
|
||||
#include "common/path_util.h"
|
||||
#include "core/debug_state.h"
|
||||
#include "core/devtools/layer.h"
|
||||
#include "core/emulator_settings.h"
|
||||
#include "imgui/imgui_layer.h"
|
||||
#include "imgui_core.h"
|
||||
#include "imgui_impl_sdl3.h"
|
||||
@ -218,8 +219,7 @@ void Render(const vk::CommandBuffer& cmdbuf, const vk::ImageView& image_view,
|
||||
if (draw_data->CmdListsCount == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Config::getVkHostMarkersEnabled()) {
|
||||
if (EmulatorSettings::GetInstance()->IsVkHostMarkersEnabled()) {
|
||||
cmdbuf.beginDebugUtilsLabelEXT(vk::DebugUtilsLabelEXT{
|
||||
.pLabelName = "ImGui Render",
|
||||
});
|
||||
@ -244,7 +244,7 @@ void Render(const vk::CommandBuffer& cmdbuf, const vk::ImageView& image_view,
|
||||
cmdbuf.beginRendering(render_info);
|
||||
Vulkan::RenderDrawData(*draw_data, cmdbuf);
|
||||
cmdbuf.endRendering();
|
||||
if (Config::getVkHostMarkersEnabled()) {
|
||||
if (EmulatorSettings::GetInstance()->IsVkHostMarkersEnabled()) {
|
||||
cmdbuf.endDebugUtilsLabelEXT();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <deque>
|
||||
@ -11,6 +11,7 @@
|
||||
#include "common/polyfill_thread.h"
|
||||
#include "common/stb.h"
|
||||
#include "common/thread.h"
|
||||
#include "core/emulator_settings.h"
|
||||
#include "imgui_impl_vulkan.h"
|
||||
#include "texture_manager.h"
|
||||
|
||||
@ -152,7 +153,7 @@ void WorkerLoop() {
|
||||
g_job_list.pop_front();
|
||||
g_job_list_mtx.unlock();
|
||||
|
||||
if (Config::getVkCrashDiagnosticEnabled()) {
|
||||
if (EmulatorSettings::GetInstance()->IsVkCrashDiagnosticEnabled()) {
|
||||
// FIXME: Crash diagnostic hangs when building the command buffer here
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "common/config.h"
|
||||
#include "core/emulator_settings.h"
|
||||
#include "video_core/host_shaders/fsr_comp.h"
|
||||
#include "video_core/renderer_vulkan/host_passes/fsr_pass.h"
|
||||
#include "video_core/renderer_vulkan/vk_platform.h"
|
||||
@ -164,7 +165,7 @@ vk::ImageView FsrPass::Render(vk::CommandBuffer cmdbuf, vk::ImageView input,
|
||||
CreateImages(img);
|
||||
}
|
||||
|
||||
if (Config::getVkHostMarkersEnabled()) {
|
||||
if (EmulatorSettings::GetInstance()->IsVkHostMarkersEnabled()) {
|
||||
cmdbuf.beginDebugUtilsLabelEXT(vk::DebugUtilsLabelEXT{
|
||||
.pLabelName = "Host/FSR",
|
||||
});
|
||||
@ -387,7 +388,7 @@ vk::ImageView FsrPass::Render(vk::CommandBuffer cmdbuf, vk::ImageView input,
|
||||
.pImageMemoryBarriers = return_barrier.data(),
|
||||
});
|
||||
|
||||
if (Config::getVkHostMarkersEnabled()) {
|
||||
if (EmulatorSettings::GetInstance()->IsVkHostMarkersEnabled()) {
|
||||
cmdbuf.endDebugUtilsLabelEXT();
|
||||
}
|
||||
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2024-2026 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "video_core/renderer_vulkan/host_passes/pp_pass.h"
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "common/config.h"
|
||||
#include "core/emulator_settings.h"
|
||||
#include "video_core/host_shaders/fs_tri_vert.h"
|
||||
#include "video_core/host_shaders/post_process_frag.h"
|
||||
#include "video_core/renderer_vulkan/vk_platform.h"
|
||||
@ -188,7 +189,7 @@ void PostProcessingPass::Create(vk::Device device, const vk::Format surface_form
|
||||
|
||||
void PostProcessingPass::Render(vk::CommandBuffer cmdbuf, vk::ImageView input,
|
||||
vk::Extent2D input_size, Frame& frame, Settings settings) {
|
||||
if (Config::getVkHostMarkersEnabled()) {
|
||||
if (EmulatorSettings::GetInstance()->IsVkHostMarkersEnabled()) {
|
||||
cmdbuf.beginDebugUtilsLabelEXT(vk::DebugUtilsLabelEXT{
|
||||
.pLabelName = "Host/Post processing",
|
||||
});
|
||||
@ -279,7 +280,7 @@ void PostProcessingPass::Render(vk::CommandBuffer cmdbuf, vk::ImageView input,
|
||||
.pImageMemoryBarriers = &post_barrier,
|
||||
});
|
||||
|
||||
if (Config::getVkHostMarkersEnabled()) {
|
||||
if (EmulatorSettings::GetInstance()->IsVkHostMarkersEnabled()) {
|
||||
cmdbuf.endDebugUtilsLabelEXT();
|
||||
}
|
||||
}
|
||||
|
||||
@ -107,7 +107,7 @@ Presenter::Presenter(Frontend::WindowSDL& window_, AmdGpu::Liverpool* liverpool_
|
||||
: window{window_}, liverpool{liverpool_},
|
||||
instance{window, EmulatorSettings::GetInstance()->GetGpuId(),
|
||||
EmulatorSettings::GetInstance()->IsVkValidationEnabled(),
|
||||
Config::getVkCrashDiagnosticEnabled()},
|
||||
EmulatorSettings::GetInstance()->IsVkCrashDiagnosticEnabled()},
|
||||
draw_scheduler{instance}, present_scheduler{instance}, flip_scheduler{instance},
|
||||
swapchain{instance, window},
|
||||
rasterizer{std::make_unique<Rasterizer>(instance, draw_scheduler, liverpool)},
|
||||
@ -468,7 +468,7 @@ void Presenter::Present(Frame* frame, bool is_reusing_frame) {
|
||||
auto& scheduler = present_scheduler;
|
||||
const auto cmdbuf = scheduler.CommandBuffer();
|
||||
|
||||
if (Config::getVkHostMarkersEnabled()) {
|
||||
if (EmulatorSettings::GetInstance()->IsVkHostMarkersEnabled()) {
|
||||
cmdbuf.beginDebugUtilsLabelEXT(vk::DebugUtilsLabelEXT{
|
||||
.pLabelName = "Present",
|
||||
});
|
||||
@ -599,7 +599,7 @@ void Presenter::Present(Frame* frame, bool is_reusing_frame) {
|
||||
}
|
||||
}
|
||||
|
||||
if (Config::getVkHostMarkersEnabled()) {
|
||||
if (EmulatorSettings::GetInstance()->IsVkHostMarkersEnabled()) {
|
||||
cmdbuf.endDebugUtilsLabelEXT();
|
||||
}
|
||||
|
||||
|
||||
@ -1275,8 +1275,8 @@ void Rasterizer::UpdateColorBlendingState(const GraphicsPipeline* pipeline) cons
|
||||
}
|
||||
|
||||
void Rasterizer::ScopeMarkerBegin(const std::string_view& str, bool from_guest) {
|
||||
if ((from_guest && !Config::getVkGuestMarkersEnabled()) ||
|
||||
(!from_guest && !Config::getVkHostMarkersEnabled())) {
|
||||
if ((from_guest && !EmulatorSettings::GetInstance()->IsVkGuestMarkersEnabled()) ||
|
||||
(!from_guest && !EmulatorSettings::GetInstance()->IsVkHostMarkersEnabled())) {
|
||||
return;
|
||||
}
|
||||
const auto cmdbuf = scheduler.CommandBuffer();
|
||||
@ -1286,8 +1286,8 @@ void Rasterizer::ScopeMarkerBegin(const std::string_view& str, bool from_guest)
|
||||
}
|
||||
|
||||
void Rasterizer::ScopeMarkerEnd(bool from_guest) {
|
||||
if ((from_guest && !Config::getVkGuestMarkersEnabled()) ||
|
||||
(!from_guest && !Config::getVkHostMarkersEnabled())) {
|
||||
if ((from_guest && !EmulatorSettings::GetInstance()->IsVkGuestMarkersEnabled()) ||
|
||||
(!from_guest && !EmulatorSettings::GetInstance()->IsVkHostMarkersEnabled())) {
|
||||
return;
|
||||
}
|
||||
const auto cmdbuf = scheduler.CommandBuffer();
|
||||
@ -1295,8 +1295,8 @@ void Rasterizer::ScopeMarkerEnd(bool from_guest) {
|
||||
}
|
||||
|
||||
void Rasterizer::ScopedMarkerInsert(const std::string_view& str, bool from_guest) {
|
||||
if ((from_guest && !Config::getVkGuestMarkersEnabled()) ||
|
||||
(!from_guest && !Config::getVkHostMarkersEnabled())) {
|
||||
if ((from_guest && !EmulatorSettings::GetInstance()->IsVkGuestMarkersEnabled()) ||
|
||||
(!from_guest && !EmulatorSettings::GetInstance()->IsVkHostMarkersEnabled())) {
|
||||
return;
|
||||
}
|
||||
const auto cmdbuf = scheduler.CommandBuffer();
|
||||
@ -1307,8 +1307,8 @@ void Rasterizer::ScopedMarkerInsert(const std::string_view& str, bool from_guest
|
||||
|
||||
void Rasterizer::ScopedMarkerInsertColor(const std::string_view& str, const u32 color,
|
||||
bool from_guest) {
|
||||
if ((from_guest && !Config::getVkGuestMarkersEnabled()) ||
|
||||
(!from_guest && !Config::getVkHostMarkersEnabled())) {
|
||||
if ((from_guest && !EmulatorSettings::GetInstance()->IsVkGuestMarkersEnabled()) ||
|
||||
(!from_guest && !EmulatorSettings::GetInstance()->IsVkHostMarkersEnabled())) {
|
||||
return;
|
||||
}
|
||||
const auto cmdbuf = scheduler.CommandBuffer();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user