summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/settings.h2
-rw-r--r--src/core/hle/service/nfc/common/device.cpp35
-rw-r--r--src/core/hle/service/nfc/common/device.h2
-rw-r--r--src/input_common/drivers/sdl_driver.cpp35
-rw-r--r--src/video_core/renderer_vulkan/pipeline_helper.h6
-rw-r--r--src/video_core/renderer_vulkan/vk_buffer_cache.cpp10
-rw-r--r--src/video_core/renderer_vulkan/vk_buffer_cache.h9
-rw-r--r--src/video_core/renderer_vulkan/vk_compute_pass.cpp39
-rw-r--r--src/video_core/renderer_vulkan/vk_compute_pass.h14
-rw-r--r--src/video_core/renderer_vulkan/vk_compute_pipeline.cpp12
-rw-r--r--src/video_core/renderer_vulkan/vk_compute_pipeline.h4
-rw-r--r--src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp10
-rw-r--r--src/video_core/renderer_vulkan/vk_graphics_pipeline.h5
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.cpp8
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.h5
-rw-r--r--src/video_core/renderer_vulkan/vk_rasterizer.cpp18
-rw-r--r--src/video_core/renderer_vulkan/vk_rasterizer.h3
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.cpp4
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.h3
-rw-r--r--src/video_core/renderer_vulkan/vk_update_descriptor.h6
-rw-r--r--src/yuzu/configuration/config.cpp2
-rw-r--r--src/yuzu/configuration/configure_input_advanced.cpp2
-rw-r--r--src/yuzu/configuration/configure_input_advanced.ui22
-rw-r--r--src/yuzu_cmd/config.cpp1
24 files changed, 163 insertions, 94 deletions
diff --git a/src/common/settings.h b/src/common/settings.h
index f4eb4e3cd..5f4caaab9 100644
--- a/src/common/settings.h
+++ b/src/common/settings.h
@@ -535,6 +535,8 @@ struct Values {
535 Setting<bool> enable_ir_sensor{false, "enable_ir_sensor"}; 535 Setting<bool> enable_ir_sensor{false, "enable_ir_sensor"};
536 Setting<std::string> ir_sensor_device{"auto", "ir_sensor_device"}; 536 Setting<std::string> ir_sensor_device{"auto", "ir_sensor_device"};
537 537
538 Setting<bool> random_amiibo_id{false, "random_amiibo_id"};
539
538 // Data Storage 540 // Data Storage
539 Setting<bool> use_virtual_sd{true, "use_virtual_sd"}; 541 Setting<bool> use_virtual_sd{true, "use_virtual_sd"};
540 Setting<bool> gamecard_inserted{false, "gamecard_inserted"}; 542 Setting<bool> gamecard_inserted{false, "gamecard_inserted"};
diff --git a/src/core/hle/service/nfc/common/device.cpp b/src/core/hle/service/nfc/common/device.cpp
index e5de65ce0..322bde2ed 100644
--- a/src/core/hle/service/nfc/common/device.cpp
+++ b/src/core/hle/service/nfc/common/device.cpp
@@ -48,9 +48,6 @@ NfcDevice::NfcDevice(Core::HID::NpadIdType npad_id_, Core::System& system_,
48 }; 48 };
49 is_controller_set = true; 49 is_controller_set = true;
50 callback_key = npad_device->SetCallback(engine_callback); 50 callback_key = npad_device->SetCallback(engine_callback);
51
52 auto& standard_steady_clock{system.GetTimeManager().GetStandardSteadyClockCore()};
53 current_posix_time = standard_steady_clock.GetCurrentTimePoint(system).time_point;
54} 51}
55 52
56NfcDevice::~NfcDevice() { 53NfcDevice::~NfcDevice() {
@@ -227,11 +224,21 @@ Result NfcDevice::GetTagInfo(NFP::TagInfo& tag_info, bool is_mifare) const {
227 return ResultWrongDeviceState; 224 return ResultWrongDeviceState;
228 } 225 }
229 226
227 UniqueSerialNumber uuid = encrypted_tag_data.uuid.uid;
228
229 // Generate random UUID to bypass amiibo load limits
230 if (Settings::values.random_amiibo_id) {
231 Common::TinyMT rng{};
232 rng.Initialize(static_cast<u32>(GetCurrentPosixTime()));
233 rng.GenerateRandomBytes(uuid.data(), sizeof(UniqueSerialNumber));
234 uuid[3] = 0x88 ^ uuid[0] ^ uuid[1] ^ uuid[2];
235 }
236
230 if (is_mifare) { 237 if (is_mifare) {
231 tag_info = { 238 tag_info = {
232 .uuid = encrypted_tag_data.uuid.uid, 239 .uuid = uuid,
233 .uuid_extension = {}, 240 .uuid_extension = {},
234 .uuid_length = static_cast<u8>(encrypted_tag_data.uuid.uid.size()), 241 .uuid_length = static_cast<u8>(uuid.size()),
235 .protocol = NfcProtocol::TypeA, 242 .protocol = NfcProtocol::TypeA,
236 .tag_type = TagType::Type4, 243 .tag_type = TagType::Type4,
237 }; 244 };
@@ -240,9 +247,9 @@ Result NfcDevice::GetTagInfo(NFP::TagInfo& tag_info, bool is_mifare) const {
240 247
241 // Protocol and tag type may change here 248 // Protocol and tag type may change here
242 tag_info = { 249 tag_info = {
243 .uuid = encrypted_tag_data.uuid.uid, 250 .uuid = uuid,
244 .uuid_extension = {}, 251 .uuid_extension = {},
245 .uuid_length = static_cast<u8>(encrypted_tag_data.uuid.uid.size()), 252 .uuid_length = static_cast<u8>(uuid.size()),
246 .protocol = NfcProtocol::TypeA, 253 .protocol = NfcProtocol::TypeA,
247 .tag_type = TagType::Type2, 254 .tag_type = TagType::Type2,
248 }; 255 };
@@ -406,7 +413,7 @@ Result NfcDevice::Flush() {
406 413
407 auto& settings = tag_data.settings; 414 auto& settings = tag_data.settings;
408 415
409 const auto& current_date = GetAmiiboDate(current_posix_time); 416 const auto& current_date = GetAmiiboDate(GetCurrentPosixTime());
410 if (settings.write_date.raw_date != current_date.raw_date) { 417 if (settings.write_date.raw_date != current_date.raw_date) {
411 settings.write_date = current_date; 418 settings.write_date = current_date;
412 UpdateSettingsCrc(); 419 UpdateSettingsCrc();
@@ -525,6 +532,7 @@ Result NfcDevice::GetModelInfo(NFP::ModelInfo& model_info) const {
525 } 532 }
526 533
527 const auto& model_info_data = encrypted_tag_data.user_memory.model_info; 534 const auto& model_info_data = encrypted_tag_data.user_memory.model_info;
535
528 model_info = { 536 model_info = {
529 .character_id = model_info_data.character_id, 537 .character_id = model_info_data.character_id,
530 .character_variant = model_info_data.character_variant, 538 .character_variant = model_info_data.character_variant,
@@ -669,6 +677,7 @@ Result NfcDevice::DeleteRegisterInfo() {
669 } 677 }
670 678
671 Common::TinyMT rng{}; 679 Common::TinyMT rng{};
680 rng.Initialize(static_cast<u32>(GetCurrentPosixTime()));
672 rng.GenerateRandomBytes(&tag_data.owner_mii, sizeof(tag_data.owner_mii)); 681 rng.GenerateRandomBytes(&tag_data.owner_mii, sizeof(tag_data.owner_mii));
673 rng.GenerateRandomBytes(&tag_data.settings.amiibo_name, sizeof(tag_data.settings.amiibo_name)); 682 rng.GenerateRandomBytes(&tag_data.settings.amiibo_name, sizeof(tag_data.settings.amiibo_name));
674 rng.GenerateRandomBytes(&tag_data.unknown, sizeof(u8)); 683 rng.GenerateRandomBytes(&tag_data.unknown, sizeof(u8));
@@ -701,7 +710,7 @@ Result NfcDevice::SetRegisterInfoPrivate(const NFP::RegisterInfoPrivate& registe
701 auto& settings = tag_data.settings; 710 auto& settings = tag_data.settings;
702 711
703 if (tag_data.settings.settings.amiibo_initialized == 0) { 712 if (tag_data.settings.settings.amiibo_initialized == 0) {
704 settings.init_date = GetAmiiboDate(current_posix_time); 713 settings.init_date = GetAmiiboDate(GetCurrentPosixTime());
705 settings.write_date.raw_date = 0; 714 settings.write_date.raw_date = 0;
706 } 715 }
707 716
@@ -868,6 +877,7 @@ Result NfcDevice::SetApplicationArea(std::span<const u8> data) {
868 } 877 }
869 878
870 Common::TinyMT rng{}; 879 Common::TinyMT rng{};
880 rng.Initialize(static_cast<u32>(GetCurrentPosixTime()));
871 std::memcpy(tag_data.application_area.data(), data.data(), data.size()); 881 std::memcpy(tag_data.application_area.data(), data.data(), data.size());
872 // Fill remaining data with random numbers 882 // Fill remaining data with random numbers
873 rng.GenerateRandomBytes(tag_data.application_area.data() + data.size(), 883 rng.GenerateRandomBytes(tag_data.application_area.data() + data.size(),
@@ -924,6 +934,7 @@ Result NfcDevice::RecreateApplicationArea(u32 access_id, std::span<const u8> dat
924 } 934 }
925 935
926 Common::TinyMT rng{}; 936 Common::TinyMT rng{};
937 rng.Initialize(static_cast<u32>(GetCurrentPosixTime()));
927 std::memcpy(tag_data.application_area.data(), data.data(), data.size()); 938 std::memcpy(tag_data.application_area.data(), data.data(), data.size());
928 // Fill remaining data with random numbers 939 // Fill remaining data with random numbers
929 rng.GenerateRandomBytes(tag_data.application_area.data() + data.size(), 940 rng.GenerateRandomBytes(tag_data.application_area.data() + data.size(),
@@ -973,6 +984,7 @@ Result NfcDevice::DeleteApplicationArea() {
973 } 984 }
974 985
975 Common::TinyMT rng{}; 986 Common::TinyMT rng{};
987 rng.Initialize(static_cast<u32>(GetCurrentPosixTime()));
976 rng.GenerateRandomBytes(tag_data.application_area.data(), sizeof(NFP::ApplicationArea)); 988 rng.GenerateRandomBytes(tag_data.application_area.data(), sizeof(NFP::ApplicationArea));
977 rng.GenerateRandomBytes(&tag_data.application_id, sizeof(u64)); 989 rng.GenerateRandomBytes(&tag_data.application_id, sizeof(u64));
978 rng.GenerateRandomBytes(&tag_data.application_area_id, sizeof(u32)); 990 rng.GenerateRandomBytes(&tag_data.application_area_id, sizeof(u32));
@@ -1189,6 +1201,11 @@ NFP::AmiiboDate NfcDevice::GetAmiiboDate(s64 posix_time) const {
1189 return amiibo_date; 1201 return amiibo_date;
1190} 1202}
1191 1203
1204u64 NfcDevice::GetCurrentPosixTime() const {
1205 auto& standard_steady_clock{system.GetTimeManager().GetStandardSteadyClockCore()};
1206 return standard_steady_clock.GetCurrentTimePoint(system).time_point;
1207}
1208
1192u64 NfcDevice::RemoveVersionByte(u64 application_id) const { 1209u64 NfcDevice::RemoveVersionByte(u64 application_id) const {
1193 return application_id & ~(0xfULL << NFP::application_id_version_offset); 1210 return application_id & ~(0xfULL << NFP::application_id_version_offset);
1194} 1211}
diff --git a/src/core/hle/service/nfc/common/device.h b/src/core/hle/service/nfc/common/device.h
index 654eda98e..98e1945c1 100644
--- a/src/core/hle/service/nfc/common/device.h
+++ b/src/core/hle/service/nfc/common/device.h
@@ -105,6 +105,7 @@ private:
105 NFP::AmiiboName GetAmiiboName(const NFP::AmiiboSettings& settings) const; 105 NFP::AmiiboName GetAmiiboName(const NFP::AmiiboSettings& settings) const;
106 void SetAmiiboName(NFP::AmiiboSettings& settings, const NFP::AmiiboName& amiibo_name); 106 void SetAmiiboName(NFP::AmiiboSettings& settings, const NFP::AmiiboName& amiibo_name);
107 NFP::AmiiboDate GetAmiiboDate(s64 posix_time) const; 107 NFP::AmiiboDate GetAmiiboDate(s64 posix_time) const;
108 u64 GetCurrentPosixTime() const;
108 u64 RemoveVersionByte(u64 application_id) const; 109 u64 RemoveVersionByte(u64 application_id) const;
109 void UpdateSettingsCrc(); 110 void UpdateSettingsCrc();
110 void UpdateRegisterInfoCrc(); 111 void UpdateRegisterInfoCrc();
@@ -127,7 +128,6 @@ private:
127 bool is_data_moddified{}; 128 bool is_data_moddified{};
128 bool is_app_area_open{}; 129 bool is_app_area_open{};
129 bool is_plain_amiibo{}; 130 bool is_plain_amiibo{};
130 s64 current_posix_time{};
131 NFP::MountTarget mount_target{NFP::MountTarget::None}; 131 NFP::MountTarget mount_target{NFP::MountTarget::None};
132 132
133 NFP::NTAG215File tag_data{}; 133 NFP::NTAG215File tag_data{};
diff --git a/src/input_common/drivers/sdl_driver.cpp b/src/input_common/drivers/sdl_driver.cpp
index 7f9e8dbb9..9a0439bb5 100644
--- a/src/input_common/drivers/sdl_driver.cpp
+++ b/src/input_common/drivers/sdl_driver.cpp
@@ -109,14 +109,37 @@ public:
109 } 109 }
110 110
111 bool RumblePlay(const Common::Input::VibrationStatus vibration) { 111 bool RumblePlay(const Common::Input::VibrationStatus vibration) {
112 constexpr u32 rumble_max_duration_ms = 1000; 112 constexpr u32 rumble_max_duration_ms = 2000;
113 constexpr f32 low_start_sensitivity_limit = 140.0;
114 constexpr f32 low_width_sensitivity_limit = 400.0;
115 constexpr f32 high_start_sensitivity_limit = 200.0;
116 constexpr f32 high_width_sensitivity_limit = 700.0;
117 // Try to provide some feeling of the frequency by reducing the amplitude depending on it.
118 f32 low_frequency_scale = 1.0;
119 if (vibration.low_frequency > low_start_sensitivity_limit) {
120 low_frequency_scale =
121 std::max(1.0f - (vibration.low_frequency - low_start_sensitivity_limit) /
122 low_width_sensitivity_limit,
123 0.3f);
124 }
125 f32 low_amplitude = vibration.low_amplitude * low_frequency_scale;
126
127 f32 high_frequency_scale = 1.0;
128 if (vibration.high_frequency > high_start_sensitivity_limit) {
129 high_frequency_scale =
130 std::max(1.0f - (vibration.high_frequency - high_start_sensitivity_limit) /
131 high_width_sensitivity_limit,
132 0.3f);
133 }
134 f32 high_amplitude = vibration.high_amplitude * high_frequency_scale;
135
113 if (sdl_controller) { 136 if (sdl_controller) {
114 return SDL_GameControllerRumble( 137 return SDL_GameControllerRumble(sdl_controller.get(), static_cast<u16>(low_amplitude),
115 sdl_controller.get(), static_cast<u16>(vibration.low_amplitude), 138 static_cast<u16>(high_amplitude),
116 static_cast<u16>(vibration.high_amplitude), rumble_max_duration_ms) != -1; 139 rumble_max_duration_ms) != -1;
117 } else if (sdl_joystick) { 140 } else if (sdl_joystick) {
118 return SDL_JoystickRumble(sdl_joystick.get(), static_cast<u16>(vibration.low_amplitude), 141 return SDL_JoystickRumble(sdl_joystick.get(), static_cast<u16>(low_amplitude),
119 static_cast<u16>(vibration.high_amplitude), 142 static_cast<u16>(high_amplitude),
120 rumble_max_duration_ms) != -1; 143 rumble_max_duration_ms) != -1;
121 } 144 }
122 145
diff --git a/src/video_core/renderer_vulkan/pipeline_helper.h b/src/video_core/renderer_vulkan/pipeline_helper.h
index 28b893e25..983e1c2e1 100644
--- a/src/video_core/renderer_vulkan/pipeline_helper.h
+++ b/src/video_core/renderer_vulkan/pipeline_helper.h
@@ -176,7 +176,7 @@ public:
176}; 176};
177 177
178inline void PushImageDescriptors(TextureCache& texture_cache, 178inline void PushImageDescriptors(TextureCache& texture_cache,
179 UpdateDescriptorQueue& update_descriptor_queue, 179 GuestDescriptorQueue& guest_descriptor_queue,
180 const Shader::Info& info, RescalingPushConstant& rescaling, 180 const Shader::Info& info, RescalingPushConstant& rescaling,
181 const VkSampler*& samplers, 181 const VkSampler*& samplers,
182 const VideoCommon::ImageViewInOut*& views) { 182 const VideoCommon::ImageViewInOut*& views) {
@@ -190,7 +190,7 @@ inline void PushImageDescriptors(TextureCache& texture_cache,
190 const VkSampler sampler{*(samplers++)}; 190 const VkSampler sampler{*(samplers++)};
191 ImageView& image_view{texture_cache.GetImageView(image_view_id)}; 191 ImageView& image_view{texture_cache.GetImageView(image_view_id)};
192 const VkImageView vk_image_view{image_view.Handle(desc.type)}; 192 const VkImageView vk_image_view{image_view.Handle(desc.type)};
193 update_descriptor_queue.AddSampledImage(vk_image_view, sampler); 193 guest_descriptor_queue.AddSampledImage(vk_image_view, sampler);
194 rescaling.PushTexture(texture_cache.IsRescaling(image_view)); 194 rescaling.PushTexture(texture_cache.IsRescaling(image_view));
195 } 195 }
196 } 196 }
@@ -201,7 +201,7 @@ inline void PushImageDescriptors(TextureCache& texture_cache,
201 texture_cache.MarkModification(image_view.image_id); 201 texture_cache.MarkModification(image_view.image_id);
202 } 202 }
203 const VkImageView vk_image_view{image_view.StorageView(desc.type, desc.format)}; 203 const VkImageView vk_image_view{image_view.StorageView(desc.type, desc.format)};
204 update_descriptor_queue.AddImage(vk_image_view); 204 guest_descriptor_queue.AddImage(vk_image_view);
205 rescaling.PushImage(texture_cache.IsRescaling(image_view)); 205 rescaling.PushImage(texture_cache.IsRescaling(image_view));
206 } 206 }
207 } 207 }
diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp
index 510602e8e..9627eb129 100644
--- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp
@@ -298,12 +298,14 @@ private:
298 298
299BufferCacheRuntime::BufferCacheRuntime(const Device& device_, MemoryAllocator& memory_allocator_, 299BufferCacheRuntime::BufferCacheRuntime(const Device& device_, MemoryAllocator& memory_allocator_,
300 Scheduler& scheduler_, StagingBufferPool& staging_pool_, 300 Scheduler& scheduler_, StagingBufferPool& staging_pool_,
301 UpdateDescriptorQueue& update_descriptor_queue_, 301 GuestDescriptorQueue& guest_descriptor_queue_,
302 ComputePassDescriptorQueue& compute_pass_descriptor_queue,
302 DescriptorPool& descriptor_pool) 303 DescriptorPool& descriptor_pool)
303 : device{device_}, memory_allocator{memory_allocator_}, scheduler{scheduler_}, 304 : device{device_}, memory_allocator{memory_allocator_}, scheduler{scheduler_},
304 staging_pool{staging_pool_}, update_descriptor_queue{update_descriptor_queue_}, 305 staging_pool{staging_pool_}, guest_descriptor_queue{guest_descriptor_queue_},
305 uint8_pass(device, scheduler, descriptor_pool, staging_pool, update_descriptor_queue), 306 uint8_pass(device, scheduler, descriptor_pool, staging_pool, compute_pass_descriptor_queue),
306 quad_index_pass(device, scheduler, descriptor_pool, staging_pool, update_descriptor_queue) { 307 quad_index_pass(device, scheduler, descriptor_pool, staging_pool,
308 compute_pass_descriptor_queue) {
307 quad_array_index_buffer = std::make_shared<QuadArrayIndexBuffer>(device_, memory_allocator_, 309 quad_array_index_buffer = std::make_shared<QuadArrayIndexBuffer>(device_, memory_allocator_,
308 scheduler_, staging_pool_); 310 scheduler_, staging_pool_);
309 quad_strip_index_buffer = std::make_shared<QuadStripIndexBuffer>(device_, memory_allocator_, 311 quad_strip_index_buffer = std::make_shared<QuadStripIndexBuffer>(device_, memory_allocator_,
diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.h b/src/video_core/renderer_vulkan/vk_buffer_cache.h
index 879f1ed94..5e9602905 100644
--- a/src/video_core/renderer_vulkan/vk_buffer_cache.h
+++ b/src/video_core/renderer_vulkan/vk_buffer_cache.h
@@ -63,7 +63,8 @@ class BufferCacheRuntime {
63public: 63public:
64 explicit BufferCacheRuntime(const Device& device_, MemoryAllocator& memory_manager_, 64 explicit BufferCacheRuntime(const Device& device_, MemoryAllocator& memory_manager_,
65 Scheduler& scheduler_, StagingBufferPool& staging_pool_, 65 Scheduler& scheduler_, StagingBufferPool& staging_pool_,
66 UpdateDescriptorQueue& update_descriptor_queue_, 66 GuestDescriptorQueue& guest_descriptor_queue,
67 ComputePassDescriptorQueue& compute_pass_descriptor_queue,
67 DescriptorPool& descriptor_pool); 68 DescriptorPool& descriptor_pool);
68 69
69 void Finish(); 70 void Finish();
@@ -116,12 +117,12 @@ public:
116 117
117 void BindTextureBuffer(Buffer& buffer, u32 offset, u32 size, 118 void BindTextureBuffer(Buffer& buffer, u32 offset, u32 size,
118 VideoCore::Surface::PixelFormat format) { 119 VideoCore::Surface::PixelFormat format) {
119 update_descriptor_queue.AddTexelBuffer(buffer.View(offset, size, format)); 120 guest_descriptor_queue.AddTexelBuffer(buffer.View(offset, size, format));
120 } 121 }
121 122
122private: 123private:
123 void BindBuffer(VkBuffer buffer, u32 offset, u32 size) { 124 void BindBuffer(VkBuffer buffer, u32 offset, u32 size) {
124 update_descriptor_queue.AddBuffer(buffer, offset, size); 125 guest_descriptor_queue.AddBuffer(buffer, offset, size);
125 } 126 }
126 127
127 void ReserveNullBuffer(); 128 void ReserveNullBuffer();
@@ -130,7 +131,7 @@ private:
130 MemoryAllocator& memory_allocator; 131 MemoryAllocator& memory_allocator;
131 Scheduler& scheduler; 132 Scheduler& scheduler;
132 StagingBufferPool& staging_pool; 133 StagingBufferPool& staging_pool;
133 UpdateDescriptorQueue& update_descriptor_queue; 134 GuestDescriptorQueue& guest_descriptor_queue;
134 135
135 std::shared_ptr<QuadArrayIndexBuffer> quad_array_index_buffer; 136 std::shared_ptr<QuadArrayIndexBuffer> quad_array_index_buffer;
136 std::shared_ptr<QuadStripIndexBuffer> quad_strip_index_buffer; 137 std::shared_ptr<QuadStripIndexBuffer> quad_strip_index_buffer;
diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp
index 1a316b6eb..3bc8553e1 100644
--- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp
+++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp
@@ -200,12 +200,12 @@ ComputePass::~ComputePass() = default;
200 200
201Uint8Pass::Uint8Pass(const Device& device_, Scheduler& scheduler_, DescriptorPool& descriptor_pool, 201Uint8Pass::Uint8Pass(const Device& device_, Scheduler& scheduler_, DescriptorPool& descriptor_pool,
202 StagingBufferPool& staging_buffer_pool_, 202 StagingBufferPool& staging_buffer_pool_,
203 UpdateDescriptorQueue& update_descriptor_queue_) 203 ComputePassDescriptorQueue& compute_pass_descriptor_queue_)
204 : ComputePass(device_, descriptor_pool, INPUT_OUTPUT_DESCRIPTOR_SET_BINDINGS, 204 : ComputePass(device_, descriptor_pool, INPUT_OUTPUT_DESCRIPTOR_SET_BINDINGS,
205 INPUT_OUTPUT_DESCRIPTOR_UPDATE_TEMPLATE, INPUT_OUTPUT_BANK_INFO, {}, 205 INPUT_OUTPUT_DESCRIPTOR_UPDATE_TEMPLATE, INPUT_OUTPUT_BANK_INFO, {},
206 VULKAN_UINT8_COMP_SPV), 206 VULKAN_UINT8_COMP_SPV),
207 scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_}, 207 scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_},
208 update_descriptor_queue{update_descriptor_queue_} {} 208 compute_pass_descriptor_queue{compute_pass_descriptor_queue_} {}
209 209
210Uint8Pass::~Uint8Pass() = default; 210Uint8Pass::~Uint8Pass() = default;
211 211
@@ -214,10 +214,10 @@ std::pair<VkBuffer, VkDeviceSize> Uint8Pass::Assemble(u32 num_vertices, VkBuffer
214 const u32 staging_size = static_cast<u32>(num_vertices * sizeof(u16)); 214 const u32 staging_size = static_cast<u32>(num_vertices * sizeof(u16));
215 const auto staging = staging_buffer_pool.Request(staging_size, MemoryUsage::DeviceLocal); 215 const auto staging = staging_buffer_pool.Request(staging_size, MemoryUsage::DeviceLocal);
216 216
217 update_descriptor_queue.Acquire(); 217 compute_pass_descriptor_queue.Acquire();
218 update_descriptor_queue.AddBuffer(src_buffer, src_offset, num_vertices); 218 compute_pass_descriptor_queue.AddBuffer(src_buffer, src_offset, num_vertices);
219 update_descriptor_queue.AddBuffer(staging.buffer, staging.offset, staging_size); 219 compute_pass_descriptor_queue.AddBuffer(staging.buffer, staging.offset, staging_size);
220 const void* const descriptor_data{update_descriptor_queue.UpdateData()}; 220 const void* const descriptor_data{compute_pass_descriptor_queue.UpdateData()};
221 221
222 scheduler.RequestOutsideRenderPassOperationContext(); 222 scheduler.RequestOutsideRenderPassOperationContext();
223 scheduler.Record([this, descriptor_data, num_vertices](vk::CommandBuffer cmdbuf) { 223 scheduler.Record([this, descriptor_data, num_vertices](vk::CommandBuffer cmdbuf) {
@@ -242,12 +242,12 @@ std::pair<VkBuffer, VkDeviceSize> Uint8Pass::Assemble(u32 num_vertices, VkBuffer
242QuadIndexedPass::QuadIndexedPass(const Device& device_, Scheduler& scheduler_, 242QuadIndexedPass::QuadIndexedPass(const Device& device_, Scheduler& scheduler_,
243 DescriptorPool& descriptor_pool_, 243 DescriptorPool& descriptor_pool_,
244 StagingBufferPool& staging_buffer_pool_, 244 StagingBufferPool& staging_buffer_pool_,
245 UpdateDescriptorQueue& update_descriptor_queue_) 245 ComputePassDescriptorQueue& compute_pass_descriptor_queue_)
246 : ComputePass(device_, descriptor_pool_, INPUT_OUTPUT_DESCRIPTOR_SET_BINDINGS, 246 : ComputePass(device_, descriptor_pool_, INPUT_OUTPUT_DESCRIPTOR_SET_BINDINGS,
247 INPUT_OUTPUT_DESCRIPTOR_UPDATE_TEMPLATE, INPUT_OUTPUT_BANK_INFO, 247 INPUT_OUTPUT_DESCRIPTOR_UPDATE_TEMPLATE, INPUT_OUTPUT_BANK_INFO,
248 COMPUTE_PUSH_CONSTANT_RANGE<sizeof(u32) * 3>, VULKAN_QUAD_INDEXED_COMP_SPV), 248 COMPUTE_PUSH_CONSTANT_RANGE<sizeof(u32) * 3>, VULKAN_QUAD_INDEXED_COMP_SPV),
249 scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_}, 249 scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_},
250 update_descriptor_queue{update_descriptor_queue_} {} 250 compute_pass_descriptor_queue{compute_pass_descriptor_queue_} {}
251 251
252QuadIndexedPass::~QuadIndexedPass() = default; 252QuadIndexedPass::~QuadIndexedPass() = default;
253 253
@@ -272,10 +272,10 @@ std::pair<VkBuffer, VkDeviceSize> QuadIndexedPass::Assemble(
272 const std::size_t staging_size = num_tri_vertices * sizeof(u32); 272 const std::size_t staging_size = num_tri_vertices * sizeof(u32);
273 const auto staging = staging_buffer_pool.Request(staging_size, MemoryUsage::DeviceLocal); 273 const auto staging = staging_buffer_pool.Request(staging_size, MemoryUsage::DeviceLocal);
274 274
275 update_descriptor_queue.Acquire(); 275 compute_pass_descriptor_queue.Acquire();
276 update_descriptor_queue.AddBuffer(src_buffer, src_offset, input_size); 276 compute_pass_descriptor_queue.AddBuffer(src_buffer, src_offset, input_size);
277 update_descriptor_queue.AddBuffer(staging.buffer, staging.offset, staging_size); 277 compute_pass_descriptor_queue.AddBuffer(staging.buffer, staging.offset, staging_size);
278 const void* const descriptor_data{update_descriptor_queue.UpdateData()}; 278 const void* const descriptor_data{compute_pass_descriptor_queue.UpdateData()};
279 279
280 scheduler.RequestOutsideRenderPassOperationContext(); 280 scheduler.RequestOutsideRenderPassOperationContext();
281 scheduler.Record([this, descriptor_data, num_tri_vertices, base_vertex, index_shift, 281 scheduler.Record([this, descriptor_data, num_tri_vertices, base_vertex, index_shift,
@@ -304,13 +304,14 @@ std::pair<VkBuffer, VkDeviceSize> QuadIndexedPass::Assemble(
304ASTCDecoderPass::ASTCDecoderPass(const Device& device_, Scheduler& scheduler_, 304ASTCDecoderPass::ASTCDecoderPass(const Device& device_, Scheduler& scheduler_,
305 DescriptorPool& descriptor_pool_, 305 DescriptorPool& descriptor_pool_,
306 StagingBufferPool& staging_buffer_pool_, 306 StagingBufferPool& staging_buffer_pool_,
307 UpdateDescriptorQueue& update_descriptor_queue_, 307 ComputePassDescriptorQueue& compute_pass_descriptor_queue_,
308 MemoryAllocator& memory_allocator_) 308 MemoryAllocator& memory_allocator_)
309 : ComputePass(device_, descriptor_pool_, ASTC_DESCRIPTOR_SET_BINDINGS, 309 : ComputePass(device_, descriptor_pool_, ASTC_DESCRIPTOR_SET_BINDINGS,
310 ASTC_PASS_DESCRIPTOR_UPDATE_TEMPLATE_ENTRY, ASTC_BANK_INFO, 310 ASTC_PASS_DESCRIPTOR_UPDATE_TEMPLATE_ENTRY, ASTC_BANK_INFO,
311 COMPUTE_PUSH_CONSTANT_RANGE<sizeof(AstcPushConstants)>, ASTC_DECODER_COMP_SPV), 311 COMPUTE_PUSH_CONSTANT_RANGE<sizeof(AstcPushConstants)>, ASTC_DECODER_COMP_SPV),
312 scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_}, 312 scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_},
313 update_descriptor_queue{update_descriptor_queue_}, memory_allocator{memory_allocator_} {} 313 compute_pass_descriptor_queue{compute_pass_descriptor_queue_}, memory_allocator{
314 memory_allocator_} {}
314 315
315ASTCDecoderPass::~ASTCDecoderPass() = default; 316ASTCDecoderPass::~ASTCDecoderPass() = default;
316 317
@@ -358,11 +359,11 @@ void ASTCDecoderPass::Assemble(Image& image, const StagingBufferRef& map,
358 const u32 num_dispatches_y = Common::DivCeil(swizzle.num_tiles.height, 8U); 359 const u32 num_dispatches_y = Common::DivCeil(swizzle.num_tiles.height, 8U);
359 const u32 num_dispatches_z = image.info.resources.layers; 360 const u32 num_dispatches_z = image.info.resources.layers;
360 361
361 update_descriptor_queue.Acquire(); 362 compute_pass_descriptor_queue.Acquire();
362 update_descriptor_queue.AddBuffer(map.buffer, input_offset, 363 compute_pass_descriptor_queue.AddBuffer(map.buffer, input_offset,
363 image.guest_size_bytes - swizzle.buffer_offset); 364 image.guest_size_bytes - swizzle.buffer_offset);
364 update_descriptor_queue.AddImage(image.StorageImageView(swizzle.level)); 365 compute_pass_descriptor_queue.AddImage(image.StorageImageView(swizzle.level));
365 const void* const descriptor_data{update_descriptor_queue.UpdateData()}; 366 const void* const descriptor_data{compute_pass_descriptor_queue.UpdateData()};
366 367
367 // To unswizzle the ASTC data 368 // To unswizzle the ASTC data
368 const auto params = MakeBlockLinearSwizzle2DParams(swizzle, image.info); 369 const auto params = MakeBlockLinearSwizzle2DParams(swizzle, image.info);
diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.h b/src/video_core/renderer_vulkan/vk_compute_pass.h
index c4c8fa081..dd3927376 100644
--- a/src/video_core/renderer_vulkan/vk_compute_pass.h
+++ b/src/video_core/renderer_vulkan/vk_compute_pass.h
@@ -9,6 +9,7 @@
9#include "common/common_types.h" 9#include "common/common_types.h"
10#include "video_core/engines/maxwell_3d.h" 10#include "video_core/engines/maxwell_3d.h"
11#include "video_core/renderer_vulkan/vk_descriptor_pool.h" 11#include "video_core/renderer_vulkan/vk_descriptor_pool.h"
12#include "video_core/renderer_vulkan/vk_update_descriptor.h"
12#include "video_core/vulkan_common/vulkan_memory_allocator.h" 13#include "video_core/vulkan_common/vulkan_memory_allocator.h"
13#include "video_core/vulkan_common/vulkan_wrapper.h" 14#include "video_core/vulkan_common/vulkan_wrapper.h"
14 15
@@ -21,7 +22,6 @@ namespace Vulkan {
21class Device; 22class Device;
22class StagingBufferPool; 23class StagingBufferPool;
23class Scheduler; 24class Scheduler;
24class UpdateDescriptorQueue;
25class Image; 25class Image;
26struct StagingBufferRef; 26struct StagingBufferRef;
27 27
@@ -50,7 +50,7 @@ class Uint8Pass final : public ComputePass {
50public: 50public:
51 explicit Uint8Pass(const Device& device_, Scheduler& scheduler_, 51 explicit Uint8Pass(const Device& device_, Scheduler& scheduler_,
52 DescriptorPool& descriptor_pool_, StagingBufferPool& staging_buffer_pool_, 52 DescriptorPool& descriptor_pool_, StagingBufferPool& staging_buffer_pool_,
53 UpdateDescriptorQueue& update_descriptor_queue_); 53 ComputePassDescriptorQueue& compute_pass_descriptor_queue_);
54 ~Uint8Pass(); 54 ~Uint8Pass();
55 55
56 /// Assemble uint8 indices into an uint16 index buffer 56 /// Assemble uint8 indices into an uint16 index buffer
@@ -61,7 +61,7 @@ public:
61private: 61private:
62 Scheduler& scheduler; 62 Scheduler& scheduler;
63 StagingBufferPool& staging_buffer_pool; 63 StagingBufferPool& staging_buffer_pool;
64 UpdateDescriptorQueue& update_descriptor_queue; 64 ComputePassDescriptorQueue& compute_pass_descriptor_queue;
65}; 65};
66 66
67class QuadIndexedPass final : public ComputePass { 67class QuadIndexedPass final : public ComputePass {
@@ -69,7 +69,7 @@ public:
69 explicit QuadIndexedPass(const Device& device_, Scheduler& scheduler_, 69 explicit QuadIndexedPass(const Device& device_, Scheduler& scheduler_,
70 DescriptorPool& descriptor_pool_, 70 DescriptorPool& descriptor_pool_,
71 StagingBufferPool& staging_buffer_pool_, 71 StagingBufferPool& staging_buffer_pool_,
72 UpdateDescriptorQueue& update_descriptor_queue_); 72 ComputePassDescriptorQueue& compute_pass_descriptor_queue_);
73 ~QuadIndexedPass(); 73 ~QuadIndexedPass();
74 74
75 std::pair<VkBuffer, VkDeviceSize> Assemble( 75 std::pair<VkBuffer, VkDeviceSize> Assemble(
@@ -79,7 +79,7 @@ public:
79private: 79private:
80 Scheduler& scheduler; 80 Scheduler& scheduler;
81 StagingBufferPool& staging_buffer_pool; 81 StagingBufferPool& staging_buffer_pool;
82 UpdateDescriptorQueue& update_descriptor_queue; 82 ComputePassDescriptorQueue& compute_pass_descriptor_queue;
83}; 83};
84 84
85class ASTCDecoderPass final : public ComputePass { 85class ASTCDecoderPass final : public ComputePass {
@@ -87,7 +87,7 @@ public:
87 explicit ASTCDecoderPass(const Device& device_, Scheduler& scheduler_, 87 explicit ASTCDecoderPass(const Device& device_, Scheduler& scheduler_,
88 DescriptorPool& descriptor_pool_, 88 DescriptorPool& descriptor_pool_,
89 StagingBufferPool& staging_buffer_pool_, 89 StagingBufferPool& staging_buffer_pool_,
90 UpdateDescriptorQueue& update_descriptor_queue_, 90 ComputePassDescriptorQueue& compute_pass_descriptor_queue_,
91 MemoryAllocator& memory_allocator_); 91 MemoryAllocator& memory_allocator_);
92 ~ASTCDecoderPass(); 92 ~ASTCDecoderPass();
93 93
@@ -97,7 +97,7 @@ public:
97private: 97private:
98 Scheduler& scheduler; 98 Scheduler& scheduler;
99 StagingBufferPool& staging_buffer_pool; 99 StagingBufferPool& staging_buffer_pool;
100 UpdateDescriptorQueue& update_descriptor_queue; 100 ComputePassDescriptorQueue& compute_pass_descriptor_queue;
101 MemoryAllocator& memory_allocator; 101 MemoryAllocator& memory_allocator;
102}; 102};
103 103
diff --git a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp
index 2a0f0dbf0..733e70d9d 100644
--- a/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp
+++ b/src/video_core/renderer_vulkan/vk_compute_pipeline.cpp
@@ -26,13 +26,13 @@ using Tegra::Texture::TexturePair;
26 26
27ComputePipeline::ComputePipeline(const Device& device_, vk::PipelineCache& pipeline_cache_, 27ComputePipeline::ComputePipeline(const Device& device_, vk::PipelineCache& pipeline_cache_,
28 DescriptorPool& descriptor_pool, 28 DescriptorPool& descriptor_pool,
29 UpdateDescriptorQueue& update_descriptor_queue_, 29 GuestDescriptorQueue& guest_descriptor_queue_,
30 Common::ThreadWorker* thread_worker, 30 Common::ThreadWorker* thread_worker,
31 PipelineStatistics* pipeline_statistics, 31 PipelineStatistics* pipeline_statistics,
32 VideoCore::ShaderNotify* shader_notify, const Shader::Info& info_, 32 VideoCore::ShaderNotify* shader_notify, const Shader::Info& info_,
33 vk::ShaderModule spv_module_) 33 vk::ShaderModule spv_module_)
34 : device{device_}, pipeline_cache(pipeline_cache_), 34 : device{device_},
35 update_descriptor_queue{update_descriptor_queue_}, info{info_}, 35 pipeline_cache(pipeline_cache_), guest_descriptor_queue{guest_descriptor_queue_}, info{info_},
36 spv_module(std::move(spv_module_)) { 36 spv_module(std::move(spv_module_)) {
37 if (shader_notify) { 37 if (shader_notify) {
38 shader_notify->MarkShaderBuilding(); 38 shader_notify->MarkShaderBuilding();
@@ -99,7 +99,7 @@ ComputePipeline::ComputePipeline(const Device& device_, vk::PipelineCache& pipel
99void ComputePipeline::Configure(Tegra::Engines::KeplerCompute& kepler_compute, 99void ComputePipeline::Configure(Tegra::Engines::KeplerCompute& kepler_compute,
100 Tegra::MemoryManager& gpu_memory, Scheduler& scheduler, 100 Tegra::MemoryManager& gpu_memory, Scheduler& scheduler,
101 BufferCache& buffer_cache, TextureCache& texture_cache) { 101 BufferCache& buffer_cache, TextureCache& texture_cache) {
102 update_descriptor_queue.Acquire(); 102 guest_descriptor_queue.Acquire();
103 103
104 buffer_cache.SetComputeUniformBufferState(info.constant_buffer_mask, &uniform_buffer_sizes); 104 buffer_cache.SetComputeUniformBufferState(info.constant_buffer_mask, &uniform_buffer_sizes);
105 buffer_cache.UnbindComputeStorageBuffers(); 105 buffer_cache.UnbindComputeStorageBuffers();
@@ -194,7 +194,7 @@ void ComputePipeline::Configure(Tegra::Engines::KeplerCompute& kepler_compute,
194 RescalingPushConstant rescaling; 194 RescalingPushConstant rescaling;
195 const VkSampler* samplers_it{samplers.data()}; 195 const VkSampler* samplers_it{samplers.data()};
196 const VideoCommon::ImageViewInOut* views_it{views.data()}; 196 const VideoCommon::ImageViewInOut* views_it{views.data()};
197 PushImageDescriptors(texture_cache, update_descriptor_queue, info, rescaling, samplers_it, 197 PushImageDescriptors(texture_cache, guest_descriptor_queue, info, rescaling, samplers_it,
198 views_it); 198 views_it);
199 199
200 if (!is_built.load(std::memory_order::relaxed)) { 200 if (!is_built.load(std::memory_order::relaxed)) {
@@ -204,7 +204,7 @@ void ComputePipeline::Configure(Tegra::Engines::KeplerCompute& kepler_compute,
204 build_condvar.wait(lock, [this] { return is_built.load(std::memory_order::relaxed); }); 204 build_condvar.wait(lock, [this] { return is_built.load(std::memory_order::relaxed); });
205 }); 205 });
206 } 206 }
207 const void* const descriptor_data{update_descriptor_queue.UpdateData()}; 207 const void* const descriptor_data{guest_descriptor_queue.UpdateData()};
208 const bool is_rescaling = !info.texture_descriptors.empty() || !info.image_descriptors.empty(); 208 const bool is_rescaling = !info.texture_descriptors.empty() || !info.image_descriptors.empty();
209 scheduler.Record([this, descriptor_data, is_rescaling, 209 scheduler.Record([this, descriptor_data, is_rescaling,
210 rescaling_data = rescaling.Data()](vk::CommandBuffer cmdbuf) { 210 rescaling_data = rescaling.Data()](vk::CommandBuffer cmdbuf) {
diff --git a/src/video_core/renderer_vulkan/vk_compute_pipeline.h b/src/video_core/renderer_vulkan/vk_compute_pipeline.h
index 78d77027f..d1a1e2c46 100644
--- a/src/video_core/renderer_vulkan/vk_compute_pipeline.h
+++ b/src/video_core/renderer_vulkan/vk_compute_pipeline.h
@@ -30,7 +30,7 @@ class ComputePipeline {
30public: 30public:
31 explicit ComputePipeline(const Device& device, vk::PipelineCache& pipeline_cache, 31 explicit ComputePipeline(const Device& device, vk::PipelineCache& pipeline_cache,
32 DescriptorPool& descriptor_pool, 32 DescriptorPool& descriptor_pool,
33 UpdateDescriptorQueue& update_descriptor_queue, 33 GuestDescriptorQueue& guest_descriptor_queue,
34 Common::ThreadWorker* thread_worker, 34 Common::ThreadWorker* thread_worker,
35 PipelineStatistics* pipeline_statistics, 35 PipelineStatistics* pipeline_statistics,
36 VideoCore::ShaderNotify* shader_notify, const Shader::Info& info, 36 VideoCore::ShaderNotify* shader_notify, const Shader::Info& info,
@@ -48,7 +48,7 @@ public:
48private: 48private:
49 const Device& device; 49 const Device& device;
50 vk::PipelineCache& pipeline_cache; 50 vk::PipelineCache& pipeline_cache;
51 UpdateDescriptorQueue& update_descriptor_queue; 51 GuestDescriptorQueue& guest_descriptor_queue;
52 Shader::Info info; 52 Shader::Info info;
53 53
54 VideoCommon::ComputeUniformBufferSizes uniform_buffer_sizes{}; 54 VideoCommon::ComputeUniformBufferSizes uniform_buffer_sizes{};
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
index baedc4424..f1bcd5cd6 100644
--- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
+++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
@@ -236,13 +236,13 @@ GraphicsPipeline::GraphicsPipeline(
236 Scheduler& scheduler_, BufferCache& buffer_cache_, TextureCache& texture_cache_, 236 Scheduler& scheduler_, BufferCache& buffer_cache_, TextureCache& texture_cache_,
237 vk::PipelineCache& pipeline_cache_, VideoCore::ShaderNotify* shader_notify, 237 vk::PipelineCache& pipeline_cache_, VideoCore::ShaderNotify* shader_notify,
238 const Device& device_, DescriptorPool& descriptor_pool, 238 const Device& device_, DescriptorPool& descriptor_pool,
239 UpdateDescriptorQueue& update_descriptor_queue_, Common::ThreadWorker* worker_thread, 239 GuestDescriptorQueue& guest_descriptor_queue_, Common::ThreadWorker* worker_thread,
240 PipelineStatistics* pipeline_statistics, RenderPassCache& render_pass_cache, 240 PipelineStatistics* pipeline_statistics, RenderPassCache& render_pass_cache,
241 const GraphicsPipelineCacheKey& key_, std::array<vk::ShaderModule, NUM_STAGES> stages, 241 const GraphicsPipelineCacheKey& key_, std::array<vk::ShaderModule, NUM_STAGES> stages,
242 const std::array<const Shader::Info*, NUM_STAGES>& infos) 242 const std::array<const Shader::Info*, NUM_STAGES>& infos)
243 : key{key_}, device{device_}, texture_cache{texture_cache_}, buffer_cache{buffer_cache_}, 243 : key{key_}, device{device_}, texture_cache{texture_cache_}, buffer_cache{buffer_cache_},
244 pipeline_cache(pipeline_cache_), scheduler{scheduler_}, 244 pipeline_cache(pipeline_cache_), scheduler{scheduler_},
245 update_descriptor_queue{update_descriptor_queue_}, spv_modules{std::move(stages)} { 245 guest_descriptor_queue{guest_descriptor_queue_}, spv_modules{std::move(stages)} {
246 if (shader_notify) { 246 if (shader_notify) {
247 shader_notify->MarkShaderBuilding(); 247 shader_notify->MarkShaderBuilding();
248 } 248 }
@@ -449,7 +449,7 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) {
449 buffer_cache.UpdateGraphicsBuffers(is_indexed); 449 buffer_cache.UpdateGraphicsBuffers(is_indexed);
450 buffer_cache.BindHostGeometryBuffers(is_indexed); 450 buffer_cache.BindHostGeometryBuffers(is_indexed);
451 451
452 update_descriptor_queue.Acquire(); 452 guest_descriptor_queue.Acquire();
453 453
454 RescalingPushConstant rescaling; 454 RescalingPushConstant rescaling;
455 RenderAreaPushConstant render_area; 455 RenderAreaPushConstant render_area;
@@ -457,7 +457,7 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) {
457 const VideoCommon::ImageViewInOut* views_it{views.data()}; 457 const VideoCommon::ImageViewInOut* views_it{views.data()};
458 const auto prepare_stage{[&](size_t stage) LAMBDA_FORCEINLINE { 458 const auto prepare_stage{[&](size_t stage) LAMBDA_FORCEINLINE {
459 buffer_cache.BindHostStageBuffers(stage); 459 buffer_cache.BindHostStageBuffers(stage);
460 PushImageDescriptors(texture_cache, update_descriptor_queue, stage_infos[stage], rescaling, 460 PushImageDescriptors(texture_cache, guest_descriptor_queue, stage_infos[stage], rescaling,
461 samplers_it, views_it); 461 samplers_it, views_it);
462 const auto& info{stage_infos[0]}; 462 const auto& info{stage_infos[0]};
463 if (info.uses_render_area) { 463 if (info.uses_render_area) {
@@ -499,7 +499,7 @@ void GraphicsPipeline::ConfigureDraw(const RescalingPushConstant& rescaling,
499 const bool is_rescaling{texture_cache.IsRescaling()}; 499 const bool is_rescaling{texture_cache.IsRescaling()};
500 const bool update_rescaling{scheduler.UpdateRescaling(is_rescaling)}; 500 const bool update_rescaling{scheduler.UpdateRescaling(is_rescaling)};
501 const bool bind_pipeline{scheduler.UpdateGraphicsPipeline(this)}; 501 const bool bind_pipeline{scheduler.UpdateGraphicsPipeline(this)};
502 const void* const descriptor_data{update_descriptor_queue.UpdateData()}; 502 const void* const descriptor_data{guest_descriptor_queue.UpdateData()};
503 scheduler.Record([this, descriptor_data, bind_pipeline, rescaling_data = rescaling.Data(), 503 scheduler.Record([this, descriptor_data, bind_pipeline, rescaling_data = rescaling.Data(),
504 is_rescaling, update_rescaling, 504 is_rescaling, update_rescaling,
505 uses_render_area = render_area.uses_render_area, 505 uses_render_area = render_area.uses_render_area,
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h
index 67c657d0e..99e56e9ad 100644
--- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h
+++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h
@@ -64,7 +64,6 @@ class RenderPassCache;
64class RescalingPushConstant; 64class RescalingPushConstant;
65class RenderAreaPushConstant; 65class RenderAreaPushConstant;
66class Scheduler; 66class Scheduler;
67class UpdateDescriptorQueue;
68 67
69class GraphicsPipeline { 68class GraphicsPipeline {
70 static constexpr size_t NUM_STAGES = Tegra::Engines::Maxwell3D::Regs::MaxShaderStage; 69 static constexpr size_t NUM_STAGES = Tegra::Engines::Maxwell3D::Regs::MaxShaderStage;
@@ -74,7 +73,7 @@ public:
74 Scheduler& scheduler, BufferCache& buffer_cache, TextureCache& texture_cache, 73 Scheduler& scheduler, BufferCache& buffer_cache, TextureCache& texture_cache,
75 vk::PipelineCache& pipeline_cache, VideoCore::ShaderNotify* shader_notify, 74 vk::PipelineCache& pipeline_cache, VideoCore::ShaderNotify* shader_notify,
76 const Device& device, DescriptorPool& descriptor_pool, 75 const Device& device, DescriptorPool& descriptor_pool,
77 UpdateDescriptorQueue& update_descriptor_queue, Common::ThreadWorker* worker_thread, 76 GuestDescriptorQueue& guest_descriptor_queue, Common::ThreadWorker* worker_thread,
78 PipelineStatistics* pipeline_statistics, RenderPassCache& render_pass_cache, 77 PipelineStatistics* pipeline_statistics, RenderPassCache& render_pass_cache,
79 const GraphicsPipelineCacheKey& key, std::array<vk::ShaderModule, NUM_STAGES> stages, 78 const GraphicsPipelineCacheKey& key, std::array<vk::ShaderModule, NUM_STAGES> stages,
80 const std::array<const Shader::Info*, NUM_STAGES>& infos); 79 const std::array<const Shader::Info*, NUM_STAGES>& infos);
@@ -133,7 +132,7 @@ private:
133 BufferCache& buffer_cache; 132 BufferCache& buffer_cache;
134 vk::PipelineCache& pipeline_cache; 133 vk::PipelineCache& pipeline_cache;
135 Scheduler& scheduler; 134 Scheduler& scheduler;
136 UpdateDescriptorQueue& update_descriptor_queue; 135 GuestDescriptorQueue& guest_descriptor_queue;
137 136
138 void (*configure_func)(GraphicsPipeline*, bool){}; 137 void (*configure_func)(GraphicsPipeline*, bool){};
139 138
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
index a318d643e..596996bec 100644
--- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
@@ -277,11 +277,11 @@ bool GraphicsPipelineCacheKey::operator==(const GraphicsPipelineCacheKey& rhs) c
277 277
278PipelineCache::PipelineCache(RasterizerVulkan& rasterizer_, const Device& device_, 278PipelineCache::PipelineCache(RasterizerVulkan& rasterizer_, const Device& device_,
279 Scheduler& scheduler_, DescriptorPool& descriptor_pool_, 279 Scheduler& scheduler_, DescriptorPool& descriptor_pool_,
280 UpdateDescriptorQueue& update_descriptor_queue_, 280 GuestDescriptorQueue& guest_descriptor_queue_,
281 RenderPassCache& render_pass_cache_, BufferCache& buffer_cache_, 281 RenderPassCache& render_pass_cache_, BufferCache& buffer_cache_,
282 TextureCache& texture_cache_, VideoCore::ShaderNotify& shader_notify_) 282 TextureCache& texture_cache_, VideoCore::ShaderNotify& shader_notify_)
283 : VideoCommon::ShaderCache{rasterizer_}, device{device_}, scheduler{scheduler_}, 283 : VideoCommon::ShaderCache{rasterizer_}, device{device_}, scheduler{scheduler_},
284 descriptor_pool{descriptor_pool_}, update_descriptor_queue{update_descriptor_queue_}, 284 descriptor_pool{descriptor_pool_}, guest_descriptor_queue{guest_descriptor_queue_},
285 render_pass_cache{render_pass_cache_}, buffer_cache{buffer_cache_}, 285 render_pass_cache{render_pass_cache_}, buffer_cache{buffer_cache_},
286 texture_cache{texture_cache_}, shader_notify{shader_notify_}, 286 texture_cache{texture_cache_}, shader_notify{shader_notify_},
287 use_asynchronous_shaders{Settings::values.use_asynchronous_shaders.GetValue()}, 287 use_asynchronous_shaders{Settings::values.use_asynchronous_shaders.GetValue()},
@@ -643,7 +643,7 @@ std::unique_ptr<GraphicsPipeline> PipelineCache::CreateGraphicsPipeline(
643 Common::ThreadWorker* const thread_worker{build_in_parallel ? &workers : nullptr}; 643 Common::ThreadWorker* const thread_worker{build_in_parallel ? &workers : nullptr};
644 return std::make_unique<GraphicsPipeline>( 644 return std::make_unique<GraphicsPipeline>(
645 scheduler, buffer_cache, texture_cache, vulkan_pipeline_cache, &shader_notify, device, 645 scheduler, buffer_cache, texture_cache, vulkan_pipeline_cache, &shader_notify, device,
646 descriptor_pool, update_descriptor_queue, thread_worker, statistics, render_pass_cache, key, 646 descriptor_pool, guest_descriptor_queue, thread_worker, statistics, render_pass_cache, key,
647 std::move(modules), infos); 647 std::move(modules), infos);
648 648
649} catch (const Shader::Exception& exception) { 649} catch (const Shader::Exception& exception) {
@@ -722,7 +722,7 @@ std::unique_ptr<ComputePipeline> PipelineCache::CreateComputePipeline(
722 } 722 }
723 Common::ThreadWorker* const thread_worker{build_in_parallel ? &workers : nullptr}; 723 Common::ThreadWorker* const thread_worker{build_in_parallel ? &workers : nullptr};
724 return std::make_unique<ComputePipeline>(device, vulkan_pipeline_cache, descriptor_pool, 724 return std::make_unique<ComputePipeline>(device, vulkan_pipeline_cache, descriptor_pool,
725 update_descriptor_queue, thread_worker, statistics, 725 guest_descriptor_queue, thread_worker, statistics,
726 &shader_notify, program.info, std::move(spv_module)); 726 &shader_notify, program.info, std::move(spv_module));
727 727
728} catch (const Shader::Exception& exception) { 728} catch (const Shader::Exception& exception) {
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.h b/src/video_core/renderer_vulkan/vk_pipeline_cache.h
index 5171912d7..15aa7e224 100644
--- a/src/video_core/renderer_vulkan/vk_pipeline_cache.h
+++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.h
@@ -82,7 +82,6 @@ class PipelineStatistics;
82class RasterizerVulkan; 82class RasterizerVulkan;
83class RenderPassCache; 83class RenderPassCache;
84class Scheduler; 84class Scheduler;
85class UpdateDescriptorQueue;
86 85
87using VideoCommon::ShaderInfo; 86using VideoCommon::ShaderInfo;
88 87
@@ -102,7 +101,7 @@ class PipelineCache : public VideoCommon::ShaderCache {
102public: 101public:
103 explicit PipelineCache(RasterizerVulkan& rasterizer, const Device& device, Scheduler& scheduler, 102 explicit PipelineCache(RasterizerVulkan& rasterizer, const Device& device, Scheduler& scheduler,
104 DescriptorPool& descriptor_pool, 103 DescriptorPool& descriptor_pool,
105 UpdateDescriptorQueue& update_descriptor_queue, 104 GuestDescriptorQueue& guest_descriptor_queue,
106 RenderPassCache& render_pass_cache, BufferCache& buffer_cache, 105 RenderPassCache& render_pass_cache, BufferCache& buffer_cache,
107 TextureCache& texture_cache, VideoCore::ShaderNotify& shader_notify_); 106 TextureCache& texture_cache, VideoCore::ShaderNotify& shader_notify_);
108 ~PipelineCache(); 107 ~PipelineCache();
@@ -144,7 +143,7 @@ private:
144 const Device& device; 143 const Device& device;
145 Scheduler& scheduler; 144 Scheduler& scheduler;
146 DescriptorPool& descriptor_pool; 145 DescriptorPool& descriptor_pool;
147 UpdateDescriptorQueue& update_descriptor_queue; 146 GuestDescriptorQueue& guest_descriptor_queue;
148 RenderPassCache& render_pass_cache; 147 RenderPassCache& render_pass_cache;
149 BufferCache& buffer_cache; 148 BufferCache& buffer_cache;
150 TextureCache& texture_cache; 149 TextureCache& texture_cache;
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
index 628e1376f..64bd2f6a5 100644
--- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp
+++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
@@ -160,17 +160,16 @@ RasterizerVulkan::RasterizerVulkan(Core::Frontend::EmuWindow& emu_window_, Tegra
160 : RasterizerAccelerated{cpu_memory_}, gpu{gpu_}, screen_info{screen_info_}, device{device_}, 160 : RasterizerAccelerated{cpu_memory_}, gpu{gpu_}, screen_info{screen_info_}, device{device_},
161 memory_allocator{memory_allocator_}, state_tracker{state_tracker_}, scheduler{scheduler_}, 161 memory_allocator{memory_allocator_}, state_tracker{state_tracker_}, scheduler{scheduler_},
162 staging_pool(device, memory_allocator, scheduler), descriptor_pool(device, scheduler), 162 staging_pool(device, memory_allocator, scheduler), descriptor_pool(device, scheduler),
163 update_descriptor_queue(device, scheduler), 163 guest_descriptor_queue(device, scheduler), compute_pass_descriptor_queue(device, scheduler),
164 blit_image(device, scheduler, state_tracker, descriptor_pool), 164 blit_image(device, scheduler, state_tracker, descriptor_pool), render_pass_cache(device),
165 render_pass_cache(device), texture_cache_runtime{device, scheduler, 165 texture_cache_runtime{
166 memory_allocator, staging_pool, 166 device, scheduler, memory_allocator, staging_pool,
167 blit_image, render_pass_cache, 167 blit_image, render_pass_cache, descriptor_pool, compute_pass_descriptor_queue},
168 descriptor_pool, update_descriptor_queue},
169 texture_cache(texture_cache_runtime, *this), 168 texture_cache(texture_cache_runtime, *this),
170 buffer_cache_runtime(device, memory_allocator, scheduler, staging_pool, 169 buffer_cache_runtime(device, memory_allocator, scheduler, staging_pool,
171 update_descriptor_queue, descriptor_pool), 170 guest_descriptor_queue, compute_pass_descriptor_queue, descriptor_pool),
172 buffer_cache(*this, cpu_memory_, buffer_cache_runtime), 171 buffer_cache(*this, cpu_memory_, buffer_cache_runtime),
173 pipeline_cache(*this, device, scheduler, descriptor_pool, update_descriptor_queue, 172 pipeline_cache(*this, device, scheduler, descriptor_pool, guest_descriptor_queue,
174 render_pass_cache, buffer_cache, texture_cache, gpu.ShaderNotify()), 173 render_pass_cache, buffer_cache, texture_cache, gpu.ShaderNotify()),
175 query_cache{*this, cpu_memory_, device, scheduler}, 174 query_cache{*this, cpu_memory_, device, scheduler},
176 accelerate_dma(buffer_cache, texture_cache, scheduler), 175 accelerate_dma(buffer_cache, texture_cache, scheduler),
@@ -669,7 +668,8 @@ void RasterizerVulkan::FlushCommands() {
669 668
670void RasterizerVulkan::TickFrame() { 669void RasterizerVulkan::TickFrame() {
671 draw_counter = 0; 670 draw_counter = 0;
672 update_descriptor_queue.TickFrame(); 671 guest_descriptor_queue.TickFrame();
672 compute_pass_descriptor_queue.TickFrame();
673 fence_manager.TickFrame(); 673 fence_manager.TickFrame();
674 staging_pool.TickFrame(); 674 staging_pool.TickFrame();
675 { 675 {
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h
index 9bd422850..b39710b3c 100644
--- a/src/video_core/renderer_vulkan/vk_rasterizer.h
+++ b/src/video_core/renderer_vulkan/vk_rasterizer.h
@@ -184,7 +184,8 @@ private:
184 184
185 StagingBufferPool staging_pool; 185 StagingBufferPool staging_pool;
186 DescriptorPool descriptor_pool; 186 DescriptorPool descriptor_pool;
187 UpdateDescriptorQueue update_descriptor_queue; 187 GuestDescriptorQueue guest_descriptor_queue;
188 ComputePassDescriptorQueue compute_pass_descriptor_queue;
188 BlitImageHelper blit_image; 189 BlitImageHelper blit_image;
189 RenderPassCache render_pass_cache; 190 RenderPassCache render_pass_cache;
190 191
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
index 9ca7751c5..012d6fa73 100644
--- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
@@ -798,13 +798,13 @@ TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& sched
798 BlitImageHelper& blit_image_helper_, 798 BlitImageHelper& blit_image_helper_,
799 RenderPassCache& render_pass_cache_, 799 RenderPassCache& render_pass_cache_,
800 DescriptorPool& descriptor_pool, 800 DescriptorPool& descriptor_pool,
801 UpdateDescriptorQueue& update_descriptor_queue) 801 ComputePassDescriptorQueue& compute_pass_descriptor_queue)
802 : device{device_}, scheduler{scheduler_}, memory_allocator{memory_allocator_}, 802 : device{device_}, scheduler{scheduler_}, memory_allocator{memory_allocator_},
803 staging_buffer_pool{staging_buffer_pool_}, blit_image_helper{blit_image_helper_}, 803 staging_buffer_pool{staging_buffer_pool_}, blit_image_helper{blit_image_helper_},
804 render_pass_cache{render_pass_cache_}, resolution{Settings::values.resolution_info} { 804 render_pass_cache{render_pass_cache_}, resolution{Settings::values.resolution_info} {
805 if (Settings::values.accelerate_astc) { 805 if (Settings::values.accelerate_astc) {
806 astc_decoder_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool, 806 astc_decoder_pass.emplace(device, scheduler, descriptor_pool, staging_buffer_pool,
807 update_descriptor_queue, memory_allocator); 807 compute_pass_descriptor_queue, memory_allocator);
808 } 808 }
809} 809}
810 810
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h
index 6f360177a..23473bf9c 100644
--- a/src/video_core/renderer_vulkan/vk_texture_cache.h
+++ b/src/video_core/renderer_vulkan/vk_texture_cache.h
@@ -34,7 +34,6 @@ class ImageView;
34class Framebuffer; 34class Framebuffer;
35class RenderPassCache; 35class RenderPassCache;
36class StagingBufferPool; 36class StagingBufferPool;
37class UpdateDescriptorQueue;
38class Scheduler; 37class Scheduler;
39 38
40class TextureCacheRuntime { 39class TextureCacheRuntime {
@@ -45,7 +44,7 @@ public:
45 BlitImageHelper& blit_image_helper_, 44 BlitImageHelper& blit_image_helper_,
46 RenderPassCache& render_pass_cache_, 45 RenderPassCache& render_pass_cache_,
47 DescriptorPool& descriptor_pool, 46 DescriptorPool& descriptor_pool,
48 UpdateDescriptorQueue& update_descriptor_queue); 47 ComputePassDescriptorQueue& compute_pass_descriptor_queue);
49 48
50 void Finish(); 49 void Finish();
51 50
diff --git a/src/video_core/renderer_vulkan/vk_update_descriptor.h b/src/video_core/renderer_vulkan/vk_update_descriptor.h
index 1c1a7020b..310fb551a 100644
--- a/src/video_core/renderer_vulkan/vk_update_descriptor.h
+++ b/src/video_core/renderer_vulkan/vk_update_descriptor.h
@@ -32,7 +32,7 @@ class UpdateDescriptorQueue final {
32 // This should be plenty for the vast majority of cases. Most desktop platforms only 32 // This should be plenty for the vast majority of cases. Most desktop platforms only
33 // provide up to 3 swapchain images. 33 // provide up to 3 swapchain images.
34 static constexpr size_t FRAMES_IN_FLIGHT = 5; 34 static constexpr size_t FRAMES_IN_FLIGHT = 5;
35 static constexpr size_t FRAME_PAYLOAD_SIZE = 0x10000; 35 static constexpr size_t FRAME_PAYLOAD_SIZE = 0x20000;
36 static constexpr size_t PAYLOAD_SIZE = FRAME_PAYLOAD_SIZE * FRAMES_IN_FLIGHT; 36 static constexpr size_t PAYLOAD_SIZE = FRAME_PAYLOAD_SIZE * FRAMES_IN_FLIGHT;
37 37
38public: 38public:
@@ -86,4 +86,8 @@ private:
86 std::array<DescriptorUpdateEntry, PAYLOAD_SIZE> payload; 86 std::array<DescriptorUpdateEntry, PAYLOAD_SIZE> payload;
87}; 87};
88 88
89// TODO: should these be separate classes instead?
90using GuestDescriptorQueue = UpdateDescriptorQueue;
91using ComputePassDescriptorQueue = UpdateDescriptorQueue;
92
89} // namespace Vulkan 93} // namespace Vulkan
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp
index a49d12266..b94d36838 100644
--- a/src/yuzu/configuration/config.cpp
+++ b/src/yuzu/configuration/config.cpp
@@ -443,6 +443,7 @@ void Config::ReadControlValues() {
443 ReadBasicSetting(Settings::values.mouse_panning_sensitivity); 443 ReadBasicSetting(Settings::values.mouse_panning_sensitivity);
444 ReadBasicSetting(Settings::values.enable_joycon_driver); 444 ReadBasicSetting(Settings::values.enable_joycon_driver);
445 ReadBasicSetting(Settings::values.enable_procon_driver); 445 ReadBasicSetting(Settings::values.enable_procon_driver);
446 ReadBasicSetting(Settings::values.random_amiibo_id);
446 447
447 ReadBasicSetting(Settings::values.tas_enable); 448 ReadBasicSetting(Settings::values.tas_enable);
448 ReadBasicSetting(Settings::values.tas_loop); 449 ReadBasicSetting(Settings::values.tas_loop);
@@ -1150,6 +1151,7 @@ void Config::SaveControlValues() {
1150 WriteBasicSetting(Settings::values.enable_raw_input); 1151 WriteBasicSetting(Settings::values.enable_raw_input);
1151 WriteBasicSetting(Settings::values.enable_joycon_driver); 1152 WriteBasicSetting(Settings::values.enable_joycon_driver);
1152 WriteBasicSetting(Settings::values.enable_procon_driver); 1153 WriteBasicSetting(Settings::values.enable_procon_driver);
1154 WriteBasicSetting(Settings::values.random_amiibo_id);
1153 WriteBasicSetting(Settings::values.keyboard_enabled); 1155 WriteBasicSetting(Settings::values.keyboard_enabled);
1154 WriteBasicSetting(Settings::values.emulate_analog_keyboard); 1156 WriteBasicSetting(Settings::values.emulate_analog_keyboard);
1155 WriteBasicSetting(Settings::values.mouse_panning_sensitivity); 1157 WriteBasicSetting(Settings::values.mouse_panning_sensitivity);
diff --git a/src/yuzu/configuration/configure_input_advanced.cpp b/src/yuzu/configuration/configure_input_advanced.cpp
index 8d81322f3..f13156434 100644
--- a/src/yuzu/configuration/configure_input_advanced.cpp
+++ b/src/yuzu/configuration/configure_input_advanced.cpp
@@ -140,6 +140,7 @@ void ConfigureInputAdvanced::ApplyConfiguration() {
140 Settings::values.enable_ir_sensor = ui->enable_ir_sensor->isChecked(); 140 Settings::values.enable_ir_sensor = ui->enable_ir_sensor->isChecked();
141 Settings::values.enable_joycon_driver = ui->enable_joycon_driver->isChecked(); 141 Settings::values.enable_joycon_driver = ui->enable_joycon_driver->isChecked();
142 Settings::values.enable_procon_driver = ui->enable_procon_driver->isChecked(); 142 Settings::values.enable_procon_driver = ui->enable_procon_driver->isChecked();
143 Settings::values.random_amiibo_id = ui->random_amiibo_id->isChecked();
143} 144}
144 145
145void ConfigureInputAdvanced::LoadConfiguration() { 146void ConfigureInputAdvanced::LoadConfiguration() {
@@ -176,6 +177,7 @@ void ConfigureInputAdvanced::LoadConfiguration() {
176 ui->enable_ir_sensor->setChecked(Settings::values.enable_ir_sensor.GetValue()); 177 ui->enable_ir_sensor->setChecked(Settings::values.enable_ir_sensor.GetValue());
177 ui->enable_joycon_driver->setChecked(Settings::values.enable_joycon_driver.GetValue()); 178 ui->enable_joycon_driver->setChecked(Settings::values.enable_joycon_driver.GetValue());
178 ui->enable_procon_driver->setChecked(Settings::values.enable_procon_driver.GetValue()); 179 ui->enable_procon_driver->setChecked(Settings::values.enable_procon_driver.GetValue());
180 ui->random_amiibo_id->setChecked(Settings::values.random_amiibo_id.GetValue());
179 181
180 UpdateUIEnabled(); 182 UpdateUIEnabled();
181} 183}
diff --git a/src/yuzu/configuration/configure_input_advanced.ui b/src/yuzu/configuration/configure_input_advanced.ui
index 0eb2b34bc..2e8b13660 100644
--- a/src/yuzu/configuration/configure_input_advanced.ui
+++ b/src/yuzu/configuration/configure_input_advanced.ui
@@ -2728,6 +2728,22 @@
2728 </widget> 2728 </widget>
2729 </item> 2729 </item>
2730 <item row="7" column="0"> 2730 <item row="7" column="0">
2731 <widget class="QCheckBox" name="random_amiibo_id">
2732 <property name="toolTip">
2733 <string>Allows unlimited uses of the same Amiibo in games that would otherwise limit you to one use.</string>
2734 </property>
2735 <property name="minimumSize">
2736 <size>
2737 <width>0</width>
2738 <height>23</height>
2739 </size>
2740 </property>
2741 <property name="text">
2742 <string>Use random Amiibo ID</string>
2743 </property>
2744 </widget>
2745 </item>
2746 <item row="8" column="0">
2731 <widget class="QCheckBox" name="mouse_panning"> 2747 <widget class="QCheckBox" name="mouse_panning">
2732 <property name="minimumSize"> 2748 <property name="minimumSize">
2733 <size> 2749 <size>
@@ -2740,7 +2756,7 @@
2740 </property> 2756 </property>
2741 </widget> 2757 </widget>
2742 </item> 2758 </item>
2743 <item row="7" column="2"> 2759 <item row="8" column="2">
2744 <widget class="QSpinBox" name="mouse_panning_sensitivity"> 2760 <widget class="QSpinBox" name="mouse_panning_sensitivity">
2745 <property name="toolTip"> 2761 <property name="toolTip">
2746 <string>Mouse sensitivity</string> 2762 <string>Mouse sensitivity</string>
@@ -2762,14 +2778,14 @@
2762 </property> 2778 </property>
2763 </widget> 2779 </widget>
2764 </item> 2780 </item>
2765 <item row="8" column="0"> 2781 <item row="9" column="0">
2766 <widget class="QLabel" name="motion_touch"> 2782 <widget class="QLabel" name="motion_touch">
2767 <property name="text"> 2783 <property name="text">
2768 <string>Motion / Touch</string> 2784 <string>Motion / Touch</string>
2769 </property> 2785 </property>
2770 </widget> 2786 </widget>
2771 </item> 2787 </item>
2772 <item row="8" column="2"> 2788 <item row="9" column="2">
2773 <widget class="QPushButton" name="buttonMotionTouch"> 2789 <widget class="QPushButton" name="buttonMotionTouch">
2774 <property name="text"> 2790 <property name="text">
2775 <string>Configure</string> 2791 <string>Configure</string>
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp
index abe7092fc..dc9a3d68f 100644
--- a/src/yuzu_cmd/config.cpp
+++ b/src/yuzu_cmd/config.cpp
@@ -169,6 +169,7 @@ void Config::ReadValues() {
169 ReadSetting("ControlsGeneral", Settings::values.enable_raw_input); 169 ReadSetting("ControlsGeneral", Settings::values.enable_raw_input);
170 ReadSetting("ControlsGeneral", Settings::values.enable_joycon_driver); 170 ReadSetting("ControlsGeneral", Settings::values.enable_joycon_driver);
171 ReadSetting("ControlsGeneral", Settings::values.enable_procon_driver); 171 ReadSetting("ControlsGeneral", Settings::values.enable_procon_driver);
172 ReadSetting("ControlsGeneral", Settings::values.random_amiibo_id);
172 ReadSetting("ControlsGeneral", Settings::values.emulate_analog_keyboard); 173 ReadSetting("ControlsGeneral", Settings::values.emulate_analog_keyboard);
173 ReadSetting("ControlsGeneral", Settings::values.vibration_enabled); 174 ReadSetting("ControlsGeneral", Settings::values.vibration_enabled);
174 ReadSetting("ControlsGeneral", Settings::values.enable_accurate_vibrations); 175 ReadSetting("ControlsGeneral", Settings::values.enable_accurate_vibrations);