diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/input_common/helpers/joycon_protocol/common_protocol.cpp | 7 | ||||
| -rw-r--r-- | src/input_common/helpers/joycon_protocol/common_protocol.h | 2 | ||||
| -rw-r--r-- | src/input_common/helpers/joycon_protocol/joycon_types.h | 7 | ||||
| -rw-r--r-- | src/input_common/helpers/joycon_protocol/nfc.cpp | 24 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/texture_cache/util.cpp | 10 | ||||
| -rw-r--r-- | src/yuzu/qt_common.cpp | 2 |
8 files changed, 29 insertions, 27 deletions
diff --git a/src/input_common/helpers/joycon_protocol/common_protocol.cpp b/src/input_common/helpers/joycon_protocol/common_protocol.cpp index 2b42a4555..077d72cd0 100644 --- a/src/input_common/helpers/joycon_protocol/common_protocol.cpp +++ b/src/input_common/helpers/joycon_protocol/common_protocol.cpp | |||
| @@ -236,13 +236,13 @@ DriverResult JoyconCommonProtocol::GetMCUDataResponse(ReportMode report_mode, | |||
| 236 | return DriverResult::Success; | 236 | return DriverResult::Success; |
| 237 | } | 237 | } |
| 238 | 238 | ||
| 239 | DriverResult JoyconCommonProtocol::SendMCUData(ReportMode report_mode, SubCommand sc, | 239 | DriverResult JoyconCommonProtocol::SendMCUData(ReportMode report_mode, MCUSubCommand sc, |
| 240 | std::span<const u8> buffer, | 240 | std::span<const u8> buffer, |
| 241 | MCUCommandResponse& output) { | 241 | MCUCommandResponse& output) { |
| 242 | SubCommandPacket packet{ | 242 | SubCommandPacket packet{ |
| 243 | .output_report = OutputReport::MCU_DATA, | 243 | .output_report = OutputReport::MCU_DATA, |
| 244 | .packet_counter = GetCounter(), | 244 | .packet_counter = GetCounter(), |
| 245 | .sub_command = sc, | 245 | .mcu_sub_command = sc, |
| 246 | .command_data = {}, | 246 | .command_data = {}, |
| 247 | }; | 247 | }; |
| 248 | 248 | ||
| @@ -269,8 +269,7 @@ DriverResult JoyconCommonProtocol::WaitSetMCUMode(ReportMode report_mode, MCUMod | |||
| 269 | std::size_t tries{}; | 269 | std::size_t tries{}; |
| 270 | 270 | ||
| 271 | do { | 271 | do { |
| 272 | const std::vector<u8> mcu_data{static_cast<u8>(MCUMode::Standby)}; | 272 | const auto result = SendMCUData(report_mode, MCUSubCommand::SetDeviceMode, {}, output); |
| 273 | const auto result = SendMCUData(report_mode, SubCommand::STATE, mcu_data, output); | ||
| 274 | 273 | ||
| 275 | if (result != DriverResult::Success) { | 274 | if (result != DriverResult::Success) { |
| 276 | return result; | 275 | return result; |
diff --git a/src/input_common/helpers/joycon_protocol/common_protocol.h b/src/input_common/helpers/joycon_protocol/common_protocol.h index 62cae739a..411ec018a 100644 --- a/src/input_common/helpers/joycon_protocol/common_protocol.h +++ b/src/input_common/helpers/joycon_protocol/common_protocol.h | |||
| @@ -156,7 +156,7 @@ public: | |||
| 156 | * @param buffer data to be send | 156 | * @param buffer data to be send |
| 157 | * @returns output buffer containing the response | 157 | * @returns output buffer containing the response |
| 158 | */ | 158 | */ |
| 159 | DriverResult SendMCUData(ReportMode report_mode, SubCommand sc, std::span<const u8> buffer, | 159 | DriverResult SendMCUData(ReportMode report_mode, MCUSubCommand sc, std::span<const u8> buffer, |
| 160 | MCUCommandResponse& output); | 160 | MCUCommandResponse& output); |
| 161 | 161 | ||
| 162 | /** | 162 | /** |
diff --git a/src/input_common/helpers/joycon_protocol/joycon_types.h b/src/input_common/helpers/joycon_protocol/joycon_types.h index dcac0e422..b03143e04 100644 --- a/src/input_common/helpers/joycon_protocol/joycon_types.h +++ b/src/input_common/helpers/joycon_protocol/joycon_types.h | |||
| @@ -575,7 +575,6 @@ struct NFCPollingCommandData { | |||
| 575 | static_assert(sizeof(NFCPollingCommandData) == 0x05, "NFCPollingCommandData is an invalid size"); | 575 | static_assert(sizeof(NFCPollingCommandData) == 0x05, "NFCPollingCommandData is an invalid size"); |
| 576 | 576 | ||
| 577 | struct NFCRequestState { | 577 | struct NFCRequestState { |
| 578 | MCUSubCommand sub_command; | ||
| 579 | NFCReadCommand command_argument; | 578 | NFCReadCommand command_argument; |
| 580 | u8 packet_id; | 579 | u8 packet_id; |
| 581 | INSERT_PADDING_BYTES(0x1); | 580 | INSERT_PADDING_BYTES(0x1); |
| @@ -587,6 +586,7 @@ struct NFCRequestState { | |||
| 587 | NFCPollingCommandData nfc_polling; | 586 | NFCPollingCommandData nfc_polling; |
| 588 | }; | 587 | }; |
| 589 | u8 crc; | 588 | u8 crc; |
| 589 | INSERT_PADDING_BYTES(0x1); | ||
| 590 | }; | 590 | }; |
| 591 | static_assert(sizeof(NFCRequestState) == 0x26, "NFCRequestState is an invalid size"); | 591 | static_assert(sizeof(NFCRequestState) == 0x26, "NFCRequestState is an invalid size"); |
| 592 | 592 | ||
| @@ -659,7 +659,10 @@ struct SubCommandPacket { | |||
| 659 | OutputReport output_report; | 659 | OutputReport output_report; |
| 660 | u8 packet_counter; | 660 | u8 packet_counter; |
| 661 | INSERT_PADDING_BYTES(0x8); // This contains vibration data | 661 | INSERT_PADDING_BYTES(0x8); // This contains vibration data |
| 662 | SubCommand sub_command; | 662 | union { |
| 663 | SubCommand sub_command; | ||
| 664 | MCUSubCommand mcu_sub_command; | ||
| 665 | }; | ||
| 663 | std::array<u8, 0x26> command_data; | 666 | std::array<u8, 0x26> command_data; |
| 664 | }; | 667 | }; |
| 665 | static_assert(sizeof(SubCommandPacket) == 0x31, "SubCommandPacket is an invalid size"); | 668 | static_assert(sizeof(SubCommandPacket) == 0x31, "SubCommandPacket is an invalid size"); |
diff --git a/src/input_common/helpers/joycon_protocol/nfc.cpp b/src/input_common/helpers/joycon_protocol/nfc.cpp index eeba82986..77ea6d5cf 100644 --- a/src/input_common/helpers/joycon_protocol/nfc.cpp +++ b/src/input_common/helpers/joycon_protocol/nfc.cpp | |||
| @@ -278,7 +278,6 @@ DriverResult NfcProtocol::GetAmiiboData(std::vector<u8>& ntag_data) { | |||
| 278 | 278 | ||
| 279 | DriverResult NfcProtocol::SendStartPollingRequest(MCUCommandResponse& output) { | 279 | DriverResult NfcProtocol::SendStartPollingRequest(MCUCommandResponse& output) { |
| 280 | NFCRequestState request{ | 280 | NFCRequestState request{ |
| 281 | .sub_command = MCUSubCommand::ReadDeviceMode, | ||
| 282 | .command_argument = NFCReadCommand::StartPolling, | 281 | .command_argument = NFCReadCommand::StartPolling, |
| 283 | .packet_id = 0x0, | 282 | .packet_id = 0x0, |
| 284 | .packet_flag = MCUPacketFlag::LastCommandPacket, | 283 | .packet_flag = MCUPacketFlag::LastCommandPacket, |
| @@ -296,13 +295,13 @@ DriverResult NfcProtocol::SendStartPollingRequest(MCUCommandResponse& output) { | |||
| 296 | 295 | ||
| 297 | std::array<u8, sizeof(NFCRequestState)> request_data{}; | 296 | std::array<u8, sizeof(NFCRequestState)> request_data{}; |
| 298 | memcpy(request_data.data(), &request, sizeof(NFCRequestState)); | 297 | memcpy(request_data.data(), &request, sizeof(NFCRequestState)); |
| 299 | request_data[37] = CalculateMCU_CRC8(request_data.data() + 1, 36); | 298 | request_data[36] = CalculateMCU_CRC8(request_data.data(), 36); |
| 300 | return SendMCUData(ReportMode::NFC_IR_MODE_60HZ, SubCommand::STATE, request_data, output); | 299 | return SendMCUData(ReportMode::NFC_IR_MODE_60HZ, MCUSubCommand::ReadDeviceMode, request_data, |
| 300 | output); | ||
| 301 | } | 301 | } |
| 302 | 302 | ||
| 303 | DriverResult NfcProtocol::SendStopPollingRequest(MCUCommandResponse& output) { | 303 | DriverResult NfcProtocol::SendStopPollingRequest(MCUCommandResponse& output) { |
| 304 | NFCRequestState request{ | 304 | NFCRequestState request{ |
| 305 | .sub_command = MCUSubCommand::ReadDeviceMode, | ||
| 306 | .command_argument = NFCReadCommand::StopPolling, | 305 | .command_argument = NFCReadCommand::StopPolling, |
| 307 | .packet_id = 0x0, | 306 | .packet_id = 0x0, |
| 308 | .packet_flag = MCUPacketFlag::LastCommandPacket, | 307 | .packet_flag = MCUPacketFlag::LastCommandPacket, |
| @@ -313,13 +312,13 @@ DriverResult NfcProtocol::SendStopPollingRequest(MCUCommandResponse& output) { | |||
| 313 | 312 | ||
| 314 | std::array<u8, sizeof(NFCRequestState)> request_data{}; | 313 | std::array<u8, sizeof(NFCRequestState)> request_data{}; |
| 315 | memcpy(request_data.data(), &request, sizeof(NFCRequestState)); | 314 | memcpy(request_data.data(), &request, sizeof(NFCRequestState)); |
| 316 | request_data[37] = CalculateMCU_CRC8(request_data.data() + 1, 36); | 315 | request_data[36] = CalculateMCU_CRC8(request_data.data(), 36); |
| 317 | return SendMCUData(ReportMode::NFC_IR_MODE_60HZ, SubCommand::STATE, request_data, output); | 316 | return SendMCUData(ReportMode::NFC_IR_MODE_60HZ, MCUSubCommand::ReadDeviceMode, request_data, |
| 317 | output); | ||
| 318 | } | 318 | } |
| 319 | 319 | ||
| 320 | DriverResult NfcProtocol::SendStartWaitingRecieveRequest(MCUCommandResponse& output) { | 320 | DriverResult NfcProtocol::SendStartWaitingRecieveRequest(MCUCommandResponse& output) { |
| 321 | NFCRequestState request{ | 321 | NFCRequestState request{ |
| 322 | .sub_command = MCUSubCommand::ReadDeviceMode, | ||
| 323 | .command_argument = NFCReadCommand::StartWaitingRecieve, | 322 | .command_argument = NFCReadCommand::StartWaitingRecieve, |
| 324 | .packet_id = 0x0, | 323 | .packet_id = 0x0, |
| 325 | .packet_flag = MCUPacketFlag::LastCommandPacket, | 324 | .packet_flag = MCUPacketFlag::LastCommandPacket, |
| @@ -330,13 +329,13 @@ DriverResult NfcProtocol::SendStartWaitingRecieveRequest(MCUCommandResponse& out | |||
| 330 | 329 | ||
| 331 | std::vector<u8> request_data(sizeof(NFCRequestState)); | 330 | std::vector<u8> request_data(sizeof(NFCRequestState)); |
| 332 | memcpy(request_data.data(), &request, sizeof(NFCRequestState)); | 331 | memcpy(request_data.data(), &request, sizeof(NFCRequestState)); |
| 333 | request_data[37] = CalculateMCU_CRC8(request_data.data() + 1, 36); | 332 | request_data[36] = CalculateMCU_CRC8(request_data.data(), 36); |
| 334 | return SendMCUData(ReportMode::NFC_IR_MODE_60HZ, SubCommand::STATE, request_data, output); | 333 | return SendMCUData(ReportMode::NFC_IR_MODE_60HZ, MCUSubCommand::ReadDeviceMode, request_data, |
| 334 | output); | ||
| 335 | } | 335 | } |
| 336 | 336 | ||
| 337 | DriverResult NfcProtocol::SendReadAmiiboRequest(MCUCommandResponse& output, NFCPages ntag_pages) { | 337 | DriverResult NfcProtocol::SendReadAmiiboRequest(MCUCommandResponse& output, NFCPages ntag_pages) { |
| 338 | NFCRequestState request{ | 338 | NFCRequestState request{ |
| 339 | .sub_command = MCUSubCommand::ReadDeviceMode, | ||
| 340 | .command_argument = NFCReadCommand::Ntag, | 339 | .command_argument = NFCReadCommand::Ntag, |
| 341 | .packet_id = 0x0, | 340 | .packet_id = 0x0, |
| 342 | .packet_flag = MCUPacketFlag::LastCommandPacket, | 341 | .packet_flag = MCUPacketFlag::LastCommandPacket, |
| @@ -355,8 +354,9 @@ DriverResult NfcProtocol::SendReadAmiiboRequest(MCUCommandResponse& output, NFCP | |||
| 355 | 354 | ||
| 356 | std::array<u8, sizeof(NFCRequestState)> request_data{}; | 355 | std::array<u8, sizeof(NFCRequestState)> request_data{}; |
| 357 | memcpy(request_data.data(), &request, sizeof(NFCRequestState)); | 356 | memcpy(request_data.data(), &request, sizeof(NFCRequestState)); |
| 358 | request_data[37] = CalculateMCU_CRC8(request_data.data() + 1, 36); | 357 | request_data[36] = CalculateMCU_CRC8(request_data.data(), 36); |
| 359 | return SendMCUData(ReportMode::NFC_IR_MODE_60HZ, SubCommand::STATE, request_data, output); | 358 | return SendMCUData(ReportMode::NFC_IR_MODE_60HZ, MCUSubCommand::ReadDeviceMode, request_data, |
| 359 | output); | ||
| 360 | } | 360 | } |
| 361 | 361 | ||
| 362 | NFCReadBlockCommand NfcProtocol::GetReadBlockCommand(NFCPages pages) const { | 362 | NFCReadBlockCommand NfcProtocol::GetReadBlockCommand(NFCPages pages) const { |
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index 052456f61..31118886f 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp | |||
| @@ -231,7 +231,7 @@ void ApplySwizzle(GLuint handle, PixelFormat format, std::array<SwizzleSource, 4 | |||
| 231 | 231 | ||
| 232 | [[nodiscard]] bool CanBeAccelerated(const TextureCacheRuntime& runtime, | 232 | [[nodiscard]] bool CanBeAccelerated(const TextureCacheRuntime& runtime, |
| 233 | const VideoCommon::ImageInfo& info) { | 233 | const VideoCommon::ImageInfo& info) { |
| 234 | if (IsPixelFormatASTC(info.format) && !runtime.HasNativeASTC()) { | 234 | if (IsPixelFormatASTC(info.format) && info.size.depth == 1 && !runtime.HasNativeASTC()) { |
| 235 | return Settings::values.accelerate_astc.GetValue() && | 235 | return Settings::values.accelerate_astc.GetValue() && |
| 236 | !Settings::values.async_astc.GetValue(); | 236 | !Settings::values.async_astc.GetValue(); |
| 237 | } | 237 | } |
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 99dd1260a..9ca7751c5 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp | |||
| @@ -1268,7 +1268,7 @@ Image::Image(TextureCacheRuntime& runtime_, const ImageInfo& info_, GPUVAddr gpu | |||
| 1268 | if (IsPixelFormatASTC(info.format) && !runtime->device.IsOptimalAstcSupported()) { | 1268 | if (IsPixelFormatASTC(info.format) && !runtime->device.IsOptimalAstcSupported()) { |
| 1269 | if (Settings::values.async_astc.GetValue()) { | 1269 | if (Settings::values.async_astc.GetValue()) { |
| 1270 | flags |= VideoCommon::ImageFlagBits::AsynchronousDecode; | 1270 | flags |= VideoCommon::ImageFlagBits::AsynchronousDecode; |
| 1271 | } else if (Settings::values.accelerate_astc.GetValue()) { | 1271 | } else if (Settings::values.accelerate_astc.GetValue() && info.size.depth == 1) { |
| 1272 | flags |= VideoCommon::ImageFlagBits::AcceleratedUpload; | 1272 | flags |= VideoCommon::ImageFlagBits::AcceleratedUpload; |
| 1273 | } | 1273 | } |
| 1274 | flags |= VideoCommon::ImageFlagBits::Converted; | 1274 | flags |= VideoCommon::ImageFlagBits::Converted; |
diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp index de37db684..f1071aa23 100644 --- a/src/video_core/texture_cache/util.cpp +++ b/src/video_core/texture_cache/util.cpp | |||
| @@ -896,11 +896,11 @@ void ConvertImage(std::span<const u8> input, const ImageInfo& info, std::span<u8 | |||
| 896 | ASSERT(copy.buffer_row_length == Common::AlignUp(mip_size.width, tile_size.width)); | 896 | ASSERT(copy.buffer_row_length == Common::AlignUp(mip_size.width, tile_size.width)); |
| 897 | ASSERT(copy.buffer_image_height == Common::AlignUp(mip_size.height, tile_size.height)); | 897 | ASSERT(copy.buffer_image_height == Common::AlignUp(mip_size.height, tile_size.height)); |
| 898 | if (IsPixelFormatASTC(info.format)) { | 898 | if (IsPixelFormatASTC(info.format)) { |
| 899 | ASSERT(copy.image_extent.depth == 1); | 899 | Tegra::Texture::ASTC::Decompress( |
| 900 | Tegra::Texture::ASTC::Decompress(input.subspan(copy.buffer_offset), | 900 | input.subspan(copy.buffer_offset), copy.image_extent.width, |
| 901 | copy.image_extent.width, copy.image_extent.height, | 901 | copy.image_extent.height, |
| 902 | copy.image_subresource.num_layers, tile_size.width, | 902 | copy.image_subresource.num_layers * copy.image_extent.depth, tile_size.width, |
| 903 | tile_size.height, output.subspan(output_offset)); | 903 | tile_size.height, output.subspan(output_offset)); |
| 904 | } else { | 904 | } else { |
| 905 | DecompressBC4(input.subspan(copy.buffer_offset), copy.image_extent, | 905 | DecompressBC4(input.subspan(copy.buffer_offset), copy.image_extent, |
| 906 | output.subspan(output_offset)); | 906 | output.subspan(output_offset)); |
diff --git a/src/yuzu/qt_common.cpp b/src/yuzu/qt_common.cpp index 5ac9fe310..5d0fd7674 100644 --- a/src/yuzu/qt_common.cpp +++ b/src/yuzu/qt_common.cpp | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | #include "core/frontend/emu_window.h" | 8 | #include "core/frontend/emu_window.h" |
| 9 | #include "yuzu/qt_common.h" | 9 | #include "yuzu/qt_common.h" |
| 10 | 10 | ||
| 11 | #ifdef __linux__ | 11 | #if !defined(WIN32) && !defined(__APPLE__) |
| 12 | #include <qpa/qplatformnativeinterface.h> | 12 | #include <qpa/qplatformnativeinterface.h> |
| 13 | #endif | 13 | #endif |
| 14 | 14 | ||