diff options
Diffstat (limited to '')
-rw-r--r-- | src/input_common/drivers/tas_input.cpp | 12 | ||||
-rw-r--r-- | src/input_common/drivers/tas_input.h | 2 | ||||
-rw-r--r-- | src/video_core/vulkan_common/vulkan_device.h | 1 | ||||
-rw-r--r-- | src/video_core/vulkan_common/vulkan_wrapper.cpp | 10 | ||||
-rw-r--r-- | src/video_core/vulkan_common/vulkan_wrapper.h | 12 | ||||
-rw-r--r-- | src/yuzu/configuration/configure_graphics_advanced.cpp | 5 | ||||
-rw-r--r-- | src/yuzu/main.cpp | 27 | ||||
-rw-r--r-- | src/yuzu/main.h | 4 |
8 files changed, 56 insertions, 17 deletions
diff --git a/src/input_common/drivers/tas_input.cpp b/src/input_common/drivers/tas_input.cpp index f3ade90da..f3cb14c56 100644 --- a/src/input_common/drivers/tas_input.cpp +++ b/src/input_common/drivers/tas_input.cpp @@ -156,10 +156,12 @@ void Tas::RecordInput(u64 buttons, TasAnalog left_axis, TasAnalog right_axis) { }; } -std::tuple<TasState, size_t, size_t> Tas::GetStatus() const { +std::tuple<TasState, size_t, std::array<size_t, PLAYER_NUMBER>> Tas::GetStatus() const { TasState state; + std::array<size_t, PLAYER_NUMBER> lengths{0}; if (is_recording) { - return {TasState::Recording, 0, record_commands.size()}; + lengths[0] = record_commands.size(); + return {TasState::Recording, record_commands.size(), lengths}; } if (is_running) { @@ -168,7 +170,11 @@ std::tuple<TasState, size_t, size_t> Tas::GetStatus() const { state = TasState::Stopped; } - return {state, current_command, script_length}; + for (size_t i = 0; i < PLAYER_NUMBER; i++) { + lengths[i] = commands[i].size(); + } + + return {state, current_command, lengths}; } void Tas::UpdateThread() { diff --git a/src/input_common/drivers/tas_input.h b/src/input_common/drivers/tas_input.h index 38a27a230..5be66d142 100644 --- a/src/input_common/drivers/tas_input.h +++ b/src/input_common/drivers/tas_input.h @@ -124,7 +124,7 @@ public: * Current playback progress ; * Total length of script file currently loaded or being recorded */ - std::tuple<TasState, size_t, size_t> GetStatus() const; + std::tuple<TasState, size_t, std::array<size_t, PLAYER_NUMBER>> GetStatus() const; private: enum class TasAxis : u8; diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 4cfb20bc2..0662a2d9f 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -65,6 +65,7 @@ EXTENSION(EXT, SHADER_VIEWPORT_INDEX_LAYER, shader_viewport_index_layer) \ EXTENSION(EXT, TOOLING_INFO, tooling_info) \ EXTENSION(EXT, VERTEX_ATTRIBUTE_DIVISOR, vertex_attribute_divisor) \ + EXTENSION(KHR, DRAW_INDIRECT_COUNT, draw_indirect_count) \ EXTENSION(KHR, DRIVER_PROPERTIES, driver_properties) \ EXTENSION(KHR, EXTERNAL_MEMORY_FD, external_memory_fd) \ EXTENSION(KHR, PUSH_DESCRIPTOR, push_descriptor) \ diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp index 61be1fce1..486d4dfaf 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.cpp +++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp @@ -96,8 +96,8 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { X(vkCmdDrawIndexed); X(vkCmdDrawIndirect); X(vkCmdDrawIndexedIndirect); - X(vkCmdDrawIndirectCountKHR); - X(vkCmdDrawIndexedIndirectCountKHR); + X(vkCmdDrawIndirectCount); + X(vkCmdDrawIndexedIndirectCount); X(vkCmdEndQuery); X(vkCmdEndRenderPass); X(vkCmdEndTransformFeedbackEXT); @@ -221,6 +221,12 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { if (!dld.vkResetQueryPool) { Proc(dld.vkResetQueryPool, dld, "vkResetQueryPoolEXT", device); } + + // Support for draw indirect with count is optional in Vulkan 1.2 + if (!dld.vkCmdDrawIndirectCount) { + Proc(dld.vkCmdDrawIndirectCount, dld, "vkCmdDrawIndirectCountKHR", device); + Proc(dld.vkCmdDrawIndexedIndirectCount, dld, "vkCmdDrawIndexedIndirectCountKHR", device); + } #undef X } diff --git a/src/video_core/vulkan_common/vulkan_wrapper.h b/src/video_core/vulkan_common/vulkan_wrapper.h index 412779b51..e86f661cb 100644 --- a/src/video_core/vulkan_common/vulkan_wrapper.h +++ b/src/video_core/vulkan_common/vulkan_wrapper.h @@ -215,8 +215,8 @@ struct DeviceDispatch : InstanceDispatch { PFN_vkCmdDrawIndexed vkCmdDrawIndexed{}; PFN_vkCmdDrawIndirect vkCmdDrawIndirect{}; PFN_vkCmdDrawIndexedIndirect vkCmdDrawIndexedIndirect{}; - PFN_vkCmdDrawIndirectCountKHR vkCmdDrawIndirectCountKHR{}; - PFN_vkCmdDrawIndexedIndirectCountKHR vkCmdDrawIndexedIndirectCountKHR{}; + PFN_vkCmdDrawIndirectCount vkCmdDrawIndirectCount{}; + PFN_vkCmdDrawIndexedIndirectCount vkCmdDrawIndexedIndirectCount{}; PFN_vkCmdEndDebugUtilsLabelEXT vkCmdEndDebugUtilsLabelEXT{}; PFN_vkCmdEndQuery vkCmdEndQuery{}; PFN_vkCmdEndRenderPass vkCmdEndRenderPass{}; @@ -1065,15 +1065,15 @@ public: void DrawIndirectCount(VkBuffer src_buffer, VkDeviceSize src_offset, VkBuffer count_buffer, VkDeviceSize count_offset, u32 draw_count, u32 stride) const noexcept { - dld->vkCmdDrawIndirectCountKHR(handle, src_buffer, src_offset, count_buffer, count_offset, - draw_count, stride); + dld->vkCmdDrawIndirectCount(handle, src_buffer, src_offset, count_buffer, count_offset, + draw_count, stride); } void DrawIndexedIndirectCount(VkBuffer src_buffer, VkDeviceSize src_offset, VkBuffer count_buffer, VkDeviceSize count_offset, u32 draw_count, u32 stride) const noexcept { - dld->vkCmdDrawIndexedIndirectCountKHR(handle, src_buffer, src_offset, count_buffer, - count_offset, draw_count, stride); + dld->vkCmdDrawIndexedIndirectCount(handle, src_buffer, src_offset, count_buffer, + count_offset, draw_count, stride); } void ClearAttachments(Span<VkClearAttachment> attachments, diff --git a/src/yuzu/configuration/configure_graphics_advanced.cpp b/src/yuzu/configuration/configure_graphics_advanced.cpp index fdf8485ce..cc0155a2c 100644 --- a/src/yuzu/configuration/configure_graphics_advanced.cpp +++ b/src/yuzu/configuration/configure_graphics_advanced.cpp @@ -22,6 +22,7 @@ ConfigureGraphicsAdvanced::~ConfigureGraphicsAdvanced() = default; void ConfigureGraphicsAdvanced::SetConfiguration() { const bool runtime_lock = !system.IsPoweredOn(); ui->use_vsync->setEnabled(runtime_lock); + ui->renderer_force_max_clock->setEnabled(runtime_lock); ui->use_asynchronous_shaders->setEnabled(runtime_lock); ui->anisotropic_filtering_combobox->setEnabled(runtime_lock); @@ -40,12 +41,12 @@ void ConfigureGraphicsAdvanced::SetConfiguration() { Settings::values.max_anisotropy.GetValue()); } else { ConfigurationShared::SetPerGameSetting(ui->gpu_accuracy, &Settings::values.gpu_accuracy); - ConfigurationShared::SetPerGameSetting(ui->renderer_force_max_clock, - &Settings::values.renderer_force_max_clock); ConfigurationShared::SetPerGameSetting(ui->anisotropic_filtering_combobox, &Settings::values.max_anisotropy); ConfigurationShared::SetHighlight(ui->label_gpu_accuracy, !Settings::values.gpu_accuracy.UsingGlobal()); + ConfigurationShared::SetHighlight(ui->renderer_force_max_clock, + !Settings::values.renderer_force_max_clock.UsingGlobal()); ConfigurationShared::SetHighlight(ui->af_label, !Settings::values.max_anisotropy.UsingGlobal()); } diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 2ea3b7d59..571eacf9f 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -3730,15 +3730,36 @@ void GMainWindow::UpdateWindowTitle(std::string_view title_name, std::string_vie } } +std::string GMainWindow::CreateTASFramesString( + std::array<size_t, InputCommon::TasInput::PLAYER_NUMBER> frames) const { + std::string string = ""; + size_t maxPlayerIndex = 0; + for (size_t i = 0; i < frames.size(); i++) { + if (frames[i] != 0) { + if (maxPlayerIndex != 0) + string += ", "; + while (maxPlayerIndex++ != i) + string += "0, "; + string += std::to_string(frames[i]); + } + } + return string; +} + QString GMainWindow::GetTasStateDescription() const { auto [tas_status, current_tas_frame, total_tas_frames] = input_subsystem->GetTas()->GetStatus(); + std::string tas_frames_string = CreateTASFramesString(total_tas_frames); switch (tas_status) { case InputCommon::TasInput::TasState::Running: - return tr("TAS state: Running %1/%2").arg(current_tas_frame).arg(total_tas_frames); + return tr("TAS state: Running %1/%2") + .arg(current_tas_frame) + .arg(QString::fromStdString(tas_frames_string)); case InputCommon::TasInput::TasState::Recording: - return tr("TAS state: Recording %1").arg(total_tas_frames); + return tr("TAS state: Recording %1").arg(total_tas_frames[0]); case InputCommon::TasInput::TasState::Stopped: - return tr("TAS state: Idle %1/%2").arg(current_tas_frame).arg(total_tas_frames); + return tr("TAS state: Idle %1/%2") + .arg(current_tas_frame) + .arg(QString::fromStdString(tas_frames_string)); default: return tr("TAS State: Invalid"); } diff --git a/src/yuzu/main.h b/src/yuzu/main.h index f25ce65a8..0f61abc7a 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -12,6 +12,7 @@ #include "common/announce_multiplayer_room.h" #include "common/common_types.h" +#include "input_common/drivers/tas_input.h" #include "yuzu/compatibility_list.h" #include "yuzu/hotkeys.h" @@ -266,6 +267,9 @@ private: void changeEvent(QEvent* event) override; void closeEvent(QCloseEvent* event) override; + std::string CreateTASFramesString( + std::array<size_t, InputCommon::TasInput::PLAYER_NUMBER> frames) const; + #ifdef __unix__ void SetupSigInterrupts(); static void HandleSigInterrupt(int); |