diff options
| -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) { | |||
| 156 | }; | 156 | }; |
| 157 | } | 157 | } |
| 158 | 158 | ||
| 159 | std::tuple<TasState, size_t, size_t> Tas::GetStatus() const { | 159 | std::tuple<TasState, size_t, std::array<size_t, PLAYER_NUMBER>> Tas::GetStatus() const { |
| 160 | TasState state; | 160 | TasState state; |
| 161 | std::array<size_t, PLAYER_NUMBER> lengths{0}; | ||
| 161 | if (is_recording) { | 162 | if (is_recording) { |
| 162 | return {TasState::Recording, 0, record_commands.size()}; | 163 | lengths[0] = record_commands.size(); |
| 164 | return {TasState::Recording, record_commands.size(), lengths}; | ||
| 163 | } | 165 | } |
| 164 | 166 | ||
| 165 | if (is_running) { | 167 | if (is_running) { |
| @@ -168,7 +170,11 @@ std::tuple<TasState, size_t, size_t> Tas::GetStatus() const { | |||
| 168 | state = TasState::Stopped; | 170 | state = TasState::Stopped; |
| 169 | } | 171 | } |
| 170 | 172 | ||
| 171 | return {state, current_command, script_length}; | 173 | for (size_t i = 0; i < PLAYER_NUMBER; i++) { |
| 174 | lengths[i] = commands[i].size(); | ||
| 175 | } | ||
| 176 | |||
| 177 | return {state, current_command, lengths}; | ||
| 172 | } | 178 | } |
| 173 | 179 | ||
| 174 | void Tas::UpdateThread() { | 180 | 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: | |||
| 124 | * Current playback progress ; | 124 | * Current playback progress ; |
| 125 | * Total length of script file currently loaded or being recorded | 125 | * Total length of script file currently loaded or being recorded |
| 126 | */ | 126 | */ |
| 127 | std::tuple<TasState, size_t, size_t> GetStatus() const; | 127 | std::tuple<TasState, size_t, std::array<size_t, PLAYER_NUMBER>> GetStatus() const; |
| 128 | 128 | ||
| 129 | private: | 129 | private: |
| 130 | enum class TasAxis : u8; | 130 | 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 @@ | |||
| 65 | EXTENSION(EXT, SHADER_VIEWPORT_INDEX_LAYER, shader_viewport_index_layer) \ | 65 | EXTENSION(EXT, SHADER_VIEWPORT_INDEX_LAYER, shader_viewport_index_layer) \ |
| 66 | EXTENSION(EXT, TOOLING_INFO, tooling_info) \ | 66 | EXTENSION(EXT, TOOLING_INFO, tooling_info) \ |
| 67 | EXTENSION(EXT, VERTEX_ATTRIBUTE_DIVISOR, vertex_attribute_divisor) \ | 67 | EXTENSION(EXT, VERTEX_ATTRIBUTE_DIVISOR, vertex_attribute_divisor) \ |
| 68 | EXTENSION(KHR, DRAW_INDIRECT_COUNT, draw_indirect_count) \ | ||
| 68 | EXTENSION(KHR, DRIVER_PROPERTIES, driver_properties) \ | 69 | EXTENSION(KHR, DRIVER_PROPERTIES, driver_properties) \ |
| 69 | EXTENSION(KHR, EXTERNAL_MEMORY_FD, external_memory_fd) \ | 70 | EXTENSION(KHR, EXTERNAL_MEMORY_FD, external_memory_fd) \ |
| 70 | EXTENSION(KHR, PUSH_DESCRIPTOR, push_descriptor) \ | 71 | 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 { | |||
| 96 | X(vkCmdDrawIndexed); | 96 | X(vkCmdDrawIndexed); |
| 97 | X(vkCmdDrawIndirect); | 97 | X(vkCmdDrawIndirect); |
| 98 | X(vkCmdDrawIndexedIndirect); | 98 | X(vkCmdDrawIndexedIndirect); |
| 99 | X(vkCmdDrawIndirectCountKHR); | 99 | X(vkCmdDrawIndirectCount); |
| 100 | X(vkCmdDrawIndexedIndirectCountKHR); | 100 | X(vkCmdDrawIndexedIndirectCount); |
| 101 | X(vkCmdEndQuery); | 101 | X(vkCmdEndQuery); |
| 102 | X(vkCmdEndRenderPass); | 102 | X(vkCmdEndRenderPass); |
| 103 | X(vkCmdEndTransformFeedbackEXT); | 103 | X(vkCmdEndTransformFeedbackEXT); |
| @@ -221,6 +221,12 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept { | |||
| 221 | if (!dld.vkResetQueryPool) { | 221 | if (!dld.vkResetQueryPool) { |
| 222 | Proc(dld.vkResetQueryPool, dld, "vkResetQueryPoolEXT", device); | 222 | Proc(dld.vkResetQueryPool, dld, "vkResetQueryPoolEXT", device); |
| 223 | } | 223 | } |
| 224 | |||
| 225 | // Support for draw indirect with count is optional in Vulkan 1.2 | ||
| 226 | if (!dld.vkCmdDrawIndirectCount) { | ||
| 227 | Proc(dld.vkCmdDrawIndirectCount, dld, "vkCmdDrawIndirectCountKHR", device); | ||
| 228 | Proc(dld.vkCmdDrawIndexedIndirectCount, dld, "vkCmdDrawIndexedIndirectCountKHR", device); | ||
| 229 | } | ||
| 224 | #undef X | 230 | #undef X |
| 225 | } | 231 | } |
| 226 | 232 | ||
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 { | |||
| 215 | PFN_vkCmdDrawIndexed vkCmdDrawIndexed{}; | 215 | PFN_vkCmdDrawIndexed vkCmdDrawIndexed{}; |
| 216 | PFN_vkCmdDrawIndirect vkCmdDrawIndirect{}; | 216 | PFN_vkCmdDrawIndirect vkCmdDrawIndirect{}; |
| 217 | PFN_vkCmdDrawIndexedIndirect vkCmdDrawIndexedIndirect{}; | 217 | PFN_vkCmdDrawIndexedIndirect vkCmdDrawIndexedIndirect{}; |
| 218 | PFN_vkCmdDrawIndirectCountKHR vkCmdDrawIndirectCountKHR{}; | 218 | PFN_vkCmdDrawIndirectCount vkCmdDrawIndirectCount{}; |
| 219 | PFN_vkCmdDrawIndexedIndirectCountKHR vkCmdDrawIndexedIndirectCountKHR{}; | 219 | PFN_vkCmdDrawIndexedIndirectCount vkCmdDrawIndexedIndirectCount{}; |
| 220 | PFN_vkCmdEndDebugUtilsLabelEXT vkCmdEndDebugUtilsLabelEXT{}; | 220 | PFN_vkCmdEndDebugUtilsLabelEXT vkCmdEndDebugUtilsLabelEXT{}; |
| 221 | PFN_vkCmdEndQuery vkCmdEndQuery{}; | 221 | PFN_vkCmdEndQuery vkCmdEndQuery{}; |
| 222 | PFN_vkCmdEndRenderPass vkCmdEndRenderPass{}; | 222 | PFN_vkCmdEndRenderPass vkCmdEndRenderPass{}; |
| @@ -1065,15 +1065,15 @@ public: | |||
| 1065 | 1065 | ||
| 1066 | void DrawIndirectCount(VkBuffer src_buffer, VkDeviceSize src_offset, VkBuffer count_buffer, | 1066 | void DrawIndirectCount(VkBuffer src_buffer, VkDeviceSize src_offset, VkBuffer count_buffer, |
| 1067 | VkDeviceSize count_offset, u32 draw_count, u32 stride) const noexcept { | 1067 | VkDeviceSize count_offset, u32 draw_count, u32 stride) const noexcept { |
| 1068 | dld->vkCmdDrawIndirectCountKHR(handle, src_buffer, src_offset, count_buffer, count_offset, | 1068 | dld->vkCmdDrawIndirectCount(handle, src_buffer, src_offset, count_buffer, count_offset, |
| 1069 | draw_count, stride); | 1069 | draw_count, stride); |
| 1070 | } | 1070 | } |
| 1071 | 1071 | ||
| 1072 | void DrawIndexedIndirectCount(VkBuffer src_buffer, VkDeviceSize src_offset, | 1072 | void DrawIndexedIndirectCount(VkBuffer src_buffer, VkDeviceSize src_offset, |
| 1073 | VkBuffer count_buffer, VkDeviceSize count_offset, u32 draw_count, | 1073 | VkBuffer count_buffer, VkDeviceSize count_offset, u32 draw_count, |
| 1074 | u32 stride) const noexcept { | 1074 | u32 stride) const noexcept { |
| 1075 | dld->vkCmdDrawIndexedIndirectCountKHR(handle, src_buffer, src_offset, count_buffer, | 1075 | dld->vkCmdDrawIndexedIndirectCount(handle, src_buffer, src_offset, count_buffer, |
| 1076 | count_offset, draw_count, stride); | 1076 | count_offset, draw_count, stride); |
| 1077 | } | 1077 | } |
| 1078 | 1078 | ||
| 1079 | void ClearAttachments(Span<VkClearAttachment> attachments, | 1079 | 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; | |||
| 22 | void ConfigureGraphicsAdvanced::SetConfiguration() { | 22 | void ConfigureGraphicsAdvanced::SetConfiguration() { |
| 23 | const bool runtime_lock = !system.IsPoweredOn(); | 23 | const bool runtime_lock = !system.IsPoweredOn(); |
| 24 | ui->use_vsync->setEnabled(runtime_lock); | 24 | ui->use_vsync->setEnabled(runtime_lock); |
| 25 | ui->renderer_force_max_clock->setEnabled(runtime_lock); | ||
| 25 | ui->use_asynchronous_shaders->setEnabled(runtime_lock); | 26 | ui->use_asynchronous_shaders->setEnabled(runtime_lock); |
| 26 | ui->anisotropic_filtering_combobox->setEnabled(runtime_lock); | 27 | ui->anisotropic_filtering_combobox->setEnabled(runtime_lock); |
| 27 | 28 | ||
| @@ -40,12 +41,12 @@ void ConfigureGraphicsAdvanced::SetConfiguration() { | |||
| 40 | Settings::values.max_anisotropy.GetValue()); | 41 | Settings::values.max_anisotropy.GetValue()); |
| 41 | } else { | 42 | } else { |
| 42 | ConfigurationShared::SetPerGameSetting(ui->gpu_accuracy, &Settings::values.gpu_accuracy); | 43 | ConfigurationShared::SetPerGameSetting(ui->gpu_accuracy, &Settings::values.gpu_accuracy); |
| 43 | ConfigurationShared::SetPerGameSetting(ui->renderer_force_max_clock, | ||
| 44 | &Settings::values.renderer_force_max_clock); | ||
| 45 | ConfigurationShared::SetPerGameSetting(ui->anisotropic_filtering_combobox, | 44 | ConfigurationShared::SetPerGameSetting(ui->anisotropic_filtering_combobox, |
| 46 | &Settings::values.max_anisotropy); | 45 | &Settings::values.max_anisotropy); |
| 47 | ConfigurationShared::SetHighlight(ui->label_gpu_accuracy, | 46 | ConfigurationShared::SetHighlight(ui->label_gpu_accuracy, |
| 48 | !Settings::values.gpu_accuracy.UsingGlobal()); | 47 | !Settings::values.gpu_accuracy.UsingGlobal()); |
| 48 | ConfigurationShared::SetHighlight(ui->renderer_force_max_clock, | ||
| 49 | !Settings::values.renderer_force_max_clock.UsingGlobal()); | ||
| 49 | ConfigurationShared::SetHighlight(ui->af_label, | 50 | ConfigurationShared::SetHighlight(ui->af_label, |
| 50 | !Settings::values.max_anisotropy.UsingGlobal()); | 51 | !Settings::values.max_anisotropy.UsingGlobal()); |
| 51 | } | 52 | } |
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 | |||
| 3730 | } | 3730 | } |
| 3731 | } | 3731 | } |
| 3732 | 3732 | ||
| 3733 | std::string GMainWindow::CreateTASFramesString( | ||
| 3734 | std::array<size_t, InputCommon::TasInput::PLAYER_NUMBER> frames) const { | ||
| 3735 | std::string string = ""; | ||
| 3736 | size_t maxPlayerIndex = 0; | ||
| 3737 | for (size_t i = 0; i < frames.size(); i++) { | ||
| 3738 | if (frames[i] != 0) { | ||
| 3739 | if (maxPlayerIndex != 0) | ||
| 3740 | string += ", "; | ||
| 3741 | while (maxPlayerIndex++ != i) | ||
| 3742 | string += "0, "; | ||
| 3743 | string += std::to_string(frames[i]); | ||
| 3744 | } | ||
| 3745 | } | ||
| 3746 | return string; | ||
| 3747 | } | ||
| 3748 | |||
| 3733 | QString GMainWindow::GetTasStateDescription() const { | 3749 | QString GMainWindow::GetTasStateDescription() const { |
| 3734 | auto [tas_status, current_tas_frame, total_tas_frames] = input_subsystem->GetTas()->GetStatus(); | 3750 | auto [tas_status, current_tas_frame, total_tas_frames] = input_subsystem->GetTas()->GetStatus(); |
| 3751 | std::string tas_frames_string = CreateTASFramesString(total_tas_frames); | ||
| 3735 | switch (tas_status) { | 3752 | switch (tas_status) { |
| 3736 | case InputCommon::TasInput::TasState::Running: | 3753 | case InputCommon::TasInput::TasState::Running: |
| 3737 | return tr("TAS state: Running %1/%2").arg(current_tas_frame).arg(total_tas_frames); | 3754 | return tr("TAS state: Running %1/%2") |
| 3755 | .arg(current_tas_frame) | ||
| 3756 | .arg(QString::fromStdString(tas_frames_string)); | ||
| 3738 | case InputCommon::TasInput::TasState::Recording: | 3757 | case InputCommon::TasInput::TasState::Recording: |
| 3739 | return tr("TAS state: Recording %1").arg(total_tas_frames); | 3758 | return tr("TAS state: Recording %1").arg(total_tas_frames[0]); |
| 3740 | case InputCommon::TasInput::TasState::Stopped: | 3759 | case InputCommon::TasInput::TasState::Stopped: |
| 3741 | return tr("TAS state: Idle %1/%2").arg(current_tas_frame).arg(total_tas_frames); | 3760 | return tr("TAS state: Idle %1/%2") |
| 3761 | .arg(current_tas_frame) | ||
| 3762 | .arg(QString::fromStdString(tas_frames_string)); | ||
| 3742 | default: | 3763 | default: |
| 3743 | return tr("TAS State: Invalid"); | 3764 | return tr("TAS State: Invalid"); |
| 3744 | } | 3765 | } |
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 @@ | |||
| 12 | 12 | ||
| 13 | #include "common/announce_multiplayer_room.h" | 13 | #include "common/announce_multiplayer_room.h" |
| 14 | #include "common/common_types.h" | 14 | #include "common/common_types.h" |
| 15 | #include "input_common/drivers/tas_input.h" | ||
| 15 | #include "yuzu/compatibility_list.h" | 16 | #include "yuzu/compatibility_list.h" |
| 16 | #include "yuzu/hotkeys.h" | 17 | #include "yuzu/hotkeys.h" |
| 17 | 18 | ||
| @@ -266,6 +267,9 @@ private: | |||
| 266 | void changeEvent(QEvent* event) override; | 267 | void changeEvent(QEvent* event) override; |
| 267 | void closeEvent(QCloseEvent* event) override; | 268 | void closeEvent(QCloseEvent* event) override; |
| 268 | 269 | ||
| 270 | std::string CreateTASFramesString( | ||
| 271 | std::array<size_t, InputCommon::TasInput::PLAYER_NUMBER> frames) const; | ||
| 272 | |||
| 269 | #ifdef __unix__ | 273 | #ifdef __unix__ |
| 270 | void SetupSigInterrupts(); | 274 | void SetupSigInterrupts(); |
| 271 | static void HandleSigInterrupt(int); | 275 | static void HandleSigInterrupt(int); |